AUViking Motor Controller

 

Revision 1.2

 

In partial fulfillment of the requirements of

Design Project CENG499

 

By

Donovan Parks (9905396)

 

Team Members:

Mark Campbell (9805386)

Zahid Rajabali (9809247)

 

Date

March 25, 2003

 

 

TABLE OF CONTENTS

 

1.0 Introduction. 1

2.0 Specifications. 1

3.0 H-Bridge. 2

3.1 MOSFET H-Bridge Operation. 2

3.2 Control Logic for H-Bridge. 4

3.3 Achieving Speed Control 4

3.4 Driving the H-Bridge. 5

3.5 Increasing Robustness of the H-Bridge. 6

4.0 Current Limiting. 8

5.0 Temperature Limiting. 8

6.0 Verification of Absolute Maximum Ratings. 9

6.1 Maximum Battery Voltage. 9

6.2 Maximum Junction Temperature. 9

6.3 Maximum Peak Current Draw.. 10

6.4 Maximum Continuous Current Draw.. 10

6.5 Maximum Duty Cycle. 11

7.0 Selecting a Heat Sink. 11

8.0 Layout of AUVic-MC PCB.. 12

9.0 Communication. 13

9.1 Communication Overview.. 13

9.2 Acknowledge Packet 13

9.3 General Error Packet 13

9.4 Diagnostic Check Packet 13

9.5 Shutdown Packet 14

9.6 Set Motors Packet 14

9.7 Set Acceleration Packet 14

9.8 Set Current Limit Packet 14

9.9 Set Temperature Limit Packet 14

9.10 Set Frequency Packet 15

9.11 Get Flags Packet 15

9.12 Get Current Packet 15

9.13 Get Temperature Packet 15

9.14 Get Current Speed Packet 16

9.15 Get Desired Speed Packet 16

9.16 Get Direction Packet 16

9.17 Get Acceleration Packet 16

9.18 Get Frequency Packet 16

9.19 Get Status Packet 16

10.0 Programming. 17

11.0 Conclusion. 17

 

References. 18

 

Appendix I – Controller Schematic. I

Appendix II – H-Bridge Schematic. II

Appendix III– Bill of Material III

Appendix IV– Controller PCB Layout V

Appendix V– H-Bridge PCB Layout VII

Appendix VI – PIC16F876 Pinout VIII

Appendix VII – AUVic-MC Visual Interface. IX

Appendix VIII – AUVic-MC PIC Code Listing. XI

 

 

LIST OF FIGURES AND TABLES

 

FIGURES

 

Figure 3.1. Basic MOSFET H-Bridge. 3

Figure 3.2. H-Bridge Drive Logic. 4

Figure 3.3. H-Bridge Controller IC (Linear Technologies LT1162). 6

Figure 3.4. MOSFET H-Bridge with Protective Zener Diodes, Schottky Diodes, Capacitors and Resistors. 7

Figure 5.1 Temperature Limiting System.. 9

Figure 6.1 Maximum Drain Current vs. Case Temperature [7] 10

Figure 9.1. Packets used in conjugation with the motor controller. 13

Figure 9.2. Data format to set motor speed. 14

Figure 10.3. Data Format of Get Flags Reply Data. 15

Figure 10.4. Data Format of Get Status Reply Data. 16

 

TABLES

 

Table 3.1. Basic H-Bridge Drive Logic. 3

Table 3.2 H-Bridge Drive Logic. 4

Table 3.3. Purpose of H-Bridge Components. 7

Table 6.1. Maximum Voltage Rating of H-Bridge Components. 9

 

 


1.0 Introduction

 

The AUVic Motor Controller (AUVic-MC) is designed to be a medium-power motor controller capable of driving a single DC permanent magnet motor.  It can handle motors requiring up to 30V at 30A continuous current.  This is sufficient to drive the small trolling motors that are commonly used on the AUVs at the AUVSI competition.

 

A reliable motor controller is essential for a competitive AUV.  The AUVic-MC performs current and temperature limiting to increase its reliability. Current limiting ensures the maximum allowable continuous current is not exceeded as this would result in damage to the AUVic-MC. Temperature limiting monitors the temperature of the low-side MOSFETs to ensure their temperature remains in a safe operating range.  If either the current or temperature limit is exceeded the motor speed is continually reduced until they fall within the safe operating limits.  Together these limiters drastically reduce the chance of the motor controller failing.

 

A motor controller should allow for high variability over a motor’s speed.  The AUVic-MC achieves this by using either signed magnitude or locked-antiphase PWM control.  Nominally, the AUVic-MC uses signed magnitude PWM control.  For a DC motor, speed is nearly proportional to the supply voltage.  Signed magnitude PWM uses this to allow for varying motor speeds by rapidly connecting and disconnecting it to the power supply (this effectively varies the supply voltage seen by the motor).   The PWM signal has a nominal frequency of 19.53kHz to ensure a steady motor speed. A 10-bit PWM signal is used to allow for 1023 unique power levels.

 

The AUVic-MC has been made as flexible as possible.  All unused pins have been brought out to a header to allow for future expansion.  The PIC16F876 microcontroller, which controls the operation of the AUVic-MC, can be re-programmed using either in-circuit serial programming (ISCP) or via a bootloader to facilitate upgrading and expanding the motor controller. Finally, the electronics have been configured to allow for either signed magnitude or locked-antiphase PWM control (the two most common forms of DC motor control via PWM).  

 

This document discusses the AUVic-MC in detail so future AUVic teams can understand its operation, enhance the design if required, and troubleshoot the circuit should problems arise.

 

2.0 Specifications

 

ABSOLUTE MAXIMUM RATINGS

Parameter

Value

Units

Maximum Battery Voltage for Motor

30

V

Maximum Continuous Current Draw through H-Bridge

30

A

Maximum Peak Current Draw through H-Bridge

150

A

Maximum Junction Temperature of MOSFETs

125

ºC

Maximum Duty Cycle for Driving H-Bridge

100

%

 

RECOMMENDED OPERATING CONDITIONS

Parameter

Value

Units

Battery Voltage for Motor

12-24

V

Continuous Current Draw through H-Bridge

< 25

A

Peak Current Draw through H-Bridge

< 100

A

Junction Temperature of MOSFETs

< 60

ºC

Duty Cycle for Driving H-Bridge

90

%

 

 

ELECTRICAL CHARACTERISTICS

(VMOT = 12V, VDRIVER = 12V, VMC = 5V unless otherwise noted)

Symbol

Parameter

Conditions

Value

(Typical/Max)

Units

VMOT

Motor Supply Voltage

 

12-24 / 30

V

VDRIVER

H-Bridge Driver Supply Voltage

 

10-15 / 20

V

VMC

Motor Controller Supply Voltage

 

5

V

IDRIVER

Supply Current for H-Bridge Driver  (Note 1)

 

130

mA

IMC

Supply Current for Motor Controller (Note 2)

 

80

mA

1 Total current drawn for the VDRIVER source

2 Total current drawn for the VMC source

 

CONFIGURABLE VALUES (Can be set at runtime by sending appropriate packets to the AUVic-MC)

Symbol

Parameter

Nominal Value

Units

FREQ

PWM Frequency

19.53

kHz

ILIMIT

Current Threshold

30

A

TLIMIT

Temperature Threshold

60

ºC

ACC

Acceleration Rate

~27 (stop to full speed)

(Acceleration Value = 255, Acceleration Multiplier = 2)

ms

 

PROGRAMMABLE VALUES (Can be set at design time by modifying the AUVic-MC program)

Symbol

Parameter

Nominal Value

Units

TREDUCTION RATE

Temperature Limit Reduction Rate3

5

 

TMARGIN

Temperature Limit Margin4

5

ºC

ACCMIN

Minimum Acceleration Value5

20

 

3 Determines how quickly the motor speed is reduced to zero when temperature limiting occurs. The exact time to reduce the motor speed to zero depends on both the motor speed when temperature limiting occurs and the acceleration rate, ACC.  TREDUCTION RATE increases the acceleration rate, ACC, by its value. For example, for TREDUCTION RATE = 5 the motor is reduced to zero speed 5 times faster than in normal operation.

4 The temperature margin ensures the motor controller does not rapidly switch between normal operation and temperature limiting mode.  Once the motor controller enters temperature limiting mode it will not return to normal operation until the temperature falls below TLIMIT - TMARGIN.

5 Specifies the minimum value the acceleration value can be set to.  This ensures the motor controller has time to perform other required processing even when the motor is acceleration between speeds.

 

VMC must be a regulated 5V source.  The AUVic-MC contains a variable voltage regulator for providing VDRIVER from VMOT by closing JUMPB and opening JUMPA (see Appendix I).  VDRIVER can be trimmed to a suitable voltage between 10V and ~13.5V using the potentiometer. Depending on the value of VMOT and the amount of internal voltage drop in the battery when driving the motor at high speed, it may not be possible to obtain a suitable VDRIVER.  The AUVic-MC allows an externally regulated 12V input to be used should this case occur by closing JUMPA and opening JUMPB (see Appendix I).

 

3.0 H-Bridge

3.1 MOSFET H-Bridge Operation

 

Due to the high currents required by a motor, interface circuitry is required in order to drive it.  This interface circuitry is most commonly an h-bridge (see Figure 3.1).  An h-bridge is a simple arrangement of “switches” that allow the motor to be driven forwards (current flowing in one direction), driven backwards (current flowing in opposite direction), braked (motor terminals shorted together), or floating (no current path through motor) depending on what “switches” are closed.   Although a variety of technologies can be used to implement an h-bridge (relays, bipolar transistors, …) MOSFETs are commonly used due to their low on-resistance, ability to handle large currents, and switching speed. 

Figure 3.1. Basic MOSFET H-Bridge

 

Figure 3.1 shows a simple MOSFET h-bridge.  Each of the MOSFETs (Q_AHI, Q_ALOW, Q_BHI, Q_BLOW) acts like a switch that allows current to flow from the supply, VMOTOR, to ground, GNDA.  It can readily be seen that Q_AHI and Q_ALOW or A_BHI and Q_BLOW should never be on at the same time as this would effectively short VMOTOR to ground. If Q_AHI and Q_BLOW are both turned on, however, current will flow through the motor from left to right and the motor will turn.  Alternately, if Q_AHI and Q_BLOW are both turned on current will flow through the motor from right to left and the motor will turn in the opposite direction. The motor can be braked by turning on Q_AHI and Q_BHI or Q_ALOW and Q_BLOW as this effectively shorts the motor terminals.  Finally, the motor is floating (free-wheeling) when none or only one of the MOSFETs are turned on.  Table 3.1 summarizes these results.

 

IN_TOPA

IN_BOTA

IN_TOPB

IN_BOTB

Motor State

0

0

0

0

Floating

0

0

0

1

Floating

0

0

1

0

Floating

0

0

1

1

Short-circuit (AVOID!)

0

1

0

0

Floating

0

1

0

1

Braked

0

1

1

0

Motor Turns CW

0

1

1

1

Short-circuit (AVOID!)

1

0

0

0

Floating

1

0

0

1

Motor Turns CCW

1

0

1

0

Braked

1

0

1

1

Short-circuit (AVOID!)

1

1

0

0

Short-circuit (AVOID!)

1

1

0

1

Short-circuit (AVOID!)

1

1

1

0

Short-circuit (AVOID!)

1

1

1

1

Short-circuit (AVOID!)

Table 3.1. Basic H-Bridge Drive Logic

 

[1] is an excellent sources of information on understanding h-bridge and MOSFET theory and [2] has practical information on the physics of motors, h-bridge design, current sensing, and reading MOSFET datasheets.

 

3.2 Control Logic for H-Bridge

 

From Table 3.1 it is clear that there are many input states that lead to a short-circuit.  In order to avoid these states and simplify control of the motor it is useful to have some control logic for the h-bridge.  Figure 3.2 shows the control logic used on the AUVic-MC.  It reduces the number of signals required to drive the h-bridge from 4 to 2 and ensures a short-circuit state never occurs.  Note that the XOR gates act as inverters when one terminal is at VDD and a buffer when one terminal is at ground.  The XOR gates acting as a buffer are used to provide a matched propagation delay between the ENABLE signal and the output signals.  When the ENABLE signal is low, the motor is braked (IN_TOPA = IN_TOPB = 0, IN_BOTA = IN_BOTB = 1). When the ENABLE signal is high, the motor is either driven forwards or backwards depending on the value of DIR. Table 3.2 summarizes the h-bridge control logic.  Appendix I contains the complete schematic for the controller side of the AUVic-MC.

 

Figure 3.2. H-Bridge Drive Logic

 

 

ENABLE

DIR

IN_TOPA

IN _BOTA

IN _TOPB

IN _BOTB

Function

0

0

0

1

0

1

Brake

0

1

0

1

0

1

Brake

1

0

0

1

1

0

Forward

1

1

1

0

0

1

Reverse

Table 3.2 H-Bridge Drive Logic

 

Note: When ENABLE is low to brake the motor, the low-side MOSFETs are turned on instead of the high-side MOSFETs so the bootstrap capacitor can recharge (see section 3.4).  This is required for proper operation.

 

3.3 Achieving Speed Control

 

This control logic in Figure 3.2 is well suited for varying the speed of the motor. The two most common methods for achieving speed control are signed magnitude and locked-antiphase.  Both methods are possible on the AUVic-MC and will be discussed here (both the DIR and ENABLE signal are attached to pins that can be set to I/O or PWM).  For a DC motor, speed is nearly proportional to the supply voltage which is the primary result used by both methods.   

 

In signed magnitude speed control, the DIR signal is set high or low to indicate the desired direction of the motor and the ENABLE signal is driven by a PWM signal. The motor is driven when the PWM signal is high and shorted when the PWM signal is low which results in the average voltage seen by the motor being directly proportional to the duty cycle (duty cycle = time signal is high / period of signal).  As stated earlier, speed is nearly directly proportional to voltage for a DC motor.  The duty cycle of the PWM signal is thus directly proportional to the speed of the motor.  The PWM signal on the AUVic-MC has 10-bits of resolutions so 1023 unique duty cycles can be achieved (in practice, the duty cycle cannot be to high are else the bootstrap capacitor does not have time to recharge – see section 3.4).

 

In locked-antiphase speed control, the ENABLE signal is always high and the DIR signal is driven by a PWM signal.  The motor is driven forwards or backwards (at all times!) depending on the level of the PWM signal.  A duty cycle of 50% then drives the motor forwards and backwards for the same amount of time so the net result is the motor does not turn (note, a sufficiently high PWM frequencies is required and the 19.53kHz PWM signal used on the AUVic-MC is adequate).  Duty cycles below 50% will cause the motor to turn in one direction and duty cycles above 50% cause the motor to turn in the opposite direction.  The benefit of locked-antiphase is that only one control signal is required which simplified control to some extent and is ideal if only a single pin is available, but the speed resolution is halved compared to signed magnitude (only 512 unique duty cycles for each direction as opposed to 1023).

 

The AUVic-MC is currently programmed to use signed magnitude speed control.

 

Most of the information from this section was taken from [3] which also details why signed magnitude and locked-antiphase are popular and effective ways of controlling the speed of DC motors. 

 

3.4 Driving the H-Bridge

 

Unfortunately, it is not possible to drive the h-bridge MOSFETs directly from the control logic.  There are two main reasons for this.  First, for a MOSFET to be turned on it is necessary for the gate to source voltage, VGS, to be ~10V. When the high-side MOSFETs (Q_AHI, Q_BHI) are turned on, the source pin of the MOSFET will be at VBATTERY - a very small voltage drop over the MOSFET (see Figure 3.1).  This means the gate must be at VBATTERY + 10V! In order to achieve a voltage above the supply voltage, VBATTERY, a bootstrap capacitor is commonly used.

 

The second reason is to avoid shoot-through current.  Shoot-through current is a short-circuit between VMOTOR and ground that occurs due to the difference in the turn-on and turn-off times of a MOSFET.  Although the control logic discussed in section 3.2 guarantees we will never be in a steady-state condition with both MOSFETs on the same side of the h-bridge turned on, it does not give protection against shoot-through current.

 

The LT1162 from Linear Technologies provides a solution to both these problems. It contains the circuitry necessary to implement a bootstrap capacitor that allows a voltage of VBATTERY + 10V to be generated for driving the high-side MOSFETs.  It also ensures that MOSFETs on the same side of the h-bridge are never simultaneously on by actively monitoring their states and only switching them when it is safe to do so.  For more information on the LT1162 consult [4], the datasheet for the LT1162, and [5], an excellent article discussing the features of the LT1162 and showing its use as an h-bridge driver.

 

Figure 3.3 shows how the LT1162 is used in the AUVic-MC.  The output of the control logic drives the LT1162 which in turn drives the h-bridge.  The output of the LT1162 follows the input from the control logic except it ensures a shoot-through situation never occurs.  The LT1162 also provides two open-collector outputs, /UV_A and /UV_B, which indicate if the supply voltage is too low or the bootstrap capacitors (C7, C8) are not adequately charged.  This protects the circuit from shoot-through current when power is first supplied to the LT1162 or when the duty cycle is so high the bootstrap capacitor can not properly recharge.

 

Figure 3.3. H-Bridge Controller IC (Linear Technologies LT1162)

 

3.5 Increasing Robustness of the H-Bridge

 

In practice, schottky diodes, zener diodes, resistors, and capacitors must be added to the h-bridge to ensure it operates as desired (see Figure 3.4).  In almost all instances the protective passive elements are added to handle transient voltages that can occur due to switching of inductive loads or leads.  Recall, that the voltage of an inductor is given by v = L * di/dt.  Thus, when an inductive load or lead is turned off rapidly it can produce an alarmingly large transient voltage.  Table 3.3 briefly explains the purpose of each of these parts and indicates references that can be consulted for further information. 

 

As can be seen in Figure 3.4, each leg of the h-bridge has two IRF1404 MOSFETs in parallel.  Parallel MOSFETs increases the efficiency of the h-bridge as it halves the on-resistance seen by the power supply, doubles the maximum operating current of the h-bridge, and reduces the power dissipated in each MOSFET by a factor of 4.  This drastically reduces the size of the heat sink required.   Consult [8] for a more detailed discussion on paralleling MOSFETs.  Appendix II contains the complete schematic for the AUVic-MC h-bridge.

 

Figure 3.4. MOSFET H-Bridge with Protective Zener Diodes, Schottky Diodes, Capacitors and Resistors

 

Location

Part Type

Purpose

References

D10-D13

Zener Diode

Ensure the gate to source voltage, VGS, of the MOSFETs stays within safe operating conditions even if transient voltage spikes occur.  These transient voltage spikes occur due to the gate capacitance of the MOSFET and the inductance of the leads and traces.  VGS for the IRF1404 is +/- 20V.  The zener diodes ensure VGS is within -1.2V to 12V as the maximum forward voltage drop of the 12V zener diode is 1.2V. Note that the zener diodes should NOT be used without the gate resistors as this may lead to transient ringing on the gate pin (see references).

[6], [7], [8], [9], [10], [11]

R2-R9

Resistor

The gate resistors are required to prevent any oscillations due to lead inductance and gate capacitance that could result in an excessive VGS voltage.  With parallel MOSFETs the gate resistor also decouples the gates to ensure they turn on at the same time.

[4], [8], [10], [11]

D2-D9

Schottky Diode

The gate resistor causes an RC circuit to exist due to the gate capacitance of the MOSFET.  This RC circuit reduces the rate at which the gate can be turned off.  The schottky diode has a very low intrinsic resistance and thus reduces the RC time constant when the MOSFET is being turned off.

[11], [12], [13] , [14]

C2-C3, C17

Capacitor

The 680uF electrolytic capacitors are used to ensure the power supply can handle the large current draw of the motor when it is turned on.  Although the 680uF capacitors drastically reduce the voltage ripple of the power supply they are too large to effectively filter any high frequency noise.  The 0.22uF polyester capacitor performs well at high frequencies and is used to reduce voltage spikes due to inductive energy in the leads and traces.

[15]

Table 3.3. Purpose of H-Bridge Components

 

4.0 Current Limiting

 

Current limiting is highly desirable on a motor controller.  The back EMF generated by the motor is responsible for reducing the current drawn from the batteries.  Back EMF, E, is related to the motor speed, ωm, and strength of the magnetic field, φ, by a constant that is dependent on the motor: E = k* ωm* φ.   If the motor should become stalled or even drastically reduced in speed, the back EMF generated by the motor will decrease.  The result is an increase in current.  It will be shown in section 6.4 that the maximum continuous current that the h-bridge can handle is 30A. 

 

Current limiting actively monitors the current being drawn from the motor. When starting the motor or accelerating the current drawn may exceed 30A for a short period of time.  That is acceptable as the h-bridge can handle peak current of up to 150A (see section 6.3).  However, if the current exceeds ILIMIT for too long (determined in software) the duty cycle will be continually decreased until the current drops below ILIMIT.  This behaviour ensures the safe operation of the AUVic-MC even if a stall should occur.

 

The AUVic-MC has been designed to use any current sensor that produces a voltage between 0 and 5V to indicate the sensed current.  A suitable current sensor is the Amploc AMP50 which has recently been ordered.

 

The software current limiting described above will protect the AUVic-MC only if the software is operating as required.  Extensive testing of the software has been conducted, but the software and environment in which it interacts in complex leaving the possibility of undetected bugs.  For this reason, a fuse has been added to the circuit.  A 35A “fast blow” fuse is currently being used, but may need to be replaced if testing reveals it is erroneously blowing out due to momentary voltage spikes.

 

5.0 Temperature Limiting

 

Temperature limiting is achieved by monitoring the temperature of both low-side MOSFETs pairs (see Figure 5.1).  If the temperature of either temperature sensor exceeds TLIMIT then the speed of the motor will be reduced until the temperature falls below TLIMIT – TMARGIN.  The rate the motor is reduced in speed is controlled by the parameter TREDUCTION RATE. Monitoring the temperature is important as it protects the MOSFETs from exceeding their maximum temperature rating which will result in the MOSFETs being destroyed (which may in turn lead to a short-circuit being produced which will damage the rest of the AUVic-MC). 

 

Unlike current limiting, temperature limiting does not necessarily indicate a failure situation (i.e. motor stall).  If the motors are run continuously the MOSFETs and their heat sinks will continually heat the surrounding air.  Eventually, the ambient air temperature will increase to a level that will result in the MOSFET temperature exceeding the temperature threshold.  In effect, temperature limiting ensures the ambient air temperature does not exceed a safe limit (that is, in a well ventilated area temperature limiting should never occur if the motor controller is designed correctly). 

 

Figure 5.1 Temperature Limiting System

 

The analysis in section 7 indicates the temperature threshold should have a nominal value of 60ºC.

 

6.0 Verification of Absolute Maximum Ratings

6.1 Maximum Battery Voltage

 

The maximum battery voltage is limited by the maximum voltage rating of the components in the h-bridge.  Table 6.1 indicates the maximum voltage ratings of these components.  It can be seen that the drain to source voltage of the IRF1404 MOSFET is the limiting factor in the maximum battery voltage.

 

Location

Component Description

Maximum Voltage Rating

C2, C3

CAP 680UF 50V ELECT FC RADIAL

50V

C17

CAP .22UF 50V POLY B SERIES

50V

Q_XXX

IRF1404 HEX/MOS N-CH 40V 162A TO-220AB

40V (MAX VDS)

MTR

MOTOR CONNECTION TERMINAL BLOCK

300V @ 30A

Table 6.1. Maximum Voltage Rating of H-Bridge Components

 

The maximum battery voltage has been specified as 30V for two reasons. First, it provides a safety margin for the IRF1404 MOSFETs.  More importantly, it reduces the requirements of other factors in the system. For example, the power dissipated by the MOSFETs can now be calculated using this reduce voltage level resulting in a smaller heat sink being required.

 

6.2 Maximum Junction Temperature

 

In order to determine the maximum continuous and peak current draws the h-bridge can handle it is necessary to assume a maximum junction temperature for the MOSFETs.  This maximum junction temperature was set at 125ºC as it is below the true maximum junction temperature of the MOSFETs (175ºC).  That is, the h-bridge has been designed under the assumption that the MOSFET junction temperature will never exceed 125ºC.

 


6.3 Maximum Peak Current Draw

 

Since the maximum junction temperature has been set to 125ºC the maximum case temperature is also 125ºC (see [2]).  Consulting the Drain Current vs. Case Temperature graph (see Figure 6.1) shows that the maximum drain current is 75A (limited by the MOSFET packaging). Since two MOSFETs are used on each leg of the h-bridge the maximum peak current is 150A.  The h-bridge could handle 150A indefinitely if it has adequate power dissipation.  In reality, this is impractical and 150A can only be handled for a short time otherwise the junction temperature will increase above 175ºC and destroy the MOSFETs.

 

For example, the power dissipated in the MOSFET at 75A is, P=I2 * RDS(ON) = (75A)2 * 0.004 ohms = 22.5W for the IRF1404 MOSFETs used in the AUVic-MC.  It would require an exceedingly large heat sink to dissipate this much power.

 

Figure 6.1 Maximum Drain Current vs. Case Temperature [7]

 

6.4 Maximum Continuous Current Draw

 

The maximum continuous current drawn that can be tolerated is limited by how much power the components in the circuit can tolerate.  The h-bridge was designed to handle 30A and it will be shown that all components are capable of handling the power generated by this current.

 

The sense resistor (RSENSE) has a resistance of 0.005 ohms and is rated at 5W. The power dissipated is P=IMAX2 * RSENSE = (30A)2 * 0.005 ohms = 4.5W.

 

The calculation for the MOSFETs is more complicated.  Three worst-cases scenarios must be considered: power dissipated when the duty cycle is 100%, power dissipated when the MOSFET is switching, and power dissipated when the motor is starting and stalled.  [2] can be consulted for a more detailed discussion on these calculations.

 

From the Drain-to-Source On Resistance vs. Junction Temperature graph in [7] we see that at 125ºC that RDS(ON) is increased by a factor of 1.6. Therefore,  RDS(ON) 125ºC =  RDS(ON) 25ºC * 1.6 = 0.004 ohms * 1.6 = 0.0064 ohms.  Since there is two MOSFETs in each leg of the h-bridge, the maximum continuous current, IMAX, through each MOSFET is 15A (30A/2) and the peak current, IPEAK, is 75A.  Recall that the maximum batter voltage, VMAX, is 30V.

 

The worst-case power dissipated when the duty cycle is 100% can be calculated as follows:

               PD(ON) = IMAX2 * RDS(ON) 125ºC = (15A)2 * 0.0064 = 1.44W

 

The worst-case power dissipated when the MOSFET is switch is dependent on both the frequency at which the MOSFET is switched and how long it takes the MOSFET to switch.  The AUVic-MC is designed to run at 19.53kHz so the period is (1/19.53kHz) ~= 50us (in one period the MOSFET turns on and off).  The time it takes the MOSFET to switch on or off can be calculated using the data found in [4] and [7]:

tR = 140ns (rise time)

tF = 26ns   (fall time)

QG = 200nC (gate charge)

IG = 1.5A (maximum gate current from LT1162)

 

The actual rise time, tRA, is the maximum of tR = 140ns and QG/IG = 200nC/1.5A = 133ns.

The actual fall time, tRF, is the same as the maximum rise time (since the LT1162 can only sink 1.5A).

 

Therefore,

               PD(SWITCH) = IMAX * VMAX * ((TRA + TRF) / TPERIOD) = 15A * 30V * (280ns/50us) = 2.52W

 

The worst-case power dissipated due to the motor being started or stalled is dependent on how often the motor is started or stalled.  For the intended use of the AUVic-MC (i.e. on the AUVic AUV) the motor should never be stalled and only started occasionally.  It will be assumed that the percentage of time the motor is being started to the time the motor is being driven is 5% (a very conservative estimate).  The power dissipated is then:

               PD(START) = (IPEAK)2 * RDS(ON) 125ºC * (% time motor stalled or started) = 75A2 * 0.0064 ohms * 0.05

                               = 1.8W

 

In the worst-case, the average power being dissipated by the MOSFET is 1.8W * 0.05 + 2.52W * (280ns/50us) + 1.44W * (1 – 0.05 – (280ns/50us)) = 1.57W.  To ensure the reliable operation of the AUVic-MC it will be assumed that the worst-case average power dissipation is 3W and a heat sink for the MOSFETs will be chosen based of this value.

 

6.5 Maximum Duty Cycle

 

Testing of the motor controller has indicated that it will operate correctly with duty cycles up to 100%.  However, theoretically one would expect the high side driver on the LT1162 to be unable to achieve extremely high duty cycles (see [4]).  At high duty cycles the bootstrap capacitors do not have an opportunity to recharge which will cause the LT1162 to enter into under voltage mode.  In testing, the under voltage pin was never seen to be asserted.  It is believed that the LT1162 is indeed entering under voltage mode when the duty cycle is at 100%, but that the time required for the bootstrap capacitors to recharge is sufficiently small that it is difficult to observe.  Because of this, the recommended operation duty cycle is 90%.

 

7.0 Selecting a Heat Sink

 

The selection of a heat sink for the AUVic-MC is based on the analysis presented in [2].  The worst-case average power dissipation is assumed to be 3W (see section 6.4).  From [2], the required heat sink to ambient thermal resistance can be calculated by:

 

               ΘSA = ((TJ - TA) / Q) - ΘJC – ΘCS

              

               where:     ΘSA – Thermal resistance, heat sink to ambient

                              ΘJC – Thermal resistance, junction to case

                              ΘCS – Thermal resistance, case to heat sink

                              TJ – Maximum junction temperature of MOSFET

                              TA – Ambient Temperature

                              Q – power that must be dissipated

 

From [7] we see that ΘJC = 0.75 ºC/W and it will be assumed ΘJC = 0.5 ºC/W (which is achieved with a Wakefield “delta pad”). TJ is 125ºC (see Section 6.2) and it will be assumed TA = 50ºC (that is, the air temperature inside the AUV must remain below 50ºC).  The required heat sink to ambient thermal resistance is then:

               ΘSA = ((TJ - TA) / Q) - ΘJC – ΘCS = ((125ºC - 50ºC) / 3W) – 0.75ºC/W – 0.5ºC/W ~= 23.75 ºC/W

              

With natural convention, a heat sink with a temperature rise of less than 23.75ºC/W * 3W = 71.25ºC above the ambient temperature is required (see [17]). From the Heat Sink Temperature vs Power Dissipation graph in [18] we can see that the 235 series of heat sinks will raise 60ºC above the ambient temperature when dissipating 3W. 

 

8.0 Layout of AUVic-MC PCB

 

The motor controller has been divided between two PCBs – the motor controller and the h-bridge.  This separation provides several benefits:

·        Either the controller or the h-bridge can be redesigned. This would allow a new h-bridge to be designed if different thrusters are used in the future (possible requiring more current or requiring less current making it possible to design a smaller h-bridge PCB).   Alternatively, if a new communication protocol is used in the future (possibly Ethernet or RS485) the controller can be redesigned independent of the h-bridge. Only the interface between the two PCBs must be maintained and this interface is unlikely to change.

·        The two circuits have been electrically isolated using a photocoupler.  Using two PCBs physically separates the high current and electrically noisy h-bridge circuitry from the controller circuitry allowing the h-bridge to be shelter in a casing if the electromagnetic noise it produces is a problem.

·        Provides more flexibility in terms of physical layout inside AUViking over a single, larger PCB.

 

The layout for the motor controller PCB is straight forward as it requires no special precautions.  Appendix IV contains the PCB layout used.  Designing the PCB for the h-bridge is challenging as several constraints must be meet:

·        Short trace length between the gate driver and the gate in order to minimize inductance that can lead to “gate ringing” [11]

·        Gate series resistor should be physically close to the gate of the MOSFET [11]

·        Length of trace to gate of parallel MOSFETs should be equal to balance inductance that effects the turn-on time of the MOSFET [8]

·        Trace widths must be large enough to handle the maximum current of the AUVic-MC (30A).

 

To determine the minimum trace width for traces in the current path of the motor the TrAmp v1.1 program by John Brown was used (the formulas used in this program is I = 0.0647*(T^0.4281)*(A^0.6732) where k = derating constant, T = maximum temperature rise above ambient in °C, and A = cross-sectional area in square mils). For a standard 1 Oz copper PCB, a trace that is 800 mils (0.8 inches) wide can carry 30A with the temperature of the trace rising only 30°C above ambient.  All traces on the AUVic-MC that are in the current path of the motor are at least 800 mils wide.  Appendix V contains the PCB layout used for the h-bridge.

 

9.0 Communication

 

Communication with the AUVic-MC is achieved over an I2C bus.  The speed of the motor and the current state of the motor controller are determined by sending packets to the AUVic-MC.  The details of the packet structure required and communication protocol that must be followed are discussed in [20].  This section discusses the different packets that can be sent to the AUVic-MC and the returned packet data.

 

9.1 Communication Overview

 

The motor controller accepts sixteen different packets: Diagnostic Check, Shutdown, Set Motor, Set Acceleration, Set Current Limit, Set Temperature Limit, Set Frequency, Get Flags, Get Current, Get Temperature, Get Current Speed, Get Desired Speed, Get Direction, Get Acceleration Rate, Get Frequency, and Get Status.  The reply to any of the Set packets is an Acknowledge packet that simply indicates the packet was received successfully.  The reply to a Get packet is a packet containing the requested information (see below for details). In either case, if the received packet is corrupt the reply will be a General Error packet. 

 

 

Figure 9.1. Packets used in conjugation with the motor controller

 

Many of the Get packets should rarely be used and are included for completeness and debugging purposes.  For example, the Get Frequency packet is useful for ensuring the frequency was set as desired, but the calling processor should retain this information for later use if required instead of continually asking the AUVic-MC.  This greatly improves the performance of the communication system.

 

9.2 Acknowledge Packet

 

An Acknowledge packet indicates that the last sent Set packet was successfully received.  If the Set packet was corrupt a General Error packet will be sent as the reply.

 

9.3 General Error Packet

 

A General Error packet indicates that the last packet was received in error and that the motor controller effectively ignored the packet.  Proper recovery is to send the last packet to the motor controller again.  See

the “AUVic Communication System” documentation for more information on how error recovery is performed.

 

9.4 Diagnostic Check Packet

 

A Diagnostic Check packet is used to check if the AUVic-MC is present on the network.  The response is a Present packet that indicates the motor controller is on-line and operating properly. See the “AUVic Communication System” documentation for more information on the use of Diagnostic Check packets.

 

9.5 Shutdown Packet

 

A Shutdown packet is only meant to be used in emergency situations.  It immediately causes the motor speed to be reduced to zero.  The response to a Shutdown packet is an Acknowledge packet.

 

9.6 Set Motors Packet

 

Message content is 2 bytes and has the format shown in Figure 9.2.  The MSBit represents the desired direction and is set to 0 for forward and 1 for reverse.  The next 5 bits are ignored.  The remaining 10 bits represent the desired speed of the motor with 0 representing stop and 1023 representing full speed.  The motor speed is set to 0 on reset.  Note, that there is a minimum speed setting required for the motor to start rotating.  The motor speed is set to 0 on reset.

 

The reply to this packet is an Acknowledge packet.

 

MSBit                                                                                                                                                              LSBit

D

X

X

X

X

X

S

S

S

S

S

S

S

S

S

S

Figure 9.2. Data format to set motor speed

 

9.7 Set Acceleration Packet

 

Message content is 2 byte word determining the rate at which the motors moves towards a new speed set by a Set Motor packet.  The acceleration rate is given by:

 

               acceleration rate = acceleration value * 400us

 

Acceleration value can be any value between 1 and 2^16-1.  This allows the acceleration from stop to full speed (0 to 1023) to be set to values between 0.4096 second to ~7.5 hours.   The acceleration value is set to 61 on reset which sets the motor to accelerate from stop to full speed in ~25s.     

 

The reply to this packet is an Acknowledge packet.

 

9.8 Set Current Limit Packet

 

Message content is 1 byte representing the desired current limit threshold in amperes. See section 4.0 for more information on current limiting.  The current limit threshold is set to 30A on reset.  It is recommended that this value be set to 1.5 times the continuous current draw of the attached motor at full speed.

 

The reply to this packet is an Acknowledge packet.

 

9.9 Set Temperature Limit Packet

 

Message content is 1 byte representing the desired temperature threshold in degree Celsius.  See section 5.0 for more information on temperature limiting.  The temperature threshold is set to 125 degree Celsius on reset.  It is recommended that this value not be set higher than 125 degree Celsius.

 

The reply to this packet is an Acknowledge packet.

 

9.10 Set Frequency Packet

 

Message content is 1 byte representing the desired PWM frequency for the AUVic-MC. The frequency is given by the formula:

 

               PWM frequency =  1 / [(frequency value + 1)*4*Tosc*(TMR2 prescale value)]

                              where:    Tosc = 1/20MHz

                                             TMR2 prescale value = 1 

 

Frequency value is set using the Set Frequency packet.  Frequencies between 19.53kHz and 5MHz can be achieved.  However, the resulting resolution of the PWM signal decreases with increased frequency [19].  For example, at 78.12kHz the PWM signal will be reduced to from 10 bits to 8 bits of resolution.  In addition, the power dissipated due to switching, PD(SWITCH), increases with increased frequency so care must be exercised to ensure the AUVic-MC does not overheat (see section 6.4). The frequency value is set to 255 on reset giving a frequency of 19.53kHz and 10 bits of resolution.

 

Frequencies less than 19.53kHz can be obtained by reprogramming the AUVic-MC to have a higher TMR2 prescale value.

 

The reply to this packet is an Acknowledge packet.

 

9.11 Get Flags Packet

 

The response to a Get Flags packet is 1 byte representing the state of all status flags (see Figure 9.3).  The SUV (static under voltage flag) is set if the AUVic-MC LT1162 has ever entered under voltage mode  excluding power up (see [5] for details). The STLF and SCLF flags (static temperature and current limit flags) are set if the system has ever entered temperature limiting mode or current limiting mode, respectively. The UV_A and UV_B flags are set if the LT1162 has entered under-voltage mode since the last Get Flags packet.  The TLF and CLF flags are set if the AUVic-MC is has entered temperature limiting or current limiting mode since the last Get Flags packet, respectively. Finally, the AF (acceleration flag) bit is set if the motor controller is in the process of accelerating to a desired motor speed.   

 

MSBit                                                                                                                                                              LSBit

SUV

STLF

SCLF

UV_A

UV_B

TLF

CLF

AF

Figure 9.3. Data Format of Get Flags Reply Data

 

9.12 Get Current Packet

 

The response to a Get Current packet is the current being sensed by the current sensor.  The packet content is 1 byte representing the current between 0 and 255A.

 

9.13 Get Temperature Packet

 

The response to a Get Temperature packet is the temperature of the highest temperature low-side MOSFET.   The reply data is simply a single byte indicating the temperature in degree Celsius.  The AUVic-MC continually samples the LM35 temperature sensors to determine the current temperature of each low-side MOSFET.  In order to handle transient readings from the LM35, each set of 3 temperature readings is sorted and the middle temperature is assumed to be the true temperature (this provides protection from both erroneous low and high readings).   This temperature is rounded to the closest integer temperature for use in the reply packet.  

 

9.14 Get Current Speed Packet

 

The response to a Get Current Speed packet is the current duty cycle of the PWM signal.  The packet content is two bytes indicating the duty cycle between 0 and 1023 (0% to 100%).

 

9.15 Get Desired Speed Packet

 

The response to a Get Desired Speed packet is the desired duty cycle of the PWM signal (0 to 1023). The packet content is two bytes indicating the duty cycle between 0 and 1023 (0% to 100%).

 

9.16 Get Direction Packet

 

The response to a Get Direction packet is the current direction of the motor where 0 indicates reverse, 1 indicates forward, and 2 indicates idle. 

 

9.17 Get Acceleration Packet

 

The response to a Get Acceleration packet is the acceleration rate of the motor.  The message contents is 2 bytes corresponding to the acceleration value and acceleration multiplier (see section 9.7).

 

9.18 Get Frequency Packet

 

The response to a Get Frequency packet is 1 data byte indicating the frequency value used to determine the PWM frequency (see section 9.10).

 

9.19 Get Status Packet

 

The response to a Get Status packet is 13 data bytes representing the current state of the motor controller.  This packet is meant to be used to aid in debugging and monitoring of the AUVic-MC when testing the controller by itself and when integrating it onto the AUV.  Figure 9.4 shows the data format of the return packet.

 

Current Direction

Actual Speed (High Byte)

Actual Speed (Low Byte)

Desired Speed (High Byte)

Desired Speed (Low Byte)

Current

Temperature

Acceleration Value

Acceleration Multiplier

Frequency

Flags

Current Limit

Temperature Limit

Figure 9.4. Data Format of Get Status Reply Data

 

10.0 Programming

 

The PIC16F876 on the AUVic-MC can be programmed either by in-circuit serial programming (ICSP) or by the resident bootloader via the serial port.   

 

To program the AUVic-MC using ICSP requires a PIC programmer.  The circuit has been designed for compatibility with the Newfoundland Warp13 programmer (www.newfoundelectronics.com), but should be compatible with all programmers supporting ICSP.  ICSP is intended to be used only when loading the PIC with a new bootloader. 

 

Programming the PIC using a bootloader does not require a PIC programmer and allows new programs to be downloaded much quicker.  Because of this, the motor controller program has been designed to ensure there is sufficient memory free to allow a bootloader.  The motor controller uses Shawn Tolmie’s excellent bootloader (www.microchipc.com).  Complete instruction on how to use the bootloader can be found on his website.

 

11.0 Conclusion

 

It is hoped the AUVic-MC will provide the AUVic with a reliable and robust motor controller solution.  Significant effort has been placed into making the AUVic-MC flexible enough so that it can be used in future generations of the AUVic AUV despite the likelihood of changing requirements.  Flexibility has been provided by allows the PIC16F876 to be reprogrammed, providing the ability to use signed magnitude or locked-antiphase PWM control, and allowing a wide range of motors to be controlled (up to 30V @ 30A).

 


References

 

[1]          J. L. Jones, B. A. Seiger, A. M. Flynn, “Mobile Robots: Inspiration to Implementation”, AK Peters,

Natick, Massachusetts, 1999.

 

[2]          P. Hills, “A Techical Guide to Building Fighting Robots”, 2001 September 19, [cited 2002

September 7], Available at: http://homepages.which.net/~paul.hills/index.html

 

[3]          L. Barello, “Motion Control,” date unknown, [cited 2002 September 7],

Available at: http://www.barello.net/Papers/Motion_Control/index.htm

 

[4]          Linear Technologies, “LT1160/LT1162 Half-/Fill-Brdige N-Channel Power MOSFET Drivers” (Datasheet), date unknown, [cited 2002 September 7],

Available at: http://www.linear.com/pdf/lt1160.pdf

 

[5]          J. Tseng, “The LT1160 and LT1162: Medium Voltage, N-Channel Bridge Design Made Easy”,

1995 December, [cited 2002 September 7], Available at: http://www.linear.com/pdf/ltm9512.pdf

 

[6]          Microsemi Corp., “1N4728A-1N4764A DO-41 Glass” (Datasheet), date unknown,

[cited 2002 September 7],

Available at: http://rocky.digikey.com/WebLib/Microsemi/Web%20Data/1N4728A-1N4764A.pdf

 

[7]          International Rectifier, “IRF1404 HEXFET Power MOSFET” (Datasheet), date unknown,

               [cited 2002 September 7],

               Available at: http://www.irf.com/product-info/datasheets/data/irf1404.pdf

 

[8]          International Rectifier, “Paralleling HEXFET Power MOSFETs” (AN-941), date unknown,

               [cited 2002 September 7],

               Available at: http://www.irf.com/technical-info/appnotes/an-941.pdf

 

[9]          International Rectifier, “The Do’s and Don’ts of Using MOS-Gated Transistors” (AN-936),

date unknown, [cited 2002 September 7],

Available at: http://www.irf.com/technical-info/appnotes/an-936.pdf

 

[10]        International Rectifier, “Gate Drive Characteristics and Requirements for HEXFETs” (AN-937),

               date unknown, [cited 2002 September 7],

               Available at: http://www.irf.com/technical-info/appnotes/an-937.pdf

 

[11]        Fairchild Semiconductor, “Suppressing MOSFET Gate Ringing in Converters” (AB-9),

               date unknown, [cited 2002 September 7],

               Available at: http://www.fairchildsemi.com/an/AB/AB-9.pdf

 

[12]        Diodes Incorporated, “1N5817-1N5819 1.0A Schottky Barrier Rectifier” (Datasheet),

date unknown, [cited 2002 September 7],

Available at: http://www.diodes.com/datasheets/ds23001.pdf

 

[13]        S. Lloyd & company, “OSMC Xtreme Motor Control”, 2002 March 30, [cited 2002 September 7],

Available at: http://www.diodes.com/datasheets/ds23001.pdf

 

[14]        Intersil, “HIP4080, 80V High Frequency H-Bridge Driver” (AN9405.3), 1997 September,

[cited 2002 September 8],

Available at: http://www.intersil.com/data/an/an9/an9405/an9405.pdf

 

[15]        SGS-Thomson Microelectronics, “Controlling Voltage Transients in Full Bridge Driver Applications”, date unknown, [cited 2002 September 7],

               Available at: http://www.st.com/stonline/books/pdf/docs/1703.pdf

 

[16]        Maxim IC, “Precision, High-Side Current-Sense Amplifier” (MAX472 Datasheet), 1996 December, [cited 2002 September 8],

               Available at:  http://pdfserv.maxim-ic.com/arpdf/MAX471-MAX472.pdf

 

[17]        S. Lee, “How to Select a Heat Sink”, date unknown, [cited 2002 September 12],

               Available at: http://www.electronics-cooling.com/Resources/EC_Articles/JUN95/jun95_01.htm

 

[18]        Wakefield Engineering, “Board Level Heat Sinks”, date unknown, [cited 2002 September 8],

               Available at: http://www.wakefield.com/pdf/Board_Level_Heat_Sink.pdf

 

[19]        Microchip, “PIC16F87x Data Sheet”, date unknown, [cited 2002 August 6]

               Available at: http://www.microchip.com/download/lit/pline/picmicro/families/16f87x/30292c.pdf

 

[20]        D. Parks, “Embedded Communication System for an Autonomous Underwater Vehicle”, 2003 January 4, [cited 2002 April 1], Available at: http://www.engr.uvic.ca/~macampbe/auv499/overview/AUVic-CS_(ENGR446).pdf


 

Appendix I – Controller Schematic

 


 

Appendix II – H-Bridge Schematic

 


 

Appendix III– Bill of Material

 

Count

Component Name

Location

Value

Description

Digi-key #

Price Each*

Total Cost

1

PIC16F876-20/SP

IC1

uC

Microchip PIC16F876 20MHz PDIP Microcontroller

PIC16F876-20/SP-ND

13.01

13.01

1

CD74HC08E

IC2

AND

IC QUAD 2-IN AND GATE HS 14

296-12773-5-ND

0.93

0.93

1

CD74HC86E

IC3

XOR

TI IC QUAD 2IN EX OR GATE HS

296-12822-5-ND

1.06

1.06

1

CD74HC04E

IC4

INV

TI IC HEX INVERTER HS CMOS

296-12772-5-ND

0.93

0.93

1

LT1162CN

IC5

DRV

IC PWR MOSFET DRIVER N-CH

LT1162CN-ND

14.23

14.23

1

LP2951CN

IC6

+12V

IC VOLT REG ADJ 8-DIP

LP2951CN-ND

1.87

1.87

1

DS2406

IC7

SW

IC SW DL ADDRESS W/1K MEM

DS2406-ND

11.46

11.46

1

PS2501-4

IC8

PC

IC PHOTOCOUPLER

PS2501-4-ND

2.31

2.31

8

IRF1404

Q_XXX

FET

IRF HEX N-CH 40V 162A

IRF1404-ND

3.98

31.84

9

1N5817-T

D1-D9,D15

DIODE

DIODE SCHOTTKY 20V 1A

DO-41

1N5817DICT

0.65

5.85

4

1N4742A

D10-D13

12V

ZENER DIODE 5% 1.0W DO-41

1N4742AMSCT

0.40

1.60

1

1.5KE30A-T

D18

30V

TVS 1500 WATT UNI-DIR

1.5KE30ADICT

1.14

1.14

2

UF1002-T

D20,D21

DIODE

DIODE ULTRA FST SW 100V 1A

UF1002DICT

0.65

1.30

7

C320C104M5U5CA

C1, C10-C15,C20

0.1uF

CAP 50V 20% CER RADIAL

399-2155-ND

0.25

1.75

2

EEU-FC1H681L

C2,C3

680uF

CAP 50V ELECT FC RADIAL

P10330-ND

2.85

5.70

2

ECU-S2A150JCA

C5, C6

15pF

100V 5% MONOLITH CERM CAP

P4839-ND

0.63

1.26

2

ECS-F1HE105K

C7, C8

1.0uF

50VDC TANTALUM CAP

P2073-ND

1.29

2.58

1

ECQB1H224JF

C17

0.22uF

CAP 50V POLYESTER B SERIES

P4597-ND

0.66

0.66

2

2222 021 38478

C9

4.7uF

CAP 63V ELECT AXIAL

4065PHCT-ND

0.46

0.92

1

ECU-S1H103KBA

C4

0.01uF

CAP CERAMIC MONO 50V 10%

P4922-ND

0.58

0.58

1

EEA-FC1E220

C21

22uF

CAP 25V ELECT FC RADIAL

P11213-ND

0.74

0.74

3

CFR-25JB-10K

R1,R19,

R20

10K

1/4W 5% CARBON FILM RES

10KQBK-ND

0.092

0.28

8

B0207C10R0F5T

R2-R9

10

RES OHM METAL FILM .6W 1%

BC10.0ZCT-ND

0.102

0.82

1

CFR-25JB-24K

R18

24K

1/4W 5% CARBON FILM RES

24KQBK-ND

0.092

0.10

4

CFR-25JB-470R

R10-R13

470

RES 1/4W 5% CARBON FILM

470QBK-ND

0.092

0.37

4

CFR-25JB-1K

R14-R17, R25

1K

RES 1/4W 5% CARBON FILM

1KQBK-ND

0.092

0.37

2

CFR-25JB-100K

R23, R24

1OOK

RES 1/4W 5% CARBON FILM

1OOKQBK-ND

0.092

0.20

2

CFR-25JB-2K

R21-R22

2K

RES 1/4W 5% CARBON FILM

2KQBK-ND

0.092

0.20

1

201XR105B

R20

1M

POT TRIMMER 1.0M VERTICAL

201XR105B-ND

0.79

0.79

1

CFR-25JB-100R

R21

100

RES 1/4W 5% CARBON FILM

100QBK-ND

0.094

0.094

5

LTL-4233-R1

T.L., C.L., ACC, UV, ERROR

LED

LED RES LAMP 5MM 5V GREEN DIFF

160-1051-ND

0.43

2.15

2

LTL-4223-R2

PWR

LED

LED RES LAMP 5MM 12V RED

160-1112-ND

0.43

0.86

1

ECS-200-S-4

Q1

20MHz

QTZ CRYSTAL(HC-49)

X438-ND

1.13

1.15

2

LM35DT

TEMPA,,TEMPB

TEMP

IC SENSOR PREC CENT TEMP TO-220

LM35DT-ND

4.68

9.36

1

PS2501-4

OK1

OPTO

4 CHANNEL OPTO COUPLER

PS2501-4-ND

2.32

2.32

1

22-05-2051

ISCP

CONN

5 CIR HED.100 FRICT LOCK

WM4203-ND

1.30

1.30

2

22-05-2031

SCI,AMP

CONN

3 CIR HED.100 FRICT LOCK

WM4201-ND

0.96

1.92

1

22-05-2030

Encoder

CONN

2 CIR HED.100 FRICT LOCK

WM4200-ND

0.96

0.96

1

39267102

BACK-PLANE

CONN

2.54mm (.100") Right Angle, Dual Row With Eject Levers

SAMPLE

0.00

0.00

2

929950-00

JUMPA, JUMPB

JUMP

SHORTING JUMPER UNPLATED

929950-00-ND

0.36

0.72

2

22-28-4020

JUMPA, JUMPB

JUMP

CONN HDR VERT 2POS .100 TIN

WM6402-ND

0.37

0.74

2

1714971

MTR,

PWR

CONN

CONN TERM BLOCK 2POS 9.52MM PCB

277-1271-ND

2.27

4.54

2

22-01-3097

IBC

CONN

10 CIRCUIT TRM HOUSING,.100

WM2008-ND

1.00

2.00

2

22-23-2091

IBC

CONN

10 CIR HEADER.100 STR LCK

WM4208-ND

1.30

2.60

1

311035

FUSE

FUSE

FUSE 35A/32V 3AG FAST

F144-ND

0.43

0.43

2

BK/1A1907-06

FUSE

FUSE

FUSE CLIP TINNED PLTING

283-2338-ND

0.23

0.23

8

345-1000-ND

Q_XXX

HS

THERMAL PAD TO-220 .007"

345-1000-ND

0.55

4.40

8

235-85AB

Q_XXX

HS

HEATSINK TO-220 CLIP-ON BLK

345-1016-ND

1.28

10.24

* Price per Unit is significantly reduced if order in quantities of 10 or more (Pricing Between July 2002 – March 2003)

 150.46

 


 

Appendix IV– Controller PCB Layout

 


Appendix V– H-Bridge PCB Layout

 


Appendix VI – PIC16F876 Pinout

 

Pin

Pin Name

Sonar Module Function

Sub-System

1

*MCLR/VPP

Connected to ISP header

ISP

2

RA0/AN0

Temperature Limit A

Temperature Limit

3

RA1/AN1    

Temperature Limit B

Temperature Limit

4

RA2/AN2/Vref-

Under voltage Detect A

UV Detect

5

RA3/AN3/Vref+

Current Limit

Current Limit

6

RA4/TOCKI

Quadrature Encoder Direction

Quadrature Encoder

7

RA5/AN4/*SS

<Unused>

 

8

VSS

Ground

Power

9

OSC1/CLKIN

Connected to 20.0MHz oscillator

Timer

10

OSC2/CLKOUT

Connected to 20.0MHz oscillator

Timer

11

RC0/T10S0/T1CKI

Quadrature Encoder Speed

Quadrature Encoder

12

RC1/T10S1/CCP2

Motor Direction

Motor Control

13

RC2/CCP1

Motor Enable

Motor Control

14

RC3/SCK/SCL

I2C Communication Clock Line

I2C

15

RC4/SDI/SDA

I2C Communication Data Line

I2C

16

RC5/SDO

<Unused>

 

17

RC6/TX/CK

Serial Communication Tx Line

Serial

18

RC7/RX/DT

Serial Communication Rx Line

Serial

19

VSS

Ground

Power

20

VDD

Regulated +5V

Power

21

RB0/INT

End Mission Interrupt Signal

Emergency Stop

22

RB1

Temperature Limit LED

Indicator LED

23

RB2

Current Limit LED

Indicator LED

24

RB3/PGM

Accelerating LED

Indicator LED

25

RB4

UV Detected LED

Indicator LED

26

RB5

Error LED

Indicator LED

27

RB6/PGC

Connected to ISP header

ISP

28

RB7/PGD

Connected to ISP header

ISP

 

Note: Unused pins are connected to backplane for future expansion.


 

Appendix VII – AUVic-MC Visual Interface

 

A visual interface that runs under the Windows operating system has been developed for the AUVic-MC.  It can communicate with the AUVic-MC through a direct serial connection or via a serial connection to the Hub.  The serial connection is fully configurable in the Serial Port menu.  It has been developed in Visual C++ and relies heavily on the MFC libraries. Source code is available upon request from Donovan Parks (dparks@uvic.ca) or in the members section of the AUVic website (www.engr.uvic.ca/~auv). 

 

 

 

Using the AUVic-MC

 

All packet types supported by the AUVic-MC are accessible through the interface (see section 9.0 for a list of supported packet types).  This allows testing of each packet and full control over the motor controller.  Packet that do not require user defined data values are available from the Commands menu whereas packets requiring user data (set temperature limit, set acceleration rate, …) are contained on the main form.  The speed and direction of the motor can be set using the slider bars on the main form.  A shutdown button has also been provided on the main form to allow the motor to quickly be turned off in case of emergencies.

 

The interface also provides feedback on the state of the motor controller to aid in controlling a motor or verifying it is operating properly.  Three graphs are provided on the main form that indicate the current and target speed of the motor, the current being sensed by the current sensor, and the temperature of the temperature sensor detecting the highest temperature.  Textual feedback is provided for all replies received from the AUVic-MC including any error replies received. Finally, the motor controller state section indicates the direction, frequency, acceleration rate, temperature limit, current limit, and state of all status flags for the motor controller.

 

 

Testing with the AUVic-MC

 

This interface was initially developed to allow for convenient testing of the motor controller. A special test mode has been included (available under the Tests menu) that causes the motor to continuously accelerate from full forward to full reverse.  This is a good test case to illustrate the ability of the motor controller to accelerate between different speeds and shows the wide range of speeds that can be achieved.  A worst-case test case in terms of heat generation (leaving the motor on full forward or full reverse) can also be quickly setup.   Both of these test cases were widely used during testing of the AUVic-MC.  

 

Complete testing of all functionality is possible as the interface supports all packets used by the AUVic-MC.

 

 

Use as ROV Controller

 

The ability to control an AUV as an ROV is extremely helpful when testing the mechanical design and different sensors.  It is expected that the interface discussed here will be expanded in the future to allow it to act as a controller for an ROV.  To act as a controller, it must be extended to allow for controller over all motors on the ROV. 

 


Appendix VIII – AUVic-MC PIC Code Listing

 

 

Available to AUVic members at www.engr.uvic.ca/~auv in the Members Section. 

 

Available to sponsors and the general public upon request - email Donovan Parks (dparks@uvic.ca).**