Order this document by AN1624 Motorola Semiconductor Application Note AN1624 ITC137 68HC708MP16 Motion Control Development Board By Jim Gray, Bill Lucas, and Warren Schultz Introduction A controller that complements software development tools for the 68HC708MP16 is presented here. It provides motor control functions on a board that interfaces easily with power stages and emulators. Its configuration is applicable to ac induction, brush dc, and brushless dc motors. Figure 1. ITC137 Development Board (c) Motorola, Inc., 1997, 2000 AN1624 Application Note Description A summary of the information required to use motion control development board number ITC137 is presented as follows. Discussions of hardware design and software are included under separate headings. Function The systems development board shown in Figure 1 is designed to provide control signals for 3-phase ac induction, brush dc, and 3-phase brushless dc motors. With the software supplied, it is set up to run ac induction motors. Inputs are accepted from switches and a potentiometer on the board or external RUN/STOP, FORWARD/REVERSE, and SPEED signals. The speed input is a 0- to +5-volt signal with 0 volts corresponding to 0 speed, and 5 volts producing full speed. RUN/STOP and FORWARD/REVERSE are logic inputs, with logic lows producing run and reverse outputs. Hall 1, Hall 2, and Hall 3 inputs are also provided for connection to brushless dc motors. The ITC137 motion control development board is designed to run in two configurations. It will operate on its own with the processor supplied. With the processor removed, it will connect to an M68HC08MP16 emulator via an M68CBL08A cable. For purposes of motion control code development, the emulator may be run on either an MMDS08 or MMEVS08. The output side of this board connects to an ITC122 or ITC132 power stage via ribbon cable. Six outputs provide power device control signals for 3-phase induction or brushless dc motors. Brush dc motors can be controlled by using either one or two of the three available phases. All six outputs will sink 20 mA, making them suitable for directly driving opto couplers in isolated gate drives. A switched +5 volts is also provided to serve as the B+ power source for opto coupler input diodes. It is turned off at reset to facilitate orderly power-up and power-down of the gate drives. AN1624 2 MOTOROLA Application Note Description Electrical Characteristics The electrical characteristics in Table 1 apply to operation at 25 degrees Celsius and unless otherwise specified B+ = 12 volts. Table 1. Electrical Characteristics Characteristic Symbol Min Typ Max Units Power supply voltage Driving ITC122 Driving ITC32 B+ 7.5 7.5 -- -- 28 15 Volts Volts Power supply voltage +5 4.75 -- 5.25 Volts Minimum logic 1 input voltage VIH -- 2.7 -- Volts Maximum logic 0 input voltage VIL -- 2.0 -- Volts Quiescent current ICC -- 80 -- mA VSPEED -- 20 -- %/volt AV (VTemp) AV (VBus) AV (ISense) -- -- -- -16.9 2 2 -- -- -- -- -- -- -- -- -- 25 mA SPEED input Buffer gain VTemp VBus ISense Output sink current AN1624 MOTOROLA 3 Application Note +5V Vtmp 2-E5 U1 MC68HC08MP16 2 3 4 Pb_buf 2-F2 5 Pc_buf 2-D4 C 7 E +5V R15 24 D 8 9 10 C8 0.1 pF R16 10 k 11 0.1 pF C9 W1 6 AGND 12 13 R17 10 k 14 0 = 9600 BAUD 1 = 4800 BAUD GREEN_LED 4-D4 YELLOW_LED 4-C4 +5V R18 10 k R19 10 k 15 +5V FLT2 3-D5 R20 10 k 16 17 18 FLT1 3-D5 19 FLT3 3-D5 FLT4 3-D6 O 20 21 22 23 24 N M Atop 4-F2 Btop 4-F2 25 Abot 4-F2 Bbot 4-F2 Ctop 4-F2 26 27 28 29 30 Cbot 4-F3 31 32 PTB1/ATD1 PTB2/ATD2 PTB3/ATD3 PTB0/ATD0 PTB4/ATD4 PTA7 PTB5/ATD5 PTA6 PTB6/ATD6 PTA5 PTB7/ATD7 PTA4 PTC0/ATD8 PTA3 PTC1/ATD9 PTA2 VDDAD/VDDAREF PTA1 VSSAD PTA0 VSSA VREFL VADCAP OSC2 PTC2 OSC1 PTC3 CGMXFC PTC4 VDDA PTC5 RST PTC6 IRQ1/VPP PTD0/FAULT1 PTF5/TxD PTD1/FAULT2 PTF4/RxD PTD2/FAULT3 PTF3/MISO PTD3/FAULT4 PTF2/MOSI PTD4/IS1 PTF1/SS PTD5/IS2 PTF0/SPSCK PTD6/IS3 VSS PWM1 VDD PWM2 PTE7/TCH3B PWM3 PTE6/TCH2B PWM4 PTE5/TCH1B PWMGND PWM5 PWM6 D2 1N914 C1 0.1 pF PTE4/TCH0B PTE3/TCLKB PTE2/TCH1A PTE0/TCLKA PTE1/TCH0A J5 +5V D3 1N914 64 63 61 60 59 58 57 56 55 C2 0.1 pF AGND AGND EXT_SPD_WIPER 4-C2 +5V D5 1N914 DIP1 C3 4-B7 DIP2 4-B7 DIP3 4-B7 DIP4 4-B7 DIP5 4-B7 C4 1 SW4 RUN/STOP R7 10 k D6 1N914 SW3 FOR/REV EXT_FOR/REV 4-C4 J3 +5V +5V MONITOR 4-B6 8 5 + 5 V NC OUT GND +5V 53 0.1 pF C6 0.1 pF 50 C5 47 SW2 MONITOR MODE = IN J6 SCI_OUT 4-C5 SCI_IN 4-C6 46 42 RESET PGMR_RESET 4-B5 V_HI 4-C8 48 43 4 OSC1 24 R9 10 k 49 44 R10 10 k 4.9152 MHz R8 52 45 EXT_RUN/STOP 4-C4 1 54 51 J4 R6 10 k 62 +5V R2 5k D4 1N914 R4 R5 10 k 10 k 0.1 pF Pa_buf 2-C2 1 R1 4.7 k 0.1 pF V_buf 2-F7 I_amp 2-C7 D1 1N914 AGND R3 24 SPEED VPP +5V 1 I 1 K J Q2 MPSA56 L 41 +5V 40 39 R13 38 10 k C7 0.1 pF 37 HALL_2 3-D3 36 35 R14 10 k +5V HALL_3 3-E4 R11 10 k R12 Q1 3 2N7000 2 820 2 3 1 +5_SWITCHED 4-D3 HALL_1 3-D3 34 33 Figure 2. Schematic AN1624 4 MOTOROLA Application Note Description Phase A 4-F4 R21 R22 2.49 k +5V +5V W2 INSERT WIRE FOR LEM SENSOR USE W3 INSERT WIRE FOR LEM SENSOR USE TP4 4.99 k Phase B 4-F4 R26 R27 2.49 k 4.99 k R23 TP5 R28 2.49 k MC33204 2.49 k G MC33204 5 + 7 6 -U2 C10 0.01 pF 3 Pa_buf 1-B3 + 1 2 -U2 C11 0.01 pF R24 AGND H Pb_buf 1-B3 R29 4.64 k AGND R25 4.64 k R30 2.21 k 2.21 k +5V Phase C 4-F4 R31 R32 2.49 k 4.99 k +5V TP6 R33 2.49 k +5V MC33204 4 + 14 13 -U2 11 12 MC33204 W4 INSERT WIRE FOR LEM SENSOR USE C12 0.01 pF + 10 U2 8 - 9 A Pc_buf 1-B3 R34 AGND 4.64 k R35 2.21 k Figure 3. Schematic (Sheet 1 of 2) AN1624 MOTOROLA 5 Application Note C14 0.1 F +5V R39 R36 4.7 k 34.0 k MC33204 6 Vtemp 4-F5 10C TO 125C 4.7 k C13 0.1 pF TP1 R38 - 7 5 +U3 R37 2 - 1 3 +U3 MC33204 11 2.0 k +5V Vtmp 1-C2 R40 AGND 1.40 k R41 100 R42 174 AGND TP2 R43 Isense 4-E5 4.75 k MC33204 F 12 C15 0.01 pF AGND + 14 13 -U3 R44 R45 4.75 k 4.75 k R44 C16 Rgain 0.01 pF I_amp 1-B3 TP3 R46 Vbus 4-E5 +5V 4.75 k 10 C17 0.01 pF AGND B 4 + 8 9 -U3 MC33204 R47 R48 4.75 k 4.75 k V_buf 1-B3 Figure 3. Schematic (Sheet 2 of 2) AN1624 6 MOTOROLA Application Note Description T2 +5V +5V C31 0.1 F C32 470 pF +5V GND R53 1k U6 HALL1 R54 R55 24 24 U6 8 C28 470 pF R56 1k 3 R57 R58 24 24 11 1 R61 24 24 U6 13 5 6 HALL_3 1-D6 MC14584BCP S FLT1 1-B5 R FLT2 1-B5 Q FLT3 1-B5 6 RP1 10 k HALL_2 1-D6 U6 12 C30 470 pF P 2 MC14584BCP R60 HALL EFFECT INPUTS HALL_1 1-D6 U6 10 C29 470 pF R59 1k 4 MC14584BCP U6 HALL2 HALL3 9 5 RP1 10 k 1 4 RP1 10 k 1 3 FLT4 1-B5 RP1 10 k 1 1 Figure 4. Schematic AN1624 MOTOROLA 7 Application Note B+ D7 1N4002 GND +5V MC7805AC VR1 IN OUT T1 POWER CONNECTOR C18 + 1 F +5V C19 + C20 1 F 0.1 F GROUND C22 0.1 F J1 TP GND GND +5_SWITCHED 1-E6 AGND AGND SPEED Atop 1 2 3 4 5 6 7 8 Atop 1-B6 Abot AGND EXTERNAL SPEED PORT C21 0.1 F GND DC INPUT POWER T3 B+ POWER CONNECTOR +5V Abot 1-B6 Btop EXT_SPD_WIPER 1-E2 Btop 1-B6 Bbot +5V +5V Bbot 1-B6 Ctop EXTERNAL RUN/DIRECTION CONTROL REV EXT_FOR/REV 1-E3 9 10 RUN EXT_RUN/STOP 1-E2 11 12 13 14 Ctop 1-B6 Cbot Cbot 1-B7 GND GND OUTPUT CONNECTOR +5V C33 0.1 F +5V R49 470 LED1 RED POWER C34 0.1 F C35 0.1 F +5V LED2 YELLOW LED3 R50 1k YELLOW_LED 1-B5 J2 1 2 Phase A 2-A1 3 4 Phase B 2-D1 5 6 Phase C 2-B3 +5V 7 8 GREEN 9 10 R51 1k 11 12 Vbus 2-D7 13 14 Isense 2-A7 15 16 C36 0.1 F C37 0.1 F GREEN_LED 1-A5 C38 0.1 F Vtemp 2-B5 AGND FEEDBACK CONNECTOR Figure 5. Schematic (Sheet 1 of 2) AN1624 8 MOTOROLA Application Note Description SCI PORT DB-9 CONNECTOR U4 MC145407P +5V R52 10 k 3 MONITOR 1-D3 MC74HC125 MC74HC125 11 U5 PGMR_RESET 1-E4 12 12 13 14 2 U5 15 1 16 +5V 8 U5 +5V 9 10 MC74HC125 13 11 MC74HC125 SCI_OUT 1-D5 5 6 SCI_IN U5 1-D5 4 C23 + 17 10 F V_HI 1-E4 18 C24 10 F R62 10 k 19 + 20 C25 0.1 F DI3 1 CD 10 2 TX 9 3 RCD TX3 DO3 RX3 DI2 TX2 DO2 RX2 DI1 TX1 DO1 RX1 VDD VSS C1- C2- VCC GND C1+ C2+ 8 4 DTR 7 5 GND 6 6 DSR 5 7 RTS 4 8 CTS C27 10 F + 3 9 RI 10 F + 2 C26 P1 1 MONITOR PORT DB-9 CONNECTOR +5V 1 CD +5V 1 2 TX 1 1 1 +5V 1 RP2 10 k RP2 10 k RP2 10 k RP2 10 k RP2 10 k 6 5 4 3 2 3 RCD R63 10 k 4 DTR J7 1 5 GND 6 DSR 1 2 DIP1 1-C3 4 5 +5V 7 RTS 14 14 8 CTS DIP2 1-C3 3 +5V DIP3 1-C3 U6 U5 9 RI 7 DIP4 1-C4 P2 7 DIP5 1-C4 MC14584BCP MC74HC125 SW1 Figure 5. Schematic (Sheet 2 of 2) AN1624 MOTOROLA 9 Application Note Table 2. Parts List Designators Quantity Description Manufacturer Part Number C1-C9, C13, C14, C20-C22, C25, C31, C33-C38 22 0.1-f capacitor Sprague 1C105Z5U104M050B C10-C12, C15-C17 6 .01-f capacitor Sprague 1C105Z5U103M050B C18, C19 2 1-F electrolytic capacitor Mepco-Centralab CN15A220K C23, C24, C26, C27 4 10-F electrolytic capacitor Digi-Key Corp. P5272 C28-C30, C32 4 470-pF capacitor Sprague 1C105Z5U471M050B D1-D6 6 Small signal diode -- 1N914 D7 1 General-purpose diode Motorola 1N4002 J1 1 2 x 7.1o.c jumper block note 2 Digi-Key Corp. S2011-36-ND J2 1 2x8 .1o.c. jumper block note 2 Digi-Key Corp. S2011-36-ND J3, J4, J5, J7 4 1x3 .1o.c. jumper block note 3 Digi-Key Corp. S1011-36-ND J6 1 1x4 .1o.c. jumper block note 3 Digi-Key Corp. S1011-36-ND LED1 1 Red LED General Instruments MV5774C LED2 1 Yellow LED General Instruments MV5374C LED3 1 Green LED General Instruments MV5474C P1, P2 2 DB-9 connector (female) Digi-Key Corp. A2100-ND Q1 1 Small signal FET transistor Motorola 2N7000 Q2 1 Small signal PNP transistor Motorola MPSA56 RP1, RP2 2 10 k, 6-pin, SIP resistor pack Digi-Key Corp. 770-61R10K-ND R2 1 5-k variable resistor Clarostat Sensors and Controls, Inc. 392JB-5k-S R4-R7, R9, R10, R11, R13, R14 -- -- -- -- AN1624 10 MOTOROLA Application Note Description Table 2. Parts List (Continued) Designators Quantity Description Manufacturer Part Number R16-R20, R52, R62, R63 17 10-k resistor Yageo Corp. -- R12 1 820 k resistor Yageo Corp. -- R21, R23, R26, R28, R31, R33 6 2.49-k resistor 1% Yageo Corp. -- R22, R27, R32 3 4.99-k resistor 1% Yageo Corp. -- R24, R29, R34 3 4.64-k resistor 1% Yageo Corp. -- R25, R30, R35 3 2.21-k resistor 1% Yageo Corp. -- R1, R36, R37 3 4.7-k resistor Yageo Corp. -- R38 1 2.00-k resistor 1% Yageo Corp. -- R39 1 34.0-k resistor 1% Yageo Corp. -- R40 1 1.40-k resistor 1% Yageo Corp. -- R41 1 100- trim potentiometer Digi-Key Corp. 3386P-101-ND R42 1 174- resistor 1% Yageo Corp. -- R43-R48 6 4.75-k resistor 1% Yageo Corp. -- R49 1 470- resistor Yageo Corp. -- R50, R51, R53, R56, R59 5 1-k resistor Yageo Corp. -- R3, R8, R15, R54, R55 -- -- -- -- R57, R58, R60, R61 9 24- resistor Yageo Corp. SW1 1 5 POS DIP switch CTS CT2068-ND SW2 1 SPST push-button switch NKK AB15AP-FA SW3, SW4 2 SPST toggle switch NKK A12AH T1 1 8-screw terminal connector Phoenix Contact MKDSN 1, 5/8-5,08 T2 1 5-screw terminal connector Phoenix contact MKDSN 1,5/5-5,08 T3 1 2-screw terminal connector Phoenix contact MKDSN 1,5/2-5,08 U1, socketed 1 Microprocessor Motorola MC68HC708MP16 AN1624 MOTOROLA 11 Application Note Table 2. Parts List (Continued) Designators Quantity Description Manufacturer Part Number U1X, U1 socket 1 QFP 64-pin socket Prine Distributors FPQ-64-0.8-10A U2, U3 1 Quad op-amp Motorola MC33204P U4 1 RS-232 driver/receiver Motorola MC145407P U5 1 Quad bus driver Motorola MC74HC125P U6 1 Hex Schmitt trigger Motorola MC14584BCP VR1 1 Voltage regulator Motorola MC7805ACT OSC1 1 4.9152-MHz oscillator Digi-Key Corp./CTS CTS156-ND GND, GND, AGND 3 Test point black Components Corp. TP-104-01-00 Atop, Btop, Ctop, TP1, TP5, TP6 6 Test point red Components Corp. TP-104-01-02 Abot, Bbot, Cbot, TP2, TP3, TP4, VPP 7 Test point yellow Components Corp. TP-104-01-04 No designator 1 4-40 x 1/4-inch screw for VR1 -- -- No designator 1 4-40 nuts for VR1 -- -- No designator 5 Shorting jumpers for J3-J7 Digi-Key Corp. 929955-06-ND No designator 6 Self-stick rubber feet -- -- ITC137 1 PC board -- -- AN1624 12 MOTOROLA Application Note Pin-by-Pin Description Pin-by-Pin Description Inputs and outputs are grouped into six connectors. Control signal inputs are located on screw connector T1. They are optional external interfaces that include a provision to power the board with +5 volts if the B+ input on connector T3 is not used. Screw connector T2 contains three Hall sensor inputs, a +5-volt connection for the Hall sensors, and a ground. B+, if used instead of the +5-volt input, is supplied through screw connector T3. It will accept power supply voltages from 7.5 to 28 volts when driving an ITC122 power stage, and 7.5 to 15 volts when driving an ITC132. The lower voltage limit for driving the ITC132 comes from the need to supply more current from the 5-volt bus to drive opto-coupled inputs. Ribbon connector J1 contains six outputs for driving a power stage and a switched 5-volt power line. Feedback signal inputs are located on ribbon connector J2, where there is provision for temperature, bus voltage, and current sense feedback signals. There is also a DB-9 connector for RS-232 serial port communications and a DB-9 connector for monitor mode. Ribbon connector pinouts are shown in Figure 6. OUTPUT TOP VIEW FEEDBACK +5V 1 2 ATOP GND 1 2 PHASE A +5V 3 4 ABOT GND 3 4 PHASE B GND 5 6 BTOP GND 5 6 PHASE C GND 7 8 BBOT GND 7 8 NC GND 9 10 CTOP GND 9 10 NC GND 11 12 CBOT GND 11 12 Vtemp GND 13 14 GND Vbus 13 14 AGND Isense 15 16 AGND J1 J2 Figure 6. Connector Pinouts AN1624 MOTOROLA 13 Application Note B+ Connector T3 B+ B+ is one of two possible power supply connections. The board either requires a power supply on this input or a +5-volt supply on connector T1, not both. For operation with an ITC122 power stage, the B+ input voltage range is 7.5 to 28 volts dc. For operation with an ITC132 power stage, it is 7.5 to 15 volts dc. GND The GND terminal on this connector is intended as the return for power supply B+. Input Connector +5 GND This input is an alternate input to B+. If it is used, no connection to B+ is required. There are multiple ground connections. The one adjacent to +5 is intended as the +5-volt return. AGND An analog ground for the speed control input is labeled AGND. SPEED This input can be used to control motor speed with an external 0- to 5volt analog signal. Zero volts corresponds to 0 speed and 5 volts to full speed. To use it, jumper J5 needs to be moved to the external position, which disables the on-board speed control potentiometer. As shipped, J5 is set to control speed from the potentiometer. REV This is an external logic input that reverses the motor when it is grounded. To use it, jumper J3 needs to be moved to the external position, which disables the on-board FORWARD/REVERSE switch. As shipped, J3 is set to control direction from the switch. RUN This is an external logic input that enables the motor when it is grounded. To use it, jumper J4 needs to be moved to the external position, which disables the on-board RUN/STOP switch. As shipped, J4 is set to control run/stop from the switch. AN1624 14 MOTOROLA Application Note Pin-by-Pin Description Hall Connector T2 HALL 1, HALL 2, HALL 3 These inputs are intended to receive open collector Hall sensor outputs from brushless dc motors. They are buffered with Schmitt triggers and filtered for noise immunity. +5 This connection is for +5 volts that the board supplies to Hall sensors in a brushless dc motor. GND GND on this connector is the Hall sensor ground. ISense Pin 15 of feedback connector J2 is a current sense input. It is connected to A/D channel ATD3 through a gain of 2 non-inverting amplifier. Feedback Connector J2 VBus Pin 13 of connector J2 is a motor bus voltage input. It is connected to A/D channel ATD2 through a gain of 2 non-inverting amplifier. VTemp Pin 12 on connector J2 is a temperature sense input. It is connected to an amplifier that is designed to translate the forward voltage of a diode into a usable A/D voltage. The output of this amplifier is connected to A/D channel ATD1. AGND Pins 14 and 16 are tied to AGND, which is a ground for analog circuits. This ground is routed such that all of the analog returns connect with digital ground at just one point. Phase Voltage Feedback Phase feedback signals phase A, phase B, and phase C are also included on feedback connector J2. They are located on pins 2, 4, and 6. When used with an ITC122 power stage, a divided down phase voltage appears at these pins. With an ITC132 power stage, no signals appear at these pins unless they are supplied by the user. AN1624 MOTOROLA 15 Application Note Output Connector J1 Switched +5 Pins 1 and 3 are connected to the 5-volt bus through a switch that is open at reset. The resulting switched 5 volts can be used to power input diodes in opto-coupled gate drives, such as the ones found in ITC132 power stages. Its use facilitates orderly power-up and power-down of the gate drives. GND Pins 5, 7, 9, 11, 13, and 14 are tied to ground. They provide a return for the switched +5 and are used to provide noise isolation between output lines in a ribbon cable. Atop --Cbot Outputs are located on pins 2, 4, 6, 8, 10, and 12. They provide control signals for three phases of half-bridge configured output transistors and are set up in an active low configuration. They have the current sinking capability to drive opto-coupled power stages such as an ITC132. SCI Port DB-9 Connector This DB-9 connector is set up for RS-232 communication with personal computers. It has standard RS-232 pinouts. When connected to a serial port on a personal computer, it can be used to allow keyboard control of motor drive functions. Monitor Mode DB-9 Connector The monitor mode DB-9 connector is included to support background debug for the HC708MP16. Test Points TP1-TP3 Test points TP1, TP2, and TP3 provide access to buffered feedback signals for temperature, motor bus current, and motor bus voltage. These voltages are seen by A/D converter inputs ATD1, ATD3, and ATD2. The temperature feedback voltage can be calibrated with potentiometer R18. TP4-TP6 Test points TP4, TP5, and TP6 provide access to buffered feedback signals from feedback connector J2 pins 2, 4, and 6. AN1624 16 MOTOROLA Application Note Pin-by-Pin Description GND and AGND These test points are provided to facilitate grounding test instruments. Outputs All six outputs and a ground are also available as test points. They are connected in parallel with the outputs on ribbon connector J1. SW1 SW1 (switch 1) is a 5-position DIP switch that enables modulation parameters to be changed while a motor is running. Switch positions are illustrated in Figure 7. Position 1 sets full modulation for either 60 or 120 Hz. Position 2 selects either sine wave or third harmonic pulse-width modulation (PWM). Positions 3, 4, and 5 select PWM frequency per Table 3 in the software section of this application note. SW2 SW2 (switch 2) is a push-button switch located on the right-hand edge of the board. It is labeled RESET. It resets the processor and turns off the switched 5 volts supplied on output connector J1. Switches 3RD HARMONIC PWM 120 Hz FULL MODULATION 1 2 3 4 5 ON PWM RATE (SEE TABLE 3) 60 Hz FULL MODULATION SINE WAVE PWM Figure 7. Switch 1 AN1624 MOTOROLA 17 Application Note Potentiometers R2 R2, labeled SPEED ADJUST, is the speed control potentiometer. It controls motor speed unless jumper J5 is set to the external position or control is taken over by the SCI port. R41 R41 is a small potentiometer that is used for adjusting the analog signal that represents temperature. Setting the voltage at test point TP1 to 1 volt at 25 degrees Celsius with this potentiometer is the recommended default calibration. Expanded I/O There are a number of blank pads located at the top of the printed circuit board. They are included to allow a user to expand the capability of the system with a prototype board. The connections are described from left to right. A Pad A is connected to the output of a non-inverting amplifier that has its input at feedback connector J2 pin 6. This amplifier has a gain of 1.5. Its output also connects to the processor's analog input ATD6. B Pad B provides access to the bus voltage feedback signal. It is connected to the output of a non-inverting amplifier that has a gain of 2 and its input at feedback connector J2 pin 13. This signal also ties to the processor's analog input ATD2. C Pad C is connected to the processor's analog ATD7 input pin. D Pad D is connected to the processor's analog ATD9 input pin. E Pad E is connected to the processor's analog ATD8 input pin. F Pad F provides access to the bus current feedback signal. It is connected to the output of a non-inverting amplifier that has a gain of two and its input at feedback connector J2 pin15. This signal also ties to the processor's analog input ATD3. AN1624 18 MOTOROLA Application Note Pin-by-Pin Description G Pad G is connected to the output of a non-inverting amplifier that has its input at feedback connector J2 pin 2. This amplifier has a gain of 1.5. Its output also connects to the processor's analog input ATD4. H Pad H is connected to the output of a non-inverting amplifier that has its input at feedback connector J2 pin 4. This amplifier has a gain of 1.5. Its output also connects to the processor's analog input ATD5. I Pad I is connected to the processor's MISO pin. J Pad J is connected to the processor's SS output pin. K Pad K is connected to the processor's MOSI pin. L Pad L is connected to the processor's SPSCK output pin. M Pad M is connected to the processor's IS3 input pin. This signal is pulled up to +5 volts through a 10-k resistor. N Pad N is connected to the processor's IS2 input pin. This signal is pulled up to +5 volts through a 10-k resistor. O Pad O is connected to the processor's IS1 input pin. This signal is pulled up to +5 volts through a 10-k resistor. P Pad P is connected to the processor's FAULT4 input pin. This signal is pulled to logic ground through a 10-k resistor. Q Pad Q is connected to the processor FAULT3 input pin. This signal is pulled to logic ground through a 10-k resistor. R Pad R is connected to the processor's FAULT2 input pin. This signal is pulled to logic ground through a 10-k resistor. S Pad S is connected to the processor's FAULT1 input pin. This signal is pulled to logic ground through a 10-k resistor. AN1624 MOTOROLA 19 Application Note +5 GND B+ Four pads labeled +5 provide +5 volts from the on-board 7805 regulator for prototype circuitry. Four pads labeled GND provide logic ground for use by additional prototype circuitry. Two pads labeled B+ are connected to the B+ power input on terminal 3. Application Example An application example, shown in Figure 8, illustrates system connections to an ITC132 power stage and an induction motor. This arrangement can run stand alone or the ITC137 can be connected to an MMDS08 for code development. The two boards are designed such that the drive and feedback ribbon connectors line up. Ribbon cables are supplied. Once they are plugged in, it is only a matter of connecting power supplies and the motor to get a system up and running. A 3-phase, center-aligned, sine wave pulse-width modulation (PWM) signal is generated by the ITC137. Speed is controlled by the frequency and amplitude of this signal, while direction is determined by phase-tophase sequence. Systems parameters are easily changed, while a motor is running. Switch 1 on the ITC137 board will change PWM rate, modulation type, and full modulation frequency. If the RS-232 communications interface is used, terminal mode operation includes inputs for boost voltage and several types of space vector modulation. AN1624 20 MOTOROLA Application Note Design Considerations MC68HC708MP16 MOTION CONTROL DEVELOPMENT BOARD HIGH-VOLTAGE MICRO-TO-MOTOR INTERFACE GND MOTOROLA ITC137 B+ 7.5 Vdc - 15 Vdc MOTOROLA ITC132 HV RAIL + 320 Vdc DRIVE RTN INDUCTION MOTOR Aout Bout FEEDBACK Cout + 18 V RTN +18 Vdc RTN Figure 8. Application Example Design Considerations The ac induction motor drives are relatively complex internal to the processor in terms of code, processing power, and the PWM timer's hardware. Brushless dc motor drives tend to be more complex external to the processor, particularly with regard to noise management of the sensor inputs. A number of design considerations that cover operation with both types of motors are discussed here. Sensor Inputs For brushless motors that use sensor inputs for commutation, noise immunity of the sensor inputs is a key design consideration. Noise on these inputs can be particularly troublesome, since commutating to the wrong state can jerk the motor and increase power dissipation. To facilitate noise robust sensor inputs, Schmitt triggers have been placed between the Hall sensor input connector and the processor. Hysteresis makes the Schmitt trigger significantly more robust than using input ports directly. In addition, these signals are filtered with 100 ns single AN1624 MOTOROLA 21 Application Note pole filters. Using relatively low value pullup resistors, on the order of 1 k, provides an additional measure of noise immunity. The way that the code is written also has an important influence on noise robustness. Since the sequence of commutation is known, based upon the state of the forward/reverse input, it is relatively easy to detect an out-of-sequence Hall sensor input. Generally speaking, when this occurs it is desirable to turn all the power transistors off until a valid Hall code is received. Lockout Especially on a machine that will be used for code development, it is desirable to prevent simultaneous conduction of upper- and lower-power transistors in the same phase. This feature is built into the HC708MP16's PWM timer. Once the timer has been initialized correctly, simultaneous conduction of a top and bottom output transistor in the same phase is locked out. Code errors that occur after initialization is completed will, therefore, not destroy power stage output transistors by turning on the top and bottom of one half bridge simultaneously. This arrangement also prevents simultaneous conduction in the event of a noise induced software runaway. Dead Time In induction motor drives, providing dead time between turn-off of one output transistor and turn-on of the other output transistor in the same phase is an important design consideration. Dead time is also a feature that is built into the HC708MP16's PWM timer. It is programmable, to accommodate a variety of gate drives and output transistors. In the software 2 s of dead time has been selected for operation with ITC132 power stages. Power-Up/ Power-Down When power is applied or removed, it is important that top and bottom output transistors in the same phase are not turned on simultaneously. Since the outputs are low when unpowered, sequencing is important in opto-coupled drives where the ITC137 output directly drives opto couplers. To ensure proper sequencing, a switched +5 is provided for sourcing drive current to the opto's. This supply is held off until RESET occurs and input voltage is high enough for safe operation. Connection AN1624 22 MOTOROLA Application Note Demonstration Software to an opto input is illustrated in Figure 9. It applies to operation with an ITC132 power stage. + 18 V 2.2 MUR1100E 5V 5.6 k MC33153 SWITCHED + 5 V 1N914 ISO1 10 k 10 F Atop Atop 180 HCPL0453 Figure 9. Connection to an Opto-Coupled Output Stage Grounding Last but not least, board layout is an important design consideration. In particular, how grounds are tied together influences noise immunity. In order to maximize noise immunity, a two section digital ground plane and a separate analog ground trace that intersects the digital ground plane at just one point are used. The digital ground plane (GND) is common to the power supply return and serves as a general-purpose ground. It is sectioned around the PWM timer's outputs to keep the relatively high return current associated with the outputs from flowing all over the board. An analog ground (AGND) ties the speed control input return and op amp signal grounds together before connecting with digital ground at only one point. AGND also runs as a separate trace to pins 14 and 16 of FEEDBACK connector J2. Demonstration Software Software included with the ITC137 motion control development board provides basic ac induction motor control. It is intended to use with an ITC132 high-voltage micro-to-motor interface, as shown in Figure 8. Firmware for this application is programmed into the MC68HC708MP16 for immediate use. Source code is also provided on diskette. Open loop volts per Hertz drive from 0 to 120 Hz and PWM rates of 1800 to 28,800 Hz are supported. Other options include sine, third harmonic injection, or space vector modulation waveforms, full modulation at 60 or AN1624 MOTOROLA 23 Application Note 120 Hz, run/stop and direction control. Two different operating modes are possible with the supplied software: stand alone mode and terminal mode. Stand Alone Mode When the ITC137 is initialized after reset, it is operating in stand alone mode. In this mode, all options (speed, direction, etc.) are read from controls on the board. Since the software ensures coordination of the actual changes in PWM, voltage, etc., changes may safely be made in real time while driving a motor. One exception to this is if the motor load has a large amount of inertia. In this case, the rate of speed change allowed by the software may not be slow enough to prevent regeneration of excessive dc bus voltage. User settings are: * SPEED, or drive frequency, is determined by speed potentiometer R2. Frequency may be set from 0 to 120 Hz in 1-Hz increments. Large changes are not instantly applied; instead a slow ramp to the new setting is implemented. * FORWARD/REVERSE sets the drive direction. When direction is reversed, speed is ramped down to 0 then ramped up to the current speed setting in the new direction. * RUN/STOP allows speed to be forced to 0. Speed is ramped to 0 when stop is selected, then rammed up to the current speed setting when the switch is returned to RUN. * DIP SWITCH SETTINGS -- Additional operating options are controlled by a 5-position DIP switch, SW1. Position 1 determines the frequency of 100 percent voltage modulation, OFF for full voltage at 60 Hz, and ON for full modulation at 120 Hz. Position 2 determines the waveform, OFF for sine, and ON for third harmonic injection. PWM rates are determined by positions 3, 4, and 5 as shown in Table 3. AN1624 24 MOTOROLA Application Note Demonstration Software Table 3. PWM Rates Terminal Mode DIP 3 DIP 4 DIP 5 PWM Rate On On On 2000 On On Off 4000 On Off On 8000 On Off Off 12,000 Off On On 16,000 Off On Off 18,000 Off Off On 20,000 Off Off Off 22,000 The ITC137 serial port, labeled SCI, is also enabled and monitored for activity. A terminal or terminal emulation software running on a personal computer (PC) will communicate with this port. Any basic serial communications software that is set for 9600 baud, eight data bits, no parity, and one stop bit, will work. When commanded to do so via the terminal, the ITC137 can be switched to terminal mode, where all control is by keyboard entries. This can be done in real time without disturbing motor drive parameters. When terminal mode is activated, it uses the ITC137 hardware settings as defaults, and when deactivated, settings revert to the hardware. To connect the ITC137 to an IBM-compatible PC, follow these steps: 1. With power removed from the ITC137 and the PC off, connect a 9-connector straight through cable from the ITC137 connector labeled SCI to the COM1 or COM2 serial port of the PC. PC serial ports are wired as DTE (data terminal equipment) and the ITC137 SCI port is wired as DCE (data communications equipment). This is why a 9-conductor cabled wired straight through must be used. Do not use a null modem cable. 2. Restore power to the ITC137 and PC. AN1624 MOTOROLA 25 Application Note 3. If you are using DOS-based communications software such as ProComm, set the COM port to COM1 or COM2 depending on which PC port you have cabled to the ITC137. Set the baud rate to 9600, the number of data bits to eight, the number of stop bits to one and the parity to none. Set the duplex to full duplex. 4. If you are using Windows or Windows 95, a terminal program is included in the accessories. Start the terminal program, open the setting pulldown menu, and select communications. Set the options as listed in step 3. 5. Reset the ITC137 board. If connected and configured properly, the terminal will display software version information and the top level command menu shown in Figure 10. Keyboard activity will have no effect until the control mode command is used to set terminal mode. In this mode, further inputs from the ITC137 hardware controls are ignored. The initial settings will be identical to the hardware settings at the time control is transferred. When control is returned to stand alone mode, settings will revert to the hardware settings, including a gradual ramp to the speed control potentiometer setting. Thus transfer between the two modes may be made while driving a motor. Figure 10. Terminal Display ProComm is a trademark of Datastorm Technologies, Inc. Windows and Windows 95 are registered trademarks of Microsoft Corporation. AN1624 26 MOTOROLA Application Note Terminal Mode Main Menu Terminal Mode Main Menu The main menu, shown in Figure 10, allows the following command options. Note that commands are executed when followed by an ENTER keystroke. Control mode (c) Chooses between stand alone mode, with ITC137 board controls and terminal mode with all control via terminal commands Frequency (f) Sets drive frequency from 0 to 120 Hz Voltage (v) Temporarily overrides the normal volts per Hertz setting with a new voltage. Voltage will change instantly. WARNING: Large voltage jumps or setting a large voltage at a low frequency can damage power transistors. PWM rate (p) Chooses a PWM carrier frequency between 1800 and 28,800 Hz Direction (d) Selects forward or reverse Run/Stop (r) Selects run or stop Boost (b) Chooses a low-frequency voltage boost of up to 20 percent Set full modulation frequency(s) Selects a 100 percent modulation point of 60 Hz or 120 Hz. Voltage will change instantly between these two slopes. WARNING: Note that large voltage jumps can be hazardous to power stages. AN1624 MOTOROLA 27 Application Note Modulation type (m) Chooses between sine, sine plus third harmonic injection or space vector modulation (SVM) waveforms. In order to experiment with any SVM modulation type containing V0 nulls with an ITC132 power stage, the bootstrap circuit should be modified. At least 220 F of additional bootstrap capacitance on each phase is needed for adequate hold up time. Pads are provided on ITC132 boards for this purpose. Therefore, it is not advisable to select type V0; or V0, V7; or V7, V0 from this menu when using an unmodified ITC132 board. Analog readings (a) Enables or disables on-screen display of bus voltage, bus current, and temperature information Software Functional Overview The core function of the demonstration code is to synthesize three phase waveforms for variable frequency drive of ac induction motors. This task is simplified greatly by the 6-channel motor control PWM unit on the MC68HC807MP16. In general, waveforms are synthesized by looking up values in a table for each point along a curve and then converting these values to PWM duty cycles. The repetition rate, or carrier frequency, determines how many data points define the curve. Drive frequency, typically 0 to 120 Hz, is determined by how rapidly the microprocessor steps through the table values. The timebase for this process is the rate at which the PWM unit interrupts the HC08 CPU. If the PWM unit is configured to interrupt every cycle, this rate is identical to the carrier frequency. It is common practice to service the PWM unit less often than this at higher carrier frequencies. This entire process is performed three times upon each interrupt to create three waveforms that are each offset 120 degrees. Only about 1800 bytes of code are needed for this basic operation. The user terminal interface, additional demonstration features, and factory test routines use about 11,000 bytes. The code is modular and written in C language (except for the SINESCALE routine), in order to encourage experimentation and reuse. A brief summary of each module is listed as follows. Consult and C source code for complete details. AN1624 28 MOTOROLA Application Note Terminal Mode Main Menu MAIN * Initializes PWM and SCI units * Resets communication, A/D data, and waveform data table pointers * Enables interrupts for PWM and communication * Enters SCAN loop PWM * PWM interrupt handler * Services COP * Passes data table pointer to QUADZ for each phase * Loads PVALX registers from global RAM value pwmmod * Exchanges two phases if reverse direction is set * Maintains waveform data table pointers * Sets PWM unit LDOK bit QUADZ * Accepts waveform data table pointer * Translates full waveform pointer into quadrant pointer * Selects sine or third harmonic injection according to settings * Calls SINSCALE to scale table value with global RAM value vscale * Modifies global RAM value pwmmod SINSCALE * Accepts waveform data and scaling value * Scales with 24-bit accuracy * Returns integer formatted for use in PVALX registers AN1624 MOTOROLA 29 Application Note SVM * Accepts waveform data table pointer * Calculates SVM time segments via CALCULATE function * Modifies PWM PVALX registers CALCULATE * Calculates times for SVM modulation SCAN * Scans hardware for speed, PWM, etc., settings * Scans serial communication buffer for commands via GETCH * Parses commands, sets control flags * Calls RECALC to execute setting changes * Calls MENU to reflect changes back to terminal user RECALC * Recalculates correct PWM modulus, load frequency, and interrupt frequency * Recalculates correct data table pointer increment value * Updates PWM registers and RAM variables coherently with interrupt mask MENU * Transmits command menus and current settings to terminal user RECEPT * SCI interrupt handler writes to buffer * Maintains pointer PUTCHAR * SCI transmit GETCH * Parses input string in buffer AN1624 30 MOTOROLA Application Note Terminal Mode Main Menu Software Development The ITC137 may be used in an emulation environment with Motorola MMDS08 or MMEVS08 development tools. Executable code in S-record format is included on the source code diskette. The development system flex cable can be connected directly to the ITC137 without the use of a target head adapter by following these steps: 1. Ensure all power is removed from the development tool (MMDS08 or MMEVS08), the ITC137 board, and the ITC132 board. 2. Remove the MC68HC708MP16 processor on the ITC137 board from its socket. 3. Attached the development tool M68CBL05C flex cable directly to the ITC137 using the headers next to the processor's socket. 4. Restore power to the development tool and the ITC137 board. CAUTION: Do not restore power to the ITC132 high-voltage rail at this point. 5. Following development tool instructions, download the demonstration code S records or code of your own creation and run it. 6. Using an oscilloscope, probe the PWM top and bottom output test points provided on the ITC137. 7. Restore power to the motor rail only after verifying that ITC137 output waveforms are correct. CAUTION: Additional Precautions Power must be removed in the exact reverse of this sequence when shutting down or power stage IGBTs may be damaged. It is very important to note that emulator operations such as stopping emulation or setting breakpoints can over-stress power stages. If, for example, the emulator is stopped in a state that energizes the motor, the relatively low winding resistance in most ac motors will allow excessive current to flow. Under these circumstances, it is relatively easy to overstress power devices. Any software change, no matter how minor, should be checked out with the above procedure before applying power to the motor. AN1624 MOTOROLA 31 N O N - D I S C L O S U R E A G R E E M E N T R E Q U I R E D Application Note Conclusion The ITC137 controller is part of a tool set that facilitates motor drive development. It allows the 68HC708MP16 processor's performance to be verified in many applications without the need for building hardware or developing software. ITC137 controllers interface with MMDS08 and MMEVS08 development tools for writing code, with ITC122 and ITC132 power stages for energizing motors and with serial port terminals for changing motor control parameters real time. In addition, both hardware design and source code can be used as references for speeding product development. Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. How to reach us: USA/EUROPE/Locations Not Listed: Motorola Literature Distribution, P.O. Box 5405, Denver, Colorado 80217, 1-303-675-2140 or 1-800-441-2447. Customer Focus Center, 1-800-521-6274 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu, Minato-ku, Tokyo, 106-8573 Japan. 81-3-3440-8573 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2 Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong. 852-26668334 MfaxTM, Motorola Fax Back System: RMFAX0@email.sps.mot.com; http://sps.motorola.com/mfax/; TOUCHTONE, 1-602-244-6609; US and Canada ONLY, 1-800-774-1848 HOME PAGE: http://motorola.com/sps/ Mfax is a trademark of Motorola, Inc. (c) Motorola, Inc., 1997, 2000 AN1624/D