04-27-2019 03:53 PM
I have a stepper motor (NEMA 11 stepper motor) and a driver for it. I create a program in a while loop which provides a step signal (PWM) and direction signal (Digital out) from the myRIO to the drivers.
There are three controls I specify for this program: the number of steps to run, the PWM frequency (steps per second) and the direction. I set the duty cycle of the PWM as a constant 0.5. I added a stopwatch using the Elapsed Time VI which basically keeps track of time and multiplies the elapsed seconds with the PWM frequency to find out theoretically how many steps would have been ran, and once it has reached the number of steps to run, the while loop breaks. I attached a picture of the program as a screenshot.
But a problem I am having is when I specify lower number of steps to run such as running 10 steps at 10 steps/second, or even 1 step at 1 step/second, it looks like it moves much more than the number of steps specified almost as if it is not able to run such a small number of steps.
Can someone look at my program and tell me how I can make this stepper control better? FYI: I also have a limit switch which breaks the while loop
Thanks!
04-29-2019 05:56 AM
Hi,
Could you attach your VI for us to take a look at please?
Kind regards,
Michael
04-29-2019 08:52 AM
This is the VI to run my motor.
When the limit switch is pressed, the direction changes so that the motor moves away from the limit switch.
04-30-2019 04:30 AM
Hi,
Thanks!
When you are saying that it is moving more than expected, how much more is this moving?
Kind regards,
Michael
04-30-2019 05:38 AM
The motor moves at around 55.56 steps per angle.
If I run this code specifying to run it at 1 step per second and to run it for 1 step, and one step is barely anything, in the timer it will say 1 second and it moved 1 step but physically it looks like it moves like at least around an angle. I think this is an issue with how I might have implemented the Elapsed Time VI or how the PWM pulses come out.
04-30-2019 07:32 AM
Hi,
I have found some information that I think will be extremely
- Inaccurate Closed Loop Stepper Movement
- What is the Step Resolution of My NEMA 23 Stepper Motor?
- How to Configure Motion Controller and Test a Stepper Motor
- What is resolution of stepper motor?
Kind regards,
Michael
05-02-2019 02:15 PM
Hi,
For the first link: I do not use an encoder. This is basically an open loop scenario, the controller sends a number of pulses to move to a position and it assumes it moved to that position.
Second link: I know the step resolution/steps per revolution of the motor which I have mentioned before it is 55.56 steps per angle.
Third link: I do not have or use an NI motion motor. I brought a NEMA motor from their website, connected to a driver, and the myRIO sends steps/dir signals to it.
Fourth link: I have a good understanding of microstepping.
I think my main question I still need answered is, after looking at my VI, does it look like it's doing the job of controlling the motor? The fact that I use an Elapsed Time VI to measure the time signals are sent and then I use the time elapsed to calculate the steps actually moved? (With obviously the second problem being the actual number of steps moved does not represent the calculated steps moved from the VI)
05-09-2019 04:42 AM
Hi,
Sorry for the delayed response.
From my end, it looks to be working okay.
Elapsed Time VI just waits a specified amount of time before sending out a signal. It doesn't control the rate at which a loop executes (how time has elapsed)