This is the revision A of the MidiMotor1 module.

MidiMotor1 Module (Revision A)

Table of Contents

1. Introduction

The MidiMotor1 module is designed to drive a medium (aka midi) sized motor with a maximum current of 3.5 Amperes per motor. The logic circuitry is separated from the motor H-bridges via optoisolators.

2. Programming

Command
Name
Action Bit Description
8 7 6 5 4 3 2 1 0
Motor1 Speed Read Send 0 0 0 0 0 0 0 0 0 Return the speed of motor1 as ssss ssss a signed 2's complement number between -128 and 127.
Receive 0 s s s s s s s s
Motor1 Speed Set Send 0 0 0 0 0 0 0 0 1 Set the speed of motor1 to ssss ssss which is a signed 2's complement number between -128 and 127.
Send 0 s s s s s s s s
Motor1 Speed Read Send 0 0 0 0 0 0 0 1 0 Return the speed of motor1 as ssss ssss a signed 2's complement number between -128 and 127.
Receive 0 s s s s s s s s
Motor1 Speed Set Send 0 0 0 0 0 0 0 1 1 Set the speed of motor1 to ssss ssss which is a signed 2's complement number between -128 and 127.
Send 0 s s s s s s s s
Duty Cycle Read Send 0 0 0 0 0 0 1 0 0 Return the duty cycle of the pulse widths as ppp. (000=32µS, 001=64µS, 010=128µS, 011=.25mS, 100=.5mS, 101=1mS, 110=2mS, 111=4mS)
Receive 0 0 0 0 0 0 p p p
Duty Cycle Set Send 0 0 0 0 0 1 p p p Set pulse width duty cycle to ppp. (000=32µS, 001=64µS, 010=128µS, 011=.25mS, 100=.5mS, 101=1mS, 110=2mS, 111=4mS)
Common
Commands
Send 0 1 1 1 1 1 x x x Standard common command. See specifications for details.
Receive 0 a a a a a a a a
Send Select 1 a a a a a a a a Select the module with an address of aaaa aaaa. A time-out indicates that the module is not selected.
Receive 0 1 0 1 0 0 1 0 1

3. Hardware

The hardware consists of a circuit schematic and a printed circuit board.

3.1 Circuit Schematic

There is a separate parts list file.

3.1.1 Logic Schematic

The logic section of the MidiMotor1 module is shown below:

MidiMotor1 Logi Schematic
The logic power and CAN signals come in from N4 pins 3 through 8. The CAN signals are connected to the MCP2551 CAN physical layer IC, U5. The transmit and receive pins of the microctroller, (U4 pins 5 and 6) are connected to the other side of U5. Lastly, the RC0 through RC3 are used to drive the quad optoislator, U3, through current limiting resistors R5 through R7.

3.1.2 Power Schematic

Please note that U3 optoisolator shows up in both schematics. There is only one optoisolator, it is just easier to understand what is going on if the optoisolator is present in both schematics. There is no shared ground between the two sides of the optoisolator.

The power section of the MidiMotor1 module is shown below:

MidiMotor1 Power Schematic
Each L298 (U1 and U2) is a dual H-bridge in a Multiwatt-15 package. As per recommended practice, the two H-bridges are ganged together to form a single H-bridge with 3.5 Amp capacity. Power comes in on N3. The dedicated regulator VR1 provides 5 volts for the logic ciruitry. The H-bridge circuitry is always enabled. The Schottky diodes (D1-D8) are used to clamp out unwanted voltage spikes that occur as a result of switching. Each H-bridge is connected to two optoisolators in U3 to allow independent switching of the H-bridge.

3.2 Printed Circuit Board

The printed circuit board files are listed below:

midimotor1_back.png
The solder side layer.
midimotor1_front.png
The component side layer.
midimotor1_artwork.png
The artwork layer.
midimotor1.gbl
The RS-274X "Gerber" back (solder side) layer.
midimotor1.gtl
The RS-274X "Gerber" top (component side) layer.
midimotor1.gal
The RS-274X "Gerber" artwork layer.
midimotor1.gml
The RS-274X "Gerber" mask layer.
midimotor1.drl
The "Excellon" NC drill file.
midimotor1.tol
The "Excellon" tool rack file.

4. Software

The following files are available:

midimotor1.ucl
The MidiMotor1 µCL source code. There is not much actual code here, since most code is implemented in libraries.
midimotor1.asm
The MidiMotor1 assembly code listing
midimotor1.lst
The MidiMotor1 assmbley listing file.
midimotor1.hex
The µCL MidiMotor1 Intel® Hex file.

5. Issues

Any fabrication issues will be listed here.


Copyright © 2009 by Wayne C. Gramlich. All rights reserved.