Chris DeHut
Senior Member
Hi guys,
I am having a tough time working through this and I don't know why - it should be simple for me. I am working on a routine to run a stepper motor. I need to accelerate the stepper up to speed and decel it back down when required.
I understand acceleration as a change in velocity over time such as:
Steps per second change over so many seconds.
Many folks write this out as SPS squared or SPS/Sec etc.
So I understand the concept, but I will be darned if I can get something to work out good, accurate, and correct.
The accel/decel values will be in Steps per second, the velocity is reltated to in steps per second - this is all communicated to the PICAXE from a host computer. However, I would like the routine to start out at the existing velocity X, then based on the parameter of acceleration rate, accelerate up to the new velocity.
From motion command to motion command, all I want to pass to the PICAXE is the velocity and the number of steps to move. I want the routine to figure out, on the fly, the acceleration dynamically. The rates for the acceleration will be pre-loaded as a parameter prior to any motion commands.
Anyone have an accel/decel routine they would mind sharing?
Thanks!
Chris
I am having a tough time working through this and I don't know why - it should be simple for me. I am working on a routine to run a stepper motor. I need to accelerate the stepper up to speed and decel it back down when required.
I understand acceleration as a change in velocity over time such as:
Steps per second change over so many seconds.
Many folks write this out as SPS squared or SPS/Sec etc.
So I understand the concept, but I will be darned if I can get something to work out good, accurate, and correct.
The accel/decel values will be in Steps per second, the velocity is reltated to in steps per second - this is all communicated to the PICAXE from a host computer. However, I would like the routine to start out at the existing velocity X, then based on the parameter of acceleration rate, accelerate up to the new velocity.
From motion command to motion command, all I want to pass to the PICAXE is the velocity and the number of steps to move. I want the routine to figure out, on the fly, the acceleration dynamically. The rates for the acceleration will be pre-loaded as a parameter prior to any motion commands.
Anyone have an accel/decel routine they would mind sharing?
Thanks!
Chris