Embedded Systems December 2000 Vol13_13

Issue link:

Contents of this Issue


Page 135 of 197

FIGURE 18 ~~ Vz e rator or brake, rather than using the cruise-control inte rface. The ___ c_ nt ol o__r_ ___ ) modifi ed split-pm module is shown in Figure 16 If Ira == /'v == 0, then tl1e input h from tl1e control mod- The second version, on the other hand, maximizes fl exibili ty of the com- ponents. For example, the I/O output that was specified in the structu re assumes that acceleration and braking are handled by two different compo- nents. What if an electric vehicle with a direct drive motor is used instead of a gas vehi cle? The vehi cle may be designed such that both acceleration and deceleration have a single force value applied to th e motor. In such a case, the split-Inn module can be removed, with the force id directly sent to the I/O output component. Using the split-pm module has an added benefit , as it allows fo r easily overrid ing the output of the control module if the driver presses the accel- ule is used, otherwise Ira and irlJ are used. This module demonstrates the situation where the computer is in charge of overriding the engine and brakes. For safety, it may be desirable to allow mechanical oven;des which bypass the computer, in which case this code would have no u eful pur- pose and can be omitted . If a variable is prodoced by one of the I/ O input e lements, draw an arrow from the appropriate input ele- ment. This is shown for both the accel and bm ke modules in Figure 17. The Xz inpu t to the dashboard module is another example; it can be connected d irectly from the position module which would generate Xz as an output port. The dashboard module also needs measured velocity (vz) . This can be obtained by differen tiating the posi- tion over time. The measured velocity is derived from the measured position. For that, we can add a time-derivative ( tderiv) module that takes the input Xv and produces the output VZ' The tderiv module is a component that can be reused often, whenever a time deriva- tive is needed. The above iteration is then repeat- ed, identifying any module tl1at does not yet have any component produc- ing its input. In th is case, only the con- trol module remains. The control module incorporates the algor ithm to be used to imple- ment the cruise control. If a simple controller is used , the inputs of the module need to be the refe rence velocity (vr) , and the current mea- sured velocity (vz) . If v,.== VZ' then the output /'1 should be 0. If they are not equal, however, a positive or negative force is output by the control mod- ule. The precise value depends on the magnitude of the difference and the gains applied with in the control algOl; thm. The function of the cruise control FIGURE 19 ComRlete configuration of • Accelerator pedal li~fbr Brake pedal ( ccui C Position ) Cruise control user interface ) Xz . Wheel position resolver Speedometer Odometer 134 DECEMBER 2000 Embedded Systems Programming V z U~l==dX=/=dt=::) . ( dashboard J • l- _ split-pm _ +: + J Force to engine L wheels . ~ Force to wheels ) algori thm also depends on the com- mands from the user. For example, the user inte rface for cmise control is a set of keys (for example, on, off, set, accel, resume, coast), any of which can be pres ed by th e driver to con- trol the fun ction of the algorithm. For example, if the accel button is pressed, the car must accelerate, and the refe rence velocity revised accord- ingly. To handle the commands, the user reference (Ur) variable is also needed as an input to th e control mod- ule. Wherea the other variables were math ematical, Ur is discrete, holding the value of the las t pressed button. In th is software component frame- work, the re is no difference in the way th e code is defin ed to handle each type of variable, thus the input can be shown th e same way as the othe r variables. For ease of under- standing the diagram, however, the

Articles in this issue

Archives of this issue

view archives of EETimes - Embedded Systems December 2000 Vol13_13