Implementation of new mixer: how to handle normalized thrust and torques?

Hello everybody

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

Basically, what I did until now is taking _att_control from the attitude controller, multiply it with the inertia matrix to get the actual desired torques in roll, pitch and yaw according to the equations of motion.

But what I don’t understand is how the thrust is handled. For example, what exactly is the thrust set-point, which unit or how is it normalized and especially, how can I transform those normalized values to actual thrust values in Newton, if I know the vehicle properties (e.g. mass, inertias, …)

If someone has a hint or any idea, I would greatly appreciate it. Thank you! :slight_smile:

Imo the thrust waypoint are normalized because otherwise you could “saturate” . if you send a throttle at 1 pitch at 0 and roll at 0.5, the mixer will do somthing like decreasing throttle such that you can still tilt the pitch. I think it makes sense because otherwise you would not be able to tilt while being at full throttle.

Maybe this can give you some ideas