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.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper Motor Control with MyDAQ Hardware Timed Digital Outputs

Hi everyone,

 

I am trying to control a stepper motor using 2 digital inputs (step and direction) and 6 digital outputs (encoder components) with a MyDAQ. I will need the stepper motor to turn at 11 revolutions per second. The stepper motor has an integrated stepper driver that I am using to communicate with. There will be 200 steps per revolution so I need the DIO lines to run at a 2200 Hz. With the VI that I have made, which is very simple because I just began working with, I have only been able to reach around 7 revolutions per minute, or 0.1167 revolutions per second. Based on the other sources that I have looked at, I will need to utilize the MyDAQ counter to write the signal fast enough. Do I need to get a different board or is there a simpler solution?

 

Thanks

0 Kudos
Message 1 of 3
(2,966 Views)

lucas171,

 

  1. Could you please explain what HW interface you currently have? What stepper driver are you using? 
  2. Are you using any NI HW to control this stepper? 
  3. I understand you need to sent 2 bits, one for direction and one for speed at a 2200Hz, is this what you want to accomplish? 

As a general recommendation, I wouldn't recommend you using the DAQ Assistant ExpressVI if you want to have better control over memory usage and execution speed of your VI. Additionally, the flat sequence structure usually unnecessarily overconstrains your code execution and also may affect performance in applications that a speedy execution is critical. I would recommend you checking existing examples to use as a reference

 

 

 

0 Kudos
Message 2 of 3
(2,937 Views)

Hey MoacirF,

In order to operate the stepper motor, I need a digital signal for the step+ and dir+, as well as inputs for the 6 digital components of the encoder that is built on. Considering this, I had the 8 DIO ports of an NI MyDAQ connected to the motor for full control. I need to be able to send and receive signals at 2200 Hz in order to rotate the stepper motor at the desired speed. Considering that only the counter DIO line on the MyDAQ is capable of reaching those signaling speeds, I will simply have to resort to coding an Arduino to run at 2200 Hz and communicate through the MyDAQ or a Visa-Serial set up. I will eventually have 2 additional motors required for the experimentation I am running but getting one to work is crucial. 

 

Thanks!

 

Automation Direct Integrated Stepper Motor NEMA 17

0 Kudos
Message 3 of 3
(2,932 Views)