paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Supervision and Actuator set question


From: antoine drouin
Subject: Re: [Paparazzi-devel] Supervision and Actuator set question
Date: Mon, 1 Mar 2010 08:46:25 +0100

All four actuators are set once per cycle
The first one is triggered synchronously by the call to actuator_set
from the periodic function of the mainloop.
The 3 others are triggered asynchronously upon I2C transmit completion
interrupt.

look at the code in sw/airborne/arm7/i2c_hw.h and the
I2C0_STOP_HANDLER flag in
conf/autopilot/subsystems/booz2_actuators_mkk.makefile

Regards

Poine

On Mon, Mar 1, 2010 at 6:09 AM, Jayson MacKiddie
<address@hidden> wrote:
> Hello all,
>
> Something is alluding me. I've gone through the actuator and supervision
> code, and done hours of poking around in Booz figuring out how things work
> by breaking things to find out where they come into play.
>
> In booz_actuators_mkk.c we have:
>
> void actuators_set(bool_t motors_on) {
>
>   supervision_run(motors_on, FALSE, booz2_commands);
>   actuators_mkk.status = BUSY;
>   actuators_mkk.i2c_done = FALSE;
>   actuators_mkk.idx = 0;
>   i2c0_buf[0] = supervision.commands[actuators_mkk.idx];
>   i2c0_transmit(actuators_addr[actuators_mkk.idx], 1,
> &actuators_mkk.i2c_done);
>
> }
>
> I notice that   actuators_YGE.idx = 0;   will result in this function only
> resulting in transmission to actuators_addr[0]. So this couldn't be used to
> command the other 3 actuators. Could this be something that was changed for
> testing but never changed back? I figure if this index was incremented each
> run and masked by hex 03 then this would command one actuator each time the
> function is run. I notice the function is called in booz2_main_periodic( ).
>
> If the above is as it should be, then I allow me to continue. In
> booz_actuators_mkk.h we have:
>
> #define ActuatorsMkkI2cHandler() {                    \
>     actuators_mkk.idx++;                        \
>     if (actuators_mkk.idx<ACTUATORS_MKK_NB) {                \
>       i2c0_buf[0] = supervision.commands[actuators_mkk.idx];        \
>       i2c0_transmit(actuators_addr[actuators_mkk.idx], 1,
> &actuators_mkk.i2c_done); \
>     }                                    \
>     else                                \
>       actuators_mkk.status = IDLE;                    \
>   }
>
> Now this could actually work with the whole update one actuator per function
> call idea on account of  actuators_mkk.idx++;  except I don't see
> actuators_mkk.idx  wrapped around to zero after hitting 3 anywhere. This is
> not taken care of in supervision so is this done elsewhere or not at all?
>
> Are all four actuators set each cycle or one per cycle, and where in the
> main loop or periodic task?
>
>
> Highest Regards,
> Jayson MacKiddie
>
> _______________________________________________
> Paparazzi-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/paparazzi-devel
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]