From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Help: Stepper motor control with NI9401 and CompactRIO 9039

Solved!
Go to solution

I want to generate the square waves to contorl the stepper motor through NI9401. And I have writen a simple FPGA code to generate the square waves as shown in Figure.

square waves.png

 

But now I want to generate finite steps for my stepper motor to move? How to do it?

Thanks very much!

English is my second language, sorry for my poor writting skills.

0 Kudos
Message 1 of 5
(2,731 Views)

useful links and documents 

https://www.ni.com/en-us/innovations/white-papers/16/motion-control-with-compactrio--the-ultimate-mu...

http://www.ni.com/pdf/manuals/373871a.pdf

 

with this you should be able to do what you want

 

 

bhovhann
0 Kudos
Message 2 of 5
(2,661 Views)

Thanks for your reply. I have read the document in the above website. But, it seems like that all control way is using the NI 95xx C serial modular. Unfortunately, we don't have this modular.  

We have a stepper motor controller, but it need square waves signal to control the rotation speed and direction of stepper motor.

Now, we only want to generate a square waves signal  through NI9401 to control the stepper motor. 

I have written a simple code to generate square waves, but it cannot adjust the frequence of square waves at real time and generate finite square waves. So, could you give me some advices and some references?

Thank you very much!

0 Kudos
Message 3 of 5
(2,647 Views)
Solution
Accepted by topic author Tianci

Here you can see part of the FPGA and Part of the host. you should know that using only FPGA you can't regulate parameters in real time. For that you should use RT or HOST or both of them. For example, you can also go through this link https://forums.ni.com/t5/Example-Programs/Generate-PWM-signals-on-cRIO-analog-output-module/ta-p/351...

bhovhann
Download All
0 Kudos
Message 4 of 5
(2,633 Views)

Thanks for your reply. It is very useful.

0 Kudos
Message 5 of 5
(2,596 Views)