Hi all,
I've been tasked with writing code that can drive two stepper motors: one that makes a single step for every full revolution of the other. I've got the first stepper motor code written and running well with no issues. The second motor, the linear actuator, is having some issues. On its own, I had it running well. It would run clockwise until it triggered a limit switch then would change direction until it hit the other limit switch. When I integrated the two codes into a single VI, the linear actuator would run clockwise just fine, like normal, but then when it switched to counterclockwise it would run fine for a bit and then suddenly jump back to moving clockwise but rather than running smoothly it would be jumping the distance of multiple steps at a time. The code would say it is still running counterclockwise. Since then, I've tried running the linear actuator code on its own and it still has the same problem. I haven't been able to figure this out and would appreciate the help.
Some specifications of my hardware:
First motor: ST5-IP-EN Applied Motion Products driver connected via Ethernet, ML23HSAP 4300 Stepper Motor
Second Motor: NI USB 6009 OEM DAQ board, Anaheim Automation MBC25081TB step driver configured to JP1 in position 1-2, and a generic motor with 18 deg/step, 4-5 VDC, and 0.5A.
The NI USB 6009 OEM is generating a CLOCK signal in Port 0.1 (and I've checked that this signal is consistent for both CW and CCW using an oscilloscope), writes the DIRECTION in Port 0.0, and reads the limit switches in Ports 1.0 and 1.3. The On/Off Input of the MBC25081TB is connected to the +5V input (pin 34) of my DAQ board and the common of the limit switches is GND pins of the DAQ with two 10 kohm external pull up resistors.
I've attached the VI that contains the combined code as well as the VI that was running the second motor well before the issue arose. Any information is appreciated.