Hello Guest it is March 25, 2023, 12:48:06 AM

Author Topic: VB script to control a 0-5v analog out for rpm of a stepper motor  (Read 1794 times)

0 Members and 1 Guest are viewing this topic.

Hello! I am new here but not new to Mach3.
First off I have to say that I know Mach3 pretty well and configuring it except for Modbus.

Here is what I am looking to do. I am trying to control a stepper motor in RPM's to use as a pump with an analog 0-5v output card on a Direct Logic 06 PLC. I would like to use one UDRO to input a speed and then to turn it on with a button. Also an increment button would be cool too. The button can be a simple toggle on off and setting speed from UDRO using a vb command and the UDRO is the speed in RPM I want the pump to run. I am familiar with VB as in enough to be dangerous and can edit it and do basic commands in mach.

I am using the aux axis for rotation so can't use this output on the breakout board (sound logic PC to rout) plus I want to run 2 but at the moment just trying to setup one. I am running the breakout through a USS smoothstepper.

I have made a 5k pot work at this point just want to set RPM and on/off in mach3.

You may ask why a stepper for a pump, well it is what I have available to me and of course cost needs to be cheap. I will be using 2 of these setups for 2 different pumps.

Here is what I have hardware wise:
Leadshine DM805-A1 steper drive that can do 0-5v input. http://leadshine.com/UploadFile/Down/DM805-AIm_P.pdf
F0-2AD2DA-0 PLC modul for the D0-06 PLC. It does 2 anlog inputs and 2 anlog outputs but only need outputs. https://cdn.automationdirect.com/static/manuals/d0optionsm/ch12.pdf
Sure Step STP-MTR-23055 stepper motor with 166 oz-in rating.

I found the extra spindles plugin from SS Systems but can't seem to figure out how to set it up. In modbus for the analog outputs i am using the following modbus setup:
refresh is 50 ms, address 3004, registers 4 and direction is output holding. This is what i could figure from the extra spindles plugin setup instructions.

this is by far my biggest hurdle to tackle and any help anyone could provide would be awesome.