
conditions that can cause temporary faults.
• The
No power
flag is 1 if the
measurement indicates that the controller’s
VIN voltage is definitely too low to run the motors. If this flag is 0, the VIN voltage
might
be sufficient.
◦ For the Motoron M3S256 and M3H256, this flag is 1 if and only if the VIN
voltage measurement is less than 27. This corresponds to a VIN of 2.9 V if
IOREF is 5 V, and 1.9 V if IOREF is 3.3 V.
• The
Error active
flag is 1 if there is a firmware-level error that is causing the Motoron to
stop its motors. By default, the only two errors are the “Reset” flag and the “Command
timeout” flags (documented above), but you can change which flags are considered to
be errors by changing the
variable documented below.
• The
Motor output enabled
flag is 1 if the Motoron is currently trying to enable any of its
motor outputs. If this is 0, all of the motor outputs are disabled, meaning that the motors
are coasting. If this is 1, some of the outputs might be enabled, but others might be
disabled if there is inadequate VIN power or a motor fault is happening.
• The
Motor driving
flag is 1 if the Motoron is currently trying to drive any of its motors at
a non-zero speed. This bit can only be 1 if the “Motor output enabled” flag is also 1.
VIN voltage
Category
general
Offset
3
Type
unsigned 16-bit
Range
0 to 1023
Units
IOREF × 0.02175
Arduino library
void getVinVoltage()
void getVinVoltageMv(uint16_t referenceMv)
This two-byte variable holds a measurement of the voltage on the Motoron’s VIN pin. It is a 10-bit
ADC reading of the VIN voltage divided by 1047/47, with GND and IOREF used as the reference
voltages.
If you are using our Arduino library, you can use the
getVinVoltageMv()
function to read this
variable and convert it to millivolts.
The following C/C++ code shows how to take the raw value of this variable, along with the
Pololu Motoron Motor Controller User’s Guide
© 2001–2022 Pololu Corporation
8. Variable reference
Page 37 of 67