TETRIX MAX DC Motor Expansion Controller Block for EV3

 

This block interfaces TETRIX MAX DC motors and encoders with an EV3 sensor port.

 

EV3 Connection:

 

To ensure proper port identification, connect and power the TETRIX controllers before power up of the EV3 brick. The EV3 will display an error flag over the port parameter of the block if the devices are not powered in this sequence. If communication with the expansion controller is not working, unplug and plug the sensor port cable back in to reset communications. Refer to the end of this document for connection and controller mounting diagrams.

For best functionality of the TETRIX DC motor controller expansion block, DO NOT use multi-thread programming methods.

 

Block Anatomy:




1.     Port Selector

2.     Mode Selector

3.     Input

4.     Choose: Next Action Parameter

5.     Output


Use the Port Selector on the top of the block to make sure that the sensor port number (1, 2, 3, or 4) matches the port on the EV3 Brick that the motor controller is connected to.

Use the Mode Selector to select the mode for the block. The inputs, outputs and next action parameters available will change depending on the mode.

 

Modes:

 

Read Encoders


Returns the encoder values for motors 1 and 2.

 

Read Voltage


Returns the voltage of the power supply connected to the battery input terminal. For example, a value of 1218 indicates an input voltage of 12.18 volts.

 

Unlimited


Continuously runs the specified motors at a user-defined power. If both motors are chosen, a different power can be set for each motor.

 

Stop


Allows the user to choose how to stop the specified motor(s) using the next action parameter.

 

Reset Encoder(s)


Resets the specified motor encoder(s) to zero (0).

 

Constant Speed


Continuously runs the specified motor(s) at a user-defined power. The speed of the motor will remain the same regardless of the load. If both motors are chosen, a different power can be set for each motor. This mode requires encoder input to the controller.

 

Degrees


Runs the specified motor(s) at a user-defined power and number of degrees. This mode also allows users to choose how to stop by using the next action parameter. If both motors are chosen, a different power can be set for each motor. The direction of the motor can be determined by using +/- degrees.

 

Rotations


Runs the specified motor(s), at a user-defined power and number of rotations. This mode also allows users to choose how to stop by using the next action parameter. If both motors are chosen, a different power can be set for each motor. The direction of the motor can be determined by using +/- rotations.

 

Encoder Position


Runs the specified motor(s), at a user-defined power to a user-defined encoder value. This mode also allows users to choose how to stop by using the next action parameter. If both motors are chosen, a different power can be set for each motor. The direction of the motor is determined by the relation of the target encoder position to the current encoder position and not by +/- motor power. When using a TETRIX DC motor equipped with an encoder, one motor shaft rotation is equal to 1440 encoder counts.

 

Inputs and Outputs:

 

The inputs available for the TETRIX DC Motor Controller block will depend on the mode selected. You can enter the input values directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of other Programming Blocks.

 

Input

Type

Allowed Values

Description

Motor

Numeric

1-3

1: Motor 1
2: Motor 2
3: Both motors

Motor 1 Power

Numeric

-100 to 100

Determines the power (speed) of motor 1. A negative value will reverse motor 1. Parameter input is not valid if motor 2 is selected.

Motor 2 Power

Numeric

-100 to 100

Determines the power (speed) of motor 2. A negative value will reverse motor 2. Parameter input is not valid if motor 1 is selected.

Turn for Degrees

Numeric

Any integer number

Determines the number of degrees to turn the motor(s). 360 degrees equals one full rotation. A negative value will reverse the motor direction.

Turn for Rotations

Numeric

Any integer number

Determines the number of rotations to turn the motor(s). A negative value will reverse the motor direction.

Turn to Encoder Value

Numeric

Any integer number

Turns the motor(s) to a specific encoder value. Motor direction is determined by the relation of the target encoder position to the current encoder position.

Next Action

Logic

True/False

True: Stop (brakes the motor(s) when action is completed). False: Float (the motor(s) coast upon completion).

Invert Motor

Numeric

0-3

Inverts the rotational direction of the specified motor(s).

Encoder

Numeric

1-3

Reset the selected encoder.

 

 

The outputs available will depend on the mode selected. To use an output, use a data wire to connect it to another programming block.

 

Output

Type

Description

Encoder M1

Numeric

Encoder value of motor 1.

Encoder M2

Numeric

Encoder value of motor 2.

Voltage

Numeric

Millivolt reading of the input power supply; for example, a numeric value of 1218 equals 12.18 volts.

 

 

Connections and Mounting:

 

 

 

 

Daisy-chaining multiple controllers:

 

DC and Servo motor expansion controllers can be connected to a single EV3 sensor port in a daisy chain configuration as shown below. Additional controllers may be added to other sensor ports in the same arrangement.