-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attitude controller not tracking command roll and pitch angles #74
Comments
Thanks for opening your first issue here! Make sure that no other issues on the same topic have already been opened! |
Hi @bobbyvanthiel! First of all, thanks for your valuable feedback and comments. I really appreciated them. Anyway, have you tried to force the controller to run at a given frequency (e.g., As for the previous question, it has been a long time since I released CrazyS. At that time, I was working with the 2018.01 release of the firmware. Therefore, we can assume that for sure something has changed in these two years. Hence, I cannot answer the question about the gains. I don't know what your plan is, but if at the end of the day you would like to test your controller with the physical vehicle, I'd rather start checking out the differences with the onboard firmware. Afterward, if there are any changes with the parameters, and finally use the I hope this helps. Please, let me know if you have any further comments or questions. |
Thanks for your response! I dove a little further into the Secondly, could you please elaborate on the frequency of 161 Hz? Your paper suggests that the all controllers should run at 250 Hz, except for the rate controller, which should run at 500 Hz. However, on the top of the controller files, |
How did you measure the working frequencies? Did you use the To speed up the real-time factor, you could remove not necessary plots from the launch file. The real-time factor is an existing problem that I ran into. I'm aware that other simulation environments, such as MRS System, do not have such issues. However, we should delve into the RotorS implementation (it is used as a basis for CrazyS), to see where this error comes from. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Dear @gsilano,
Thank you for sharing this CrazyFlie simulator.
I am adapting the
crazyflie2_with_joy.launch
example to work with a custom controller I build. It sends roll/pitch/yawrate/thrust command topic to theroll_pitch_yawrate_thrust_crazyflie_node.cpp
at 80 Hz. The main issue is that the provided attitude controller does not properly track the commanded roll & pitch angles. Perhaps issue #43 is related to this behavior.My setup:
The attitude controller runs in the
roll_pitch_yawrate_thrust_crazyflie.cpp
among the other lower-level controller if I am not mistaken. This file has#define SAMPLING_TIME 0.01
which suggests this control loop runs at 100 Hz. However, I experienced that the attitude controller actually runs at ~240 Hz (when the roll/pitch/yawrate/thrust command topics are send at 80 Hz). Upon halving the custom command rate to 40 Hz I observe that the attitude controller also changes frequency but not with the same proportion. In other words, (80 Hz → ~240 Hz), (40 Hz → ~180 Hz) with (custom topic rate → attitude update rate).This suggests that the attitude controller does not run at a fixed frequency, but is dependent on the control commands’ frequency, but also other (unkown) factors have an influence.
Moreover, the CrazyS paper suggests that the attitude controller runs at a fixed 250 Hz. 250 Hz, which corresponds to 1 / 250 = 0.004 seconds. Then why is the macro
roll_pitch_yawrate_thrust_crazyflie_node.cpp
set to#define SAMPLING_TIME 0.01
, as this would correspond to 100 Hz. This will likely have a large influence on the attitude controller performance, as the integrator error is multiplied withSAMPLING_TIME
.Furthermore, are the control gains from the
crazyflie2_with_joy.launch
exactly the same as in the ones defined in the Crazyflie firmware of Bitcraze?Lastly, do you think it is better to use
crazyflie2_hovering_example.launch
as a starting point, and adapt it such that it accepts roll/pitch/yawrate/thrust command topics. If so, where would you think we can best adapt this example such that it accepts these topics?The text was updated successfully, but these errors were encountered: