HiTechnic-Motor-Controller-Specification
HiTechnic-Motor-Controller-Specification
Contents
1. Introduction .............................................................................................................. 3
2. Description ............................................................................................................... 3
2.1. Function ................................................................................................................ 3
3. Technical Description .............................................................................................. 5
3.1. Operation .............................................................................................................. 5
3.2. Parameter ordering ............................................................................................... 6
3.3. Channel mode ....................................................................................................... 6
3.4. Channel power...................................................................................................... 7
3.5. Channel current encoder value ............................................................................. 8
3.6. Channel target encoder value ............................................................................... 8
4. Appendix 1. Electrical Connections ........................................................................ 8
1. Introduction
This document describes the HiTechnic Motor Controller operation and programming
interface.
The motor controller has connections for two DC motors and two encoders. The onboard
firmware functions provide comprehensive motor control functions.
2. Description
2.1. Function
The motor controller communicates with the NXT using the LEGO Company’s defined
use of the I2C interface.
The motor controller will time-out if no I2C communication is detected for 2½ seconds.
If a timeout occurs both motor channels will be set to float mode.
The motor controller will shut down if a fault condition such as an output short circuit,
output over-current or internal overheating is detected. It will automatically restart after a
one minute cool down period. If a shut down occurs both motor channels will be set to
float mode.
The motor controller accepts 32 bit target values for the encoder counts for position
setting mode.
The motor controller returns the readings for the encoder counts from both channels as 32
bit values.
The first motor controller in the daisy chain will use an I2C address of 02/03. Subsequent
controllers will obtain addresses of 04/05, 06/07 and 08/09. Up to four controllers may be
daisy chained. Sensors and other I2C devices may not be connected to the controller
daisy chain.
The motor controller consumes 5mA or less from the NXT “brick” 4.3v unregulated
supply.
The motor controller supplies up to 4 amps on each motor channel when running from 9v
– 15v.
The motor controller uses separate grounds for the NXT I2C interface and the battery
supply to reduce ground loop problems. Care should be taken when wiring the battery
Specification Rev1.4 Page 3 of 8
©Dataport Systems, Inc 2008
HiTechnic FIRST Motor Controller Specification
supply between modules to ensure that the terminals are tight and that an adequate gauge
of wire is used for the likely motor current consumption. Inappropriate wiring will result
in failure to operate correctly. Care has been taken to ensure that typical wiring errors
should not cause permanent damage. However, care should always be taken to avoid
wiring errors. Do not use un-fused battery packs.
3. Technical Description
3.1. Operation
The motor controller firmware will support the LEGO company’s sensor memory model.
The Motor 1/2 target encoder value fields will accept a 32 bit target position setting for
use in position setting mode. This value is a signed 32 bit value.
The Motor 1/2 current encoder value fields will return the 32 bits current encoder value.
This value is a signed 32 bit value.
The Motor 1/2 gear ratio fields have not been implemented in the current version of the
firmware.
The Motor 1/2 P coefficient fields specify the differential control loop P coefficient. This
value is an unsigned byte.*
The Motor 1/2 I coefficient fields specify the differential control loop I coefficient. This
value is an unsigned byte.*
The Motor 1/2 D coefficient fields specify the differential control loop D coefficient. This
value is an unsigned byte.*
The Battery voltage field will return the current battery voltage. The high byte is the
upper 8 bits of a 10 bit value. It may be used as an 8 bit representation of the battery
voltage in units of 80mV. This provides a measurement range of 0 – 20.4 volts. The low
byte has the lower 2 bits at bit locations 0 and 1 in the byte. This increases the
measurement resolution to 20mV.
*Note: the preset PID coefficient values in the firmware have been tuned for the motors
being used and it is recommended they not be changed. Any changes to these values will
be lost at power down.
3.2. Parameter ordering
The motor controller mode, power and target position control parameters have been
placed in order to permit single multi-byte writes to be used per channel to control its
operation. If just the mode or power needs to be changed, then a single byte write can be
used. If power and mode need to be changed, then a two byte write of mode followed by
power can be used. All six bytes can be written to set up a new mode, power and target
position. Since the two channels six byte areas are contiguous, a 12 byte write can be
used to command both channels simultaneously.
3.3. Channel mode
The motor controller has one mode control byte per channel to control and monitor its
operation.
D7 D6 D5 D4 D3 D2 D1 D0
Busy Error - NTO Rev Lock Sel 1 Sel 0
The Sel 1 and 0 bits encode the operation thus;
Sel Action
00 Run with power control only
Specification Rev1.4 Page 6 of 8
©Dataport Systems, Inc 2008
HiTechnic FIRST Motor Controller Specification