What is servo "ramping"?
Strelnikov
Posts: 18
I downloaded Servo32v7 from the OBEX and looked at it a bit, noticing the code for "ramping". I loaded it into ViewPort, observing it both with and without "ramping" and didn't really see any difference (unless I missed something subtle). It's not obvious to me from the code what's going on so hopefully someone can enlighten me...
Comments
But of you jump from zero stepping speed to the max in a instant the stepper probably
will stutter and don't move.
What does the following mean (from the source code)?
'' Note: It takes aproximately 3100 clocks to process all 32 Channels,
'' So the resolution is about 38.75us
'' increment/decrement pulse width every 3100 clocks
'' So at 2us and a full sweep 500us to 2500us (Delta of 2000us)
'' the total time travel would be 38.75ms
''
'' 160 = 2us @ 38.750ms
'' 240 = 3us @ 25.833ms
'' 320 = 4us @ 19.375ms
'' 400 = 5us @ 15.500ms
'' 413 = 5.1625us @ 15.012ms
'' 480 = 6us @ 12.917ms
'' 560 = 7us @ 11.071ms
'' 620 = 7.75us @ 10ms
'' 640 = 8us @ 9.6875ms
My object: http://obex.parallax.com/objects/445/
Note that position and speed control happen in a single cog and the code is written in Spin for easy updates.
For CR servos ramping is definitely useful because if you go max velocity out of the gate your wheels will slip. Wheels slip is death to odometry accuracy. Phil's applying encoders document has some good PBASIC ramping routines which I've used in several projects now.
I think it's here.
It's completely separate from Servo32v7.
Phil's paper goes through the theory of using encoders. Page 7 talks about ramping. The paper is not light reading.
Duane gave you the correct URL to the PDF. I still use the BS2 for many projects and use those PBASIC routines instead of the Servo32v7 when my project is BS2 based.
This made me laugh out loud. I agree.
I've read through that paper several times and the code. I mostly understand it, but there's a few bits of the servo ramping routine that are still black magic. I have half a mind to translate them into C to force myself to truly understand them.