Home
The DatasheetArchive - Datasheet Search Engine
Contents
1. HOV E m o L H 5 1 55 5 HE 8 M 2 woo Ht Sed XOL z XOL 1 1 428 e 1 028 gt 1 dd T 8r L 9 41 9 SL Or E SL Lal L H E yip nioo vzo 61 Si T ay 8 4 d xi 1 nio ezo 9 ions 5 T 1 11100 229 1 120 Tena 1 x nioo 022 X acu a L SN 01 A Motor Control Schematic 1 2 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 20 Application Note 34 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 4 Jo jeeus 8661 Sz Menga HOIO3NNOO 5 Nouodsndo po 0 wp
2. DRIVER PORT4 4 Analog SENSORS Room Temperature Channel Temperature Humidity 4 PHASE STEPPING MOTOR FOR FLAP 5 96 91506 Source PWM HSI 46 1 Receiver la l Remote Controller Controller 8 196 LED 3 Driver gt LED Display HSI Port 1 4 Switch Panel Power lt lt HSO Transistor Fon TXD rom To RXD PHOTO COUPLER EXTINT Outside Unit 3 Phase DC Brushless Motor for FAN Application Note 13 Inverter Motor Control Using the 8 196 Microcontroller Design Guide 3 2 Table 2 14 Outside Unit On the outside unit the 8 196 performs the following functions see Table 2 Controls compressor motor which is controlled by using V F control algorithm and sinusoidal wave PWM technique Monitors with thermistors the outside compressor heat exchanger temperature to recognize abnormal conditions Controls the control valve to change direction of coolant flow Controls the capillary valve to change the inside diameter A three phase induction motor is used as compressor motor stepping motor controls the capillary valve block diagram is shown in Figure 9 The 8xC196MC controller has the sine table to perform the sinusoidal wave PWM and V F pattern in the internal memory When the controller in the outside unit receives the fre
3. 09 0923H dcw O6A6H 05D1H 4 0428H 0355E O27EH ODSH dcw OOH OFF2BH OFES6H OFD82H OFCADH OFBO4H OFA2FH dcw 5 86 7 2 OFG6DDH OF60SH OF535H OF461H OF38DH dcw 2 OFLE6H OF113H OFQ3FH OEF6CH OEE99H OEDCTH OECF4H dcw 22 OEBSOH OEATEH OE9ADH OEBOAH 0 739 OE669H 0 598 OE4C8H 0 329 25 0E18BH OEOBDH ODFEFH ODF21H ODES4H 00087 ODCBAH ODBEEH ODB22H ODAS7H ODS8CH 008 1 OD7F7E 00720 00664 OD59BH OD4D3H 0D344H dcw OD27DH ODIB6H ODOFOH 00028 66 OCEA2H OCDDEH OCD1BH dcw 0 58 OCB96H OCADSH 14 OC953H OC7D4H 0 716 dcw 0 658 0 59 OC4DEK 0 422 OC367H 0 2 OC1F2H 0 139 dcw 0 080 OBF11E OBESAH OBDASH OBCEFH OBB88H 5 0 971 8 0 811 0B762H 6 4 08606 cw 55 OB4AEH 40 0B353H OB2BOH 0B208H OB160H OBOBSH dew OBO14H OAF6FH OAE27H OAD85H OACE4H OAC43H OABOSH 68 OASCBH OA92FH 0A894H OAJ7FAH 761 OA6COH dcw 0A633H 590 5 04474 OA2BEH 22 dew 19 111
4. enu V dSVHd Zs Tw T 50 ran sed 00 lt B Wu star sly LEGPNE Sw ga i X ba neyo x Hnoo ss lt Z L S EY gt LON as ijs NH Hir fa Z Em 5 Oran z anvo OL ABT i 1 szar 20 2 oor ER e nyo gx anvo AST i 4 6 45691 sz VOSNOLdOXI AC Drives Technology Schematic 3 6 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 24 38 9 Jo v jeeus 8661 22 Iudv OLLVW3HOS 3OVJH3 INI HOLOW ASSY Od 9219 ASOTONHO31 SINIYA OV Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 39 enu 5 5 400 sly 227 OvADSZ sup anro VOSNOLdOXI w so 30535 T x ssa EE sn lt 2 05 ZJ su E ER aan r SON P g E S gt 1569 190 1
5. OSEE4H 9 5 O9DD4H dew 090409 OSCCBH O9C44H 09 O9B3EH OSABEH 09A3EH 099 dew 09941 098 5 09849 097 09756 096 09667 095F2H dcw O957DH 0950 09498 09427 093 7 O9348H 092 0926 dew 09204 0919 O9131H 090 09064 O8F9BH 08F39H dcw O8EDSH O8E78H 08 19 O8DBBH 0805 08004 8 08C52H dcw OBBFBE O8BASH 08850 OBASAH 08 089 dcw 0896 08924 O8891H 08849 08802H O87BDH 0877AH O8737K 086 6 086 6 O8678H O863BH O85FFH 085 5 O858CH 08554 08510 084 8 5 08482 08451H 08422H O83F3H dcw 83 6 O839BH 08371 08348H 08320 082FAH 08206 082B2H 08290 08270 08250 08233 08216 081FBH 081 1 081 9 dcw 08182 08190 08188 08176 08164 08154H 08146 08138H 08120 08122 08119 08111 0810 08106 08103 08101H dew 08100 08101 08103 08106 O810BH 08111H 08119H 08122H 908120 08138 08146 O8154H 08164 08176 08188 0819DH 081B2H 081 O81E1H 081 08216 08233 O8250H 08270H dcw 08290 08282 08206 082 08320 08348 08371 0839BH dcw 083 083F3H 08422 08451 08482H 084B5H 084 8 0851DH dcw 08554 0858 085 5
6. 0 break case ENDKEY pos len break case INSKEY insert insert changecursor insert break case LEFT ARROW if gt 0 pos break case RIGHT ARROW if pos len Application Note 85 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table6 C Program Source Code for User Interface Sheet 14 of 17 break case BS if pos gt 0 movmem amp s pos amp s pos 1 len pos 1 pos len break case DEL if pos lt len movmem amp s pos 1 amp s pos len pos len break case CR break case ESC len 0 break default if legal 0 0 strchr legal c NULL amp amp gt lt amp amp len lt maxlength if insert memmove amp pos 1 amp s pos len pos 1 1 else if gt len len s pos c break switch if first char TRUE for 1 0 1 lt 10 1 if edit keys i break if i 10 if strchr legal c NULL s 0 c len pos 1 first char FALSE s len 0 86 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 15 of 17 while c CR amp amp c ESC changecursor FALSE return c ESC editstring
7. 41 Signal Descriptions for the 8xC196KB Inside 12 Signal Descriptions for the 8xC196MC Outside 14 Connector Signal Description nennen 20 VO Port Connections 23 Demonstration Unit Software Control 43 Program Source Code for User 73 Application Note Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide 1 0 Introduction This application note describes how to apply the inverter motor control concept to a common air conditioning system The algorithm and software used to generate the three phase pulse width modulated inverters are also presented Section 2 0 summarizes the inverter motor control concept and its application in an air conditioning system Section 3 0 presents an overview of an 8xC196MC controller based inverter motor control design in an air conditioner The block diagram of the indoor and outdoor unit design is presented Section 4 0 provides an example of a three phase inverter motor control design This section describes the motor control s hardware design and describes the associated software The schematics and program code are included in the appendixes Information on related documents and customer support contacts is available in Section
8. 1FBFh CLRB PI MASK WO reset peripheral interrupt mask CLRB WSR CALL INITIALIZE REGS Initialize Registers tst6 LBB AX PIN jbs AX 6 tst6 wait for go signal from direction switch CHK RPM LB TEMP timer0 CLR 2 HOLB DJNZ 2 DJNZ TEMP 3 HOLD CMP TEMP timer0 JNE CHK_RPM ready ORB P7_BAK SETO STB P7_BAK P7_REG enable start switch LBB AL WG_LWR_ON turn on lower xistors to start STB AL WG_OUTPUT ANDB P7 CLR1 STB P7 BAK P7 REG Enable HV Drivers LBB reverse Reverse 7 is the direction flag CALL GET VALUES lb temp 100 Hold low xistors on to charge djnzw temp LBB AL ALL OFF STB AL WG OUTPUT turn off lower xistors lbb change flag 0ffh lb ax timerl 48 Application Note intel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 7 of 30 7 7 7 7 7 7 Application Note add ORB STB Initialize LBB ANDB ORB ORB CLRB Initialize LBB LBB LBB LB LB LB LB LB CLRB ref time ax pwm per P7 BAK SET2 P7_BAK 7_ port timer WSR 3Fh P2 MODE WO OFDh P2 DIR 02h P2_REG_WO 02h WSR RXD Mode WSR 24h PTSCON1_WO 21h SAMPTIME1_WO 10h EPAREG1_WO 1F46h BAUDCONSTI WO 0D0h 5 1 WO 118h PORTREG1 1FD6h 1 WO 028 WSR Set receive
9. This method employs a PWM signal to enable or disable the transistors In the example the 8xC196MC microcontroller is used to produce the PWM signal The switching points of the PWM signal are determined by the intersection of the fixed frequency triangular carrier wave and the reference modulation sine wave The output frequency is at the sine wave frequency and the output voltage is proportional to the magnitude of the sine wave The on chip waveform generator WFG of 8xC196MC allows generation of three independent complementary PWM pairs with switching times determined by the method previously discussed The WFG is divided into three functional areas the timebase generator the phase driver channel and the control section For a detailed description of the refer to the application note AP 483 Application Examples Using the 8xC196MC MD Microcontroller and to the 8xC196 MC MD MH Microcontroller User Manual Application Note 7 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide I n 2 2 Figure 3 Typical Air Conditioner Operation The typical air conditioner consists of an evaporator a compressor a condenser an expansion valve and two circulating fans The complete air conditioning system can generally be divided into two parts an indoor unit that channels the air into the premises and an outdoor unit containing the compressor the heart of the system The room temperature can be regulated by con
10. 36 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 23 Drives Technology Schematic 2 6 59 ko 5 8 2 N 2 gt gg E E 5 9 1 30 4 5 A 9 ul 2 2 5 8 5 lg g ER 898 s E 208 5 B5 lt 8 s 8 39 5 o 25 Z 22 18 83 2 55 5 o 55 5 5 lt 80 lt 3 I E 2 8 5 lt 148 2 13538 2 s 38 zs x 2 13 Z 19599 8 5 x DL 3 gt E Ei 82 T M 4 E A 5 g 4 E E CD40938 CD40938 040938 Rit 100 5 DES 2 9 8 i 8 4 8 s s 5 4 e E E Application Note 37 9 10 19949 8661 OLLVIN3HOS 3OV3H31NI HOLOW ASSY Od azig ASOTONHO31 SINIYA OV Application Note
11. Rev Sheet Monday May 11 1998 PC ASSY MOTOR INTERFACE SCHEMATIC AC DRIVES TECHNOLOGY Document Number A A A 82 5 1D AAA AAAA Application Note 41 ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Appendix B Demonstration Unit Software Control Module The following 21 pages contain the code listing for the demonstration unit software control module Table 5 Demonstration Unit Software Control Module Sheet 1 of 30 MOTOR CONTROL iMC rev 1 MODULE MAIN STACKSIZE 6 Main Code list SINCLUDE def196mc INC Include SFR definitions CSEG AT 2018H DCB 11111111B CCB DCB 20H DCB 11011110B 1 CLEAR KB KB2 BITS DCB 20H CSEG AT 5 atod_done_int capcompO int comparel int capcomp2 int compare2 int capcomp3 int compare3 int empty int 1 empty int 2 empty int 3 wg counter int PTS VECTOR ADDRESS LOCATIONS timer ovf pts atod done pts capcompO pts 0 pts comparel pts capcomp2 pts compare2 pts capcomp3 pts compare3 pts empty pts 1 empty pts 2 empty pts 3 wg counter pts Application Note 43 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n A Table 5 Demonstration Unit Software Control Module Sheet 2 of 30 external_pts nmi br list
12. V Ncc 4 ACH Increment PB 6 Decrement PB 8 ACH5 Freq Slope SW 10 ACH6 Disable Enable SW 12 ACH Forward Reverse SW 14 RESET 16 7 3 Application 21 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel A Figure 16 Inverter Air Conditioner Demonstration Set Top View FREQUENCY VOLT HZ MOTOR RPM INVERTER MOTOR METER METER METER DEMONSTRATION UNIT 80 196 4 LINE x20 CHARACTER DISPLAY Motor Control EROS lt 96 POWER gt Boa rd Log ic lt FREQUENCY OUTPUT gt lt MOTOR RPM gt Power Board FORWARD VOLTS HZ RATIO REVERSE FREQUENCY 22 Application Note intel 4 1 1 Note Table 4 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide 80C196MC Motor Control Board Logic The Motor Control Board schematic and the component layout diagram are included in Appendix A Schematics The reset circuit causes a chip reset in four ways at power up from the reset pushbutton from an external input on RESET or internally from the 80C196MC The timings for the demo board are based on the 16 MHz circuit Board locations referenced in this section are shown in the schematics in Appendix The 80C196MC has seven ports Port 0 Port 6 Port 0 is used as an analog input only port Signals at this port a
13. 9 Inverter Controlled Air 10 Effect of Frequency Variations on the PWM Waveforms 11 Electrical Circuit Block Diagram Of Inside 13 Electric Circuit Block Diagram Of Outside 15 U Channel Motor Driver Block 16 EEE 17 Inverter Motor Control Demonstration 18 Inverter Air Conditioner Demonstration System Block Diagram 19 1 Display 20 P8 Control Switches 21 Inverter Air Conditioner Demonstration Set Top 22 Motor Control Power eL 24 9 Connector coetu Rx buen 25 Software Block u uu a 28 Motor Control Schematic 1 2 34 Motor Control Schematic 2 2 essere 35 AC Drives Technology Schematic 1 6 sse 36 AC Drives Technology Schematic 2 6 sse 37 AC Drives Technology Schematic 3 6 38 AC Drives Technology Schematic 4 6 39 AC Drives Technology Schematic 5 6 40 AC Drives Technology Schematic 6 6
14. Port 2 1 is the RXD pin and Port 2 6 is the TXD pin P8 16 pin connector providing the interface to the control pushbuttons and switches Its connections are shown in Figure 14 P9 16 pin connector that interfaces PWMO P9 8 and PWM1 P9 9 to the panel meters that display frequency and volts Hz ratio P10 40 pin connector containing the motor control signal routed to the power board P10 outputs Waveform generator outputs which drives the power board WG1 WG1 produce and ALO on P10 14 16 WG2 and WG2 produce and BLO on 10 20 and 22 WG3 and produce CLO on 10 26 and 28 P10 inputs Feedback and status signal from the power board RUNNING P10 4 goes to the 80C196MC EXTINT pin CPU Requested P10 6 goes to the 80C196MC Port 2 0 IB and IC are the analog phase currents on P10 34 36 and 38 ISEN on P10 32 is the amplified sum of the three phase currents P1 to Display Wiring P1 DISPLAY 2 Vcc 2 4 D 7 6 1 8 30k 8 p 9 10 D3 10 12 11 G 14 Ds 12 N 16 D6 13 T 2 18 D 14 20 COMMON 1 5 22 08 6 T 30k 24 D9 4 55 V 3 15 Application Note ntel Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Figure 15 P8 Control Switches Interface E STOP PB 2
15. rg h ah 1 int86 0x16 amp rg amp rg if rg x flags amp 0x40 11586 0x28 continue rg h ah 0 int86 0x16 if rg h al 0 128 amp rg amp rg amp rg c rg h ah else rg h al break return Outputs selecting menu to the screen int get_choice const char title const char menu int options int 1 posit position textmode C80 clrscr gotoxy FIRST COLUMN FIRST ROW 2 textattr TITLE ATTR cputs title textattr NORMAL ATTR for i20 i options 1 gotoxy FIRST COLUMN FIRST ROW i cputs menu il gotoxy FIRST_COLUMN FIRST_ROW posit textattr INTENSIVE ATTR cputs menu posit gotoxy FIRST COLUMN strlen menu 0 FIRST ROW while 1 cmd get char switch cmd case LOWER ARROW gotoxy FIRST COLUMN posit FIRST ROW textattr NORMAL ATTR cputs menu posit 82 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 11 of 17 if posit options posit 0 break case UPPER ARROW gotoxy FIRST COLUMN posit FIRST ROW textattr NORMAL ATTR cputs menu posit if lt 0 posit options 1 break case ESC textattr NORMAL ATTR return ESC case CR case SPACE textattr NORMAL ATTR clrser jy textattr TITLE ATTR gotoxy 5 2 cp
16. 54 Demonstration Unit Software Control Module Sheet 12 of 30 ST add ST LB LB LB LB clrb clrb lbb lb RET ERROR DI LBB LBB ST ANDB STB PUSH PUSH PUSH PUSH nom per wg comp3 nom per nom per nom per is now full period value nom per wg reload min nxt hz min_hertz volts hz finit volts V H constant 3fffh max hz 100 init_hertz initial frequency in hertz hz out HZ X100 int pend ipendl tmr ovf cnt 61 ptr 6000h debug pointer AH WG_CMP_OFF AL WG_ALL_OFF AX WG_OUTPUT Drive all WG pins to zero P7_BAK CLR2 P7 BAK P7 REG 0 0 0 0 error_dump lb dump 1b st Jbc nop ax 0d0h bx bx ptr ax 1 0 dump error_trap LBB bbs djnz ANDB STB djnz ORB STB AX 6 restart Restart anytime switch is turned off temp P7_BAK CLR2 P7_BAK P7_REG temp P7 BAK SET2 P7 BAK P7 REG Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 13 of 30 br loop forever CSEG AT 2400H GET NEW REQUEST Get requested parameters based on inc dec buttons BBS change flag 0 no change Do not modify frequency or volts until last update is processed LBB bbs sign 0 software bbs process 0 adjust jbc AX 4 decrement jbc AX
17. Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Application Note August 2000 Order Number 273175 002 Information in this document is provided connection with Intel products license express or implied estoppel otherwise to any intellectual property rights is granted by this document Except as provided in Intel s Terms and Conditions of Sale for such products Intel assumes no liability whatsoever and Intel disclaims any express or implied warranty relating to sale and or use of Intel products including liability or warranties relating to fitness for a particular purpose merchantability or infringement of any patent copyright or other intellectual property right Intel products are not intended for use in medical life saving or life sustaining applications Intel may make changes to specifications and product descriptions at any time without notice Designers must not rely on the absence or characteristics of any features or instructions marked reserved or undefined Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them The 8xC196MC microcontroller may contain design defects or errors known as errata which may cause the product to deviate from published Specifications Current characterized errata are available on request Contact your local Intel sales office or your distribu
18. OB5FFH 08638 08678 086B6H 086 6 dcw 08737 0877 O87BDH 09802 08849 08891 88 0892418 dcw O896FH 0898CH 08 0 O8B50H O8BASH dcw 08 52 08004 0805 08 19 8 08F39H 09064 090 09131 0919 dew 09204 0926 O92DBH 09348 O93B7H 09427 09498 0950AE dew 09570 095 2 09667 0960 09756 097 098498 098C5H dcw 09941 OSSBFH 09B3EH O9BCIH 09 44 O9CCBH dew O9D4DH 09004 09 5 O9EE4H O9FF8H OAQ84H OA111H OA22EH 2 OA34FH 474 OA59DH dew 0 761 OATFAH 0A894H 2 OASCBH 4 OAC43H OACE4H OAD85H OAE27H OAECBH OAF6FH dew OBO14H OBOB9H OB160H 08208H OB359H OB403H OB4AEH OBSSAH OB606H 6 4 08762 OB811H OB8C1H OB971H 23 dew OBADSH OBB88H OBC3BH OBCEFH OBDASH 5 OBFC8H 92 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide dcw dcw dcw dcw dcw dcw dcw dcw dcw dcw dcw dcw dow dow dcw dew END OCC5
19. ST AX OUTPUT eject CLR HZ IN IDLE TIME LOOP WAIT FOR NEXT INTERRUPT AND DO HOUSEKEEPING JBC RXDDONE 0 wait ADDB TIMES 01h CMPB TIMES 03h BNE CONT CLRB TIMES CMP VALID 01 MORE BLT GONE LBB TEMP1 RECEIVE VALID CALL DECODE BR STEP MORE LBB TEMP1 RECEIVE VALID SUB VALID 015 1 RECEIVE VALID BNE CMP 3 CALL DECODE BR STEP 3 CMP VALID 015 GONE CMPB 1 RECEIVE 1 BNE _2 CALL DECODE BR STEP 50 Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 9 of 30 2 LBB TEMP1 RECEIVE VALID CMPB TEMP1 RECEIVE 1 BNE GONE CALL DECODE BR STEP GONE CALL ERROR STEP CLR VALID CONT LBB WSR 3Fh map 64 bytes to 1 1FFFh ANDB P2_MODE_WO 0FDh P2 0 P2 7 1510 ORB P2 DIR WO 02h INPUT P2 0 P2 3 OUTPUT P2 4 P2 7 ORB P2_REG_WO 02 2 0 2 7 CLRB WSR LB R COUNT 1 receive data count CLRB RXDDONE Clear done flag LBB WSR 24h LBB PTSCOUNT1_WO 09h of bits including parity amp stop LBB 5 11 WO 608 enable odd parity CLR 1 WO Clear recive data buffer LBB WSR 3Dh map 64 bytes to 1F40h 1F4Fh LBB 1 0 90h capture negative edge CLRB WSR wait LBB AX PO PIN BBS AX 6 restart Restart anyLime switch is turned CMP ptr 7000h
20. restore text mode Lent at LC NORMAL ATTR clrscr bios COM INIT COM SETTINGS initialize serial i o Sets the initial operating frequency to 6 0 Hz itoa hz hex 16 convert to hex if hz 4096 pad zeros if blank for 1 0 1 lt 2 1 hex 3 i hex 2 i 0 0 for 1 0 1 lt 3 1 converting into ASCII represention dig 0 hex il digit hextoint dig digit digit 48 in digit serially output each byte 3 times serial delay 0100 serial delay 0100 Motor rpm 150 rpm Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 3 of 17 serial delay 0100 while quit 0 main loop setting up the menu static char source_menu 250 500 N 750 N 000 s 100 200 n 300 400 500 N 600 700 800 900 2000 2100 2200 2300 2400 2500 why source get_choice Select Compressor Motor Speed rpm source_menu 19 decodes user input by assigning the corresponding rpm frequency switch source 5 quit 1 break case 0 hz 950 break case 1 hz 1830 break case 2 Application Note 75 Inverter Motor Control Using 8xC19
21. 0 0 oo IN HOLOW p o en T SSUN 92NO9 52 92 vo Lo 72 5 te 22 n BL SHOW E ab 8r SHOW 0 20 SL 9 4 el uou 6 0r I 4 8 ZHOV L 9 IHV H 2 gt T NON L 5 nos s v s 99 LS m ue sa uwauwesd ONIV OdWOO yZd U snsd dVOltzd J 03094 aw SHOV i dd 12 ONd Z Od LHOV 5 L sav 12 98 yz 29404 HS Od EHOV uae 55 85 32 08 I 0 ta
22. 23 4 1 2 Motor Control Power 24 4 153 Serial Port Module rete 25 4 2 Software Description 25 4 21 Serial Communication 0 25 4 2 2 Asynchronous Serial Data Transmission 26 4 2 3 Asynchronous Serial Data 27 4 3 Inverter Air Conditioner Demonstration Unit Software Control Module 28 4 4 Detailed Description of the Software 29 Related 5 32 a 33 Demonstration Unit Software Control 43 C Program Source Code for User 73 PADIS 91 Application Note 3 Inverter Motor Control Using 196 Microcontroller Design Guide ntel Figures Tables GM GQ Basic Structure of 6 Sinusoidal Waveform Generation Example 7 Refrigeration Cyl uuu uy 8 Air Conditioner s Operation in Cooling Heating Mode 9 Typical Alr uuu u u uuu
23. AD RESULT LOEQUIFAAH BYTE RESULT HIEQUIFABH BYTE AD TIME EQU 1FAFH BYTE 01 40 1 44 CAPCOMP2_CONEQU1F 48H BYTE CAPCOMP3_CONEQU1F4CH BYTE 1 42 WORD 1 1 46 WORD CAPCOMP2 TIMEEQUIFA4AH WORD CAPCOMP3_TIMEEQU1F4EH WORD COMPAREO_CONEQU1F 58H BYTE COMPARE1_CONEQU1F5CH BYTE COMPARE2_CONEQU1F 60H BYTE COMPAREO_TIMEEQU1F5AH WORD COMPARE1_TIMEEQU1F5EH WORD COMPARE2_TIMEEQU1F62H WORD to D command register Low byte of result and channel High byte of result to D time register capture compare 0 control register capture compare 1 control register capture compare 2 control register capture compare 3 control register capture compare 0 time register capture compare 1 time register capture compare 2 time register capture compare 3 time register compare module 0 control register compare module 1 control register compare module 2 control register compare module 0 time register compare module 1 time register compare module 2 time register INT MASKEQUO8H BYTE Interrupt mask register INT PENDEQUO9H BYTE Interrupt pending register INT 5 1 0013 Interrupt mask register 1 INT PENDIEQU12H BYTE Interrupt pending register 1 IMASK1 EQU 13H BYTE Interrupt mask register 1 1 EQU 12H BYTE Interrupt pending register 1 EQU 1F
24. 5 0 Related Documents on page 32 2 0 Inverter Motor Control Overview Over the last few years the number and variety of inverter motor control applications has increased tremendously A few examples include air conditioning systems industrial motors and a variety of home appliances The inverter control air conditioner has many advantages over the traditional ON OFF control type system Frequency controlled systems save energy Most air conditioners operate with a light load An inverter controlled air conditioner can adjust the compressor motor speed for a light load by changing the frequency This allows designers to use a high efficiency induction motor in the air conditioner ON OFF loss in compressor is reduced inverter air conditioner operates the compressor continuously with a light load Thus it avoids the loss of power that results from pressure changes in refrigerant in ON OFF control type air conditioners Performance variations due to 50 60 Hz line frequencies are eliminated Due to the different input frequencies in different areas the performance of the ON OFF air conditioner can vary The inverter controlled air conditioning system is not affected by frequency changes because the input AC is transformed to DC then back to the desired AC frequency Starting current is reduced The starting current required for the inverter air conditioner is adjusted to an optimum level to achieve the necessary torque whe
25. 6 O6AQEH 06999 06922H 06831H O67B7H 0673BH dew O66BFH 06641 065 2 06542 064 2 0643FH O63BCH 06338H 06283 0622 061 5 0611 06092 96008 05 7 OSEEFH dcw OSE61H 05002 05042 05 05 1 05 8 OSAF8H 05A63H dcw OS9CDH 05936H 0589 05806 0576 05601 05635 05598H 054 0545 5 0531 0527BH 05109 05135 05091H O4FECH O4F47H 4 O4DF8H 04050 04 7 O4BFDH 04B52H cw 04 6 049 0494 0489 O47EFH O473FH 0468 045DDH acw 0452 04478 043 5 04311 0425 041 6 O40EFH 040384 03 80 O3EC7H 03 03054 03C99H O3BDEH 03B22H O3A65H 0382 O376DH O36ADH 0352BH 0346AH 05255 03222 O315EH O309AH O2FDSH O2F10H 02E4AH Application Note 91 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide dcw 02083 C2CBCH 02BF5H 02B2DH 02A65H 0299CH 028D3H O2809H dcw O273FH 02674H 025 9 024DEH 02412 02346H 02279 O21ACH dcw 0200 02011 1 01 158 010 6 O1CD7H 01 07 G1B38H dew O1A68H 01997 018 7 17 6 017256 01653 01582 01480 dew O13DEH 0130 01239 011679 01094 OFClH 1 dew OD46H
26. COMPAREO INT interrupt subroutine is executed The reason for the above initialization code is now apparent we have caused the software to execute part of the interrupt code even though no interrupt has occurred The wave generator register buffer update occurs and if PERCENT PWR is too high the software calls the ERROR routine In the error routine the error will be trapped until the enable switch is turned off The program then branches to RESTART Either action will shut the motor down If the value in PERCENT PWR is acceptable the software calculates the new PWM phase values checks their integrity and stores them to await the next COMPAREO INT If the reverse switch is in the reverse position the software swaps the values of phases B and C The initialization process continues with the receive mode initialization First the PTS control block is set up for the asynchronous serial data reception mode Majority sampling is enabled and a 16 state sampling time is set The EPA Capture Compare 1 module and its corresponding P2 1 port pin is used for data reception The EPA is programmed to capture a negative edge to mark the beginning of a reception A baud rate of 9600 bit sec is selected by writing DOh to the BAUDCONSTI WO register Seven data bits one stop bit and one odd parity bit is to be received Only 1 byte is received in one cycle Finally the RESTART software writes to the interrupt mask register to enable the respect
27. PORT USAGE INPUTS 1 2 CLOCK IN FROM MOTOR GEAR PORTO OANALOG IN FROM CURRENT SENSE PORTO 1ANALOG IN FROM CURRENT SENSE PORTO 2ANALOG IN FROM CURRENT SENSE LO HI pete Se a N PORTO 3DECREMENT NONE PORTO NONE PORTO 5ADJUST VOLTS HZ RATIO ADJUST FREQUENCY PORTO 6ENABLE POWER DISABLE POWER PORTO 7FORWARD REVERSE OUTPUTS 7 05 PULSE AT BEGINNING OF START SINEWAVE PORT7 1LO ENABLE HIGH VOLTAGE DRIVERS PORT7 2 open PORT7 5 timing flag PORT7 6 timing flag PORT7 7 timing flag PORT6 6PWMO OUT FOR FREQUENCY INDICATOR PORT6 7PWM1 PWM OUT FOR VOLTS HZ RATIO INDICATOR PORT2 1 COMPARE1 PWM OUTPUT FOR SPEED INDICATOR eject Puis CONSTANTS CHANGED AT COMPILE TIME tab length equ 2 960 Sine lookup table length bytes theta 360 equ 960 16 theta for 360 degrees theta 60 equ theta 360 6 theta for 60 degrees min percent volts equ 0600H Minimum ratio max percent volts equ 0A000H maximum ratio if too high algorithm fails max depends on PWM PER and loading time nominal p equ 100 initial nominal half pwm period 44 Application Note intel Table 5 half_minimum init_dead init_volts min_volts max_volts min_hertz max_hertz init_Hertz init_Hertz hertz_step first_rate first_step second_rate second_step third_rate hertz_scale volts_scale sc
28. Unit Software Control Module Sheet 30 of 30 cseg at 2018h dcw dew Offffh cseg at 203Eh dcw nmi cseg at 2030h dcw capcomp3 int dcw compare3 int dcw empty int 1 dcw empty int 2 dcw empty int 3 dcw wg counter int dcw external int END OF RISM SELECTION PTS VECTOR ADDRESS LOCATIONS cseg at 2040H dcw timer_ovf_pts dcw atod_done_pts dcw capcomp0_pts dcw 0 pts dcw 110h dcw capcompl pts dcw comparel pts dcw capcomp2 pts dcw compare2 pts dcw capcomp3 pts dcw compare3 pts dcw empty pts 1 dcw empty pts 2 dcw empty pts 3 wg counter pts dcw external pts 0 1 Application Note intel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Appendix C C Program Source Code for User Interface Table6 C Program Source Code for User Interface Sheet 1 of 17 S EEK K k k k kk I ke kk INVERTER MOTOR CONTROL DEMONSTRATION UNIT USER INTERFACE Purpose Provide the user interface for the inverter air conditioner demo unit The programs allows the user to select a desired speed for the air conditioner compressor motor Subsequently it will decode the user request and send it serially to the 8XC196MC Motor Control Board for the necessary changes to be made The corresponding frequency For each motor Speed is sent in 4 bytes with each byte being sent 3 tim
29. at which the first data bit should be driven to the port This time must correspond to 1 bit time for the baud rate being used The formula used to this is VALUE 4 x BAUD RATE x PRESCALE Each time a timer match is made between EPA Compare 2 and an interrupt is generated The PTS outputs the next bit of data on the output pin in this case P2 6 The asynchronous transmit mode automatically transmits the 7 data bits followed by a parity bit and terminated by a stop bit 1 A maximum of 16 bits can be transmitted data parity stop 16 max To transmit 7 data bits with parity a total of 9 PTS interrupt and one conventional end of interrupt cycles occur Note that the data to be transmitted is right justified in the PISCB DATAO register and is shifted out least significant right most bit first For example an ASCII character 1 is transmitted below using this asynchronous serial transmission program Binary representation for ASCII 1 011 0001 31h Start Bit Data Flow Stop Bit C J Parity Bit 0 01110 0 1 1 0 0 1 The final interrupt is called end of PTS interrupt This interrupt occurs immediately after the stop bit is outputted and takes the conventional interrupt vector to COMPARE2 INT where the PTS control block is serviced In this program the DATAO WO L is loaded with the next data byte PISCOUNT is reloaded with 9 and PTSCON10 is
30. i 338 200 i 318 200 i 338 200 i line line line L line 346 200 1 346 200 1 11 346 200 1 366 200 1 delay 40 gotoxy 18 18 printf Inverter Air Conditioner Demonstration Unit gotoxy 21 20 80 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 9 of 17 settextstyle 0 0 0 textcolor CYAN printf Software Control Module Version 1 getch return 0 77777777777777777777777777777777777777777777 finclude bios h finclude lt stdio h gt include lt stdarg h gt include lt stdlib h gt include lt string h gt include lt conio h gt include lt graphics h gt include lt mem h gt include lt dos h gt include lt float h gt include myheadl h define FIRST_COLUMN 28 define FIRST_ROW int position 0 store previos position int x_curs y_curs void clear_kbd void while bioskey 1 bioskey 0 void wait key void clear kbd while keyhit get a keyboard character int get char void Application Note 81 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table6 C Program Source Code for User Interface Sheet 10 of 17 int c union REGS rg while 1
31. mode LB CLRB LBB LBB LBB R COUNT 1 RXDDONE WSR 24h PTSCOUNT1_W0 09h PTSCON11 0 60h CLR 1 WO LBB WSR 3Dh LBB CON WO 90h CLRB CLRB Set reference for 1 pwm map 64 bytes to 1 1FFFh P2 0 P2 7 LSIO INPUT P2 0 P2 3 OUTPUT P2 4 P2 7 P2 0 P2 7 HIGH map 64 bytes to 0100h 013Fh asynchronous SIO receive majority sampling sample time for majority sampling EPA capcoml timer register address Set baud rate 9600 bits second pointer to PTSCB1 Port 2 has the RXD pin P2 1 RXD receive data count clear done flag of bits including parity amp stop enable odd parity Clear recive data buffer map 64 bytes to 1F40h 1F4Fh capture negative edge WSR INT PEND ENABLEEXTINT TMR OVF 1 INT MASK 34000110018 LBB LBB LBB STB EPTS EI INT 01000000 AL 00000100B AL PI_MASK 1 49 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n A R Table 5 Demonstration Unit Software Control Module Sheet 8 of 30 lbb AX EPA_T1_SWT OR EPA_REP stb AX compare0_con st REF_TIME compare0_time Set first swt for reference LB INT TIME REF TIME lbb AL ENABLE disable protection and enable outputs stb AL wg protect LBB AL ALL ON LBB AH SYNC setup for syncronous loading
32. reloaded Then clearing the P2 6 creates the start bit for the next data word to be transmitted The EPA Compare 2 channel is initialized and COMPARE TIME is written to establishing the time which the first bit of the next word is to be driven out A total of 4 bytes is transmitted in this program Application Note intel 4 2 3 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Asynchronous Serial Data Reception In the program developed the EPA CapComp 1 channel 15 initially used in the capture falling edee mode to receive the data start bit input a falling edge transition from 1 to 0 on P2 1 This generates a conventional interrupt the same as the end of PTS interrupt which starts the asynchronous receive process This initial interrupt changes the CapComp 1 module to the compare mode sets the time of the next compare to 1 5 bit times and enables the PTS Thus at exactly 1 5 bit times from the beginning of the start bit the first PTS cycle will sample the input data on P2 1 and shift it into the DATA1_W0 register This software also uses the majority sampling mode thus an additional sample is taken If the two samples are different the data is sampled one more time to determine which polarity is correct The time between samples is controlled by the value of the SAMPTIME register in the PTSCB Each PTS cycle samples the input data at P2 1 and shifts the value into DATA1_WO0 register
33. this software Software Block Diagram COMPAREO INT ENABLE SWITCH OFF Update wave generator compare registers RESTART INITIALIZE REGISTERS CHANGE FLAG TIMER OVERFLOW IDLE TIME BYTE INT ENABLE SWITCH OFF GET NEW REQUEST INT ENABLE SWITCH ON Serial Data Input The complete software uses three interrupts the EPA Compare Module 0 Interrupt EPA Capture Compare Module 1 and Timer Overflow interrupt The EPA Compare Module 0 interrupt is used to update the waveform generator compare registers after each carrier period This is necessary for the generation of a sinusoidal PWM waveform because the duty cycle is continuously changing The EPA Capture Compare Module 1 interrupt is used for asynchronous serial data reception from the host PC and the Timer Overflow interrupt keeps track of real time The blocks of software communicate through the CHANGE FLAG byte Generally the software enters the IDLE TIME LOOP after completing the initialization routines The software remains in this loop until a software serial port or hardware push button switches input occurs Upon getting an input it recalculates the system variables for this new condition The peripherals such as the Waveform Generator PWM Generator and EPA modules react accordingly based on the condition conveyed through the CHANGE FLAG byte Upon completion the software continues to cycle in the IDLE TIME awaiting t
34. when the motor runs while applying a voltage at a very different frequency Assuming that the conditions are met the program sets up for motor control with a call to GET VALUES which consists of the following code VALUES CALL VALUE CHANGE CALL SET FREO WITH PUSHA SET FREO WITH PUSHA PUSHA BR SET FREQUENCY This structure is only used during initialization and does not occur again after the program is up and running The above code uses the interrupt run time subroutines during the startup phase before enabling interrupts During normal operation the VALUE CHANGE routine executes as a part of the GET NEW REQUEST routine During initialization there is no new request so VALUE CHANGE executes directly This routine controls the PWMO and PWMI which serves as indicators of frequency HZ x100 and the slope of the output volts to output frequency ratio VOLTS HZ VALUE CHANGE checks these variables for an overflow condition and routes frequency to PWMO and slop to PWMI These signals go the panel meters Subsequently VALUE CHANGE compares the present output frequency HZ OUT with the new input HZ 100 If they are equal no action is necessary Otherwise the program calculates the new values of the associated variables sets CHANGE FLAG 0 and outputs the new values to the LCD display The LCD display module is separated from the motor control module and is optional Next the subroutine SET FREQUENCY part of the
35. 2 7 077 07843 07886 dew 078 9 0790 0794 07988 079 5 01 07 07 74 dew O7AACH O7AE3H 07 18 07 4 0787 O7BAFH O7BDEH 07CODH dew O7C3AH 07 65 OTCBFH 07 8 07 07006 0702 07D4EH dew O7D70H O7DS0H 070 80 O7DCDH 07 05 O7E1FH O7E37H dew O7E4EH 07 78 07 9 7 07 07EC8H dew O 7ED3H 07 7 O7EF5H 7 7 7 dcw 07 00 7 07 5 7 7 O7EDEH dew O7ED3HK 7 07 9 7 07 78 07E63H dcw 07 37 07 05 O7DCDH 07DBOH 07D90H dcw 07070 0104 0702 07006 97 07 8 07 07C65H dcw O7C3AR 07 00 7 7 O7B7EH 07 4 078 8 07AE3H dcw 07 74 O7AOLH 079C5H 07988 0794 07904 078C9H 07886 O7843H 077 07787 0776 07726 O76DCH dcw 07691 O7644H 075 5 O75A6H 07555 07503 07480 0745BH dew 07405 073 07356 072 072 1 07245 071 7 07188H dew 07128 070 7 07055 07001 O6F9CH O6F36H OGECFH O6E66H 060 06D81H 06025 06 8 06 49 OSBD9H 06868 dcw
36. 3 increment lb inc_count 0000h br get done Increment inc inc_count lb temp HZ X100 LBB PIN jbs AX 5 is hz jump if hz adjustment lb temp VOLTS H2 otherwise adjust volts is hz addtemp f4first rate cmp inc count f4first step jnh inc done add temp rate cmp inc count fsecond step jnh inc done add temp third_rate inc done LBB AX PIN jbs AX 5 2 inc volts inc cmp temp VOLTS jh lim v st temp VOLTS HZ br value change lim v lb volts hz MAX_VOLTS br value change HZ inc cmp temp max_hertz Application Note 55 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n A Table 5 Demonstration Unit Software Control Module Sheet 14 of 30 jh limh st temp hz_x100 br value_change lim h lb hz x100 max_hertz br value change eject Decrement inc inc count lb temp HZ X100 LBB PIN jbs AX 5 is 121 Jump if hz adjustment lb temp VOLTS 2 otherwise adjust volts is hzl subtemp f first rate cmp inc count fKfirst step jnh dec done sub temp second_rate inc count second_step jnh dec_done sub temp third_rate dec_done LBB jbs AX 5 HZ dec volts dec cmp L emp volts jlt v lim st temp VOLTS HZ br value change lim lb volts bz Emi n volts br value change HZ dec cmptemp min_hertz jlt h lim st temp hz x100 br value change h lim lb hz x100
37. 6 01 75 O1F43H 02011H O20DFH 021ACH O2279H 02346H 02412 024 025A9H 02674H dcw 0273 02809E 02803 0299CH 02 69 02B2DH O2BFSH O2CBCH dcw O2D83H 02E4AH O2F10H O2FDSH O309AH 0315 03222H 032 5 dcw 0346AH 03528 035 O36ADH 0376DH 0382CH dcw 039 8 03A65H 03B22H O3BDEH 03 99 03D54H dcw O3F80H 04038H O40EFH O41A6H 0425 04311 043 5 04478H dcw 0452 045DDH 0468 O473FH O489EH 0494 O49FAH dcw 04 6 04B52H O4BFDE 04CA7H 04050 040 8 O4EAOH O4F47H dcw 04 05091 051355 05109 0527 0531 O53BDH 0545 dcw OS4FBH 05598H 05635H 05601 0576 05806 0589 05937H dcw OS9CDH 05A63H 0588 OSCIFH 05 05042 05002 dcw 05 61 OSEEFH 05 06008H 06092 0611 061 5 0622CH dcw 062B3H 06338H O63BCH 0643288 O64C2H 06542H 055 2 06641H dcw 66 0673BH 067 2 O6631H O68AAH 06322H 05999 dcw 06A83H 06AF6H 06868 O6BD9H O6C49H 8 06025 C6D91H dcw O6DFCH O6E66H O6F36H 06 07001 07065 070 7 dcw O7128H 071889 071 7 07245 072 1 O72FCH 07356 073AEH dew 074059 0745 074 0 07503 O7555H 075 6 075 5 07644 dew O7691H 0760 O7726H 0776 07
38. 6MC Microcontroller Design Guide Table6 C Program Source Code for User Interface Sheet 4 of 17 hz 2900 break case 3 hz 3700 break case 4 hz 4120 break case 5 hz 4450 break case 6 hz 4800 break case 7 hz 5050 break case 8 hz 5300 break case 9 hz 5550 break case 10 hz 5740 break case 11 hz 6000 break case 12 hz 6300 break case 13 hz 6640 break case 14 hz 7000 76 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 5 of 17 break case 15 hz 7320 break case 16 hz 7600 break case 17 hz 8000 break case 18 hz 8400 break if quit 1 put motor back to 6 0 Hz before exit hz 600 itoa hz hex 16 convert to hex if hz lt 4096 pad zeros if blank for 1 0 1 lt 2 1 hex 3 i hex 2 i hex 0 0 for 1 0 1 lt 3 1 4 converting into ASCII represention dig 0 hex i digit hextoint dig digit digit 48 in digit serially output each byte 3 times serial delay 0100 Application Note 77 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 78 Table 6 Program Source Code for User Interface Sheet 6 of 17 ser
39. 8H 20270 OD8C1H ODF21H OES98H OEC22H OF2BAH OF95AH OOH 06A6H 0D46H 013DEH 01A68H 020DFH 0273FH 02D83H 033A8H SLIST 0c139H 0 716 OCD1BH OD344H OD98CH ODFEFH CE669H OFA2FH OD5H O77AH 0 4BOH 01B38H 021ACH 028094 02E4AH 00H OCLP2H OC7D4H OCDDEH 5 DEOBDH 0E739H OEDC H OF461H 1 O84EH 0 582H 01 07 022796 028D3H O2F1CH OOH OC2ACH 0C893H OCEA2H OD4D3H ODB22H 18 OEE99H 0F535H OFBDEH 027 EE 0923H 01654H 01 27 02346H 0293CH 02FD5H OOK 0C367H 0C953H OCP66H ODS9BH OE25AH OEF6CH OF609F OFCADH 0353H 01094H 01725H 01DA6H 02412H O2A65H OOK 0C422E 006649 ODCBAH 0 329 OF6DDH OFD82H 0428H 01167H 017F6H 01E75H 024DEH 0282DH 0315EH COH OC4DEH ODOFOH 007208 0F113H 0F782H OFES6H 04 OBSFH 01239H 018C7H 01F43H 025A9H 92 5 03222H OOH 0 59 OCB96E 00186 ODTFTH 4 OF1E6H 0501 OC73H 0130CH 01997 02211H 02674H 032 5 OO
40. A8H BYTE Port 0 pin register input only Pl PIN EQU 1FA9H BYTE Port 1 pin register input only P2 DIR EQU 1FD2H BYTE Port 2 direction register I O dir2 equ 00D2H byte in vertical wind 3F P2 MODEEQUIFDOH BYTE Port 2 mode register I O or EPA mode2 equ OODOH byte in vertical wind P2 PIN EQU 1FD6H BYTE Port 2 pin register read input P2 REG EQU 1FD4H BYTE Port 2 register write output port2 equ 00D4H byte in vertical wind P3 PIN EQU 1FFEH BYTE Port 3 pin register read input P3 REG EQU 1 Port 3 register write output PIN EQU Port 4 pin register read input P4 REG EQU 1FFDH BYTE Port 4 register write output P5 DIR EQU 1FF3H BYTE Port 5 direction register I O DIRS EQU OOF3H byte address for window 3F P5_MODEEQUIFF1H BYTE Port 5 mode register I O or EPA Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 25 of 30 mode5 EQU 00F1H byte address in window P5 PIN EQU 1FF7H BYTE Port 5 pin register read input P5 REG EQU 1 5 Port 5 register write output P7 DIR EQU 1FD3H BYTE Port 7 direction register 1 0 dir7 EQU 00D3H byte address in window 3F P7 MODEEQUIFD1H BYTE Port 7 mode register I O or EPA mode7 EQU OOD1H byte P7_PIN EQU 1FD7H BYTE Port 7 pin register read input P7 REG EQU 1FD5H BYTE Port 7
41. ER_ARROW 72 128 define LOWER ARROW 80 128 define LEFT_ARROW 75 128 define RIGHT ARROW 77 128 define ESC 27 define HOMEKEY 71 128 define ENDKEY 79 128 define PgDn 81 128 define PgUp 73 128 define INSKEY 82 128 define BS 8 define DEL 83 128 define CR 13 define SPACE 32 define ADDRESS 1808 GRAPHICS C int opening screen void MAIN C int serial void int hextoint char GIO C int get_char void void clear_kbd void void wait_key void int get_choice const char menu_title const char menu_lines int getint int number int low int high int getfloat float number float low float high int editstring char s const char legal int maxlength int cdecl gprintf int xloc int yloc char fmt int cdecl grprintf int xloc int yloc ch int options int getlong unsigned long number unsigned long low unsigned long high Application Note 89 ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Appendix D Sine Table SINCLUDE SINES60 INC include sine table cseg from 3800H cseg at 3800h SIN dcw 5 O1AAH 027 0353 0428H D4FCH OSO1H dcw O6A6H 077AH 084EH 0923 9 ACBH OC73H dew OD46H OELAH OEEDH OFCIE 01094H 01167 01239H 0130 dcw 013 014 01582H 01653 01725 O17F6H 018C7H 01997 dcw 01 68 01 38 O1CO7H 01 07 010
42. ET FREQUENCY CLEAR RAM LB ax 60 clear ST 00 cmpb ax jne clear RET INITIALIZE REGS LBB temp 0FFH STB temp P5 MODE CLRB temp STB temp P7 MODE STB temp P7 DIR LBB temp init STB temp tO control LBB temp init STB temp tl control STB zero pwm period LB min time 4half minimum LB nom per nominal_p LB dead time f init dead LBB al all off LBB ah off ST AX WG OUTPUT add AX dead time CENTER ST AX WG CONTROL ST nom per wg compl ST nom per wg comp2 Application Note SUBROUTINES TO FOLLOW load initial frequency values implements a call to the middle of a routine that ends with a PUSHA instruction clear registers from 40h to not TMPx SFRs or stack Initialize EPA WG and all registers set P5 to sys func bus control P7 as standard I O P7 as output port up count clock external enabled TIMER 0 control and set up up count clock internal T1 enabled TIMER 1 control and set up PWM PERIOD 256 states one half the minimum high or low time nominal half pwm period deadtime for outputs WG output set up all phases high 1 1 PWM center up count wg counter enabled loading the waveform comparators for 50 duty cycle 53 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5
43. F 7 IS SET THEN ORDER IS A C B lb tmp val c swap phases B amp C to reverse lb val c val b lb val tmp update count add theta rate rate is the of theta per full pwm cycle end calc ANDBP7 CLRO STB P7 7 REG P1 0 IS SCOPE TRIGGER AND RUN SWITCH ENABLE End Time 0 verify POPA RET 64 Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 23 of 30 Seject TIMER_OVF_INT pushf clrbwsr LBB 00010000B 1 lb timer0 bak timerO djnztmr cnt not61 lbb tmr ovf 61 st zero timer0 not6l orbchange_flag setl set flag for timer change EXTERNAL INT RISING EDGE LB RESET INTO DI br RESTART Stack pointer will be cleared at RESTART DECODE ADDBmem 018 SHL HZ IN 04 SHRBTEMP1 01 ANDBTEMP1 00001111b ORB HZ RET Seject SINCLUDE SINE960 INC include sine table cseg from 3800H Snolist END defl96mc INC include file of the main code DEMOK5 INC DEFINITION OF SYMBOLIC NAMES FOR THE I O REGISTERS OF THE 87C196MC set tapbs 4 Application Note 65 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 66 Demonstration Unit Software Control Module Sheet 24 of 30 ZERO EQU 00h WORD Zero Register AD COMMANDEQUIFACH BYTE A
44. FF WG_CMP_SYNC PUBLIC WG_ALL_OFF WG_ALL_ON WG_UPR_ON WG_LWR_ON PUBLIC WG_DISABLE WG_ENABLE WG_ENA_PRO OR PTSCB address in the vertical window 7 PTSCOUNT1_WOEQU 0008 Application Note 69 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 70 Demonstration Unit Software Control Module Sheet 28 of 30 PTSCON1 WOEQU EPAREG1 WOEQU OD1h BYTE 0021 BAUDCONST1_W0 EQU 0041 WORD 5 1 EQU 1 EQU PORTMASK1 WOEQU PTSCON11 W0 EQU DATA1 WOEQU ODCh WORD SAMPTIME1 WOEQU ODEh WORD DATA1_W0_HEQU ODDh BYTE OD6h WORD OD8h WORD ODAh BYTE ODBh BYTE absolute address of PTSCB PTSCOUNT1 EQU PTSCON1 EQU 1 EQU BAUDCONST1EQU PTSVEC11FQU PORTREG1FQU PORTMASK1 EQU PTSCON11EQU 1101 BYTE 11 BYTE 2h BYTE 114h WORD h WORD h WORD 11Ah BYTE Bh BYTE DATA1 EQU 11Ch WORD SAMPTIME1 EQU 11Eh WORD RR OK CK RRR ICR IIR ORR ICI REGISTER ADDRESSES in vertical window FFK f f fff pf f f PI MASK WOEQU P2 DIR EQU 2 WOEQU P2 REG EQU P2
45. H Application Note 93
46. Inputs an integer from the user with user protection int getint int number int low int high Reads in a positive integer from low to high int i good FALSE char s 7 message 81 sprintf 5 sprintf message You must give number from to low high do if leditstring s 1234567890 6 gotoxy Xx curs y curs cprintf d number return FALSE 5 if good gt low amp amp i lt high errormsg message while good number 1 return getint Gets a long integer from the user with user protection int getlong unsigned long number unsigned long low unsigned long high Reads in a positive unsigned long integer from low to high unsigned long i good FALSE char s 7 message 81 sprintf s Su number sprintf message You must give number from to Su low high do if leditstring s 1234567890 6 gotoxy Xx curs y curs cprintf u number return FALSE Application Note 87 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 88 Table 6 Program Source Code for User Interface Sheet 16 of 17 1 if good i gt low amp amp i lt high errormsg message while good number i return TRUE getlong Gets a floating point num
47. Monitors room coil temperature through the use of thermal sensors Compares the room temperature setpoint with the monitored value and sends the frequency command to the outside unit through a serial communication line The flap motor is a stepping motor the fan motor is typically a DC brushless motor which is a type of synchronous motor with a permanent magnet Figure 8 shows a block diagram Table 1 Signal Descriptions for the 8xC196KB Inside Unit 8xC196KB m Signals Function Description of Function ACH 0 Monitor room temperature ACH 1 Monitor heat exchanger temperature AID ACH 2 Read a setpoint value Read setpoint value ACH 4 Monitor room humidity ACH 5 6 7 Not used HSO 0 through 5 Drive power transistor module of fan motor Detect induced electromagnetic voltage of fan motor to HSI 0 HSI monitor the pole position of rotor Receive remote controller data Control the DC voltage source which is supplied to the PWM fan motor to vary the motor torque Port 1 Receive setpoint conditions from power select switch Port 2 Read setpoint value Port 3 Control LED display RXD TXD Communicate with the controller of outside unit EXTINT 12 Application Note Inverter Motor Control Using the 196 Microcontroller Design Guide Figure 8 Electrical Circuit Block Diagram Of Inside Unit
48. P15 TP15 TP17 contain the phase current signal test points 24 Application Note intel 4 1 3 Figure 18 4 2 4 2 1 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Serial Port Module The module comprises an RS 232 driver MAXIM 233 and a 9 pin female connector The received or transmitted data at the serial connector enters the RS 232 driver through the R2IN and leaves through the TI OUT pin The receive data is buffered to obtain the output at the RIOUT pin while the input is buffered to produce the TIOUT transmit data In the demonstration system the output is connected to P2 1 of the 80C196MC which serves as the serial receive channel while the transmitting channel is currently not implemented The T2IN pin is connected as the input for the Ring Indicator and R2OUT is the status pin which contains the Data Carrier Detect DCD signal These two signals are also not implemented on the current demo 9 Pin Female Connector Pin Name Description 1 CD Carrier Detect 2 RXD Receive Data 3 TXD Transmit Data 4 DTR Data Terminal Ready 5 GND System Ground 6 DSR Data Set Ready 7 RTS Request to Send 8 CTS Clear to Send 9 RI Ring Indicator Software Description The software portion of the Inverter Motor Control Demonstration System consists of two parts the operation code for the 8 196 written in assembly language Appendix B and a program cre
49. PIN EQU T1 CONTROL WO CON EQU OC4h byte 1 TIME WO EQUOC6h byte RSEG at 1cH AX OFCh byte OD2h byte ODOh byte 0041 byte OD6h byte 7 7 WSR WSR WSR WSR WSR EQU OFCh byte dsw WSR WSR WSR 3Dh 3Dh 3Dh Temp registers used in conformance Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 29 of 30 DX dsw 1 with PLM 96 tm conventions BX dsw 1 CX dsw d tmp DSL 1 tmpl DSL 1 tmp2 DSL 1 AL EQU AX BYTE AH EQU AX 1 BYTE BL EQU BX BYTE IS RESERVED WORD EQU BYTE CH EQU CX 1 BYTE DL EQU DX BYTE DH EQU DX 1 BYTE tmph equ Ltmp 2 word tmplh equ tmpl 2 word tmp2h equ tmp2 2 word publicax bx cx dx al ah bl cl ch dl dh CSEG at 2000H INTERRUPT AND CCB LOCATIONS dcw timer ovf int 0 dcw atod done int 1 capcompO int 2 0 int 3 dcw capcompl int 4 dcw comparel int 5 dcw capcomp2 int 6 dcw compare2 int 7 200Eh cseg at 2010H REMOVE THIS SECTION FOR RISM dcw sw_trap remove for rism cseg at 2012H dcw unimp_opcode cseg at 2014h dcw OffffH Application Note 71 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 72 Demonstration
50. PSW INT MASK INT MASK1 WSR PUSH TEMP1 CLRBWSR LBB WSR 3Dh map 64 bytes to 1F40h 1F7Fh JBS CON W0O 4 RXD SETUP edge or end of PTS interrupt LBB 1 CON WO 00H disable capture compare2 CLRBWSR ANDBINT 0EFh clear false pending interrupt LBB WSR 24 map 64 bytes to 0100h 013Fh JBS PTSCON11 W0 1 RXD ERROR framing error JBS PTSCON11 W0 6 RXD ERROR parity error STB DATA1 WO H CLRBWSR ADD VALID 01h STB TEMP1 RECEIVE VALID save received data DJNZW R COUNT CAPCOMP1_SKIP decrement data count amp check for end LBB RXDDONE 01h set done flag SJMPCAPCOMP1 RET finish data receive SETUP LBB WSR 3Fh map 64 bytes to 1FCOh 1FFFh JBS P2 PIN 0 1 1 RET detect false start bit LBB WSR 300 map 64 bytes to 1F40h 1F7Fh LBB CAPCOMP1 CON WO 0 compare interrupt only ADD 1 TIME 0 120 Set first PTS cycle 1 5 BAUDCONST CLRBWSR ORB PTS SELECT 101 enable PTS on CAPCOMP2 5 1 RET ERROR LBB RXDDONE 03h set error code Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 19 of 30 5 1 RET exit 1 SKIP LBB WSR 246 LBB PTSCOUNT1_WO 09h of bits inclusing parity amp stop LBB PTSCON11 0 60h enable o
51. Schematic is available in Appendix A Schematics Sheet 1 shows the schematic for the AC to DC conversion portion of the inverter circuitry The AC provides high voltage approximately 340 at TP26 J1 can be used to enable a voltage doubler circuit low voltage regulator circuit provides 15 supply voltage at TP4 The logic devices this board operate at 15 for improved noise immunity Ratings and notes for the power board are listed on Sheet 3 of the schematics On sheet 2 U5 and U6 form the protection circuitry The compliment of RUNNING enables the three phase driver logic The enable signal from the demo board RUN 0 turns on the US flip flops which results in CPUREQ 0 and RUNNING When RUN goes to a 1 RUNNING goes to a 0 and CPUREQ goes to a 1 Also when the total phase current goes too high it turns off the RUNNING flip flop while leaving CPUREQ 0 The CPUREQ signal is helpful for debug as it shows whether an over current error or a CPU request turned the motor off ISENSE is an analog output showing the sum of the current through the lower transistors Sheets 3 to 5 contain the phase driver electronics Since these sheets are similar we will only discuss Sheet 3 The high and low phase enable signals go to U1 and continues to the high and low drivers Q1 and Q4 Q1 supplies the high voltage drive available on TP25 Q4 supplies the common low drive at TP24 The buffered phase current appears at T
52. T ezar vonni 2 2011 wn run we Sw sia VOSNOLdOXI Ye zo AC Drives Technology Schematic 4 6 Figure 25 Application Note 9 jo 5 8661 22 3OVHH3INIHOIOW ASSVOd A9O IONHO3LS3AIHQ OV Application Note DH ord lt sur L K 7 TOIT oly 27 ved Suv VOSNOLdOXI mo sza dnro arestag T x i m 14 AST ZJ ton as 2 ZJ SA NH r dnivo 9 298 c 75 i m g oun 5 4 T A baada AST v 001 m anyo XH 2011 4 su LAUR 4 ma rine V0SN01d9XI Yet 0 AC Drives Technology Schematic 5 6 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 26 40 ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 27 Drives Technology Schematic 6 6
53. The time interval between the cycle establishes the baud rate To receive 7 data bits with parity a total of nine PTS cycles and two conventional interrupts occur During the conventional interrupt the CON register is read to determine if it is the initial final end of PTS interrupt This could be achieved by determining when the software is in the capture or compare mode Thus when the capture mode is active indicating that this is the initial start bit interrupt the CapCompl module is switched to the compare mode and CAPCOMPI TIME is loaded with the time to sample the first data bit 1 5 bit times The PTS is enabled and the routine returns to a loop waiting for the rest of the data bits to be received Else if the compare mode is selected indicating a final end of PTS interrupt checking for parity and framing error is done and DATA1 WO which contains the incoming data is stored in the RECEIVE buffer Then the module is re initialized and EPA COM is set to the capture falling edge mode thus readying P2 1 to wait for the next start bit A total of 4 bytes are received Application Note 27 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel A 4 3 Figure 19 28 Inverter Air Conditioner Demonstration Unit Software Control Module Figure 19 provides an overview of the complete software control module Appendix B provides the program source code for
54. U01010000B EPA TO SETEQU01100000B EPA TO TGLEQU01110000B TO FALLEQU00010000B8 EPA TO RISEEQU00100000B EPA TO 0000110000 EPA Tl SWTEQU11000000B Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 27 of 30 EPA Tl CLREQU11010000B EPA Tl SETEQU11100000B Tl TGLEQU11110000B EPA T1 FALLEQU10010000B EPA T1 RISEEQU10100000B EPA ANYEQU10110000B PUBLIC EPA REP EPA TO SWT EPA TO CLR EPA TO SET PUBLIC EPA TO TGL EPA TO FALL EPA TO RISE 0 ANY PUBLIC SWT EPA CLR EPA SET EPA T1 TGL PUBLIC EPA FALL EPA RISE EPA ANY WG OPERATIONS ASSUME ACTIVE HIGH SIGNALS FOR HIGH BYTE OF WG OUTPUT WG CMP ONEQU11011111B turn wg based pwm on WG CMP OFFEQU11011000B std pwm still on WG SYNCEQU11111111B PWM OFFEQU11100111B AND with above to turn std pwms off FOLLOW BYTE OF WG OUTPUT WG ALL OFFEQU00000000B ALL 000111111 WG UPR ONEQU00101010B upper wgl wg2 wg3 on WG_LWR_ONEQU00010101B lower wgl wg2 wg3 on FOR WG PROTECT WG_DISABLEEQU00000100B WG_ENABLEEQU00000111B enable without protection WG_ENA_PROEQU00000101B enable with rising edge protection 77 FOR WG CONTROL dead time must be added WG_CENTEREQU 00000100B 100H set high byte for center match only PUBLIC WG_CMP_ON WG_CMP_O
55. agnetic valve Port3 and similar functions Port4 Control stepping motor of capillary valve RXD TXD Communicate with the controller of outside unit Application Note In Figure 9 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Electric Circuit Block Diagram Of Outside Unit 4 PHASE STEPPING MOTOR FOR MCS 96 CAPILLARY VALVE 87 196 CONTROL Fan Speed U phase ets Ports Control Valve Electromagnetic Valve V phase WG2 WG2 N W phase WG3 3 PHASE WG3 AC INDUCTOR supply RXD PHOTO COUPLER Power Driver EXTINT Inside Unit PORT 4 SENSORS High exchanger Temp outside Temp Compressor Temp Analog Channel DRIVER Circuitry 10f3 Application Note 15 Inverter Motor Control Using the 8 196 Microcontroller Design Guide 3 3 Figure 10 Dead Time intel Dead time is defined as the time in which both transistors of the upper arm and lower arm turn off as show in Figure 10 The dead time is implemented to protect the power transistor module from through current when both transistors of a phase are turned on Because there is no hardware limit on minimum PWM pulse width it is also possible to deassert one of the WFG outputs for the entire PWM period if the total dead time is longer than the pulse width For this reason there should be a software limit ch
56. ale Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Initial values P2D_INIT P2M_INIT TO_INIT T1_INIT Seject rseg at 30h EXTRN HEX_NUM RSEG at 40H RECEIVE R_COUNT 1 TEMP2 TEMP3 Application Note equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ equ DSB DSW DSW DSW DSW DSW DSW 9 8 15d8h 400n 2000H 550 10510 600 12500 200 30 0 50 808 6767 2 000001005 111110115 110010005 110000015 Demonstration Unit Software Control Module Sheet 3 of 30 initial min high or low time for half period initial dead time initial volts hz const 3FFFh max minimum volts hz ratio 3fffh max minimum frequency 100 abs min 2 55 maximum frequency 100 abs max 163 83 initial frequency in Hz TESTING initial frequency in Hz 8 0 MS max delta between freq when slowing of Hz 100 for each inc dec count of inc dec counts before speeding up rate of Hz 100 for each inc dec count LINE of inc dec counts before speeding up rate of Hz 100 for each inc dec count Scale 167117 hz x100 dec at PWM 1 0ffh Scale OFF0000 volts hz at PWM 2 0ffh pwm scale counts 256 6 counts rev 10 240rpm 1024 counts sec 400h now every 2 seconds P2 2 input others output all pins except 2 2 special function external u d
57. ated using Borland to handle the user interface at the host The Borland program can establish a serial link with the control board which enables the user to communicate with the microcontroller Please refer to Appendix C for the source code Serial Communication Module This serial communication module sets up a software serial data transmission and reception on the 8xC196MC microcontroller A software approach had to be used since the microcontroller does not have a hardware serial port This is achieved by utilizing the Peripheral Transaction Server s Serial Input Output PTS SIO mode together with an EPA channel In the programs created Port 2 1 EPA Capture Compare Channel 1 EPA CapCompl is set up as the receiving channel while Port 2 6 EPA Compare Only Channel 2 EPA Compare 2 is used as the transmitting channel The protocol for this asynchronous data communication is 7 data bits 1 start bit 1 parity bit and 1 stop bit at a baud rate of 9600 bit s Odd parity is used Application Note 25 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel 4 2 2 Equation 1 Example 1 26 Asynchronous Serial Data Transmission The EPA Compare 2 channel is set up to generate the time base for outputting the serial data thus determining the baud rate Transmission is started by clearing the output pin which generates the start bit 0 The EPA Compare 2 module is loaded with the time
58. ation Note ntel Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide A control valve is used to switch the air conditioner from cooling mode to heating mode The operation of the control valve is shown in Figure 4 typical system with a control valve 15 shown in Figure 5 Figure 4 Air Conditioner s Operation in Cooling Heating Mode INSIDE OUTSIDE INSIDE OUTSIDE yt w a Wind Wind T 520 CN Condenser Compressor a COOLING MODE b HEATING MODE Control Valve Evaporator Condenser Figure 5 Typical Air Conditioner Outside Heat Control Exch xchanger Valve Si Fan Inside AN SS c Capillary Valve Compressor Fan Application Note 9 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel 2 3 Figure 6 10 Inverter Controlled Air Conditioner Figure 6 shows a simple block diagram of an inverter air conditioner An inverter is used to control the speed of the AC compressor motor by varying the supply frequency The higher the frequency the faster the compressor rotates and the more the air conditioner warms or cools the air To control the supply frequency a microcontroller is required to produce the thre
59. ber from the user with protection int getfloat float number float low float high Reads in a floating point value from low to high int good FALSE char s 41 message 81 float f sprintf s f number sprintf message You must give number from f to f low high do if leditstring s eE 1234567890 40 gotoxy x curs y curs cprintf f number return FALSE s if good f gt low 1 e 6 amp amp lt hightl e 6 errormsg message while good number f return getfloat 777771777777777777777777777777777777777777777 MYHEAD1 H 777771777777777777777777777777777777777777777 define BLACK BACKGR 0x00 define BLUE BACKGR 0x10 define NORM WHITE FOREGR 0x07 define INT WHITE FOREGR 0 define INT YELLOW FOREGR 0 0 define NORMAL ATTR BLACK BACKGR NORM WHITE FOREGR define INTENSIVE ATTR BLUE BACKGR INT WHITE FOREGR define TITLE ATTR BLACK BACKGR INT YELLOW FOREGR Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 17 of 17 define TRUE 1 define FALSE 0 define AXIS_COLOR LIGHTCYAN define TICK_COLOR CYAN define LIMIT_COLOR WHITE define XSPACE 39 define GRAPHMODE 1 define TXTMODE 0 define XTICKS 20 define YTICKS 3 define PLOTCOLOR 0 define DESC_COLOR RED define UPP
60. bit 1 1 clock internal u d bit 1 2 clock 5us 30h to 40h reserved for rism 45 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n Table 5 46 Demonstration Unit Software Control Module Sheet 4 of 30 hz in VALID RXDDONE TIMES SIGN mem process pwm nxt rate nxt temp dead time nom per Volts hz HZ x100 hz out min nxt HZ sine per percent volts rate half pwm num per min time percent pwr pwm per min pwm max pwm val a val b val c theta loop time offset indx ptr timer0 bak int time t2 last ref time Ane Count DSW DSW DSB DSB DSB DSB DSB ds1 ds1 ds1 dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw dsw low wd period of single sided PWM low wd of theta counts pwm_per dead time between xistor turn on nominal period for single sided PWM Volts per hertz value 100 times freq in Hz restricted hertz value Min next HZ prevent over regeneration 1 6 period of sine wave in usec volts hz duty cycle multiplier of theta counts per pwm_per half of the actual single PWM period number of PWM periods per 60 120 degrees minimum on off time of single PWM generates min_pwm and max_pwm Includes PWM_per V Hz power factor etc low wd period of sin
61. cimal digit The decoded value is stored in the HZ IN register The serial receive mode is re initialized to wait for the next data byte When four data bytes are verified and decoded successfully the value of HZ IN is transferred in the HZ register The value in this register is the software frequency input from the host PC Again if the enable switch is off the program restarts and all registers are cleared The CHANGE FLAG 1 indicates whether there is a timer overflow IDLE TIME LOOP waits for the timer overflow and fetches any new request after eight timer overflows Every second 61 timer overflows occur causing execution of the rest of the idle time loop The GET NEW REQUEST subroutines execute every eight timer overflows to fetch any new request This subroutine first checks for a software input then checks the panel switches for a hardware input Input from either of these sources causes the program to increment or decrement a corresponding variable Values must be within the maximum and minimum limits Note that the software input has a priority higher than the hardware input in this demonstration unit After servicing the serial input and switches the VALUE CHANGE portion of the GET NEW REQUEST subroutine starts the system with the initial parameter constants After the next Compare interrupt nothing changes until the operator activates either the increase or decrease push button while the enable switch is on The wave generator compar
62. d enable 1 disable 0 signal for the display These lines have pull up resistors and appear on plug Port 5 signals control the external bus and appear on plug P1 The demo unit does not use the external bus Port 6 contains signals corresponding to Waveform Generator WG and PWM logic The WG signals control three phase voltages to the AC motor and appear on P10 after U6 buffers them The PWM signals appear on P9 and go to the panel meters indicating frequency and volts Hz One last block of logic involves U7 This wired or circuit can shut off the motor by deasserting There are two sources When the WG turns on both outputs of a complementary output pair at the same time The RESTART button is pressed The fact that there is so little circuitry on the 80C196MC demo board demonstrates how well integrated the 80C196MC is The only external circuits needed are U6 buffers and U7 interlock Application Note 23 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel A 4 1 2 Motor Control Power Board Figure 17 Motor Control Power Board CONVERTER INVERTER AC POWER RECTIFIER COMPRESSOR SUPPLY MOTOR my 120 60 Hz POWER BOARD COMPLEMENTARY PWM OUTPUT WAVEFORM GENERATOR 80C196MC The Motor Interface
63. dd parity CLR DATA1 0 clear recive data buffer LBB WSR 3Dh map 64 bytes to 1400 1 4 LBB 1 CON WO 901 capture negative edge CLRBWSR 1 RET POP TEMP1 POPA load PSW INT_MASK INT_MASK1 WSR RET EPA_ERROR CALLERROR GO TO THE FATAL ERROR ROUTINE skip 00 skip 00 EPA ERRORI CALLERROR GO TO THE FATAL ERROR ROUTINE compare0 int PUSHA CLRBWSR LBB INT 5 00010000 CAPCOMP1 CLR5 STB P7 BAK P7 REG START TIMING SIGNAL 5 lb tmpl timerl sub tmpl int time ensure interrupt time is tmp1 200 less than 200 counts behind timerl jgt EPA add int time loop time set up for next loop lbb BX Tl SWT OR EPA REP stb BX compare0 con St int time compare0 time st val a wg compl St val b wg comp2 St val wg comp3 Application Note 61 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 62 Demonstration Unit Software Control Module Sheet 20 of 30 ALIGN_THETA Align theta at 360 degree intervals cmp 960 16 comp theta to counts 360 degrees jnh CALC VALUES imp if theta full sinewave cycle sub theta 960 16 reset theta ORB 7 5 STB P7 P7 REG 1 0 IS SCOPE TRIGGER AND RUN SWITCH ENABLE Start timing signal 0 35 usec jbc change flag 0 CALC VALUES Update freq if change flag 0 1 andbchange f
64. e functions return cnt Return the conversion count void setcursor int startline int endline Sets the shape of the cursor union REGS reg reg h ah 1 reg x cx startline lt lt 8 endline int86 0X10 amp reg amp reg setcursor void changecursor int insmode Changes the cursor shape based on the current insert mode if insmode setcursor 4 7 else setcursor 6 7 changecursor void errormsg const char message gotoxy 1 24 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 13 of 17 textattr INTENSIVE ATTR cputs message textattr NORMAL ATTR wait key gotoxy 1 24 clreol gotoxy x curs y curs Allows the user to edit a string with only certain characters allowed Returns TRUE if ESC was not pressed FALSE is ESC was pressed int editstring char 5 const char legal int maxlength int c len 1 pos 0 insert FALSE int edit keys 9 HOMEKEY ENDKEY INSKEY LEFT ARROW RIGHT ARROW BS DEL ESC CR int first_char TRUE struct text_info r int i gettextinfo amp r X 5 r curx y curs r cury clreol do gotoxy x Curs y curs clreol cprintf s gotoxy x curs switch c get char
65. e Sheet 26 of 30 PUBLIC ZERO AD COMMAND AD RESULT LO AD RESULT HI AD TIME PUBLIC CON 1 CON CAPCOMP2 CON CAPCOMP3 CON PUBLIC TIME TIME CAPCOMP2 TIME CAPCOMP3 TIME PUBLIC CON 1 CON COMPARE2 CON PUBLIC TIME 1 TIME 2 TIME PUBLIC INT INT PEND INT INT PEND1 IMASK1 IPEND1 PUBLIC CONTROL T1 CONTROL RELOAD PIN PIN PUBLIC P2 DIR dir2 P2 MODE mode2 P2 PIN P2 REG port2 P3 PIN REG PUBLIC PIN REG P5 DIR dir5 P5 MODE mode5 P5 PIN P5 REG PUBLIC P7 DIR dir7 P7 MODE mode7 P7 PIN P7 REG 7 PUBLIC PTS SELECT PTS SERVICE PWMO DUTY PWM1 DUTY PWM PERIOD PUBLIC SP TIMERO TIMER1 WATCHDOG WG 2 COMP3 WG CON PUBLIC WG CONTROL WG COUNTER WG OUT WG OUTPUT WG PROTECT WG RELOAD WSR SETO EQU 00000001b SET1 EQU 00000010b SET2 EQU 00000100b SET3 EQU 00001000b SET4 EQU 00010000b SETS EQU 00100000b SET6 EQU 01000000b SET7 EQU 10000000b CLRO EQU Ob CLR1 EQU 01b CLR2 EQU 011b CLR3 EQU 0 b CLR4 EQU 0 b CLR5 EQU 0 b CLR6 EQU 10 b CLR7 EQU 0 b PUBLIC SETO SET1 SET2 SET3 SET4 SET5 SET6 SET7 PUBLIC CLRO CLR1 CLR2 CLR3 CLR4 CLR5 CLR6 CLR7 EPA 0000000100 EPA TO SWTEQUO1000000B EPA TO CLREQ
66. e least significant bits 960 5 12 16 add indx indx indx is table pointer get a mul tmp percent pwr sin indx percent pwr from volts hz etc lo test a tmp 2 min jgt hi test a lb tmp 2 min br a done hi test a max pwm tmp 2 jgt a done lb tmp 2 max a done addval a half tmp 2 center waveform on half PWM period get b add indx 2 tab_length 3 2 3 table length cmp indx tab_length jnh b ok sub indx tab_length b ok mul tmp percent pwr sin indx percent pwr from volts hz etc lo test b tmp 2 min jgt hi test b lb tmp 2 min br done hi test b max tmp 2 jgt done Application Note 63 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n Table 5 Demonstration Unit Software Control Module Sheet 22 of 30 lb tmp 2 max_pwm b done addval b half pwm tmp 2 center waveform on half period eject get c addindx 2 tab length 3 2 3 table length in bytes indx length jnh ok sub indx T tab length C ok multmp percent pwr sin indx percent pwr from volts hz etc lo test c cmp tmp 2 min pwm jgt hi test c lb tmp 2 min br c done hi test c max pwm tmp 2 jgt c done lb tmp 2 max pwm C done addval half pwm tmp 2 center waveform on half period direction reverse 7 update count I
67. e phase complementary PWM signals required for the transistor switching These waveforms must be generated using the sinusoidal PWM technique with three reference sinusoidal waveforms each 120 apart in phase as shown in Figure 2 Inverter Controlled Air Conditioner 3 Phase AC Induction Motor Power Relay Converter Inverter AC Single Compressor Phase P LE Motor U V DRVER U Complementary PWM Output Driver sxcigsMc Serial Interface INDOOR UNIT OUTDOOR UNIT When the room requires only a small amount of heating or cooling the inverter enables the air conditioning unit to operate at a lower level with the compressor rotating at a slower speed The compressor revolutions can be increased as the inside temperature rises This cost effective measure consumes the minimum power level required to maintain the desired temperature Application Note intel 2 4 Figure 7 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Compressor Motor AC Induction Speed Control In the inverter air conditioner control scheme the voltage frequency ratio is typically held constant As previously described the speed of an AC motor is proportional to the supply f
68. e registers changes only at the beginning of the compare interrupt service routine COMPAREO INT After processing all the parameters checking all possible error conditions and processing the serial and push button requests the software updates the three wave generator compare registers Application Note 31 Inverter Motor Control Using the 8 196 Microcontroller Design Guide 5 0 Related Documents Document Title Order Number 8xC196MC 8xC196MD 8xC196MH Microcontroller User s Manual 272181 AP 483 Application Examples Using the 8xC196MC MD Microcontroller 272282 32 Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Appendix Schematics The following pages contain schematics for the Motor Control Demonstration Board discussed in this application note Application Note 33 jo L jeeus 8661 Aepuow 5400 0 5558 vv F 7IOHINOO HOLOW eni ano ano t i 3nio anzz I 82 so so 42
69. eck preventing the pulse width from being less than 3x the dead time U Channel Motor Driver Block Diagram U Phase 0v Torr 5 U Phase I La U N 4 dead time 10 us Application Note ntel Inverter Motor Control Using the 196 Microcontroller Design Guide 3 4 Protection Circuitry The protection circuitry allows all WFG outputs to be simultaneously deasserted under software control or in response to an external event This same external event also generates the EXTINT interrupt allowing software to stage a graceful recovery from an external error condition Figure 11 Protection Circuitry ES IT EXTINT Interrupt Request EO BT Register Transition Detector EXTINT OD Sampler CPU Write EO V CPU Read EO CPU Bus 4758 01 Application Note 17 Inverter Motor Control Using the 8 196 Microcontroller Design Guide ntel A 4 0 Figure 12 18 Project Overview The previous sections provided an overview of how to use MCS 96 controllers to create an inverter controlled air conditioning system This section describes a demonstration unit that provides a working example which uses the peripherals in the 8 196 microcontroller to handle inverter motor control in an air conditioning system The main purpose of the Inve
70. ed on the nominal period then calula e h exact period based on the number of periods This setup assumes the PWM carrier frequency is 4 times the update frequency LB temp sine per sine per 2 usec per 60 degrees CLR temp 2 temp 32k divutemp nom per ot hal f pwm periods in 60 degrees full pwm periods in 120 degrees or temp 1 ensure odd of full pwm cycles add num per temp temp calc num of half pwm cycles 120 deg LB pwm nxt sine per CLR nxt 2 calculate period for half pwm cycle divupwm nxt num per lb rate nxt f theta 60 ext rate nxt rate 1 2 of theta counts per divurate nxt num per single pwm cycle orb change flag set0 set flag to cause freq change ORB P7_BAK SET6 STB P7_BAK P7_REG End Time 6 update the PWM PERIOD line LB hex num pwm_nxt next was 1 2 the single SHR HEX 1 cycle callline 1 update the SIN PERIOD line mulutemp hz out 46553 65535 10 lb hex num temp 2 LB FREQ OUT HEX NUM callline 3 Application Note 59 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 60 Demonstration Unit Software Control Module Sheet 18 of 30 update the POWER line mulutemp percent_volts 200 200 8000H 0ffffh 100 lb hex num temp 2 LB POWER OUT HEX NUM callline 2 no change RET eject cseg at 2700H w w k kkk and WG 1 INT PUSHA save
71. es to ensure accurate communication The protocol used is 7 data bit 1 stop bit and 1 odd parity bit at a baud rate of 9600 bit s Project file AIRCON PRJ contains of 3 modules MAIN C GIO C and GRAPHICS C Header file FRR AR A kk kk ke kk Ck Kk Ck kk kk Kk Ck Kk Ck kk kk kk Ck Kk Ck kk ko ke kk Ck ko kk IR kk ke ke ke ke ke ke 7777777777777777777777777777777777777777777777777777777777777777777777777777 7777777777777777777777777777777777777777777 include lt stdio h gt include lt conio h gt include lt math h gt include lt graphics h gt include lt stdlib h gt include lt bios h gt include lt dos h gt include myheadl h define MAX 60 define COM 1 For Com 1 set COM 0 define DATA_READY 0x100 define TRUE 1 define FALSE 0 define SETTINGS COM 9600 COM CHR7 COM STOP1 ODDPARITY 9600 bit s baud rate 7 data bits 1 stop bit 1 odd parity bit global variables their names are self explanatory int quit int source Application Note 73 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 74 Table6 C Program Source Code for User Interface Sheet 2 of 17 unsigned in out status store 6 int main local vairables int i digit int hz 600 char hex 5 char dig 1 opening screen opening page restorecrtmode
72. gle sided PWM minimum off time usec of single_pwm maximum on time usec of single PWM usec on time for PWM used in HSO routine angle 120 256 theta 360 degrees time of last interrupt Base value of timer to avoid latency problems Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 5 of 30 POWER OUT dsw 1 RPM OUT dsw 1 FREQ OUT dsw 1 Tmr ovf cnt dsb 1 7_ dsb 1 Image of port 7 reg reverse dsb 1 Reverse 7 motor direction 0 fwd l reverse change flag dsb 1 O change once 7 change always l timer ovf Seject CSEG AT 2080H EXTRN LCD_INIT LINE_1 LINE_2 LINE_3 LINE_4 BEGIN LB SP 0f8h LBB P7_BAK STB P7 BAK P7 REG Disable HV drivers LBB AH WG_CMP_OFF LBB AL WG_ALL_OFF ST AX WG_OUTPUT CALL CLEAR_RAM CALL LCD_INIT RESTART DI LBB P7_BAK STB P7 BAK P7 REG Disable HV drivers LBB AH OFF DRIVE ALL OUPUTS TO ZERO OFF LBB AL ALL OFF ST AX WG OUTPUT LB SP 0 8h RESET STACK 7 Clear interrupt mask register Application Note 47 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n A Table 5 Demonstration Unit Software Control Module Sheet 6 of 30 CLR RECEIVE CLR RECEIVE 2 CLR RECEIVE 4 CLRB INT_MASK reset interrupt mask register CLRB INT_MASK1 LBB WSR map 64 bytes to
73. he next external request Application Note In 4 4 tel Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Detailed Description of the Software Listing Appendix B contains the complete source listing of the Inverter Motor Control Demonstration Unit Software module The DEF196MC INC defines the 80C196MC Input Output and Special Function registers It also declares some items as public for the use of other modules and defines all interrupt and PTS vector locations The PTS control block and its corresponding windowed locations are defined here too The following are the few associated concepts in the main program code Memory location 40h through 58h contains the variables used for the serial reception and decoding of the data from the host PC The RECEIVE array contains the data in bytes that is successfully received without parity or framing array Variable R COUNT controls the number of bytes received in one cycle and HZ contains the decoded frequency x 100 input Asine lookup table contains 960 word entries THETA 360 is the number of sample times in 360 degrees and THETA 60 is the number of sample times in 60 degrees The motor control parameters have limits and the program has many min xxxx and max constants The constants half xxxx corresponds to half cycles The program defines a a variable named VOLTZ HZ along with its associated max min constants As the frequency of the motor increa
74. ial delay 0100 serial delay 0100 restorecrtmode restore text mode clrscr return 0 ROR KKK KK KKK KK IKK A KR kk kk Kk Ck Kk Ck kk Ck kk hextoint Converts the hexadecimal values to decimal values k k k k k k k k k int hextoint char dig int value if dig 0 value 5 1 1 919 value 11 II 1 1 919 value 12 II p else if dig 0 value 13 else if dig 0 value 14 Hh else if dig 0 value 15 else value atoi dig return value ROK KKK KK KKK KK KK k Kk k k A k RI KR kk AR k k k IR IR k k k k k k k k k k k k k k k k k k k k Serially transmit a byte of data XXX KNX XNXX Kk Ck CK Ck IR AR IR kk Ck ko Kk Ck kk XNXX XXX KNX XNXX XXX int aerial 1 bios serialcom COM SEND COM in Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 6 Program Source Code for User Interface Sheet 7 of 17 return 0 GRAPHICS C 77777777777777777777777777777777777777777777 include lt graphics h gt include lt stdlib h gt include lt stdio h gt include lt conio h gt include lt dos h gt include myheadl h D
75. ive interrupts The motor power board and the interrupts are enabled and the motor enters the IDLE TIME LOOP software Application Note tel Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide At the IDLE TIME LOOP RXDDONE is checked to see if any data has been received Each byte of data is sent three times from the host PC to ensure precise communication A variable TIMES is used to indicate the number of times a particular byte is received Upon receiving three bytes of data the program enters a validation process First it will determine the number of valid data bytes that have been received A data byte 15 valid if there is no framing or parity error This check is done at the EPA CapCompl module used for the serial I O as part of its interrupt service routine The implementation of the EPA CapCompl module for the asynchronous serial data reception is discussed in detail in Section 4 2 3 If there are two or three valid data bytes they are compared with one another to determine if they are the same If there is a match between two received data bytes then that data byte is used If they do not match the error routine is called to indicate a serial communication error When there is only one valid data byte then this byte would be used The error routine is also called if there are no valid data bytes Upon obtaining the correct data byte a decode routine is called to convert the received ASCII byte into a hexade
76. lag 1 0 SET FREQUENCY ANDB P7_BAK SET NEW FREQUENCY CLR7 STB P7_BAK P7_REG Timing signal 7 22 usec lb theta rate nxt Start with theta 1 2 rate add rate rate_nxt rate_nxt and rate 0 syncronized values only lb half pwm sub max pwm sub min pwm addpwm per pwm nxt output value of half pwm 0 volts half pwm min time set PWM max rain limits at pwm per time half pwm half pwm pwm per actual pwm ST PER WG reload full cycle period add loop time pwm per pwm per FOR CENTERED PWM Fills MAY NEED TO BE DOUBLED mulutmp pwm per percent volts add percent pwr 2 tmp 2 percent pwr pwm per if percent volts 8000h jbc percent pwr 1 7 FREQ OK Error if percent pwr gt 8000h FREQ ERROR CALL ERROR FREQ OK ORB P7 BAK percent pwr must be less than 07fffh 5 7 STB P7_BAK P7_REG End time 7 eject Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 21 of 30 CALC VALUES Val a Val b Val c are the on t ime i n usec per Single PWM cycle for each phase LBB bbs BX 6 restart Restart anytime switch is turned of ORB P7 SET5 STB P7 BAK P7 REG END TIME SIGNAL 5 calc lb indx theta shr indx 4 remov
77. min hertz br value change software CLRB sign cmp HZ min_hertz 56 Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 15 of 30 jlt min cmp HZ max_hertz jgt max_h lbb process 01h br adjust min_h lb HZ min_hertz lbb process 01h br adjust max_h lb HZ max_hertz lbb process 01h adjust CMPHZ_x100 HZ BGT big BLT small CLRBprocess br value change big SUB HZ x100 4200 CMP HZ x100 HZ BLT big done br value change big done LB HZ x100 HZ CLRBprocess br value change small ADDHZ x100 4200 CMP HZ x100 HZ BGT small done br value change small done LB HZ x100 HZ CLRBprocess Value change ANDBP7 CLR6 STB P7 BAK P7 REG Start Timing signal 6 15 usec fisrt half mulutemp hz x100 4hertz scale 167117 scale hz x100 100 cmpbtemp 3 zero je ok lbb temp 2 0ffh mh_ok mulutmp2 volts_hz volts_scale Off0000h scale volts hz cmpbtmp2 3 zero je ok lbb tmp2 2 0ffh ok STBTEMP 2 pwm0 DUTY PWMO Offh at 163 83Hz Hz_x100 16383 Application Note 57 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 58 Demonstration Unit Software Control Module Sheet 16 of 30 STB TMP2 2 pwml_DUTY PWM1 Offh if volts hz 2000H br out hz eject get done set hz cmphz x100 hz out be no change bh hz out hz cmphz out min nx
78. n a compressor starts Increased comfort range decreased noise In an inverter controlled air conditioning system the temperature variation in the room and compressor noise are reduced compared to a non inverter system This is because the inverter air conditioner drives continuously even when the compressor has a light load Application Note 5 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel A 2 1 Figure 1 What is an Inverter An inverter converts DC power to AC power at a desired output voltage or current and frequency The two general types are voltage fed inverters and current fed inverters The former has essentially a constant DC input voltage independent of load current drawn the latter has a constant supply current In a typical inverter application e A converter converts a single phase AC with a fixed frequency to a DC voltage output The inverter converts the DC to The control circuits on the converter inverter combination allow this circuit to produce variable frequency AC which can drive an induction motor at varying speeds e Slow starting speed reduces strain on mechanical system and reduces starting current The basic structure of an inverter is shown in Figure 1 Basic Structure of an Inverter AC DC DC AC CONVERSION CONVERSION ACSINGLE rbe E eed PHASE Converter Smoothi
79. new numbers duly cycles ptr 1 ptr 6000H ptr ok CMPB mem 048 mem ok CLRB mem LB HZ HZ IN ORB sign 018 mem ok BBC change flag l idle time loop wait unless timer just overflowed ANDB change flag 1 1 Application Note 51 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide I n Table 5 52 Demonstration Unit Software Control Module Sheet 10 of 30 ANDB JNE CALL temp mr_ovf_cnt compare_timer GET_NEW_REQUEST COMPARF_TIMER CMPB JE BNE one_second MULU LB LB 11 mulu CMPB JE LBB pwm_ok LBB STB ST CLR BR tmr ovf cnt one second idle time loop TEMP timerO0 bak RPM OUT hex num line 4 temp timer0 bak TEMP 3 ZERO pwm ok temp 2 AL AL TEMP 2 timer0 bak idle time loop 111B 61 40959 2 RPM OUT scale 0ffh 11011000B COMPARE1_CON COMPARE1_TIME 7 7 check buttons every 8 counts approx 1 8 second 61 overflows 1 00 seconds 65535 60 48counts 2 update the frequency line on the LCD check for no overflow load instead of overflow TIMER1 RESET PIN Application Note intel Table 5 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Demonstration Unit Software Control Module Sheet 11 of 30 GET VALUES CALL VALUE CHANGE CALL SET FREQ with pusha RET SET FREQ with pushA PUSHA BR S
80. ng Inverter Circuit Circuit Circuit Control Circuit 60 Hz nance a S amp T2 ON L AC with fixed frequency with variable frequency T amp T2 OFF T3 amp T4 ON Application Note ntel Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Varying the switching time controls the frequency of the AC output from the inverter The switching time can be controlled using a sinusoidal pulse width modulated PWM signal as illustrated in Figure 2 Figure 2 Sinusoidal Waveform Generation Example Frequency Modulating Waveform 8XC196MC MD Driver f Circuitry n i Vsupply 3 Phase hu Hh wGis 222 AC Induction tt U Phase Motor JH 4 __ V WG2 WG2 Q1 N k U WG2 V Phase T LT T 120 A jd 120 phase WG3 WG2 92 V W Phase V V V h oth WG34 44 I LA i 120 Vsupply V Bi DC V w 144 3 phase PWM inverter
81. o board which interfaces to various subsystems through ribbon cable compatible dual in line header plugs The subsystems include A power board which drives the three phase motor Switches to enable manual user control Panel meters and an LCD display to show the system variables Sensors which feed back the state of the motor ASerial port for communication with the host PC The interface signals between the systems are listed in Table 3 Inverter Air Conditioner Demonstration System Block Diagram 3 PHASE MOTOR jg SERIAL PORT SENSORS 80C196MC MOTOR CONTROL DEMO BOARD METERS AC INPUT SWITCHES Application Note 19 Inverter Motor Control Using the 8 196 Microcontroller Design Guide Table 3 Figure 14 20 In Connector Signal Description PLUG DESCRIPTION P1 60 pin connector containing among other signals the output signals of Port 3 and Port 4 These ports drive the 4 line by 20 character LCD display The connections are shown in Figure 13 P2 10 pin connector with signals for monitoring the digital motor sensors to measure position and RPM The sensor interfaces the microcontroller through Port 1 2 Port 1 3 Port 2 2 and Port 2 4 The current software only implements the input to Port 1 2 for the motor RPM P6 50 pin connector providing general plug which links the microcontroller and the serial port
82. oes the opening page for the program int opening_screen void request auto detection int gdriver VGA gmode VGAHI int i j end initialize graphics and local variables initgraph amp gdriver amp gmode setgraphmode getgraphmode setwritemode COPY PUT textcolor BLACK setlinestyle 0 1 3 setcolor 1 for j 1 j 5 j end 421 for i end i 0 i clrscr 1 line 244 200 1 244 200 1 line 234 200 1 254 200 1 11 234 200 1 254 200 1 N line 262 200 i 262 200 i line 282 200 i 282 200 i line 262 200 i 282 200 i T line 300 200 i 300 200 i line 290 200 i 310 200 i Application Note 79 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table6 C Program Source Code for User Interface Sheet 8 of 17 line 318 200 1 318 200 1 318 200 333 200 318 200 1 338 200 1 318 200 1 338 200 1 line line 11 L line 346 200 1 346 200 1 11 346 200 1 366 200 1 delay 40 for 1 0 1 lt i elrser 7 I line 244 200 1 244 200 1 line 234 200 1 254 200 1 line 234 200 1 254 200 1 N line 262 200 i 262 200 i line 282 200 i 282 200 i line 262 200 i 282 200 i T line 300 200 i 300 200 i line 290 200 i 310 200 i E line 318 200 i 318 200 i 318 200 333 200 318 200
83. quency command from the controller in the inside unit through the serial communication line the outside unit s controller knows the output voltage of the inverter from V F pattern and creates the equivalent PWM pulse in sinusoidal wave using the sine table The PWM pulses are output from the 8xC196MC controller s six Waveform Generate output pins The waveform generator can produce three independent pairs of complementary PWM outputs that share a common carrier period dead time and operating mode The waveform generator has three main parts a timebase generator phase driver channels and control circuitry The time base generator establishes the carrier period the phase driver channels determine the duty cycle and the control circuitry determines the operating mode and controls interrupt generation For additional information and application examples consult AP 483 Application Examples Using the 196 Microcontroller Signal Descriptions for the 8xC196MC Outside Unit 8xC196MC TRES Signals Function Description of Function Ach 0 Monitor heat exchanger temperature Ach 1 Monitor compressor temperature A D Ach 2 Monitor outside temperature Ach 3 Monitor current of smoothing circuit Ach 4 5 6 7 Read setpoint value and for test WG Port 6 WG1 to WG3 Drive photocoupler driver for compressor motor three WG1 to WG3 phase induction motor Port1 Read setpoint value Control fan speed control valve electrom
84. re connected as follows Port Connections Signal Connection ACHO ACH1 ACH2 Any three of ISEN IA IB or IC as selected by jumpers E8 E9 and E10 Increment Switch ACH4 Decrement Switch ACH5 Frequency Slope volts hz Switch ACH6 Enable Disable Switch ACH7 Forward Reverse Switch Port contains five additional analog digital input only bits P1 0 is a serial input on plug P3 P1 2 and P1 3 go to plug P2 from digital motor sensors The demo system only uses the P1 2 input which gives the motor RPM These signals appear on the general purpose plug P6 Port2 is the capture compare I O associated with EPA P2 0 is used for CPU REQ while P2 2 and P2 4 are the other motor sensor inputs The current demo does not implement these two sensor feedback Meanwhile P2 5 provides the additional PWM signal needed to control the RPM panel meter P2 1 and P2 6 are involved in the serial interface module as the receiving and transmitting pin respectively these port 2 signals also appear on plug P6 Port 3 is the low order address data lines for the external bus There is no external bus during demo operation and these lines are the data interface to the LCD display These lines have pull up resistors and appear on plug Port 4 is the high order address data lines for the external bus P4 0 switches between data 4 0 1 and commands 4 0 0 for the LCD display 4 1 is a loa
85. register write output PORT7 EQU OD5H BYTE Port 7 address in vert win PI MASKEQUIFBCH BYTE Peripheral interrupt mask PI PENDEQUIFBEH BYTE Peripheral interrupt pending PTS SELECTEQUO0004H WORD PTS select register PTS SERVICEEQU0006H WORD PTS service register PWMO DUTYEQUIFBOH BYTE PWMO duty cycle control register PWM1 DUTYEQUIFB2H BYTE duty cycle control register PERIODEQUIFBA4H BYTE amp period control register SP EQU 18H WORD System stack pointer TIMERO EQU F7AH WORD TIMERO register TO RELOADEQUI1F72H WORD TIMERO reload register TO CONTROLEQUIF78H BYTE TIMERO control register EQU F7EH WORD TIMER1 register 1 CONTROLEQUIF7CH BYTE TIMER1 control register WATCHDOGEQUOO0AH BYTE Watchdog timer COMPIEQUIFC2H WORD Compare register 1 for WG COMP2EQUIFCAH WORD Compare register 2 for WG COMP3EQUIFC6H WORD Compare register 3 for WG WG CONEQUIFCCH WORD WG control register WG CONTROLEQUIFCCH WORD WG control register WG COUNTEREQUIFCAH WORD WG counter register OUT EQU 1FCOH WORD WG output register OUTPUTEOUIFCOH WORD WG output register PROTECTEQUIFCEH BYTE WG protection register WG RELOADEQUIFC8H WORD WG reload register WSR EQU 0014H BYTE window select register Application Note 67 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 68 Demonstration Unit Software Control Modul
86. requency As the compressor motor speeds up higher frequency the motor consumes more power higher voltage input thus producing a greater amount of torque The effect of this on the PWM switching waveforms can be observed in Figure 7 Effect of Frequency Variations on the PWM Waveforms FREQ 0 6 fmax JETE Lower Frequency more pulses VE lt CONSTANT FREQ 0 8 fmax Higher Frequency less pulses pulse width bigger When the frequency increases the pulse width increases and the modulation depth d also increases The pulses change more rapidly and a larger change 1 observed The opposite happens when the frequency decreases Application Note 11 Inverter Motor Control Using the 8 196 Microcontroller Design Guide ntel A 3 0 Designing an Inverter Air Conditioner with the MCS 96 Controller Two MCS 96 controllers are used An 8xC196KB controller is used in the inside unit monitors temperature settings and controls the fan motors An 8 196 controller is used in the outside unit controls the compressor motor speed and the direction of coolant flow The operation of these controllers is described in the following sections 3 1 Inside Unit On the inside unit the 8xC196KB performs the following functions see Table 1 Controls flap DC fan motors Monitors the setpoint of room temperature through a wireless remote controller
87. rter Motor Control Demonstration Unit Figure 12 is to show that the 8xC196MC microcontroller is suitable for use in an inverter controlled air conditioner control system This demonstration unit consists of a control unit a motor unit and a host PC Inverter Motor Control Demonstration Unit HOST PC CONTROL UNIT MOTOR UNIT AC Induction Motor Generally the host PC provides the user interface and transmits the inputs serially to the control unit of the demonstration system The control unit contains the control board and power board The 8xC196MC microcontroller which resides in the control board processes the transmitted request from the host PC The response signals output from the waveform generator of the microcontroller drive the inverter module in the power board to produce a variable frequency signal suitable for powering the three phase AC Induction Motor The effect of this change can be observed at the output of the motor unit through the speed of the blower driven by the AC Induction Motor The 8xC196MC controller also interprets the sensor feedback from the motor unit and displays the motor speed on an LED display Application Note intel 4 1 Figure 13 Inverter Motor Control Using the 8xC196MC Microcontroller Design Guide Hardware Description Figure 13 1 a block diagram of the Inverter Motor Control Demonstration Unit The main component in the demonstration unit is the 80 196 motor control dem
88. ses the applied voltage must be adjusted to compensate for the changing motor reactance VOLTZ HZ is the value that sets the slope of the volts applied as frequency increases and roughly corresponds to the torque Controlling the rate of frequency change avoids excessive currents by ensuring the motor does neither stalls nor becomes a generator In inverter motor this VOLTS HZ ratio is usually set as a constant The frequency value which corresponds to the speed of the AC compressor motor is stored in the program in the HZ OUT variable The value stored is the frequency x 100 not the actual frequency This is to enable higher precision of speed control of the AC motor HZ x100 contains the frequency x 100 values inputted by the user via hardware or software The restricted value taking into account the limits of the motor is stored in the HZ OUT variable This is the frequency at which the motor is operating The main program starts at location 2080h to which the processor branches following the reading of the CCB bytes The subsequent code contains the BEGIN software the RESTART software and the IDLE TIME LOOP software Here the software looks for the input from the push buttons or the host PC and sets flags that determine what the program will do next The flags are set by the interrupt routines and the software code The remainder of the source code contains the program subroutines and the interrupt service routines The sine lookup table s
89. t hz restrict rate of speed reduction jh ok hz lb hz out min nxt hz HZ out can only be changed from br next min these three lines of program ok hz lb hz out hz 100 next min sub min nxt hz hz out 4hertz step min nxt hz min_hertz jh change motor lb min_nxt_hz min_hertz CHANGE MOTOR Change percent volts and sine per parameters mulutemp hz out volts hz max volts hz 3fffh shlltemp 5 shift count controls voltz hz thresholb jnv no ovf 4 max 8 4000h 164Hz 6 8 1000h 41Hz lb temp 2 07fffh 1024 1 VOLT HZ no ovf addtemp 2 temp 2 overflow on shift occurs at 7fffh cmp temp 2 f min percent volts temp 2 percent volts jh chk hi volts 8000H 100 lb temp 2 percent volts br volts done chk volts temp 2 percent volts jnh volts_done lb temp 2 max_percent_volts volts_done lb percent volts temp 2 only change to PERCENT VOLTS is here Hz 2 period lb temp 4502Bh temp 1 6 100 10 6 2 lb temp 2 0FEh temp 16 666 667 2 divutemp Hz out hz out is the restricted hz x100 Application Note ntel Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Table 5 Demonstration Unit Software Control Module Sheet 17 of 30 jnv ok hi lb temp 0ffffh ok hi lb sine per temp only change to SINE PER is here Sine per is now the sine period 6 Seject CALC_FREQUENCY Calculate the number of periods 120 degrees bas
90. tarts at location 3800h in the program and contains 2048 bytes of data When the demo first is powered up the BEGIN software is executed This software initializes the LCD and clears the register RAM location 40h to EOh This BEGIN software needs to be executed only once Next the RESTART software initializes the system variables and operating modes This software 15 re executed every time the restart button is pressed First the interrupt is disabled and the interrupt mask registers are cleared Then the INITIALIZE subroutine is called before the software stops to wait for the enable switch to be turned on In the INITIALIZE REG subroutine the C8h that goes in the TO CONTROL register enables the timer counter as an up counter sets the clock source to external and sets the resolution to the 250 ns maximum Setting Tl CONTROL to a selects an up count internal clock source and 500 ns resolution The next instruction sets the PWMO and PWMI period to 256 states Then a Application Note 29 Inverter Motor Control Using the 8 196 Microcontroller Design Guide I ntel 30 section initializes the wave generator and associated variables Finally the software clears any pending interrupts and initializes the CNT the debug pointer It then returns control to the RESTART software The software waits until the enable switch is turned on and the motor is stopped This prevents damage that can occur
91. tor to obtain the latest specifications and before placing your product order Copies of documents which have an ordering number and are referenced in this document or other Intel literature may be obtained by calling 1 800 548 4725 or by visiting Intel s website at http www intel com Copyright Intel Corporation 2000 Other brands and names are the property of their respective owners Application Note intel Inverter Motor Control Using the 8KC196MC Microcontroller Design Guide Contents 1 0 2 0 3 0 4 0 gt d Inverter Motor Control Overview 5 2 1 What is an Inverter 6 2 2 Typical Air Conditioner 8 2 3 Inverter Controlled Air Conditioner sees eee ee 10 2 4 Compressor Motor AC Induction Speed 11 Designing an Inverter Air Conditioner with the MCS 96 12 3 1 Inside Unit c 12 3 2 Qutside m a 14 3 3 Dead TIW6 16 3 4 17 18 4 1 Hardware ul ll lll n l Sasha sas 19 4 1 1 80 196 Motor Control Board 0
92. trolling the compressor speed The basic refrigeration cycle is as follows The compressor compresses the refrigerant freon 22 vapor and the refrigerant becomes hot The coolant passes through the condenser In the condenser the refrigerant gas changes into liquid as it transfers its heat to the outside air The refrigerant passes through a capillary valve and becomes cold The capillary valve is narrow valve whose inside diameter is 1 0 mm to 1 5 mm In the capillary valve both the pressure and temperature of the condensed liquid refrigerant decrease The cold refrigerant enters the evaporator The evaporator uses the heat of vaporization from the inside air to evaporate the refrigerant from a liquid to a vapor The cooled air is blown to the inside of the room by the fan The vapor returns to the compressor to begin the cycle again The cycle is shown in Figure 3 Refrigeration Cycle Liquid coolant Air forced out 48 C Condenser Condenser Liquid coolant at cooling fan high temperature and pressure Outside air 35 C accumulator Coolant in gaseous state at high temperature and pressure Expansion valve Coolant in practically liquid state at low temperature and pressure Air delivered to room 15 C j Coolant in gaseous state at high temperature and pressure eT _ Evaporator Cooling Fan 3 4760 01 Applic
93. uts menu posit textattr NORMAL ATTR position posit return posit default break gotoxy FIRST_COLUMN posit FIRST ROW textattr INTENSIVE ATTR cputs menu posit return Prints text in graphic mode int cdecl gprintf int xloc int yloc char fmt va list argptr Argument list pointer char str 140 Buffer to build sting into k int ent Result of SPRINTF for return _ start L argptr fmt Initialize va_ functions cnt vsprintf str fmt argptr prints string to buffer outtextxy xloc yloc str Send string in graphics mode yloc textheight H 2 Advance to next 11 Application Note 83 Inverter Motor Control Using 8xC196MC Microcontroller Design Guide 84 Table6 C Program Source Code for User Interface Sheet 12 of 17 va_end argptr Close va_ functions return cnt Return the conversion count int cdecl grprintf int xloc int yloc char fmt va list argptr Argument list pointer x char str 140 Buffer to build sting into int cnt Result of SPRINTF for return va start argptr fmt Initialize functions cnt vsprintf str fmt argptr prints string to buffer gt outtextxy xloc yloc str Send string in graphics mode va end argptr Clos
94. v 82 29 E 55 dya 13834 Lee 000 INXA po kad HIQwWsna I LAL T inui 94 WN H 44 oWs9d dee jy T 20WE9d NEZ ka Ex T tow ri x m 50 094 X Lag I E js 4 m I 1s iam 5 F 1 gen oen awrasia 01 9 gt ota 2 9 m Motor Control Schematic 2 2 Figure 21 35 Application Note Inverter Motor Control Using 8xC196MC Microcontroller Design Guide Figure 22 Drives Technology Schematic 1 6 8 x Y 25 B 8 8 28 2007 1000uF 200V 1000uF 200V 1000uF 200V T 1000uF 2007 100042 58 88 28 ia lt XM 630VAC T 630VAC 0 tuF lt 59 5 s 2 9 3 gt amp 85s g s 9 5 186 sg 56 22 m 5 t 88 3 lt 80 lt jaa 5 87 8 E 6
Download Pdf Manuals
Related Search
Related Contents
Régulation de la hauteur de rampe Manuel du conducteur 取扱説明書 新西工場整備運営事業 要求水準書(案) Serviceanleitung - Frank's Hospital Workshop HP EliteDisplay E190i Bedienungsanleitung Instruction Manual Copyright © All rights reserved.
Failed to retrieve file