I have to publish a required throttle and attitude to setpoint_raw/attitude. I am unable to figure out, how a mapping between the actual thrust(force or acceleration) required and throttle can be made. Any help?
Please note that the required acceleration is computed using a guidance algorithm.
Thanks in advance!
I found the following link: (Static) Thrust = f(RPM).
I think it should be reasonable to calculate RPM = f(Thrust) given that equation.
(S)He also explains the derivation of the equation. @BossHater: how did you come up with your equation?
throttle = throttle + (a_cmd - a_curr) *k
Is there any scientific background to that or is it a fit using some data?
I donāt want to sound rude, just wonderingā¦
@robin-ecn The only thing you need to figure out is the scaling factor between the normalized thrust and the acceleration. This is hardwawre dependent on what kind of mootrs / voltage you are using.
A good guess can be made with the hover throttle. For example, if your drone hovers at a normalized thrust value of 0.5, that means the normalized thrust value of 0.5 is going to be close to accelration value of 9.8m/s^2.
This way, the normalized thrust values can be mapped to the actual acceleration.
But we are not sure the mapping is linear, right? I am not sure about that. That is why I am stepping inside of the px4 and mavros codes trying finding out the exact relation.
@robin-ecn The actuator commands corresponds to the PWM values commanded on the ESCs. The nonlinearity is not that high and I believe the performance will not be too bad even if you assume that it is linear. Given that the thrust values will not vary too much around the hovering value of the thrust commands.
Even if you manage to model the nonlinearity between the pwm and thrust generation, this will no longer hold when the drone starts to move dynamically as the thrust generated by the rotors will vary on the load and speed.
There are a lot of people testing motors and measuring thrust vs pwm values on benches so this could be a good reference for you
I have a question. When you said āThe actuator commands corresponds to the PWM values commanded on the ESCs.ā, you mean āactuator_control provided by MAVROS are actually the PWM of the motorsā?
Now I am trying to control the motors directly, do you have some good reference on that.