Download presentation
Presentation is loading. Please wait.
Published byErik Morton Modified over 9 years ago
1
CSE 466 – Fall 2000 - Introduction - 1 Fuel Cell Power Plant A Control Dominated Example H2H2 Air H20H20 Heat controller sense: Temperature H 2 Output Current Output Voltage Fan Speed control H2 valves Output MOSFET Fan Speed Stack MOSFETS not showing power supply circuitry for the controller…runs off fuel cell w/ backup battery.
2
CSE 466 – Fall 2000 - Introduction - 2 System level Modes (Logical Structure) startup warmuponline offline shtdwn Self Check Fail Warm On Off+ V<min + I>max Self Check Pass Failure Failure = H2+TooHot+TooCold I>0+V<min off
3
CSE 466 – Fall 2000 - Introduction - 3 State Table (activities/error conditions are mode dependent) ModeOutputs Processes Events New Mode OffLoad Disabled Power Supply Off Gas Valves Closed Power Button Enabled nonePower Button PushStartup Load Disabled Power Supply On Gas Valves Closed Initialize Temp Control H2 Detection Load Monitor UI Running Initialize Complete Warm Up Error Condition Detected* or shutdown request Shutdown WarmupLoad Disabled Power Supply On Gas Valves Open Temp Control H2 Detection Load Monitor UI Running Operating Temp ReachedOff Line Error Condition Detected* or shutdown request Shutdown Off LineLoad Disabled Power Supply On Gas Valves Open Temp Control H2 Detection Load Monitor UI Running On-Line Command Received (UI) On Line Error Condition or Shutdown request Shutdown On LineLoad Enabled Power Supply On Gas Valves Open Temp Control H2 Detection Load Monitor UI Running Off Line CommandOff Line OverloadOff Line Error Condition* or Shutdown Request Shutdown Load Disabled Power Supply On Gas Valves Closed Fan On Temp Control Schedule transition to Off state TimeoutOff
4
CSE 466 – Fall 2000 - Introduction - 4 Examples of Mode Dependencies Fan Speed Control: In startup or shutdown mode always run minimum speed otherwise attempt to maintain temperature set point If fan doesn’t turn, issue shutdown event Hydrogen Detection: always close hydrogen valves and issue shutdown event if hydrogen detected, except in startup mode. Load Monitoring If not online and output current > 0 or output voltage < min, then issue shutdown event. If online and load current is > max allowed, or if output voltage is < min then turn on another stack. If all stacks are on, then issue overload event. UI Process If “line” button pushed and online issue offline event, If offline issue online event. If “power” button pushed and not in off mode, then issue shutdown event.
5
CSE 466 – Fall 2000 - Introduction - 5 Master Slave Architecture Master/Slave Architecture master process: determines what mode the system is in at any given time and synchronizes mode transitions. Process events and data. Slave processes: Perform mode-dependent activities, pass data and events back to master. Logical Decomposition Master (Mode) Slave 1 (H2) Slave 2 (Load) Slave 3 (Temp) mode events Slave 4 (UI)
6
CSE 466 – Fall 2000 - Introduction - 6 Sockets are a “logical” constructs Master slave socket == 2-way fifo Socket could be implemented in shared memory, internet, or anything in between. High level architecture can be independent of implementation choices. Synthesis Problem: Map processes and sockets to processors and networks Warning: usually not done this way for embedded systems…usually designer performs the physical decompositions
7
CSE 466 – Fall 2000 - Introduction - 7 Master/Slave Software Architecture Master void master() _task_ MAST{ m = doEvent(events); if (m != mode) enq(newModeCmd(mode = m)); checkDB(); // could be separate slave } void comTop() _task_ COM{ wait(K_TMO, 1); if (!deq(cmd)) { cmd = modeCmd(next++); slave = next; } else slave = toWho(cmd); write(slave, cmd); read(slave, response); signal(VERIFY); } // probably ISR/Timer void comBot() _task_ VERIFY{ // match up resp. and commds wait(K_SIG); verify(response); addEvent(events,response); updateDB(response); //data and/or events } Slave void mainTask() _task_ SL{ manageLoad(mode); } // can queue up events void comTop() _task_ TOP{ read(master,mssg); if (!deq(resp)) event = mkEvent(db,i++); write (master,event); //prev signal(DO); }// could be ISR void comBot() _task_ DO { wait(K_SIG); do(mssg); } commands and responses are packets not single bytes mode is NOT a global variable MODE COMMANDS EVENTS and DATA responses are for previous command
8
CSE 466 – Fall 2000 - Introduction - 8 Master/Slave Software Architecture Master void master() _task_ MAST{ m = doEvent(events); if (m != mode) enq(newModeCmd(mode = m)); checkDB(); // could be separate slave } void comTop() _task_ COM{ wait(K_TMO, 1); if (!deq(cmd)) { cmd = modeCmd(next++); slave = next; } else slave = toWho(cmd); write(slave, cmd); read(slave, response); signal(VERIFY); } // probably ISR/Timer void comBot() _task_ VERIFY{ // match up resp. and commds wait(K_SIG); verify(response); addEvent(events,response); updateDB(response); //data and/or events } Slave void mainTask() _task_ SL{ manageLoad(mode); } // can queue up events void comTop() _task_ TOP{ read(master,cmd); if (!deq(event)) event = mkEvent(db,i++); write (master,event); //prev signal(DO); }// could be ISR void comBot() _task_ DO { wait(K_SIG); do(cmd); } commands and responses are packets not single bytes mode is NOT a global variable responses are for previous command POLL, OFF, POLL, POLL I=10,V=15, M=ON, I=0
9
CSE 466 – Fall 2000 - Introduction - 9 Distributed State Synchronization Master doEvents() {… if (mode == ONLINE && event->type == BUTTON) { enq(mkCmd(OFFLINE)); mode = OFFLINE; } else … } checkDB() { … } manageLoad(mode) { db[V] = readV(); db[I] = readI(); adjustStack(I,V); if (mode == OFFLINE && db[I]>0) enq(mkEvent(SHTDWN); … } do(m) { if (m != mode); if (m==OFFLINE) { out = 0; db[M] = offline; } if (m==ON) out = 1; db[M] = online; } mode = m; } Is there a problem here? POLL, OFF, POLL, POLL I=10,V=15, M=ON, I=0
10
CSE 466 – Fall 2000 - Introduction - 10 Distributed Data Master doEvents() {… if (mode == ONLINE && event->type == BUTTON) { enq(mkCmd(OFFLINE)); mode = OFFLINE; } else … } checkDB() { if (db[I] > maxI(db[T ]) shutdown(); } manageLoad(mode) { db[V] = readV(); db[I] = readI(); adjustStack(I,V); if (mode == OFFLINE && db[I]>0) enq(mkEvent(SHTDWN); … } do(m) { if (m != mode); if (m==OFFLINE) { out = 0; db[M] = offline; db[V] = INVLD; db[I] = INVLD; } … mode = m; } Is there a problem here? POLL, OFF, POLL, POLL I=10,V=15, M=ON, I=0 switching time is another factor not consider here db[I] and db[T] come from different slaves.
11
CSE 466 – Fall 2000 - Introduction - 11 Synchronous Systems warmup offline online offline need to identify mode transition periods, and identify data that is out of synch as a result of transition. Need also to know when it is valid again. propagation time
12
CSE 466 – Fall 2000 - Introduction - 12 Managing Distributed Transitions manageLoad() { db[V] = readV(); db[I] = readI(); adjustStack(I,V); … } do(m) { if (m != mode); if (m==OFFLINE) { out = 0; db[M] = offline; db[V] = INVLD; db[I] = INVLD; } … mode = m; } POLL,POLL,POLL,POLL, OFF, POLL, POLL I=10,V=15, M=ON, I=5, V=20, M=OF, I=0 Master doEvents() {… if (mode == ONLINE && event->type == BUTTON) { enq(mkCmd(OFFLINE)); mode = OFFLINE; } else … } checkDB() { if (db[I] > maxI(db[T ]) shutdown(); } enq(cmd) { if (cmd=OFF) { db[I] = INVLD; db[V] = INVLD; db[M] = INVLD; q.data[q.head] = cmd; next(q); } updateDB(response) { ignore slave responses until correct mode is received from slave } ignored, transition period db’s are not global either!
13
CSE 466 – Fall 2000 - Introduction - 13 Multiprocessor Implementation Bus Two main types of serial buses: master-slave (SPI,USB) and multi-master (I 2 C, CAN) RS-232 is point to point…but can be used as a master-slave bus.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.