Robot App Store

image description

Robopedia

LEGO NXT Motors Are Not Running


Question


I can’t make the LEGO NXT 2.0 motors running.
Neither of the following commands, has worked:

Regulated motor mode, synchronized motors
0x0C 0x00 0x00 0x04 0x0FF 0x64 0x04 0x02 0x00 0x20 0x00 0x00 0x00 0x00

Regulated motor mode, speed regulation
0x0C 0x00 0x00 0x04 0x0FF 0x64 0x04 0x01 0x00 0x20 0x00 0x00 0x00 0x00

Break motor mode
0x0C 0x00 0x00 0x04 0x0FF 0x64 0x02 0x00 0x00 0x20 0x00 0x00 0x00 0x00

Please help.

Answer


Motor Mode byte of 0x02 (break mode alone), or 0x04 (regulated mode alone) won’t do anything.

Motor mode byte field is a bit-field- a combination of all or part of the three modes:
Motor On (0x01),
Break Mode (0x02)
and Regulated mode (0x04);

It means that you can set more than one mode.
You must set at least the Motor ON mode (0x01 + another mode if you want) to activate the motors.

The following values are all the valid combinations and their influence on the motors working mode:
  • 0x00- Coast mode. Motor that is connected to the specified port will rotate freely.
    Use the coast mode to release the motor locking for letting the motor to rotate from external source alone (manually).
    The Motor power set point value will be ignored.
  • 0x01- Motor ON mode. Motor that is connected to the specified port will rotate according to the value specified in the motor power set point value.
    Note- the actual speed can be effected by external physical load on the motor and can be different from the motor power set point value.
  • 0x02- Break mode alone. Nothing will happen. Don’t use this value.
  • 0x03- Motor ON with Break mode. Use this mode to improve the accuracy of motor output.
    Note- this mode uses more battery power, and the actual speed can be affected by external physical load on the motor and can be different from the motor power set point value.
  • 0x04- Regulated mode alone. Nothing will happen. Don’t use this value.
  • 0x05- Motor ON with Regulated mode. Turn on the regulation mode that will be specified in the Regulation mode byte.
    This mode gives NXT firmware the ability to adjust the speed (add more power to the motors) according to the external physical load on the motors.
    This mode is used to synchronize two motors when it is important the vehicle to drive straight no matter the surface it is driving on, or to synchronize the specified speed (motor power set point) to be constant no matter the physical overload on the motor.
    The regulation synchronize mode will be configured in Regulation Mode byte.
    In case of using the regulation mode to synchronize two motors with separate SetOutputState commands, make sure to use either the 0x05 or 0x07 mode on the both commands.
  • 0x07- Motor ON with Break and Regulated mode- This mode is used for regulated mode with accuracy of motor output.
    The actual speed will not be affected by external physical load on the motor.
    The regulation synchronize mode will be configured in Regulation Mode byte.
    In case of using the regulation mode to synchronize two motors with separate SetOutputState commands, make sure to use either the 0x05 or 0x07 mode on the both commands.
    Note- this mode uses more battery power.

In generally, in order to successfully turn on the motors, make sure that:
  • The motor power set point is set to a value that is not 0x00;
  • If you are using a Turn ratio argument for synchronized regulation, make sure that the Power set point is at least 75% (0x4B or 0xB5 for opposite direction) for both motors, and the left motor is connected to either A or B port, and the right motor is connected to either B or C port;
  • Motor mode byte is set to 0x01 (Motor ON alone), 0x03 (Motor ON + Break), 0x05 (Motor ON + Regulated), or 0x07 (Motor ON + Break + Regulated) values;
  • If you are using a synchronized regulation mode, make sure that both motors have the same values set in Motor mode byte and Regulation motor byte;
  • Regulation state should not be 0x00 when the Motor mode byte is set to either 0x05 (Motor ON + Regulated) or 0x05 (Motor ON + Break + Regulated);
  • Running state argument is set to 0x20 as running or to 0x10 (Ramp up) or 0x40 (Ramp down) when you are using a synchronized regulation mode;
  • Tacho limit argument should not be 0x00 when you are using one of the ramping states;

The syntax of the SetOutputState command is:
[0x0C] [0x00] [0x00 or 0x80] [0x04] [0x00-0x02 or 0xFF Motor output port] [Motor power set point] [Motor mode byte] [Regulation mode] [Turn ratio] [Run state] [Tacho limit LSB] […] […] [Tach limit MSB]

For more information about this command and its arguments check the How to Control Lego NXT Motors tutorial.

For more information about the usages of this command check the How to make LEGO NXT drive tutorial.
my wife cheated now what married men that cheat looking for affair



Related Robopedia portals

Find out further reading in the following topic-based portals.
[Add or Edit Article]