Auxiliary I/O#

Telega provides the versatile auxiliary analog I/O interface that is designed to address the following use cases:

  • Connection of the motor temperature sensor.

  • RCPWM control input.

  • Analog voltage control input.

  • Connection of other analog sensors.

  • General-purpose analog I/O port for an arbitrary application.

This chapter documents the auxiliary I/O interface at the software level. For the physical-level description involving the specific signal names, signal levels, dynamic range, impedance, etc., refer to the hardware-specific datasheets.

Some hardware designs may lack support for auxiliary I/O or some of its features, in which case the respective configuration registers may have no effect.

Electrical circuit#

The specific values of each parameter shown in the circuit diagram are given in the hardware-specific documentation.

../_images/aux_pin_schematic.svg

Auxiliary I/O structure.#

Configuration registers#

Configuration parameters whose name contains a component that begins with a digit followed by an underscore (e.g., .1_) specify a selectable strategy. The strategy is selected by writing the appropriate integer value into the corresponding .type register.

Notice that changes to some of the configuration registers take effect immediately, which enables (and, in fact, intended for) real-time control of the auxiliary pin via the register interface.

Register

Type

Default

Unit

Takes effect at

Description

aux.pull

integer8

0

immediately

Internal pull resistor connection.

aux.power_output

boolean

false

immediately

Enables the power output via the communication interface connectors.

aux.ctl.dead0

boolean

false

reboot

When the analog signal is within the deadband, assume the signal to be zero rather than none.

aux.ctl.mode

string

(empty)

reboot

Which command/control mode is commanded by the aux interface. Empty disables analog control.

aux.ctl.type

natural8

0

reboot

Type of the analog signal applied to the aux analog input. Zero disables analog control.

aux.ctl.1_rcpwm.rev_mid_fwd

real32[3]

1.0e-3, 1.5e-3, 2.0e-3

second x3

reboot

RCPWM interpolation endpoints that correspond to output values (-1, 0, +1).

aux.ctl.1_rcpwm.deadband

real32

0.1e-3

second

reboot

RCPWM deadband.

aux.ctl.2_voltage.rev_mid_fwd

real32[3]

0.0, 1.65, 3.3

volt x3

reboot

Voltage interpolation endpoints that correspond to output values (-1, 0, +1).

aux.ctl.2_voltage.deadband

real32

0.15

volt

reboot

Voltage deadband.

Power output (BEC)#

Optionally, the auxiliary I/O interface can provide low-voltage power supply to external consumers, such as other electronics, sensors, PoE/PoDL injectors, CAN bus, etc. This capability is occasionally referred to as a battery elimination circuit or BEC. The output voltage, maximum current, overload handling, and other parameters are provided in the hardware-specific documentation.

The auxiliary power output is enabled by writing to aux.power_output. Writes to this register take effect immediately; that is, it can be used to control the power supply to an external load in real time.

Pull resistor#

The I/O pin is equipped with a low-resistance \(R_\text{pull}\) that can pull the I/O pin to one of the internal voltage rails. This is controlled via aux.pull; writes to this register take effect immediately. The behavior is as follows:

aux.pull value

\(R_\text{pull}\) connected to

-1

Ground

0

Nothing, high impedance mode

+1

\(V_\text{pull}\)

Values that are not listed shall not be used.

The fact that writes to aux.pull take effect immediately enables the use of the I/O pin as a high-impedance output for controlling external electronics.

Note

Often, \(R_\text{pull} \approx 1200 \Omega; V_\text{pull} = 3.3 V; R_\text{io} = 0 \text{ or } 200 \Omega\).

Voltage monitoring#

The voltage at the auxiliary I/O pin is always monitored regardless of its configuration. The voltage can be observed in real-time by reading register aux.voltage [volt] of type real32.

With the help of the built-in pull resistor, it is possible to use the auxiliary I/O pin for interfacing with current-output analog sensors, such as certain types of torque transducers.

An example with Yakut is provided below, assuming the node-ID of the device is 125 and the auxiliary I/O pin is floating:

 1$ y r 125 aux.pull          # By default, the pull resistor is disabled.
 20
 3
 4$ y r 125 aux.voltage       # The pin is floating in the high-impedance state.
 50.9879853129386902
 6
 7$ y r 125 aux.pull 1        # Pull the pin up. The change takes effect immediately.
 81
 9
10$ y r 125 aux.voltage       # The voltage is now close to the pull-up voltage.
113.279853343963623
12
13$ y r 125 aux.pull -- -1    # Pull the pin down. The change takes effect immediately.
14-1
15
16$ y r 125 aux.voltage       # The voltage is now close to zero.
170.012893772684037685

Motor temperature measurement#

The continuous voltage measurement facilitates the motor temperature sensor support. No special configuration is required for this to work, as the voltage at the auxiliary input is always measured regardless of its application.

Analog control front-end#

Functional description#

The auxiliary I/O pin can be used to issue commands, thereby enabling motor control via simple analog interfaces. The analog signal is demodulated and its value is projected to \([-1,+1]\) or \([0,+1]\) depending on the configuration; the resulting value is then used as the argument of the command. The command issued by the front-end and its options are selected via the aux.ctl.mode register as follows:

aux.ctl.mode

Command

Sub-command

Analog signal value interpretation

Example

dtr

drive

ratiometric torque

ratiometric torque setpoint

dtr

dur

drive

ratiometric voltage

ratiometric voltage setpoint

dur

dv <VELOCITY>

drive

velocity

velocity scaled per the value of <VELOCITY>, which is a floating-point literal

dv 500.0

sp <POSITION>

servo

target position scaled per the value of <POSITION>, which is a floating-point literal

sp 100.0

Values of aux.ctl.mode that are not listed shall not be used.

The analog signal is not clamped to \([-1,+1]\) or \([0,+1]\) upon projection, and if the input analog signal value is large, the range may be exceeded through linear extrapolation.

In the case of carrier-based analog signals[1], the analog control front-end will only issue commands when the carrier signal is present. When the carrier is lost, the last issued command will be automatically canceled upon expiration of its deadman timeout.

The deadman timeout used by the analog front-end is always 100 milliseconds; this is not configurable.

Deadband handling#

By default, commands are not issued while the analog signal resides in the deadband zone. If aux.ctl.dead0 is set, then commands will be issued with a zero setpoint while the signal is present and resides in the deadband zone.

../_images/analog_control_deadband.svg

Fault handling#

If the current state is fault and the signal is within the deadband, a standby command will be issued regardless of the behavior prescribed by aux.ctl.mode and aux.ctl.dead0. This special case allows the outer controller to unlatch faults without having to resort to the other interfaces by simply bringing the analog signal into the deadband zone once.

Signal modulation types#

The modulation type is selected via aux.ctl.type.

RCPWM#

RCPWM control signal can be demodulated at the auxiliary I/O pin if its temporal characteristics are within the following limits (signals that do not fall into the specified envelope may still be demodulated but this is not guaranteed):

Parameter

Minimum

Maximum

High level duration

0.01 ms

3 ms

Low level duration

0.01 ms

20 ms

The signal is modulated as the duration of the high level pulse. The duration of the low level pulse and the pulse period carry no information.

During demodulation, the pulse duration is linearly projected to the ratiometric control value in \([-1, +1]\) through the negative one, zero, and positive one reference points, respectively, provided via aux.ctl.1_rcpwm.rev_mid_fwd. Pulse duration within aux.ctl.1_rcpwm.deadband seconds off the midpoint falls within the deadband zone.

For unipolar control (without reversal), the midpoint and the reverse point need to be assigned the same value.

When the RCPWM modulation type is selected, a weak pull-down resistor is connected to the auxiliary I/O input regardless of the aux.pull setting. This is to ensure that the input is driven to a well-known state when no signal is supplied.

The RCPWM demodulator does not perform low-pass filtering.

Tip

For aux.ctl.1_rcpwm.rev_mid_fwd, a common configuration for unidirectional control is (1.0e-3, 1.0e-3, 2.0e-3) seconds; for reversible control: (1.0e-3, 1.5e-3, 2.0e-3) seconds.

Analog voltage#

In this mode, the analog voltage supplied at the auxiliary I/O pin is linearly projected to the ratiometric control value in \([-1, +1]\) through the negative one, zero, and positive one reference points, respectively, provided via aux.ctl.2_voltage.rev_mid_fwd. Voltage within aux.ctl.2_voltage.deadband volts off the midpoint falls within the deadband zone.

For unipolar control (without reversal), the midpoint and the reverse point need to be assigned the same value.

A digital low-pass filter with a low cutoff frequency is applied to suppress parasitic feedback from the power stage.

Tip

For aux.ctl.2_voltage.rev_mid_fwd, a common configuration for unidirectional control with a 3.3 V signal is (0, 0, 3.3) volts; for reversible control: (0, 1.65, 3.3) volts.