[ crazyflie-lib-python] send_setpoint(roll,pitch,yawrate,thrust) question: how to convert from Newton(N) to the thrust value? #167
-
Hi. I'm currently working on my master thesis. I'm developing a testbed/framework to test n-Crazyflie's indoor using the Lighthouse positioning system. So far I've developed a MATLAB/Simulink controller and some Python scripts to connect, get logs, etc. from the Crazyflie. Currently I can send the Crazyflie's logging data in real-time to my Simulink controller. Right now I must send my controller's inputs and intend to use this, from the Python lib: According to the online documentation this thrust value is an integer between 10000-60000. How can convert my controllers thrust output, in Newtons, to this thrust value? Searching online I've found this topic at the old Bitcraze forum. Supposedly using this I can convert from thrust (10000-60000) to acceleration: Is this the correct use of the formula? I've seen the mapping between thrust (in grams), PWM and RPM, (https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/pwm-to-thrust/) and according to this topicthis topic this integer thrust is the mean of all motors's PWM. But since I want to use send_setpoint(), to use PWM, battery or RPM related conversions seems too much. I feel like I'm missing something on the CONTROL_TO_ACC formula. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi! I just changed the wiki link to the new link on our web in your post, since we are phasing out the wiki. This line in the firmware: is related to the kalman filter, as it uses the control inputs to predict where the next position of the crazyflie will be. So it should be useable for what you want to do but it might not be super accurate either as we haven't tested if this fits the measurements... This filter was a contribution by ETH. They have done system identification a while ago on the Crazyflie 2.0 (which should hold for the 2.1), so that might be interesting for you to look at as well. We are in the process of making a better test rig for these measurements, but currently it's summer here so that's on a hold. In 2 weeks @tobbeanton will be back so he can give an update about that then |
Beta Was this translation helpful? Give feedback.
-
Thank you so much, I've managed to control a Crazyflie using a Matlab/Simulink controller! The controller works well but has significant static error. My controller has no integral effect (it's a Mellinger controller). I know that the CF's Mellinger controller has an added integral term to compensate battery voltage drop, etc, so I intend one as well on my Simulink controller. My university is currently closed for summer so I can't test this yet. |
Beta Was this translation helpful? Give feedback.
Hi! I just changed the wiki link to the new link on our web in your post, since we are phasing out the wiki.
This line in the firmware:
https://github.com/bitcraze/crazyflie-firmware/blob/8c925aa7abd79ac05ef7d94b98bfacd4e37441fd/src/modules/src/estimator_kalman.c#L184
is related to the kalman filter, as it uses the control inputs to predict where the next position of the crazyflie will be. So it should be useable for what you want to do but it might not be super accurate either as we haven't tested if this fits the measurements... This filter was a contribution by ETH. They have done system identification a while ago on the Crazyflie 2.0 (which should hold for the 2.1), so that might be i…