tailieunhanh - Essentials of control techniques and Keyword Stats_5

Tham khảo tài liệu 'essentials of control techniques and keyword stats_5', kỹ thuật - công nghệ, điện - điện tử phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Controlling an Inverted Pendulum 121 body style background-color rgb 255 255 204 center h2 Pendulum simulation h2 br br br br br br br br br br br br br form name panel input type button name runit value Run onclick running true eval stepmodel input type button name stoppit value Stop onclick running false b Command b input type button value -1 onclick command -1 input type button value 0 onclick command 0 input type button value 1 onclick command 1 br br textarea name initial rows 12 cols 60 c .01 d .04 e f .44 textarea textarea name model rows 12 cols 60 stepmodel u c x-command d v e tilt f tiltrate x x v dt v v 10 u dt tilt tilt tiltrate dt tiltrate tiltrate 10 tilt -10 u Math. cos tilt dt Move trolley x 0 Move bob x tilt tilt round again if running setTimeout stepmodel 10 textarea br form center div id track style position absolute left 50 top 410 img src height 6 width 800 div 122 Essentials of Control Techniques and Theory div id trolley style position absolute left 400 top 350 img src height 62 width 62 div div id bob style position absolute left 400 top 50 img src height 62 width 62 div script var trolley trolley var bob bob script body html To go with the code we have three images. is the image of a cube that represents the trolley. is a picture of a ball the pendulum bob while road. gif is a simple thick horizontal line for the slideway. You will have noticed that the feedback gains have already been written into the initial text area. So how well does our feedback work If you do not want to go to the trouble of typing in the code you can find everything at 9 . When you press run you see the trolley move slightly to correct the initial tilt. Perhaps you noticed that we gave tilt an initial value of . If we had started everything at zero nothing would seem to happen when run