|
The EA09's firmware contains a single loop in which the various aspects from sensor reading, motor control and communication are handled. In this chapter we show, how long the different parts within this control loop last and when they are called. EA09 can be run in different modes. The different modes have strong influence on the timing.
The functions investigated are:
| • | motor_update: Within this function all internal PI controllers are calculated (if internal PI controllers are activated). Also within this function monitoring messages are send to the receivers if monitoring is activated. |
| • | SetControlPoint: This function is called when a SetControlPoint message is received. The motors speed are updated if external control is activated. |
| • | ControlLoop: This function is called with 1kHz and contains the motor_update and communication with Robotino via a serial link. |
| • | udp_callback: This function is called whenever messages are received via UDP. |
| • | send_MessageA(0): This function is called from within moto_update if monitoring for motor 0 is activated. The function sends the monitoring data via UDP to the external receiver. |
| • | send_MessageA(1): This function is called from within moto_update if monitoring for motor 1 is activated. The function sends the monitoring data via UDP to the external receiver. |
| • | send_MessageA(2): This function is called from within moto_update if monitoring for motor 2 is activated. The function sends the monitoring data via UDP to the external receiver. |
main_loop //runs as fast as possible
{
every_millisecond
{
motor_update
{
if( motor_x_internal_pi_controller )
{
pi_controller_motor_x
}
if( motor_x_monitoring )
{
send_MessageA(x)
}
}
}
udp_callback
{
SetControlPoint
}
}
|