Movimiento#
Introduction#
Motor blocks can spin a motor forward or in reverse, move it to a specific position, and adjust its speed, torque, and timeout settings. They can also report encoder values to track movement and position.
Below is a list of all available blocks:
Actions – Stop and spin motors.
spin – Spins the selected motor indefinitely.
spin for – Spins a motor for a specific distance in degrees or turns.
spin to position – Spins a motor to a set position.
stop motor – Stops a specific motor from spinning.
Settings – Adjust motor settings.
set motor position – Sets the encoder value of a motor.
set motor velocity – Sets the speed of a motor as a percentage.
set motor stopping – Sets the stop behavior (brake, coast, or hold).
set motor max torque – Limits the maximum torque the motor can apply.
set motor timeout – Limits how long a motor block waits before giving up if movement is blocked.
Values – Check movement status.
motor is done? – Returns a Boolean indicating whether the motor is no longer spinning.
motor is spinning? – Returns a Boolean indicating whether the motor is currently spinning.
motor position – Returns the motor’s current rotational position in degrees or turns.
motor velocity – Returns the motor’s current velocity in %.
motor current – Returns the current drawn by the motor in %.
Actions#
spin#
The spin block spins a selected motor in a specified direction using the current motor velocity.
girar [Motor 1 v] [adelante v]
Parameters |
Description |
---|---|
motor |
The motor to spin, configured in the Devices window. |
direction |
The direction to spin, configured in the Devices window. By default this is:
|
Example
Example coming soon!
spin for#
The spin for block spins a selected motor for a specific amount of rotation using the current motor velocity, measured in degrees or turns.
girar [Motor 1 v] [adelante v] por (90) [grados v] ▶
Parameters |
Description |
---|---|
motor |
The motor to spin, configured in the Devices window. |
direction |
The direction to spin, configured in the Devices window. By default this is:
|
distance |
The rotation amount, as an integer or decimal. |
unit |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the motor will finish moving before running the next block. To make the motor start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
spin to position#
The spin to position block spins a motor to a specific absolute position using the current motor velocity and motor position.
girar [Motor 1 v] a la posición (90) [grados v] ▶
Parameters |
Description |
---|---|
motor |
The motor to spin, configured in the Devices window. |
position |
The target position to spin the motor to. |
unit |
The unit of measurement, which can be one of the following:
|
expanding arrow |
By default, this is a waiting block, so the motor will finish moving before running the next block. To make the motor start moving and immediately run the next block right away, expand the block to say and don’t wait. |
Example
Example coming soon!
stop motor#
The stop motor block immediately stops the selected motor.
parada [Motor 1 v]
Parameters |
Description |
---|---|
motor |
The motor to stop, configured in the Devices window. |
Example
Example coming soon!
Settings#
set motor position#
The set motor position block sets a specific position value to a motor, which updates the encoder reading.
Establezca la posición [Motor 1 v] en (0) [grados v]
Parameters |
Description |
---|---|
motor |
The motor to set the position of, configured in the Devices window. |
position |
The encoder position value to set. |
unit |
The unit of measurement, which can be one of the following:
|
Example
Example coming soon!
set motor velocity#
The set motor velocity block sets the default spinning speed of a motor as a percentage for all subsequent Motion blocks in the project.
Establezca la velocidad [Motor 1 v] al (50)%
Parameters |
Description |
---|---|
motor |
The motor to set the velocity of, configured in the Devices window. |
velocity |
Sets the default movement velocity from 0% to 100%. |
Example
Example coming soon!
set motor stopping#
The set motor stopping block sets how a motor behaves when it stops.
establecer [Motor 1 v] deteniéndose en [freno v]
Parameters |
Description |
---|---|
motor |
The motor to set the stopping behavior of, configured in the Devices window. |
stopping behavior |
Sets how the motor stops, which can be one of the following:
|
Example
Example coming soon!
set motor max torque#
The set motor max torque block sets how much force a motor can exert.
set [Motor1 v] max torque to (50) %
Parameters |
Description |
---|---|
motor |
The motor to set the max torque of, configured in the Devices window. |
torque |
The maximum torque allowed, from 0% to 100%. |
Example
Example coming soon!
set motor timeout#
The set motor timeout block sets a time limit for how long a Motor block will wait to reach its target. If the robot cannot complete the movement within the set time, it will stop automatically and continue with the next block.
Note: The Motor’s time limit is used to prevent Motor blocks that do not reach their target position from stopping the execution of other blocks in the stack.
Establezca el tiempo de espera [Motor 1 v] en (1) segundo
Parameters |
Description |
---|---|
motor |
The motor to set the timeout of, configured in the Devices window. |
time |
The maximum number of seconds a Motor block will run before stopping and moving to the next block. |
Example
Example coming soon!
Values#
motor is done?#
The motor is done? block returns a Boolean indicating whether the motor is not spinning.
True - The motor is not spinning.
False - The motor is spinning.
<[Motor 1 v] ¿está hecho?>
Parameters |
Description |
---|---|
motor |
The motor to check, configured in the Devices window. |
Example
Example coming soon!
motor is spinning?#
The motor is spinning? block returns a Boolean indicating whether the motor is spinning.
True - The motor is spinning.
False - The motor is not spinning.
<[Motor 1 v] esta girando?>
Parameters |
Description |
---|---|
motor |
The motor to check, configured in the Devices window. |
Example
Example coming soon!
motor position#
The motor position block returns the total distance the selected motor has rotated.
([Motor 1 v] posición en [grados v] :: custom-motion)
Parameters |
Description |
---|---|
motor |
The motor to check, configured in the Devices window. |
unit |
The unit of measurement, which can be one of the following:
|
Example
Example coming soon!
motor velocity#
The motor velocity block returns the current rotational speed of the motor in a range from -100% to 100%.
([Motor 1 v] velocidad en %)
Parameters |
Description |
---|---|
motor |
The motor to check, configured in the Devices window. |
Example
Example coming soon!
motor current#
The motor current block returns the electrical current used by the motor in a range from 0% to 100%.
([Motor 1 v] corriente en %)
Parameters |
Description |
---|---|
motor |
The motor to check, configured in the Devices window. |
Example
Example coming soon!