how to hold the position of a motor by using NXC? like, if i want to make a robot arm, and use it to hold an object. if i use the command "Off(OUT_A)", the position of the motor can be held, but the force is not strong enough. if I use the command "OnFwd(OUT_A, 100)", the motor will give an force on the object, but it might break the object. furthermore, will the motor itself be broken if it is stuck for a long time by the object? So what's the correct way to make the motor to hold the certain position with certain force?
Re: How to hold the position of a motor (NXC)?
Posted: 09 Aug 2011, 08:44
by timpattinson
Edit: use linusa's info instead
Off() is the correct way to brake the motor.
mindcharlie1 wrote: furthermore, will the motor itself be broken if it is stuck for a long time by the object?
Well the motor has some kind of over-current protection designed for exactly that, but I'm not sure how effective it is.
Maybe using gears would help?
This is really strong, and consumes quite a lot of power, but it's "not a hack" and safe for the motors (even if they get a bit warmer). The motors have thermal over-heat-protection by the way. You can release this brake again using Coast().
Edit: P.S.: The MotorBrake() function might be the same as Off(), but there's a good chance it's stronger. Can't try it at the moment, please do try it for yourself.
Re: How to hold the position of a motor (NXC)?
Posted: 24 Aug 2011, 03:04
by mattallen37
Try looking into APR, which is a fairly new feature. It is now completely implemented into NXC and John's EFW. I haven't used all the features of it, but it seems to work great for everything I have needed it for so far (with NXT motors). For non-NXT motors (with the built in encoders), I made my own PID motor control loops so that I could input the position with a different sensor (like the RCX rotation sensor).