[NXC] How to set speed 0 (zero) during position regulation

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

[NXC] How to set speed 0 (zero) during position regulation

Post by ricardocrl »

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! :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest