Automatic control system lab manual

control system lab manual electrical engineering and control system lab manual using matlab
KomalMittal Profile Pic
KomalMittal,India,Teacher
Published Date:13-07-2017
Your Website URL(Optional)
Comment
University of Colorado Electrical, Computer, and Energy Engineering ECEE4638 Control Systems Lab Manual Co-Advisors: Author: Prof. Jason R. Marden Shalom D. Ruben Prof. Lucy Y. Pao Postdoctoral Scholar August 21, 2011Contents Preface ii 1 Preliminaries 1 1.1 Why Feedback Control? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Why The 3-disk Torsional System? . . . . . . . . . . . . . . . . . . . . . . . 2 2 Hardware 3 2.1 Plant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2 Actuation and Hardware Gain k . . . . . . . . . . . . . . . . . . . . . . . . 9 h 2.3 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4 Hardware Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.4.1 Simulation and Implementation Method I . . . . . . . . . . . . . . . 19 2.4.2 Simulation and Implementation Method II . . . . . . . . . . . . . . . 19 2.5 System Speci cations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.6 Disturbances and Nonlinearities . . . . . . . . . . . . . . . . . . . . . . . . . 20 3 Software 21 3.1 Main LabVIEW Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2 Main FPGA Code (instructor access only) . . . . . . . . . . . . . . . . . . . 24 3.3 Encoder Count FPGA Code (instructor access only) . . . . . . . . . . . . . . 26 3.4 Sti ness Data Acquisition (for System Identi cation, instructor access only) 26 3.5 Free Response Data Acquisition (for System Identi cation) . . . . . . . . . . 28 A Safety Hardware Warnings 29 iPreface Welcome to the Control Systems Lab course This course was developed by Prof. Todd Murphey with the help of Prof. Lucy Pao who developed a similar lab during her tenure at Northwestern University. This lab and this manual are constantly changing in the attempt to improve the course so suggestions are encouraged. It is assumed that you have or are currently taking the theory course (ECEE 4138 Con- trol Systems Analysis). This lab course requires learning Mathworks' Matlab (which you will already be learning in the theory course) and National Instruments' LabVIEW soft- ware. Although there will be some simulation in LabVIEW, in an attempt to aid in learning LabVIEW, for the most part it sucient to simulate in Matlab so as to be consistent with the tools used in the theory course. LabVIEW, for the most part, will be used in implementing control algorithm and collecting data in lab experiments. This manual described both the hardware and software, in some detail, that will be used through out this course. It is my hope that both the students and future instructors will need only look to this manual for most of their hardware and software questions. I'd like to acknowledge that the majority of the LabVIEW code described in this manual was written or supervised by Prof. Todd Murphey 1. Marian Cha e edited the LabVIEW Tutorial (Lab 0) and made many useful suggestions. Darren McSweeney, Application Engi- neer at the ITLL, speaks LabVIEW better than he speaks english and is a great help to this course. iiChapter 1 Preliminaries 1.1 Why Feedback Control? Before answering the question at hand, let me present a few di erent control structures. The Feedback (or Closed-Loop) control structure which we will primarily use in this course is shown in Figure 1.1. y r e u C P FB y Figure 1.1: Feedback Control Diagram Another control structure is the Feedforward (or Open-Loop) structure shown in Figure 1.2. y r u C P FF Figure 1.2: FeedForward Control Diagram 1 It is theoretically possible to havey =r by settingC =P . There are many advanced FF 1 control schemes that deal with the problems that can occur, for exampleP may be unstable due to non-minimum phase zeros ofP (zeros in the right-plan complex plane), and you need to modelP and any disturbances very well. Feedforward can respond faster since it predicts the future and does not wait for a feedback signal. We will not cover any of these advanced techniques. The last structure that I will mention is the combined Feedback/Feedforward control structure shown in Figure 1.3. 1u r FF C FF u y r e FB u C P FB y Figure 1.3: Feedback/FeedForward Control Diagram The combined Feedforward/Feedback combines the best of both world but will not be cov- ered in this course. An illustration of the bene t of the combined structure versus feedback- only on an atomic force microscope can be found in Figure 4. of this paper 2. Now back to the question of the bene ts of feedback: 1.) Can Stabilize a system while feedforward cannot change the dynamics of the plant 2.) Can improve robustness to un-modelled plant dynamics while feedforward depends on an excellent model 3.) Rejection of un-modelled disturbances For interesting, yet not so rigorous, explanations of control theory, I point you to this book 3 1.2 Why The 3-disk Torsional System? More details to come, but the main points are as follows: 1. It is a non-trivial system 2. Although non-trivial, the system can be modeled as coupled second order systems 3. Able to show the diculties of controlling a system with a non-collocated actuator and sensor (will see this in the Root Locus lab) 4. Visualize 3 distinct mode shapes (more relevant for a vibration course but interesting non the less) 2Chapter 2 Hardware 2.1 Plant The experimental test bed used in this course, designed and built by Educational Control Products (ECP), is the Model 205 Torsional Disk System (TDS) shown in Figure 2.1. Figure 2.1: Model 205 Torsional Disk System (TDS) The following pages come from the ECP Model 205 TDS Manual and describe the possible con gurations of this model and other useful directions. 3"%&'()((+,-%&.(/&-0'1%123(4(5&'%136(73-%'80%123- " ecp ( ))( 9:&0%'2.&0"310:(;:3%( %%& '()+,'()-./01, 23(/45,06)317,,8+9.(%:&6-1,))0)1;071=1(4?A1.03.((=1(4?5A)B) )9//1.0(CD501.)1,544D;4(EC4()35;073-3))9)/(,(F(.0-544D1,5,0:;.-01,C544C(5.,+)% 23( )35;0 ) .F(, CD 5C.9)34()))(.F1G101.-1,,(-0(F55.+C(40,(+4+C4(0(,)4( ;4(EC40DA5,/944(D)D)0(G7035"H&)/((.(9-01,.501%I,(,-1(.41-50(1,03(C5)(1; 03()35;0G(5)9.()03(5,+945.)/45-(G(,06 1;03(;.)0)B6J %23()(-1,)B)-1,,(-0( & & 010)(,-1(.CD5.+C(40K/944(D7035&H&)/((.501%I))317,,8+9.(%:503))B 5,(,-1(.G5DC(G1F(;.1G03(9//(.)35;041-501,0103(G4(41-501,;1.=1(4?% 81.=1(4?5603(.()5,(,-1(.50(5-3)B41-501,8+9.(%:CA 8+9.()%:5LC54)1)31703(F5.(0D1;/45,00D/()03505.()9//1.0(CD(5-3G1(4% =503(G50-54G1(4,+5,/5.5G(0(.(,0;-501,1;03()(/45,0)5.(+F(,,M35/0(.)5,% Encoder 3 A " Third encoder/disk for Model 205a only m m J A " Make certain upper disk is mounted below shaf t O clamp BN PJ m m m m J A Encoder 2 A O& B&N PJ 4 Movable Brushless masses Servo m m each disk J A Motor & Rigid belt drive Encoder 1 A & Figure 2.2-1. Torsion Spring / Inertia Apparatus © 1991-1999 Educational Control Products. All rights reserved. 4"%&'()((+,-%&.(/&-0'1%123(4(5&'%136(73-%'80%123- " ecp © 1991-1999 Educational Control Products. All rights reserved. 5"%&'()((+,-%&.(/&-0'1%123(4(5&'%136(73-%'80%123- " ecp © 1991-1999 Educational Control Products. All rights reserved. 6"%&'()((+,-%&.(/&-0'1%123(4(5&'%136(73-%'80%123- " ecp %% &'()+),-().&/)0+12(.+/)3()4,(2(56.627(-163 83 3'/9) +) :+126 ;%%= .'6 -(). 5(? 6 -(A64 +) ( B(2+6.? /0 0266 ()4 A-(564 A/)0+12(.+/)39+.'C==()4"DE/46-F;(G462663/002664/5DHI:G%:/2C()4HI: -().3=.'6./23+/)(-32+)A/)3.().J 5(?6'(-B64?A'/+A6/04+3J-/A(.+/)%&'()+) C A/)0+12(.+/)3/0.6)26K1+263265/B+)/226-(A+)+)62.+(4+3J3%8-.'/1'.'636/62(.+/)3(26 3.2(+'.0/29(24= +. +3 26A/556)464 .'(. .'6? 6 620/2564 ? ( K1(-+0+64 .6A')+A+()% L. +3 +5/2.()../J666(A'(+2/0'(-04+3J3./6.'62+)5(.A'6436.3D366+)3A2+64-6..623/)4+3J 6463G%M?(-+)+).'6A/)A6).2+A5(2J+)3=.'62/6226-(.+B6(-+)56)./0.'6.9/'(-B63+3 (331264%:/2/62(.+)3(06.?=63126./0+25-?.+'.6)D1.)/.6NA633+B6-?3/G.'6/-.3.'(. 0(3.6).'64+3J3./.'63'(0.A-(53% O'613625(?A'()6+)62.+(B(-163?A'()+).'6)1562/05(3363()4P/2.'6+2-/A(.+/)/)( +B6)4+3J%:+126%"+B63+)3.21A.+/)30/2'?3+A(?A'()+)+)62.+(3% Secure masses by tightening screw. Loosen and sli de to relocate. Concentric rings r = 2.0 to 9.0 cm i n 1 cm intervals to assi st i n m ass c.g. m easurement. (M easure to edge of 5.00 cm dia mass) All masses must be concentrically located (w ithin ± 1 m m) prior to oper ation. Disk Mass 500 ± 1 gr (i ncl bol t & nut) Disk Pl ate Flat side of square nut must face upw ard Hub Split Line If only tw o masses are used, they must be located along the hub split line. Each disk may hav e four, two or zero masses only. One or three masses w ill imbalance disk. Figure 2.2-3. Guidelines For Changing Or Adjusting Disk Masses © 1991-1999 Educational Control Products. All rights reserved. 7"%&'()((+,-%&.(/&-0'1%123(4(5&'%136(73-%'80%123- " ecp %&'(&)(%'+,-&)./01%211%&,.(3(45&+1(426,7'++&0(2)&7)7&)+02+.86&,26,(&9')&,26, )121&/)&&+07).)17&)21.6: ;),&+=?=,.(36+01%&(&96,,.(3.(6A.62++0+921&,211%&'77&)(%2/17(.1.6:B/ 1%&,.(3.(A-&,11%&A.,,+&7(.1.641%&&69,&)C.++5&).&61&,'7(.,&,C626,1%& 7+2).10/.1((.862+C.++5&)&-&)(&,:D6&821.-&'6.1082.6.61%&&69,&)/&&,52935)269%?&:8: "4%"4)&"A'(15&,C6+2,&,-.21%&8&6&)2+/)A17)-.,&(125+&?6&821.-&/&&,5293 9+(&,+7961)+:%.(A'(15&,6&&-&)01.A&2961)++&).6-+-.68&69,&)E=?211%&A.,F (%2/1+921.6.(.A7+&A&61&,:;),&+=267+2).109))&91.6.(6&9&((2)0: =:=:G %&H71.62+I.(1')5269&I).-& %&,).-&.(92+.5)21&,211%&/291)01'17'1277)J.A21&+0K:=LFAMN2(277+.&,11%&.6&)1.2 UHLNIVWSXWJHRDWQLGLOYRVRUH+H9´WWHLWSOHPLR³KKUPD 26,A20'5&(7&9./.&,-.21%&&J&9'1.-& 7)8)2A4)277+.&,&J1&)62++0.61%&92(&1%&'(&).(('77+30.68961)+%2),C2)&.67'1(?&:8:1%& R JXUWQDLL´IRFQ\WOQD2Q3OWH³QKGHLVDSXUVKZDFWVPH\V O P%&61%&,).-&.(,).-&6.6)&(76(&11%&A1.6212(7&9./.9,.(3± HJQLWHKRFVXVLY³ ´RWQFLULIRUWRUTXHSURSRODRUWQLWR QLV A,&(± 1%&A1.6.((&6(&,-.21%&&69,&)211%& 2,Q29&61,.(3:%&72)1.9'+2),.(3A'(15&(7&9./.&,.61%& Disturbance Configuration,.2+85J: RFH´RVXV7WKQFLLUYL³I .(277+.&,2(21)R'&?A1)9'))&617)7)1.62+126,.61%&77(.1& ,.)&91.6/1%&)21&2(A&2(')&,-.21%&&69,&)211%&(7&9./.&,.6&)1.2,.(3: B6(1)'91.6(/)7(.1.6.6842,Q'(1.68426,(1C.681%&,).-&2)&8.-&6.6;.8')&=:=F": © 1991-1999 Educational Control Products. All rights reserved. 82.2 Actuation and Hardware Gain k h Actuation of the system , from the command desired torque in the computer to actual torque applied, is a combination of the parts shown in Figure 2.2. First a desired torque Torque Digital to Counts Torque Torque Analog Volts Current Amp Pulley Motor Converter (DAC) Figure 2.2: Ampli er, Motor, DAC, and Pulley from the software is sent, in counts to the digital to analog converter (DAC) which outputs a proportional voltage (10 volts per 32767 counts for a 16 Bit DAC) to the current ampli er which then send current to the motor which applies a torque that is nally magni ed by a pulley before torque is applied to the system. We neglect any dynamics by the ampli er, motor, and pulley and assume constant gains as shown in Figure 2.3. To simplify the system identi cation, we combine these three gains as shown in Figure 2.3 and call this the hardware gain k . You will calculate this gain h experimentally in Lab 3. Torque Counts Torque Torque Volts Current 10 k = k dac k k p a m 32;767 k h Figure 2.3: Hardware Gain k =k k k h a m p The motor in this system is known as a Brushless DC motors which has 3 current inputs (3 phases or coils) to produce the torque (notice in Figure 2.2 that Current is bold face to signify a vector). The algorithm that the ampli er implements, of converting a desired torque (or proportional voltage) to 3 currents, is known as Commutation. More detail about the commutation and current feedback implemented by the ampli er can be found in the follow pages which were taken for the ECP manual. The main point to keep in mind is that due to the low-resolution commutation, implemented by this ampli er, a source of torque error (actual torque versus desired torque/voltage command) of up to 13% occurs. This error oscillates and therefore is known as Torque Ripple and the reduction of Torque Ripple can be found in many research papers. 9"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp )3( 4'56",&66(70%0'(0//5%%.01(18(90':5&(01%'0,( %& '() (+,(-(.& /0 ( 12 3456%7&66 '/-/4 8/-%&49)6& :/9 (6 ( "%&"&'( %)&"'( +&,-.&./ '/-/4;/,&4-%&/,&-)/(7123456%'/-/4)6-%&&7)')(-)//03/-%3456% 04)-)/(66/)(-&+9&(4= ).54&?=AB6%/96(4/666&-)/(7,)&9/0(-CD)(7123456%7&66'/-/4=E/-4(6/-%& /,&-)/(7123456%'/-/4F-%&D&4'(&-'(.&-6(4&0)G&+-/-%&4/-/4=%&D%(6&9)+).6 8-CD)(77CD%(6&6;(4&+)6-4)35-&+)67/-6/0-%&6-(-/4=%)6(44(.&'&-(76/D4/,)+&60/4 H .4&(-&4%&(-+)66)D(-)/8) I;F9%)%)-547&(+6-/)'D4/,&+7)0&(+-CD)(77C.4&(-&4,/75'&A-/A D/9&44(-)/60/43456%7&66'/-/46-%(0/43456%'/-/46= Hall Sensors (3 places) Stator S N o 30 o 30 Permanent Magnet S N Rotor Air Gap Figure 4.3-1. Cross-section of a Typical DC Brushless Motor. (Four pole type shown) E(C/-)5/567C4/-(-).'/-/4F-/D4/,)+&/-)5/56-/4J5&-%&544&-'56-3&65&66),&7C (7-&4&+/469)-%&++&D&+)./-%&(36/75-&D/6)-)//0-%&4/-/4=E(123456%'/-/4F-%)6 69)-%).)6)'D7&'&-&+'&%()(77C3C-%&/''5-(-/4=E(123456%7&66'/-/4F(4/-/4 D/6)-)/). 6&6/4 )6 56&+ (+ -%& /''5-(-)/ D4/&+54& )6 +/& &7&-4/)(77C= K& 9)77 /6)+&4-9/+)00&4&CD&6/0/''5-(-)/D4/&+54&60/412D&4'(&-'(.&-3456%7&66 '/-/46L4&-(.57(4(+6)56/)+(7= ?==BI&-(.57(48M(77AN00&-;2/''5-(-)/( ).54&?=AH6%/96(6)'D7)0)&+6%&'(-)/0-%&+4),&6C6-&'86;56&+)-%)6'&%()6'=%)6)6( -CD)(7 +4),& 6%&'& 0/4 ( ?AD/7& AD%(6& 6-(4A9/5+ 3456%7&66 '/-/4 9)-% M(77A&00&- 84&-(.57(4;/''5-(-)/=%&-%4&&M(77A&00&-6&6/46(4&D/6)-)/&+/-%&6-(-/4=%& 6&6&+'(.&-)0)&7+69)-%&63&-9&&-%&(+O(&-/4-%P6/5-%D/7&6(6-%&4/-/44/-(-&6=%)6 69)-%).6&J5&&)6-%&56&+-/+)4&%&/''(+&+'/-/4544&/)+),)+5(79)+). D%(6&68).54&?=A;=Q6)'D7&&7&-4/)7/.))45)-)656&+0/4-%&.&&4(-)//0-%&69)-%). 6-&D686)G6-&D6D&4&7&-4)(7C7&/4BH6-&D6D&4'&%()(7C7&0/4(?AD/7&'/-/4;=Q(7/. %).%3(+9)+-%..'0.&%1(1/(0&'")%18RE;544&-0&&+3(:7//D6(4&-%&56&+/-9//0 © 1991-1999 Educational Control Products. All rights reserved. 10"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 "" ecp %&%%'()%)())+&%(,-)./)(/(/%+)&%)'/)%0%(1+(,2./3./41+&&%/0,,2./4 (/51(/3%31+&&%/1(/4%)67%.&3'()%3%)/&%8+.&%(1+&&%/0%%39(1:,' 9%1(+)%;()'%&.&100=),(2%1+&&%/./%.&3'()%.)%/%4(.?%0%)+-0% 1+&&%/./%%&2'()%)6 Figure 4.3-2 Simplified Schematic of Hall-effect Commutated DC Brushless Motor Drive System( %())+-%(A3+%%&%,(.?%,5.49(/32.30%1+&&%/,')A/%(&,5./)(/(/%+) B -(1./40%1(/3%31+&&%/;&8+%(/3%(1+(,1+&&%/11+&)6 .%&%1(/4+,(& 3&.?%)1%-%)2/./C.4+&%D6EFE9A((/5')..//,520%&%%'()%)(&%'%&(./(, )(%1+&&%/./%.&3'()%.)G%&6H/).3%&("I%,%1&.1(,3%4&%%./%&?(,I "I6 7%&8+%./'+0&-'()%J.) 7 KL )./ ;D6EFB J J (/3 L KFL 2.L KI J 7 M 2%&% KNOP O&O,.)%&8+%1/)(/'%&'()%./QF-6N.)%/+-9%&0+&/)'%& ' 2./3./4A&.)%./).3%&(3.+)0%)(&./-%%&)A(/3,.)%(1.?%,%/401/3+1&)./ -%%&)6P .)%'%(:(.&4('0,+R3%/).5./7%),()6 ' B %8+(,.05%?(,.3.50.)())+-'./,(%&2%/2%3.)1+))%SL1+&&%/,')6 © 1991-1999 Educational Control Products. All rights reserved. 11"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp ( Figure 4.3-3 Hall-effect Commutation Timing Diagram( %&'%()+&%,-.-/+.%'0)+1.2+34)5(+6,-.78),.9+6+:;.-/+3%'&2;,+2-,-,.2+;,+3%'; ,-6),%-(;447=%)6(8%.%',++?-:)'+ABA;CD EF G ,-6 IJKC ABJC . H EF G KL,-6 IKMM"%, C 3%'K "K . H 2+.%.;4.%'0)+-,:-/+697.2+;((-.-%6%3 ;6( %/+'.2+-6.+'/;4K "KD H E I EF NL,-6 IKMM"%, COG ABAC H . H P0);.-%6ABA,2%=,.2;..2++33+.-/+.%'0)+%6,.;6.1F NL,-6 IKMM"%, C12;6:+,;,; . 3)6.-%6%3'%.%';6:4+&'%()-6:;.%'0)+'-&&4+;,8)2;,NAQ3%''+.;6:)4;'%88).;.-%6 2-,.%'0)+'-&&4+;69+.'+;.+(;,;(-,.)'9;6+=2-21-68%,.&';.-;4;&&4-;.-%6,1-,'+()+( 974%,-6:%).+'/+4%-.7;6(&%,-.-%64%%&,;'%)6(.2+)''+6.4%%& ( ( ( © 1991-1999 Educational Control Products. All rights reserved. 12"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp ( %&%'()+,-)./01-22+3/3)-( 4-5/2-3-56)37,)+,-)./0086-+.,3/3-59-)0,37:/)5;/=0+.:,)3):,/5:? B ,) A B ,)C DE'FG C%&HG ( B ,)C D'FG I J7:5: K K /. /5: 37: :5 7/,: =0+ .:,)3):, =-5 37: 2-3-5 7/,:, AK (K /. I A ( I 5:,:93)L:08/. ),37::/ML/0+:)I:,0/%N=6:/,,+2:37/337:ON9-35-00:5,/5-+.37: 9+55:302/)3/)37:7/,:9+55:3,)7/,:6)3737:/)5;/=0+.:,)3):,K37:37:9+55:3 ):/977/,:)3:52,-=37::/M9+55:3N /5:;)L:P8 N BN ,) A N BN ,)C DE'FG C%&HQG ( N BN ,)C D'FG I 45-2:R+/3)-%&H/.%&HQK37:),3/3/:-+,3-5R+:P:);5-.+9:.):/977/,:), ' I BS N ,) A 3 ' I BS N ,) C DE'FG C%&H"G ( 3 ' I BS N ,) C D'FG A 3 I7:3-3/03-5R+:),37:,+2-=37:/P-L:3-5R+:9-2-:3,K67)97),;)L:P8 IBI DI DI A ( I ' ' ' BSN C,) D,) C DE'FGD,) C D'FGG 3 B&T'SN C%&HUG 3 VR+/3)-%&HU,7-6,37/3W:5=:93W,)+,-)./09-22+3/3)=/W:5=:9308W,)+,-)./0086-+. 2-3-55-L).:,=-5/5)0:=5::3-5R+:9-,3/3%N5/93)9:K7-6:L:5K/,2/00/2-+3-=3-5R+: 5)0: 2/8 :),3 .+: 3- )2:5=:93)-, ) 37: 6).);, /. 37: 9+55:3 0 :0:2:3, /. 2),/0);2:3-=37:5-3-5-,)3)-,:,-5%X-3:37/3=-537),2:37-.-=9-22+3/3)-K/7);7 5:,-0+3)-/P,-0+3:-,)3)-,:,-5),5:R+)5:.% %&%&O553)-/0O0+,N3:;5/0CONG1+55:3Y V/977/,:-=37:2-3-56).);9-)0),97/5/93:5)Z:.P8)3,5:,),3/9:A/.)3,).+93/9:Y%N= 6:/,,+2:37/337::5H7/,:P/9M:2=-=2-3-5),:;0);)P0:)37:7);73-5R+:T0-6,::. 5:;)=-:5/3)-K37:37:P0-9M.)/;5/2,7-6)4);+5:%&H5:5:,:3,37::5H7/,:ON 0=-536=37:375::7/,:,%CI7:5:),-::.=-5ON0-37:37)5.7/,:K/,37:,+2-= 37:3-3/09+55:32+,3P:Z:5-)/,3/56).);9)59+)3G%( © 1991-1999 Educational Control Products. All rights reserved. 13"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp Phase Winding PI Control i T c i o v & % " %&'( - Motor Admittance 1 Figure 4.3-4 Simplified Block Diagram of Analog PI Controller (applies to each motor winding phase)( )+&+&,&-./01/21-2&3&4-56+44-42,0&7-2780.4+/0 )&' ) 9&: ' " ; 9?AB: 9&: = +' ( " & ' &' ) ) ,C+0D0,482,E72-F8-0.3 ; 9?A: , ) ,011,5G+0D2,4+/ '+ " ; 9?AB: = ) H3.//&+0D4-,GG2/G2+,4-C,E8-&7/2 ,01 IC-23+DJ,016+14&7/2.E/&-1E//G.822-04 " 94/2F8-:2-&G/0&-5,3J-,.+-C-19KLMMNO:?P0./5G,2+&/04/4-,.+-C,JE-J,016+14&7/2 4-/84-2C-E/.+43,01/2G/&+4+/0E//G&I4-J,016+14/74-.822-04E//G+&D-0-2,EE3,J/8446/ /21-2& /7 5,D0+481- D2-,4-2? )+& 5-,0& 4,4 4- .822-04 94/2F8-: 2-&G/0&- +& -&&-04+,EE3 +0&4,04,0-/8&,014-2-7/2-+4&130,5+.&5,38&8,EE3J-+D0/2-1?Q/4-,E&/4,44-,11+4+/0/7 4-+04-D2,4/2,&5,1-4+&.E/&-1E//G&3&4-5,43G-/0-&3&4-5?)+&I+04820I2-&8E4&+0O-2/ &4-,13&4,422/2,01,80+43RSD,+0? ( ( ))( 34,%.-567.18(91:.'01/&1% R+D+4,E./042/E+5GE-5-04,4+/0+&+04+5,4-E3./8GE-16+44-,216,2-,01&/746,2-4,4&8GG/24& +4?Q/6-2-+&4+&5/2-,GG,2-044,0+04-,2.+4-.482-,014+5+0D8&-14/&8GG/244-C,2+/8& 1,4,G2/.-&&+0D2/84+0-&?T6-EEG2+/2+4+O-14+5-58E4+A4,&U+0D&.-5-+&-&&-04+,E4/5,V+5+O+0D 4-G-27/25,0.-,44,+0,JE-72/54-G2/.-&&+0D2-&/82.-&? )-G2+/2+43&.-5-7/24-WSX2-,EA4+5-S/042/EE-2Y&58E4+A4,&U+0D-0C+2/05-04+&4,J8E,4-1+0 ),JE-?A?)-+D-&4G2+/2+434,&U+&4-42,Z-.4/238G1,4-,01&-2C/E//G.E/&82-./5G84,4+/0 6+.4,U-&GE,.-,44-5,V+5852,4-/7?NO95+0+585&,5GE+0DG-2+/1+&M?MMMBB &-./01&:?P04+&.,&-I4-8&-25,32-18.-4-&,5GE+0D2,4-42/8D4-WV-.84+C-X2/D2,5C+, .,0D-&4/) +04-Setup Control Algorithm(1+,E/DJ/V? & © 1991-1999 Educational Control Products. All rights reserved. 142.3 Sensors The sensor in this system, known as a Quadrature Encoder, is a digital encoder and therefore does not need a analog-to-digital converter (ADC). The encoder sends two channels of digital (High/Low) feedback to the controller. Using the A and B channel phasing, which are 90 degrees phase shifted, to decode direction and detects the rising and falling edge of each to generate 4x resolution. This added resolution can be seen in Figure 2.4 by analyzing one period of the A and B channel and noticing that it is possible to read four regions (High/High, Low/High, Low/Low, and High/Low). Figure 2.4: Quadrature Encoder A and B channel outputs Our encoders have 4000 Lines per revolution making the disk resolution 16000 encoder counts per revolution due to the 4x magni cation and de ne this encoder gain as k . For enc more details see the following pages which come from the ECP manual and the encoder FPGA code in the following chapter. 15"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp %&'()&+',(-./)00102')34%)3'%&'%1(5%12%&3'.(1,(1'-)05133&(61+&5)')7)81797()'&,: ;""=&(&'%&.)()7&'&(3:,()0&?'()&+',(-0&&50,'&+)/+9/)'&5&6&(-'17&'%13')3413 3&(61+&5-'%&(&)/A'17&B,0'(,//&(C%&0&6&()0&?'()&+',(-13(&D91(&5E1&'%&+9((&0' '()&+',(-130&)(1'3+,7./&'1,0F'%13')3413&8&+9'&5%&/,?&(.(1,(1'-')343)(&3-3'&7%,93& 4&&.102(,9'10&310+/951023):&'-+%&+43G10'&(:)+&)05)981/1)(-)0)/,2,9'.9' Table 4.4-1 The Multi-Tasking Priority Scheme of the Real-Time Controller 3'.0'.%4( 567(8&69'.%.01( :&';.9&('&=&194( H I&(6,J,,.B/,39(&KB,77)05L.5)'& HHM= N ()&+',(-O/)00102 ;""= ; P)+42(,905)34310+/95102L3&(Q0'&(:)+&G P)+42(,905EQ0'17& R981/1)(-SRBL.5)'&GJ171'+%&+43&'+ &'?&&0,'%&(')343F ( %&%12%&(.(1,(1'-')343)/?)-3.(&6)1/,6&(/,?&(,0&310,')10102'%&+,7.9')'1,0)/.,?&(,: '%&SIO%1379/'1A')341023+%&7&13(&)/1=&5-)(&)/A'17&+/,+4?%1+%2&0&()'&3.(,+&33,( 10'&((9.'3 )?( :&160'6 %&(&)(&'?,10+(&7&0')/(,')(-3%):'&0+,5&(393&510'%&T,5&/NUV)+%%)3)(&3,/9'1,0,: W.9/3&3.&((&6,/9'1,0%&3&&0+,5&(37&)39(&'%&10+(&7&0')/513./)+&7&0',:'%&7,',( )05'%&/,)53%):' %&&0+,5&(3)(&)0,.'1+)/'-.&?%,3&.(10+1./&,:,.&()'1,0135&.1+'&510X129(&WUAHR/,? .,?&(/12%'3,9(+&1393&5',2&0&()'&'?,Y5&2(&&3,9',:.%)3&31093,15)/3120)/3,0'%& 5&'&+',(3)3'%&7,6102./)'&(,')'&3?1'%(&3.&+'','%&3')'1,0)(-./)'&%&3&3120)/3)(&'%&0 3D9)(&59.)05)7./1:1&510,(5&(',2&0&()'&D9)5()'&/,21+/&6&/3120)/3391')/&:,(10.9'','%& .(,2()77)/&2)'&)(()-,0'%&(&)/A'17&B,0'(,//&(%&2)'&)(()-93&3'%&R)05P+%)00&/ .%)3102 ', 5&+,5& 51(&+'1,0 )05 5&'&+'3 '%& (13102 )05:)//102&52&,:&)+%',2&0&()'&W8 H (&3,/9'1,0± 3&&X129(&WUAN %&.9/3&3)(&)++979/)'&5+,0'109,93/-?1'%10NWA1'+,90'&(3 E%)(5?)(&(&213'&(3F%&+,0'&0'3,:'%&+,90'&(3)(&(&)5-'%&SIO,0+&&6&(-3&(6,E,( +,779')'1,0F +-+/& '17& )05 &8'&05&5 ', WZA1' ?,(5 /&02'% :,( %12% .(&+131,0 097&(1+)/ .(,+&33102%93'%&)++979/)'1,0,:&0+,5&(.9/3&3.(,615&3)0)029/)(.,31'1,07&)39(&7&0' E3120)/F:,('%&3&(6,(,9'10&3 H Q&'%&5134&0+,5&((&3,/9'1,0&::&+'16&/-&+,7&3HG+,90'3.&((&6,/9'1,0 © 1991-1999 Educational Control Products. All rights reserved. 16"%&'()((+&,-%./&(01%'0,(2/,&/&1%%.01 " ecp Figure 4.5-1 The Operation Principle of Optical Incremental Encoders(( Figure 4.5-2. Optical Encoder Output(( © 1991-1999 Educational Control Products. All rights reserved. 17