SharpAI
/

my lift keeps falling down when I let go of the stick

To prevent a lift from falling, a motor can be programmed to run to and hold a specific position using RUN_TO_POSITION mode . This mode tells the motor to move to a target position, specified in ticks, and uses a PID loop to control the motor's position .

To implement this:

  • Set the desired target position as an integer using motor.setTargetPosition(desiredPosition) .
  • Then, set the motor's run mode to DcMotor.RunMode.RUN_TO_POSITION .
  • The maximum power the motor can use to reach or hold this position can be set with motor.setPower(0.5) (using 0.5 as an example) .
Was this right?

Generated from indexed documentation and can be wrong — check the source beside each claim. Follow-ups are not saved. Unofficial, not affiliated with FIRST. Quotes Game Manual 0 (CC BY-NC 4.0) and FTC Docs (BSD 3-Clause). Built by Sharp Face Robotics.