How to start with the Controlled-motor module

This guide contains all the basic notions you will need to use the Controlled-motor module.

Module category


Actuators modules are able to act on the physical world.

How to connect your motor-reducer to your modules

The Controlled-motor module have one PH connector with 6 pins, where the motor can be plugged.

This module accepts supply voltage from 7V to 24V.

Warning: The USB module provides too weak power to drive a motor-reducer with this module. A power module such as Battery module or Power plug module shall be used.


How to use your Controlled-motor module using Pyluos

This module is able to control DC motors with a reduction and a sensor (usually called motor-reducer or speed-reducer). To control regular DC motors (without reduction neither sensor), please refer to DC motor module’s documentation.

The Controlled-motor module provides a PID control on the output position, and PID control on the output speed, taking into account the reducer and the encoder. 

To control your Controlled-motor module, you have to connect it in a Luos network and connect this network through a communication module to Pyluos.

Then you can access to your module and control it.

Module’s type settings:

Warning: These settings must be set in your code as an initialization before starting to use your module.


Both PID’s values have to be set accordingly to the motor-reducer plugged to the module. Each different motor-reducer will have different PID’s values, for position and speed control.
The default values [0, 0, 0] won’t have any effect on the motor, and must be changed. The following set values are examples (robot and controlled_moto are to be replaced by the actual names of your robot and Controlled-motor module). 

Set the position PID values [P, I, D]:

Set the speed PID values [P, I, D]:

Set the encoder resolution before reduction:

Set the gear reduction ratio:

Set the output wheel’s diameter, in mm:

Reinitialize the position measurement:

Module’s driving modes:

This module can drive a motor-reducer in several modes:

  • Power mode: A value between -100 and 100 is applied, defining the percentage of full power of the motor, in both possible directions.
  • Rotational speed mode: An angular speed value in degrees / second is applied.
  • Rotational position mode: An angle in degrees is applied, for the motor-reducer to reach.
  • Linear speed mode: A linear speed in millimeters / second is applied (wheel’s diameter must be set).
  • Linear position mode: A position in millimeter is applied, for the wheel to reach.

The following commands allow to enable or disable the different driving modes. Only one mode can be enabled at a time.

Power mode (this is the only mode which is enabled by default):

Angular speed mode:

Angular position mode:

Linear speed mode:

Linear position mode:

Module’s control values:

Several values can be get or set, using the following commands:

Get a value:

Set a value:

The characters **** must be replaced by one of the following:

  • compliant (Return or set True or False)
  • power_ratio (Return or set a value from -100.0 to 100.0)
  • target_rot_speed (Return or set the target value of the output’s speed in degrees/second)
  • target_rot_position (Return or set the target value of the position in degrees)
  • target_trans_speed (Return or set the target value of the linear speed of the wheel, in millimeters / second)
  • target_trans_position (Return or set the target value of the wheel’s position in millimeters)

Module’s report data:

Measurements are available to be read, and can be enabled or disabled.

Read a value:

Enable or disable a value measurement:

The characters **** must be replaced by one of the following:

  • rot_position (Return the rotational angle of the output, °)
  • rot_speed (Return the rotational speed of the output, °/s)
  • trans_position (Return the position of the wheel, mm)
  • trans_speed (Return the linear speed of the wheel, mm/s)
  • current (Return the current into the motor, A)


Display the controls of the module: