paparazzi-devel
[Top][All Lists]
Advanced

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

[Paparazzi-devel] Supervision and Actuator set question


From: Jayson MacKiddie
Subject: [Paparazzi-devel] Supervision and Actuator set question
Date: Mon, 1 Mar 2010 00:09:14 -0500

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

reply via email to

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