Embedded Systems October 2000 Vol13_11

Issue link:

Contents of this Issue


Page 95 of 181

FIGURE 7 Heater temperature v's: time " . -' ," . 0.8 i , , , , ,, . , I .,. I I I 0.2 - o , o I .. # .. - I I - Input Temperature I I .. ~ ... ~~ ------ 0.5 Time 1.5 2 You otwos believed there were mo(\ int t embedde People doubted their existence - yet you continued to search - and now you've found them. COSMIC C compilers are fast, efficient, reliable, and produce the tightest object code available. Cosmic Software's embedded development tools offer portability for a complete line of micro- controllers. All toolkits include IDEA, our intuitive IDE that provides everything you need in a singl e, seamless Windows framework. ou were right. G."f!,.~t;; E-mail: Phone: US ... . .. . . 781 932-2556 France .... . 331 43995390 UK ....... 4401256 843400 Germany ... 4907114204062 Sweden . . .46317043920 Add ZAP, our non-intrusive source- level debuggers and minimize your test cycle too. Want proof of their existence? Download a free evaluation copy of our development tools at or call Cosmic today. Cosmic supports the Motorola family of microcontrollers: 68HC05, 68HC08, 68HCll, 68HC12, 68HC16, 68300 and STMicroelectronics' ST7 Family. 94 oaOSER 2000 Embedded Systems Programming back with the tempel-ature controll er. I'm showing the system response with a disturbance due to a change in ambi- e nt tempe rature at t= 2s. Even without the disturbance you can see that pro- portional control doesn 't get the tem- perature to the d esired settin g. Increasing the gain he lps, but even with "1)= 10 the output is still below tar- get, and you are starting to see a stro ng overshoot that con tin ues to travel back and forth (tllis is called ringing). As the previo us examples show, a proportional conu-oller' a lo ne can be useful for some things, but it doesn' t a lways he lp. Pla nts that have too much d elay, like th e precisio n actuator, can ' t be stabilized with proportional con- trol. Some plan ts , like tlle tempera- ture conu-oller, canno t be brought to th e desired set po in t. Pla nts like the moto r a nd gear combina ti o n may wo rk, but they may need to be driven faster than is possible with pro portio n- al contro l alone. To solve these con trol problems you need to add integral o r differential conu-o l or both. Integral Integral con trol is used to add long- term precisio n to a control loop. It is almost always used in conjunctio n with proportional conu-o!. The code to impleme nt an integra- tor is shown below. The integrator state , i State is the sum of all the pre- ceding inputs. The paramete rs iMin and iMax al-e the minimum and maxi- mum a llowable integrator state values. doubLe iTerm; II caLcuLate the integraL state II with appropriate Limiting pid->iState += error; if (pid->iState > pid->iMax) pid->iState = pid->iMax; eLse if (pid->iState < pid-> iMin) pid->iState = pid->iMin; iTerm = pid->iGain * iState;

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems October 2000 Vol13_11