08-30-2022 09:09 AM
Hey Guys,
i have two problems. I use MyRio, Stepper motor (42BYGHW811) and a TB6600 Stepper Motor Driver
Best grades
Akbaba
08-30-2022 06:15 PM
Long ago, I worked with steppers quite a bit.
I'll assume that you're doing position control so you'll want an exact # of steps in your motion profile, right? Well, that can be a little tricky to get exactly right. The theoretical math for the time it takes to get from low freq to high freq at a specific accel rate won't match up exactly with what you *actually* end up doing with an integer # of steps. The quantization error can be fairly significant at higher accel rates -- I recall using a commercial stepper controller that had implementation flaws such that it reached the target # of total steps after just barely starting down the decel ramp. It would immediately stop issuing step pulses, but the motor's speed & momentum were such that it coasted well beyond the intended stopping position.
I think you'll find that trying to do all the calcs on the fly will leave you more vulnerable to these things. (But on the other hand, if you're *generating* the step pulses, your first question about counting them becomes trivial.)
A few tips:
1. You *can* work your way up the accel ramp by doing calcs on the fly. Just be prepared to store all the interval timing information so you can use it in reverse for the decel ramp.
2. Remember that your starting frequency isn't defined until you've issued the 2nd step. It takes 2 steps to define the very first frequency, each frequency thereafter requires only one more step.
3. So, for a given # of frequencies in your accel and decel ramps, accel will use up 1 more step than decel.
4. All remaining steps can be issued at your constant high speed.
5. Actual motion time may not match up with simple trapezoidal calculations, particularly the accel / decel portions.
6. When moving short distances, you may not make it all the way up the accel ramp before it's time to transition to decel. This is one of the gotchas to watch out for.
-Kevin P
08-31-2022 03:35 AM - edited 08-31-2022 03:37 AM
Thanks Kevin,
the problem is, i have no idea how to do such a ramp.
i use the stepper motor for a linear drive, The function of it, is to drive back an forth with this trapezoidal speed. that's the most significant function that i need.
For the positioning i use now an encoder, so i gone try with that
-Akbaba
08-31-2022 08:10 AM
What are the specific motion requirements?
(Note: these are not all independent of one another. Choices for some will constrain others)
- Total # steps
- Starting step rate
- Top speed step rate
- Desired motion time
- Allowed acceleration rate (the slope of the accel/decel ramps)
And then, how about more details about your system?
- what size / kind of stepper? A hybrid with 1.8 deg steps? Do you know the NEMA size?
- what kind of load are you driving with it?
Here's a start on the math:
A = acceleration (steps/sec^2)
F = next freq in accel ramp (steps/sec)
Fp = prev freq = 1/previous interval
dt = next time interval
A = (F - Fp) / dt
dt*A = (F - Fp), but note that dt = 1/F, so
A/F = (F-Fp)
F^2 - Fp*F - A = 0
Now you have a quadratic formula to solve and you get:
F = (Fp + sqrt(Fp^2 + 4*A)) / 2
So your next interval dt is just 1/F, and that tells you when the next ramp step should be issued. When you calculate a value higher than your top speed, ignore it, your ramp is done, then just use the interval associated with the top speed until it's time to decel.
-Kevin P
09-01-2022 11:05 AM
I've worked with stepper motors that require a specific acceleration and positioning. We've used the a NEMA 17 stepper motor with a uStepper S controller. This little board can run Arduino code and has a quite intuitive library ready to use. You can simply specify the acceleration and velocity. It does require some microcontroller programming though.
09-02-2022 10:51 AM
I Use myrio for my system. i cann controll also my stepmotor
. But not whit the funktion of the speed