120 likes | 219 Views
Tutorial Robot :. Alvin AuYoung EECS (Junior). Daniel Jhin Yoo EECS (Senior). an implementation of the Embedded Machine. Overview. Embedded Machine Design Demo TuteBot Implementation Following a Path. Kernel Structures. Kernel Subsystems:. TM.c. EM.c. Tasks. Interpreter.
E N D
Tutorial Robot: Alvin AuYoung EECS (Junior) Daniel Jhin Yoo EECS (Senior) an implementation of the Embedded Machine
Overview • Embedded Machine Design • Demo • TuteBot Implementation • Following a Path
Kernel Structures Kernel Subsystems: TM.c EM.c . . . . . . Tasks Interpreter Tiggers Eco + Ports
Emachine Trigger List EInterpreter Life of an Emachine eco[] User Program schedule trigger return handle_trigger()
Triggers? E-Machine: Kernel 1ms Poll Subsystems CAL Synchronous Computation Einterpreter Scheduled Computation LegOS Scheduler Yes No EMP Done
EMP and CAL • EMP • Trigger list is just a sorted list w.r.t deadline • Only signal port allowed is CLK! • CAL • Uses already existing legOS Task Structure and execi • priority = infinity - deadline (unsigned long) • This results in an EDF scheduler w.r.t. deadline
DEMO 1: The EE40 Tutebot bump!
Theory of Operation Giotto High Level Description (Compiler) Distributed Code Ecode
High-Level Description {move motors, check touch sensors} {reverse motors, check timer} If touch sensor pressed/ switch to Mode R Mode R Mode F If timer is up/ switch to Mode F If timer is up/ switch to Mode T Mode T {change direction, check timer}
High Level Implementation: Giotto Start f() { mode f() period 200 ms entry freq 1{ taskfreq 2 do function_forward(); exitfreq 1 if TouchSensor then mode r(); } mode r() period 1000ms entry freq 1 taskfreq 10 do function_reverse(); exitfreq 1 if TimerUp() then mode t(); } mode t() period 1000ms entry freq 1 taskfreq 10 do function_turn(); exitfreq 1 if TimerUp() then mode f(); }
Distributed Code Generation: E code Mode_f: psh(0) emp(clk)(Invoke_forward:) add(200) emp(clk)(check_mode_f:) pop ret check_mode_f: red(read_touchSensor) prd(touchSensor_pressed) cmp(Mode_f:) jmp(Mode_r:) Invoke_forward: psh(0) neq(200) cmp(End:) cal(clk)(function_forward) add(100) jmp(Invoke_forward) End: pop ret
DEMO 2: Following a Path {move forward, check R and L sensors} {turn right, check R sensor} R light sensor: see path Mode R Mode F R light sensor: no path L light sensor: see path L light sensor: no path Mode L {turn left, check L sensor}