User Tools

Site Tools


getting_started:tutorials:controlsystem2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
getting_started:tutorials:controlsystem2 [2016/10/23 10:29] – created grafgetting_started:tutorials:controlsystem2 [2020/10/15 16:20] ursgraf
Line 1: Line 1:
 ====== Control System with Several Time Domains ====== ====== Control System with Several Time Domains ======
-A simple control system consists of a single time domain which has to be run periodically by the excutorWrite your main program as followsFirst you have to define the executor and set ist own speedThe executor runs its own periodic task, the main task. +In the EEROS library you will find a directory with examples. Open a shell in the build directory of your EEROS library and run ''examples/controlsystem/PeriodicExample2''
-<code cpp> +This examples does: 
-  eeros::Executor &executor = eeros::Executor::instance();  +  * Creates a main task //ss// with an execution period of one second. The task itself is defined of type ''Lambda'' with a run method given by a lambda functionIt prints out two messages with a short delay in between. 
-  executor.setPeriod(0.001); // runs every millisecond +  * Creates a periodic //task1// with a period of one secondIts run method prints out some messages with a short delay in between. //task1// runs concurrently to //ss//. 
-</code>+  * Creates a periodic //t2// with a period of two seconds. Its run method prints out some messages with a short delay in between. //t2// runs after //t1// has finished
 +  * Creates a periodic //t4// with a period of four seconds. Its run method prints out some messages with a short delay in between. //t4// runs after //t2// has finished. 
 +  * Creates a periodic //t3// with a period of five secondsIts run method prints out some messages with a short delay in between//t3// runs after //t1// has finished but concurrently to //t2//. 
 +  * Creates a periodic //t5// with a period of three seconds. Its run method prints out some messages with a short delay in between. //t5// runs concurrently to //t1//.
  
 +All of the harmonic tasks have a periodic counter which measure its periods and run times. Once every 10th run the results are logged. The results are printed in milliseconds.