> For the complete documentation index, see [llms.txt](https://vrs-book-complete.gitbook.io/virtual-robot-simulator-official-guidebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vrs-book-complete.gitbook.io/virtual-robot-simulator-official-guidebook/programming/blocks/actuators/dcmotor.md).

# DcMotor

DcMotor is a fundamental component in FTC (FIRST Tech Challenge) robots, providing the essential power for various movements and actions. It's a direct current electric motor that converts electrical energy into mechanical energy.

**CurrentPosition**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcv0jMgaXDbRVoVIKZjWEe9B0tDZv-p3Y6Jwgrv42KCU835EsZ5xYzrmxg6AIscXyYBamiSidMlM_vQFVnzkxKUDGBIKfPfNdGjQ8cHlNRsnOQZwgpj6jRfBftJUWtUfPGQ2fneMMqgZlZt7E1enc1KkZN4?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Provides the current rotational position of a motor.

Key points:

* Return Value: A floating point value in ticks.
* Usage: Crucial for precise motor control, closed-loop control, and position-based actions.

**Mode**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrxVg9dhWhxX0u5QP72LeDFHWX-0ew63MKgy1yPa9MOL8BFvMpmECsdN5aiGrYejhdztIvAI6JBEm8MjXkoAQ7Rc9URVPmDBkxxI-B-Anq4GZE-b0tpYjRxT7SMhv2glxlyVY1Sw8Jal6MJuPD4UtVQFJU?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Gets the mode of a motor.

Key points:

* Return Value: RunMode. The four possible modes are RUN\_WITHOUT\_ENCODER, RUN\_USING\_ENCODER, RUN\_TO\_POSITION, and STOP\_AND\_RESET\_ENCODER.
* Usage: Crucial for precise motor control, closed-loop control, and position-based actions.

**Power**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfxLYP8VssOffpCBFU-39MCB6780PZyFu0aSQ76ptmFTMBJwpvy1WGXEHmG2FGRz0ouuoxI-d6rY4O3emNi5WLACeMhx4C7ebOiDiBb46gTUaWmOy3Kc_HiT_5RKZdkO3Qsg2hO5NDeBduhYSNWRdr3B-02?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Gets the power of a motor.

Key points:

* Return value: A floating point value from -1.0 to 1.0
* Usage: Used to check the power of a motor. Crucial for precise motor control.

**PowerFloat**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXftep5h5EDePF5sYzypYOLPOOXy1nmktUCKUpyKVdQfaoPBbV1ThCVxQpBp2NGMgoiOEcyLQWOQlPupQnZYlJqKZFXh2BEmFuohUHCUvY-jWzKfPV6E2mCJTKq-kAMHrghfB4tQFTeLfM0Ib03if8LAcX8?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Determines if the power of a motor is a float number.&#x20;

Key points:

* Return value: True if motor power is not an integer, false otherwise.
* Usage: Used to check if the power of a motor is a whole number. Crucial for precise motor control.

**TargetPosition**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdGA9LLxU8wGFY7AIDk_HzSVnaVFfneOTw4BJ-73v3cjwiU8K-MBRMRvNkOcTXPC_2InGA_QuctqFiMCqNPbeCxMGofZ6ip-mq9mxlonM7jIiJA3PF_WnzGUP5esxokF591JQiZ5mYwe3VxK12GzgxmLpHI?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Provides the target position of a motor.

Key points:

* Return value: A floating point value in ticks
* Usage: Used to check the target position of a motor. Crucial for precise motor control and autonomous driving.

**TargetPositionTolerance**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcgxTE-27jS4BlxoD8fchJOgI0MFF34qXXG5clB6oY_K77NXyYYhv9BrTpWSNkNQoQFKvrXNPTppKPrKAelOMhMlICKgRSyXOOdGIJ4VTg_xlJkUJDpKAi0kfXw7e8Kkryi0Fuai7RqpktHsOemrx1NwS4?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Provides the margin of error for the position of a motor. Not all motors have this feature.

Key points:

* Return value: A floating point value in ticks
* Usage: Used to check the tolerance of a motor. Crucial for precise motor control
* Can’t find it? You will need to choose CurrentPosition or TargetPosition, then choose from the dropdown list.

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf3X2ooA8lgV4ZqNFTiPogT9W5ynrR_PLwOzSSWuF52hl9qJsmWxEu7imVRfSHH2LZ7ba1ktCdNXLeYPlB4rlRUZmg9An4EoEHukIDORJuplqPm6hP5iPOSmibnN0HUZZeNOqPiacfE8AvKNh6UZK82ZEer?key=hRw9bBhBfp1lHBJ7rUAI2Q)

**Velocity**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfpnzPZVZ0hDtBOKkafIDBJ_TNWIgXNINnpyQ2sHVw0FfV9SC21K0qREctf9UTWPSGQeAiT2W80svyTzMBKbYfhcWc1uIA_snsO2pGOW48J380HpEFRtTYG4SAjgpanMOXeREQvjvNwVUQUzv2846GImLg?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Provides the current velocity of a motor.

Key points:

* Return value: The returned value is in ticks per second
* Usage: Used to check the current velocity of a motor. Crucial for precise motor control and autonomous driving.
* Can’t find it? You will need to choose CurrentPosition or TargetPosition, then choose from the dropdown list.

**Direction**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdf8jxNEuYjA40UrZImYqM02h9fQBSrm40i1VG4IALDEsAZGTflDUXSY7jpQJwJwnaeJjox9FB9QJmLQ5ex5djGWjlXF7JIF4qTHhDHt6zCIPF5lKIqG9-VhfM0xS0XAlA6d8qwkBvRPmgN1OgBU65T9VI?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Provides the current direction of a motor.

Key points:

* Return value: A string value of “FORWARD” or “REVERSE”.&#x20;
* FORWARD: The power the motor receives is unaltered.
* REVERSE: The power the motor receives is multiplied by -1, reversing its sign.
* Usage: Used to check the current direction of a motor.

**ZeroPowerBehavior**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeG-yLuVLrzBvtvqCF6h3_WpfUk06e7v5obKXD3Tvn1ReJB10yLk9yox5PcCCtOiv0v5OUG9fsSFnTiqxgbIh14uBJS9JQZIcGTSHW421lVkofvKjGPrb2sH2mOUx6KNaSXzlor1ReSt237_qYhnrHCfnE?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Determines the behavior of a motor when its power is set to zero. The two possible values are BRAKE or FLOAT.

Key points:

* Brake: When the motor's power is set to zero, the motor is braked, bringing it to a quick stop. Ideal for situations where you want the motor to stop quickly and hold its position. This is commonly used for mechanisms like arms or lifts.
* Float: When the motor's power is set to zero, the motor coasts freely, allowing the motor's axle to rotate without generating torque. Suitable when you want the motor to coast freely after setting power to zero, allowing momentum to carry the mechanism. This can be useful for wheels or mechanisms where controlled deceleration is not required.

**set DcMotor.Direction to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcHTCyws13zTf_6-hqqyYw59dX2KJVwcLQjymLGTCe3jEvYebJUzbB-ZZBd9MHo4c5IKJfoXC8R3I1PVUADf-bFHnmhlLLq1iFnxuechjHVawh-mIlV5xwjBsLX_wDffyJVGWKPbCN1rohHSMaH2l9coiE?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Controls the direction of the motor. The only directions are “FORWARD” or “REVERSE”

Key points:

* FORWARD: The power the motor receives is unaltered.
* REVERSE: The power the motor receives is multiplied by -1, reversing its sign.
* Usage: To make setting and controlling the power to motors easier while programming and driving. This can be useful for wheels on a drivetrain where opposing motors need to spin opposite to each other to move in one direction.

**set DcMotor.Power to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfevj0o9QZuChq2IjYe-adCekTjGrCbeYrp-hZcCMpPssbevpbZRc0AKMAmJrjgPUAFwofX600lurjAOmgsrnJsZXgpEDAf-00_DZgMnb5Rk7fzDnZAUjSYCdMXUu0hPpulArbcfunkkFo26xorr3zYf7Am?key=hRw9bBhBfp1lHBJ7rUAI2Q)

controls the power the motor receives, determining its speed and direction.

Key points:

* Value range: Accepts a floating-point value between -1.0 and 1.0.
* Direction: Positive values move the motor forward, negative values move it backward.
* Magnitude: The absolute value of the power determines the motor's speed.

**set DcMotor.TargetPosition to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeHvYWek6nB5Vy4ckP2sFrhQ52tml1JfzTupwt5kVV1qYWWiLy9GTnLJr9INhJOiHOEWbgWWhbvNWpT9yi7ccbDpw_97Tg6nIWNS4Cq4b4c9rrPjfedqYlY_uI2Phx3jfGEIUfQQD8EUS1sdOZJ5eDbF_5v?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position of the motor.

Key points:

* Value: A floating-point value in ticks.
* Usage: A more precise method to control the position of the motor.&#x20;

**set DcMotor.TargetPositionTolerance to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdilmxlG5cDEWP1kvo_7DT_eL-5TCBn-rYlXsfYm4EVqVkUkiAtPC1E92xMI63kpvujkZI8oZ3bcI7xo2KWwvPkcd6QFJeszF8oZAj7QLbRwjL7PYDN4Zc64u6d-YMW9pm7Vjvle_n_Tm8n31qvqDna8Ma4?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position tolerance of the motor.

Key points:

* Value: A floating-point value in ticks.
* Usage: Controls the margin of error of the motor.
* Can’t find it? You will need to choose set TargetPosition, then choose from the dropdown list.

**set DcMotor.Velocity to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfqfrx9ehFiq67UDkWr_plfWnHtbGJw6J2lsAz-qSXgE1fP1KfY2GZRNp0iq9cPwrm7pmKFlRGtkGZLWydJ9gkyNLHQ2Gm8Ous_aLvwMmxdMDbR-YOLYeb3rX8OUoQ3sQ4WE07xFVopINNUNk7dcLMaYQ0d?key=hRw9bBhBfp1lHBJ7rUAI2Q)

sets the velocity of the motor. Not all motors support this feature.

Key points:

* Value: A floating-point value in ticks per second.
* Usage: Controls the speed of the motor more precisely.
* Can’t find it? You will need to choose set TargetPosition, then choose from the dropdown list.

**set DcMotor.Mode to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfNS6lpWFpYAWcuCiu7miIB5ZPF5r1k7ba4mLBkE5-wQ47Wk2HHKOpSXwDp5sTTacJomEw8lKf20JwWmzGpW-xRfxAgGPEEXtDnTpWw21tRcutix-I6An3Oh7B0N02vEGsk-xhmrIwXq8_YB-HAc17ICARO?key=hRw9bBhBfp1lHBJ7rUAI2Q)

sets the mode of the motor. The four modes are RUN\_WITHOUT\_ENCODER, RUN\_USING\_ENCODER, RUN\_TO\_POSITION, and STOP\_AND\_RESET\_ENCODER.

Key points:

* DcMotor.RunMode.RUN\_WITHOUT\_ENCODER: This is the default mode. The motor runs at the specified power level without using encoder feedback. Suitable for basic open-loop control.
* DcMotor.RunMode.RUN\_USING\_ENCODER: Uses encoder feedback to control motor speed. Allows for more precise speed control. Often used in conjunction with PID control.
* DcMotor.RunMode.RUN\_TO\_POSITION: Runs the motor to a specified target position using encoder feedback. Ideal for precise positioning tasks.
* DcMotor.RunMode.STOP\_AND\_RESET\_ENCODER: Stops the motor and resets the encoder count to zero. Used to initialize the motor's position before starting a new movement.

**set DcMotor.ZeroPowerBehavior to**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfX_mlGY4zjqSNsJ-uAIr-6iDtdiLWSSbZhxjTOXAviGHg_a2CFCNwL58CHuufO6XUk4UaKhJ7mhPAWVd1yhCMm_fCgF7WghN3mNr3Dko3OQXK-1QUIcmr4H0bmLpEy-ILvG0LXZCl4ksmbRDNVxOVG3CwV?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the state of a motor when its power is set to zero. The two possible values are BRAKE or FLOAT.

Key points:

* Brake: When the motor's power is set to zero, the motor is actively braked, bringing it to a quick stop. Ideal for situations where you want the motor to stop quickly and hold its position. This is commonly used for mechanisms like arms or lifts.
* Float: When the motor's power is set to zero, the motor coasts freely, allowing the motor's axle to rotate without generating torque. Suitable when you want the motor to coast freely after setting power to zero, allowing momentum to carry the mechanism. This can be useful for wheels or mechanisms where controlled deceleration is not required.

**isBusy**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZo3_ZCwmD4j0oisLL3OkLWBy-DmFJFCb5KVwoTds9n1LrYrt5afQNOFtH7k7T7pQk5L7el46Mimk8ek78WPatczxUWYrq7pefzkJAy5sMw9lGcHjZHoXShjWxi5GHZS_K3EwKRCLQZpUUBNcBlXputYa_?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Determines whether a motor has reached its target position.

Key points:

* Returns: true if the motor is still moving towards its target position; false If the motor has reached its target position.
* Usage: Commonly used in while loops to wait for a motor to complete its movement.&#x20;
* Purpose: Essential for synchronous motor control. Helps prevent unintended actions before the motor reaches its desired position.

**Dual**

This set of commands are commonly used to move a two motor drivetrain.

**Power**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdWn0FHfQZhZlbEaAqk_FsrEX5m87nD_oJ_5YyLPThrPkLJuD8_4c2ETjiD6NbTcIvnDDlzpT3dFcKfvedhAw4U65KutsEU3epEmTC3iED_NnwcfErWLRG-GVJLWJQnujZyEh9eAIZUWYT5e81AhyT02S8E?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Controls the power of two motors, determining its speed and direction.

Key points:

* Value range: Accepts a floating-point value between -1.0 and 1.0.
* Direction: Positive values move the motor forward, negative values move it backward.
* Magnitude: The absolute value of the power determines the motor’s speed.

**TargetPosition**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe_K5JiBuqRMprj5wz6kWuSDMHtZ0k1IihQ4xzwl_ZRltEUR8NioUe0Re-D4vQPvDRyAgxASjSfNAdGsfMCfQ4d3Q8CsUOEtfEp8NzvCEKkm8XTaElder13DZtFna9I77e1pvxv5RuKjIkr2EevM_xb9hg?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position of two motors.

Key points:

* Value: A floating-point value in ticks.
* Usage: A precise method to control the position of the motors.&#x20;

**TargetPositionTolerance**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfsAVFtJ4gVxLZgkz2K3akP_PpE2mbPVavLwtbP2L2TQ4Zdrc0jxwg1BMkQJZdOttzt-qI_gwayk0QjGpncrxs9Xdp4sYyX-lHgQgnIu6CwQzZmIvw93WYTWRHQVpTNCwWl5LoCtog2FfcIrKJOfNXJx0I?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position tolerance of two motors.

Key points:

* Value: A floating-point value in ticks.
* Usage: Controls the margin of error of the motors.
* Can’t find it? You will need to choose the set TargetPosition block, then choose from the dropdown list.

**Velocity**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfRhacICjtpPH83HgvTjCnNeNFrgKAhcbnibqKBxp2hi_Kz5QIudfXjC-0cKc-YtZ917V176TFasxJ4If1A0vZkWo9GpnVEZtgT5EZqKqEn_UOaOOJXAcwMx6YMsVEehK0trRLxQSruHouqMGqm6HULq3Cb?key=hRw9bBhBfp1lHBJ7rUAI2Q)

sets the velocity of two motors. Not all motors support this feature.

Key points:

* Value: A floating-point value in ticks.per second
* Usage: Controls the speed of the motors more precisely.
* Can’t find it? You will need to choose the set TargetPosition block, then choose from the dropdown list.

**Mode**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcY3DXRGZeO2cCOYUOkjH7rpDit45GU6wiKQFJa0R6trPnd9FMVK19G_HvfZolAK9Am0sVxs2IpPlHnqDM8ksLLLiUqStRoiBKA0pRE3ABdR3lkbbvrpu2BhDrxonBrVLIy4UpNrtV41deJ0myi95lM7sxS?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the mode of two motors. The four modes are RUN\_WITHOUT\_ENCODER, RUN\_USING\_ENCODER, RUN\_TO\_POSITION, and STOP\_AND\_RESET\_ENCODER.

Key points:

* DcMotor.RunMode.RUN\_WITHOUT\_ENCODER: This is the default mode. The motor runs at the specified power level without using encoder feedback. Suitable for basic open-loop control.
* DcMotor.RunMode.RUN\_USING\_ENCODER: Uses encoder feedback to control motor speed. Allows for more precise speed control. Often used in conjunction with PID control.
* DcMotor.RunMode.RUN\_TO\_POSITION: Runs the motor to a specified target position using encoder feedback. Ideal for precise positioning tasks.
* DcMotor.RunMode.STOP\_AND\_RESET\_ENCODER: Stops the motor and resets the encoder count to zero. Used to initialize the motor's position before starting a new movement.

**ZeroPowerBehavior**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcllNuxm2_sGA364YXaTfGGsOy8XrTVYnA2AwehxFHI4qbyD4jPIvcqB-oh1pOVltlpCGx-MH1OSH4--7InG_bzt3jegCOnu-cMhudPUCVABnWlssr3IswAmOUApl35h0_-GvXen2JUBc3VE6GqAUMcULE?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the state of two motors when their power is set to zero. The two possible values of Brake or Float.

Key points:

* Brake: When the motor's power is set to zero, the motor is actively braked, bringing it to a quick stop. Ideal for situations where you want the motor to stop quickly and hold its position. This is commonly used for mechanisms like arms or lifts.
* Float: When the motor's power is set to zero, the motor coasts freely, allowing the motor's axle to rotate without generating torque. Suitable when you want the motor to coast freely after setting power to zero, allowing momentum to carry the mechanism. This can be useful for wheels or mechanisms where controlled deceleration is not required.

**Quad**

This set of commands are commonly used to move a four motor drivetrain.

**Power**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdK3FISsJAecMj-OsiF6YHeIFiRQZsQU12F4RBHWSEOHtrPRGFPXAy0t2VZw3emN80q0Ds5gCV0ypdsAi9X-bl0gaduRbI1Ase4a-yzp3j0jC5PqhiOaao8YPjMVcmOsfQc4BlBOp2TnqEGRrcwo7AyjCjw?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Controls the power four motors receive, determining its speed and direction.

Key points:

* Value range: Accepts a floating-point value between -1.0 and 1.0.
* Direction: Positive values move the motor forward, negative values move it backward.
* Magnitude: The absolute value of the power determines the motors’ speed.

**TargetPosition**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeDnJe2E03-jCxhWC6rw1s4PIQCksjRX6RBeQofPYfOXDqyOAl9nekkrAhtzTwphE_L556Rkqyy0WkDT8IxpPdnrDvkFrJSizPDH2nsTnruhS9yh89nWn8ldR-d4fmTK0fJ4yojOmsP-BTwghTsw3khFjSD?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position of four motors.

Key points:

* Value: A floating-point value in ticks.
* Usage: A more precise method to control the position of the motors.&#x20;

**TargetPositionTolerance**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfsGMRuEreNpI3vL98tGUHyk1jTA3hFOjSHi_2Svm3MHVb3fRDL6_-qBnb0bNwC6aNz3H8o0dQh5aaIGGUd1chOe-sx9Gy0CL4tAYrnvksx3ieNKgXciopMkl1zxPaWjjab4Oz8tRLfr8Ccag1OJnGEXrst?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the target position tolerance of four motors.

Key points:

* Value: A floating-point value in ticks.
* Usage: Controls the margin of error of the motors
* Can’t find it? You will need to choose the set TargetPosition block, then choose from the dropdown list.

**Velocity**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeHOepS2phNJ0_pcTwdASqH9cUTlXQOdz3wjM-uMdbLInPGahUmKwe6veSvRb-eVclz7aDy1aBNESUWZQwo1JQtuY0BH4635qGcDCkMH3_6O03QlvSc7w3v1ZJlc6VXL3i8CN4uILhi9njnhkfcbX0E7-sr?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the velocity of four motors. Not all motors support this feature.

Key points:

* Value: A floating-point value in ticks per second
* Usage: Controls the speed of the motors more precisely.
* Can’t find it? You will need to choose the set TargetPosition block, then choose from the dropdown list.

**Mode**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXekQAdUYM8OLWjV0ZHwbhTIsgWWiaOiDLRD5V4dvkKIjF0SiK3bIEAP1QKSGm3RFhk_H84NmdkVKcaPbNe8-r7LZSVYrlNH1l1MsBMYSLhHYiYRs1i8VkI4zBOQ7ZtxAAUEFC1rjpIBxdhT5jrK-3TJA4Xh?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the mode of four motors. The four modes are RUN\_WITHOUT\_ENCODER, RUN\_USING\_ENCODER, RUN\_TO\_POSITION, and STOP\_AND\_RESET\_ENCODER.

Key points:

* DcMotor.RunMode.RUN\_WITHOUT\_ENCODER: This is the default mode. The motor runs at the specified power level without using encoder feedback. Suitable for basic open-loop control.
* DcMotor.RunMode.RUN\_USING\_ENCODER: Uses encoder feedback to control motor speed. Allows for more precise speed control. Often used in conjunction with PID control.
* DcMotor.RunMode.RUN\_TO\_POSITION: Runs the motor to a specified target position using encoder feedback. Ideal for precise positioning tasks.
* DcMotor.RunMode.STOP\_AND\_RESET\_ENCODER: Stops the motor and resets the encoder count to zero. Used to initialize the motor's position before starting a new movement.

**ZeroPowerBehavior**

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdWEpsM1fuwfLyytwPvLvFPVF14ZPMU9-0PcEPcZMb0ynf83d0dhLN88_DQYKhWX5G17_5nmmRz5xcUkThS-kqwgI1jFkBq4BTx-_nkmoq_EqhL8ZKQnYeV3TWUQMmGzZDgSCI58c2w2oUlWpG-MsZYxoRW?key=hRw9bBhBfp1lHBJ7rUAI2Q)

Sets the state of four motors when their power is set to zero. The two possible values are BRAKE or FLOAT.

Key points:

* Brake: When the motor's power is set to zero, the motor is actively braked, bringing it to a quick stop. Ideal for situations where you want the motor to stop quickly and hold its position. This is commonly used for mechanisms like arms or lifts.
* Float: When the motor's power is set to zero, the motor coasts freely, allowing the motor's axle to rotate without generating torque. Suitable when you want the motor to coast freely after setting power to zero, allowing momentum to carry the mechanism. This can be useful for wheels or mechanisms where controlled deceleration is not required.

**Extended**

More blocks for motors that are less commonly used. Nothing in this folder is implemented. DO NOT USE.

<br>
