TETRIX Motor Controller

Revision as of 16:11, 4 April 2012 by Bfeher (Talk | contribs)

Jump to: navigation, search

Main >> NXT >> Motor Controller


The HiTechnic Motor Controller allows you to drive two 12V motors and read values from two shaft encoders.


Once your HiTechnic DC Motor Controller is configured in the "TETRIX Controllers" tab of the Motors and Sensor Setup screen, you can use the Motors tab of the Motors and Sensors Setup to configure your motors.

Tetrix motors 1.png


The name of the motor. NXT motors are given names "motorA" through "motorC". The TETRIX DC motors are named based on how they're connected to the NXT. The port name can be used to reference a motor in your program (i.e. motor[motorC] = speed;)

The TETRIX motor names can be translated as follows:
mtr_S1_C1_1 - Motor (mtr) on Sensor Port 1 (S1) connected on the first controller (C1) in the daisy chain attached to Motor Port 1 (1)
mtr_S1_C1_2 - Motor (mtr) on Sensor Port 1 (S1) connected on the first controller (C1) in the daisy chain attached to Motor Port 2 (2)


Motors can be given more descriptive names, such as "LeftMotor" or "FrontMotor". This name is an alias for the motor port name, so you can use it anywhere you want to specify that motor. The first two configured TETRIX motors are given the names "motorD" and "motorE" by default, but these names can be changed based on your preference.


This allows you to set the type of motors, wether they are 12V DC motors or NXT motors.

PID Control

This checkbox enables the PID Speed Control functionality for a motor. The TETRIX DC motors don't have built-in encoders, so they must first be installed to use this feature.


This checkbox will reverse the direction of a motor in an entire program. This is useful when motors are installed opposite one another. Instead of giving one motor a positive power level and the other motor a negative power level to make the robot move forward, both can be given a positive power level, simplifying your code.

ROBOTC Functions


int motor[tMotor motor]
(int) Contains the motor power or speed level (-100 to +100). Negative values are reverse; positive formward. A power level of 0 (zero) stops the motors.
Parameter Explanation Data Type
motor A motor port or name tMotor
motor[motorA] = 100;   // motor A is given a power level of 100 (forward)
motor[motorA] = -100;  // motor A is given a power level of -100 (reverse)