[NXC] How to set speed 0 (zero) during position regulation
Posted: 13 Oct 2012, 17:08
Hi,
I would like to set a target position (with absolute position regulation), but I need to keep changing Speed over time, while reaching the target. Sometimes I need the speed to be zero, or motor stoped.
If I do PosRegSetMax(OUT_X, 0, x), it will mean maximum velocity, while 1 means a very low velocity, not stopped.
Is there any way to do this, without disabling APR? I could also do PosRegSetAngle(output, MotorTachoCount(output)) and restore the target, after giving a positive velocity, but it doesn't look a very smooth/clean solution...
Thank you!
I would like to set a target position (with absolute position regulation), but I need to keep changing Speed over time, while reaching the target. Sometimes I need the speed to be zero, or motor stoped.
If I do PosRegSetMax(OUT_X, 0, x), it will mean maximum velocity, while 1 means a very low velocity, not stopped.
Is there any way to do this, without disabling APR? I could also do PosRegSetAngle(output, MotorTachoCount(output)) and restore the target, after giving a positive velocity, but it doesn't look a very smooth/clean solution...
Thank you!