Loading...
Please wait, while we are loading the content...
Similar Documents
Figure 13 Example showing transfer of program control on an interrupt.
| Content Provider | Scilit |
|---|---|
| Author | Popovich, Dobrivojie |
| Copyright Year | 1998 |
| Description | InputFromProcess, (* Function which returns measured value, yn, of the system as a real value *) OutputToActuator; (* Procedure which sends manipulated variable, mn, to the actuator *) FROM 10 IMPORT (* 10 is a language support libarary of input and output proceĀ dures *) KeyPressed ; (* Returns value TRUE if a key has been pressed *) FROM SYSTEM IMPORT (* SYSTEM is a language support library *) NEWPROCESS, IOTRANSFER, TRANSFER; (* For an explanation of these see note below *) CONST BIOSCIockHook = 1CH; WorkSpaceSize = 5000; VAR Workspace: ARRAY[1.. WorkSpaceSize] OF BYTE; ISR, Main: ADDRESS; ClockTicks, Ts: CARDINAL; TimeToStop, PrepareToStop: BOOLEAN; en, enOld, Kd, Ki, Kp, mn, sn, sp, yn: REAL; P R O C E D U R E PlDControl; BEGIN sn := sn + en; mn := Kp*en + Ki*sn + Kd*(en - enOld); enOld := en; END PlDControl; P R O C E D U R E Control; yn := lnputFromProcess(): en := sp -yn; PlDControl; OutputToActuator(mn); END Control; P R O C E D U R E InterruptServiceRoutine; BEGIN LOOP IOTRANSFER(ISR, Main, BIOSCIockHook); INC(ClockTicks) IF ClockTicks MOD Ts = 0 THEN Control; END (* IF*) IF ClockTicks > MaxCardinal THEN ClockTicks := 0; END (* IF *) IF PrepareToStop THEN EXIT END (* LOOP *) TimeToStop := TRUE; T R A N S F E R O R , Main); END InterruptServiceRoutine; BEGIN (* Main *) (* Set initial conditions *) NEWPROCESS(lnterruptServiceRoutine, ADR(WorkSpace), SIZE(WorkSpaceSize), ISR); TRANSFER(Main, ISR); LOOP (* Do anything *) IF KeyPressedQ THEN PrepareToStop:= T R U E END (* IF *) IF TimeToStop THEN EXIT END (* IF *) END (* Loop *) END PID_2. Book Name: Mechatronics in Engineering Design and Product Development |
| Related Links | https://content.taylorfrancis.com/books/download?dac=C2010-0-38770-3&isbn=9780429076725&doi=10.1201/9781482289862-129&format=pdf |
| Ending Page | 546 |
| Page Count | 11 |
| Starting Page | 536 |
| DOI | 10.1201/9781482289862-129 |
| Language | English |
| Publisher | Informa UK Limited |
| Publisher Date | 1998-09-30 |
| Access Restriction | Open |
| Subject Keyword | Book Name: Mechatronics in Engineering Design and Product Development Language Transfer Enold Pldcontrol |
| Content Type | Text |
| Resource Type | Chapter |