Lab. Spd Control of a D.C. motor Controllr Dsign
Motor Spd Control Projct. Gnrat PWM wavform. Amplify th wavform to driv th motor 3. Masur motor spd 4. Masur motor paramtrs 5. Control spd with a PD controllr v DC Motor AC achomtr v Powr Amplifir Supply Labs / Computr Systm Spd Masurmnt
chnical goals for lab Dsign a PD controllr to rgulat th motor spd Dsign in Simulink mplmnt in softwar Dmonstrat improvmnt in motor prformanc with th PD controllr Fastr ris tim 50% or mor No stady-stat rror Minimal ovrshoot of targt spd Fast sttling tim whn changing spds
Simplifid systm modl Switch stting Duty cycl of PWM signal Dtrmind xprimntally PD algorithm ADC/imr output
PD Controllr Controllr computs control action at PWM signal duty cycl Compnsat for rror, t, btwn st point and masurd spd PD Proportional, ntgral, Drivativ Control action at basd on thr trms : P trm - proportional to t trm - proportional to th intgral of t D trm - proportional to th drivativ of t
PD Controllr Dsign Continuous tim domain: LaPlac transform/controllr transfr function: t rror dtctd at tim t at control action computd at tim t P,, D constants dt t d dt t t t a D t P 0 s s s E s A s C D P
PD Controllr Dsign Discrt tim domain: transform: sampling tim n sampl numbr rror computd at nth sampling intrval a control action computd at nth sampling intrval P,, D constants n i D P i i a 0 E A C D P
Proportional Control Controllr producs a control action that is proportional to th rror at any givn tim at p t Advantags: Simpl to implmnt Largr p causs gratr systm rspons to a givn rror t possibly improv systm prformanc Disadvantags: som stady-stat rror is rquird to hav a control action can ovrshoot st point and possibly produc unstabl bhavior controllr racts to high-frquncy nois in t
ntgral Control Controllr producs a control action proportional to th intgral of th rror ara undr th rror curv a t t 0 t dt his trm dtrmins th stady-stat control action whn t0 P and D trms ar both 0 Advantags: liminats stady stat rror dampns rspons to high frquncy nois on t Disadvantags: slows systm rspons can contribut to ovrshoot
Convrt intgral trm to discrt form t - Comput th ara undr th curv - t Considr intgral up to prvious and currnt sampl tims: y t t 0 t dt 0 t dt t dt y y y, ara up to t - incrmntal ara from - to
Convrt intgral trm to discrt form Ara undr th curv btwn - and : approximat as a trapoid y rctangl part [ ] triangl part [ ] Add this to y-: y y [ ]
Discrt transfr function of th intgral trm Diffrnc quation: transform: ransfr function: [ ] y y [ ] E E Y Y E Y
Drivativ control Controllr producs a control action proportional to th drivativ of th rror anticipats dirction of rror changs can dcras ovrshoot can dampn oscillatory bhavior BU: incrass snsitivity to high frquncy nois in t Normally, drivativ trm usd only in conjunction with P and/or trms
h discrt form of th D trm: Comput th slop of t at th currnt sampl tim: y D Z transform: ransfr function: D Y D E E Y E [ ] [ ] D [ ] D
mplmnting th PD controllr ] [ ] [ ] [ a nt a D D P P Combin th discrt P, and D trms: Considr th prvious sampl tim: Solv nd quation for y- and substitut into st quation: [ ] [ ] y a D P [ ] y a D P
mplmnting th PD controllr Simplify by combining trms involving, -, -: a a A0 A A A 0, A, A ar constants, -, - ar th 3 most rcnt rror valus a- is th prvious control action Softwar procdur at ach sampl tim: Sampl spd and comput rror Calculat nw control action: 3 multiply, add, subtract Updat duty cycl with nw control action Dlay rror valus to gt rady for nxt sampl
Othr convrsion approachs Can us Matlab to prform th convrsion S th lab writ up for dtaild xplanation
Som practical issus ntrrupt srvic routin with PD calculation tim cannot xcd intrrupt priod Pr-comput all constants A0, A, A Avoid floating-point ral # oprations Rprsnt fractions as ratio of intgrs Dnominator of th form k allows shift instad of divid Exampl: A 0, whr A 0 0.3 0.3 3/000 80/56 approximatly A 0 80*/ 8 80*>>8 in C
Mor practical issus Duty cycl cannot xcd 00%, nor go blow 0% Saturat valus in Simulink modl Systm opration is discrt, not continuous Us ro-ordr hold for spd in Simulink modl Simulink simulation givs O starting valus for constants, but ral systm usually varis from th modl
st program rquirmnts Eight switch-slctabl sttings stoppd and svn incrasing spd valus. Rspond to spd stting changs at any tim whil th motor is running without stopping th motor Rspond to changs in motor load to rturn spd to th slctd stting w won t tst this Ris/fall tims at last 50% fastr than th uncompnsatd motor No stady stat rror Minimal ovrshoot of th dsird spd whil rsponding to a chang Fast sttling tim aftr rsponding to a chang
Dsign th controllr in Matlab/Simulink Slct P--D constants to produc th dsird rspons. Start with P valu to improv rspons tim Us trm to liminat stady-stat rror Us D trm to furthr improv rspons
Lab Procdur R-vrify hardwar from prvious labs Not that circuits can still b damagd with incorrct connctions/opration! Dsign your PD controllr in Matlab/Simulink dtrmin th P--D constants Modify th softwar to implmnt th PD controllr st th controllr by masuring rsponss to stp inputs Compar th compnsatd and uncompnsatd stp input rsponss