05-20-2025 03:46 PM
I wrote a code to control a stepper motor by generating pulse train to control the pulse and direction. The motor I have is applied motion TSM 17P 3AG and the hardware for controlling is NI 9472 used in cDAQ 9178. I am currently using a function generator to generate a function and converting that into 1D U8 data to feed into the digital output. I am using this method rather than generating a pulse train because the eventual goal is to feed a sinusoidal profile and this method seems to work well in generating a pulse train for the sinusoidal motion. However, when I feed the pulse train to the motor, the motor does not seem to respond. I have tried this in arduino and it works but not sure why it doesn't work here. Is this the right way to do it or are there better ways of doing things?
I have attached the VI and the screenshot of the code that I wrote.
Thank you in advance.
05-21-2025 08:48 AM
What is the actual sample rate?
NI-9472 requires an external power supply. What voltage did you provide?
05-21-2025 10:13 AM
I am using a 9 V DC power supply for the NI-9472.
The sampling rate for the sample clock comes out to be the same as the steps per rev of the stepper motor. In my case it is 20000.
06-03-2025 03:56 AM
Hi,
Here's another forum post that solves the same problem, you can take a look.
https://forums.ni.com/t5/LabVIEW/how-to-generate-digital-pulses-to-run-stepper-motor-in-a/td-p/75975...
Although the code is written for 6229 DAQ, you can modify it to use NI-9472.
BR
John
Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source legacy NI hardware? Try Extend Test