There are currently 0 users and 2 guests online.
Stepper Motor Control Techniques
4 Trapezoidal Ramping
Submitted by paulstreats on March 8, 2009 - 6:59pm.
When I ramped the motors up to a high speed earlier, the program just assumed the motors kept going and never happened to stop. If we were to combine this ramping with the positional program then the motors would ramp up to speed and then just stop when the specified number of steps have passed.
Unfortunately, its not that simple.
If I sent the motors going at high speed and just stopped them, the momentum we carry them forwards and back emf would make it difficult for a coil to energise correctly. To put it simply, if you just try and stop the motor dead from high speed it will keep going for a while and you lose steps and accuracy.
To combat this, we can ramp the stepping speed back down just like we ramped it up. This is known as a trapezoid ramping profile as in the picture below.
Time is along the bottom and pulse frequency is on the left.
To implement this we have to do the following:
set a variable for the minimum speed of the motor
Here is the C file to add trapezoidal ramping
There is really very little added, just a couple more variables in the struct, some initialising in the setupMotor(), some initialising in moveSteps(), and also some if's in moveSteps()
I have alse changed the moveSteps() call to 12000 steps so we can see it ramping up to speed - travelling at speed - then ramping back down again.
You can adjust the ramping speeds etc.. if your motors are capable of it. Also I made the ramping down become equal to the ramping up, you may find that you can ramp 1 way faster than the other, this was just an overview of a basic technique that can be built on.
See the next page for improving ramping technique