I am currently trying to implement a custom control allocation or mixer. The algorithm takes the desired thrust and torque set-points and further the maximum and minimum thrust of the propellers as inputs. After that, it outputs the desired motor speeds which could be transformed into the individual propeller thrusts, too.
I put the code into the
/Firmware/src/lib/mixer/mixer_multirotor.cpp which, as far as I understand, takes normalized (!) thrust and torques as input and outputs normalized (!) PWM values for each actuator. Furthermore, I have the mapping relationship from propeller thrust to PWM signal of the ESC/motor/propeller used in the drone.
My question now is how to deal with those normalized thrust and torques set-points. How can I convert them to the actual thrust and torques? At the moment I am "denormalizing" thrust and torque by multiplying them with calculated maximum thrust and torques.
I would greatly appreciate any help! Maybe someone has even an idea of a better way to implement a new mixer.
Annex: The code can be built and the simulated drone is flying, too. But after some time, it starts to suddenly drop some height and eventually it crashes because it somehow tries to overcorrect that drop.
Thank you and regards