Problem with Arm Code

Hello. I’m running into a problem in my code where after lifting the arm, it is given the stop (brake) command, but after this command is given, the arm starts to slowly fall down until it reaches the ground. I thought it was a physical problem, but the arm worked just fine in the default. driver control. Does anyone know what could be causing this? I could give the code if needed.

This is usually needed. Always post code when asking about code problems. You got half of it down really well, which was describing what you wanted to happen and what happened instead. Either part without the other leaves it very hard to troubleshoot, though. (The worst questions are “why isn’t my X working” with no further information at all.)

3 Likes

I assume that you are using “brake” motor braking mode to stop the motor.

In that mode motor control electronics shorts the motor, which will make it hard to turn, but it could still spin converting mechanical work into the heat in the motor coils.

What you really want to do is to use “hold” breaking mode - then motor controller will remember desired position and actively move the arm back to that position whenever external forces (gravity) tries to move it.

Here is the reference for the motor breaking modes for RobotC and VCS:

http://help.robotc.net/WebHelpVEX/index.htm#Resources/topics/VEX_IQ/ROBOTC/Motor_Commands/getMotorBrakeMode.htm

https://help.vexcodingstudio.com/#cpp/namespacevex/brakeType

4 Likes