getting_started:tutorials:controlsystem
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
getting_started:tutorials:controlsystem [2016/10/21 08:52] – created graf | getting_started:tutorials:controlsystem [2016/10/23 10:28] (current) – graf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | A simple control system consists of a single time domain which has to be run periodically by the excutor. Write your main program as follows. First you have to define the executor and set ist own speed. The executor runs its own periodic task, the main task. | ||
+ | <code cpp> | ||
+ | eeros:: | ||
+ | executor.setPeriod(0.001); | ||
+ | </ | ||
+ | |||
+ | Next we have to define this main task. In general the main task will be the safety system. To make matters simple we omit the definition of the safety system. Please check for this in [[getting_started: | ||
+ | <code cpp> | ||
+ | SafetySystem ss; | ||
+ | executor.setMainTask(ss); | ||
+ | </ | ||
+ | |||
+ | Now we create a time domain and add it to the executor. | ||
+ | <code cpp> | ||
+ | eeros:: | ||
+ | executor.add(td1); | ||
+ | </ | ||
+ | |||
+ | This creates a time domain which should run in real-time with a period of 1 millisecond. Obviously the time domain has no blocks yet and therefore doesn' | ||
+ | |||
+ | You could also create a periodic task as a separate object and assign it a time domain as follows. | ||
+ | <code cpp> | ||
+ | eeros:: | ||
+ | eeros:: | ||
+ | executor.add(per3); | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
getting_started/tutorials/controlsystem.1477032771.txt.gz · Last modified: 2016/10/21 08:52 (external edit)