1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

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

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.

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

Postby ricardocrl » 13 Oct 2012, 17:08


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! :)
Posts: 117
Joined: 27 Dec 2010, 19:27

Return to Mindstorms Software

Who is online

Users browsing this forum: No registered users and 2 guests