Accessing sensor information in selfmade attitude controller
Posted: Mon Nov 18, 2019 12:47 pm
Hey all,
I have developed an attitude controller for the crazyflie which I soon want to implement on the firmware. The input variables are as following:
Setpoints given by any input device:
- ascent/descent speed (in the direction of the intertial frame z-axis)
- yaw rate (angular velocity)
- Pitch- and Rollangle
The 4 corresponding actual values given by sensors (in my case calculated with model equations):
- ascent/descent speed (in the direction of the intertial frame z-axis)
- yaw rate (angular velocity)
- Pitch- and Rollangle
and as it is a cascaded Controller, it also needs:
- ascent/descent acceleration (in the direction of the intertial frame z-axis)
- angular velocities of Pitch- and Rollangle
The output values are the 4 input command values (cmd) to control the motors. I created a c-file containing the controller calculations and I want to implement it on the crazyflie to replace the original attitude controller in the firmware.
My questions for now: Is it possible to get the above named values from the firmware? Is there a function which calculates the Pitch- and Rollangle? And how can I access the values (including setpoints) in my code? Later I want to control the crazyflie using the USB-dongle.
And how can I set the input command values (cmd) respectively commit them to the motor controller?
I just started trying to implement my controller and already facing lot of difficulties. I'd be very glad if anybody can help or knows where I can find further information. I couldn't find any information in the documentations so far.
Kind regards,
Joyner
I have developed an attitude controller for the crazyflie which I soon want to implement on the firmware. The input variables are as following:
Setpoints given by any input device:
- ascent/descent speed (in the direction of the intertial frame z-axis)
- yaw rate (angular velocity)
- Pitch- and Rollangle
The 4 corresponding actual values given by sensors (in my case calculated with model equations):
- ascent/descent speed (in the direction of the intertial frame z-axis)
- yaw rate (angular velocity)
- Pitch- and Rollangle
and as it is a cascaded Controller, it also needs:
- ascent/descent acceleration (in the direction of the intertial frame z-axis)
- angular velocities of Pitch- and Rollangle
The output values are the 4 input command values (cmd) to control the motors. I created a c-file containing the controller calculations and I want to implement it on the crazyflie to replace the original attitude controller in the firmware.
My questions for now: Is it possible to get the above named values from the firmware? Is there a function which calculates the Pitch- and Rollangle? And how can I access the values (including setpoints) in my code? Later I want to control the crazyflie using the USB-dongle.
And how can I set the input command values (cmd) respectively commit them to the motor controller?
I just started trying to implement my controller and already facing lot of difficulties. I'd be very glad if anybody can help or knows where I can find further information. I couldn't find any information in the documentations so far.
Kind regards,
Joyner