Data Sheet

Serial mode
TTL level serial operating at a baud rate that is set in the USB configuration. Commands are:
Hex command value Command Returned byte / additional byte
0x21 Read speed Returns 1 byte (0 - 0xff)
0x22 Read direction Returns 1 byte (0 / 1)
0x23 Read current Returns 1 byte (0 - 0xff)
0x24 Read temperature Returns 1 byte (-40°c to 125°c)
0x25 Read software version Returns 1 byte
0x26 Read acceleration Returns 1 byte (0 - 0xff)
0x28 Read status Returns 1 byte as described in I2C section
0x31 Write speed Follow with desired speed (0 - 0xff)
0x32 Write command Follow with desired direction (1/ 2) or instant stop (0)
0x33 Write acceleration Follow with desired acceleration (0 - 0xff)
Status register
Bit 7 (msb) 6 5 4 3 2 1 Bit 0 (lsb)
Busy - - - -
over-temperature
limiter
over-current
limiter
Acceleration
in progress
Bit 0 is read as high when the drive is accelerating the motor. It will be cleared when the requested
speed is achieved or the over current or over temperature limiters are active.
Bit 1 set high indicates that the current through the motor has reached 20Amps and is being limited to
that value, the red LED will be illuminated when this happens.
Bit 2 set high indicates that the over temperature limiter is active. Above a preset threshold, the motor
current will be reduced in proportion to the MD04 temperature. The module can still be used but the
motor power will be limited, the red LED will be illuminated when this happens. It should be noted that
a few minutes of running continuously at 20A will cause the heatsink to get hot - watch your fingers!
Bit 7 is the busy flag. It is set high when you issue a new command to the module. It is cleared very
quickly and you are unlikely ever to see it set.
Speed register
Sets the maximum speed that the motor will accelerate to. It is actually the 8-bit value sent to the
modules PWM controller. Write a value of 0 to 243 (numbers from 243 to 255 are clamped to 243) .
The larger the number, the more power is applied to the motor.
Acceleration register
This sets the rate at which the motor accelerates or decelerates from where it is towards the new speed
set by the speed register. Write a value of 0 to 255, the larger the number the longer the module will
take to reach the new speed. Writing zero to the acceleration register will allow maximum acceleration
of 0 to full in 0.187 seconds. This value actually controls a timer which steps the current motor speed
towards the requested motor speed. It does this every (((acceleration register)*125)+768)uS. A value of
zero gives 768uS/step or 243*768=186624uS (0.187s) to accelerate from 0 to full. A value of 255 is
((255*125)+768)*243=7932249uS or just under 8 seconds.
© Devantech Ltd 12/07/15 MD04 documentation 6/8