How to use Lee Controller in Crazyflie-lib-Python #1528
-
Hello. I have code from the Crazyflie Python library, and I want to experiment with this example code using the Lee Controller. I understand that the Lee Controller's control mode uses torque and thrust as the control output through controlModeForceTorque. However, in the ramp.py code, it appears that the thrust command is given directly to PWM. So, when using the Lee Controller, do I need to convert to force and torque values rather than PWM? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The thrust in the setpoint was originally based on PWM. However, battery compensation has since been added, so it's no longer purely PWM that we use as a reference. Instead, it's more accurate to consider it as a throttle command, scaled from 10001 to 60000. This "thrust" refers to the mean thrust. The controller generates commands to control the attitude, and these are combined with the thrust to produce the average thrust as requested. The attitude controller's commands are prioritized, and the thrust is scaled accordingly. Regarding the Lee controller: thrust and torque are internal to that controller (#1503). It still relies on the same setpoints as other controllers, including this PWM-like "thrust" setting (i.e., the throttle I mentioned earlier). |
Beta Was this translation helpful? Give feedback.
The thrust in the setpoint was originally based on PWM. However, battery compensation has since been added, so it's no longer purely PWM that we use as a reference. Instead, it's more accurate to consider it as a throttle command, scaled from 10001 to 60000.
This "thrust" refers to the mean thrust. The controller generates commands to control the attitude, and these are combined with the thrust to produce the average thrust as requested. The attitude controller's commands are prioritized, and the thrust is scaled accordingly.
Regarding the Lee controller: thrust and torque are internal to that controller (#1503). It still relies on the same setpoints as other controllers, including this P…