Foldable quadrotor

Hello everyone,
I have design a foldable quadrotor where I have four independent rotate arms controlled by four servomotors type DYNAMIXEL AX-12A .
I this type of quadrotors, the matrix allocation change in function of arm rotation (angle alpha_i) . The inertia matrix change and the center of gravity change.
I used Arduino to control servomotors and to have there position.
I want to implement this informations (angles alpha_i) in the Pixhawk software, in order to calculate the center of gravity, the inertia matrix and the matrix allocation.
So for each quadrotor configuration the Pixhawk receive angles and calculate the necessary commands.
How can I do all of this?
is it better to use Matlab or another method to implement this algorithm ?

Hi , yes you can do simulations on matlab and after when the algorithm is ok , you have to code a new control module that will replace the actual control module : mc_att_control and mc_pos_control
you have to write the mixer in your control code , because the actual mixer is not done for dynamic allocation.
good luck it’s lot of work ! i’m working on custom control module too

1 Like