the goals is a flip

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
Davidefinocchi
Beginner
Posts: 4
Joined: Mon Oct 29, 2018 3:52 pm

the goals is a flip

Post by Davidefinocchi » Mon Oct 29, 2018 4:08 pm

Hi, i'm using a crazyflie 2.0 for the first time, the goals of my project is to make a flip, anyway i don't know how to start my project and how can i better undestand the code?
i undestood that to communicate with the drone i have to write a script in python where i use the cflib, but for a maneuver like flip i think the pid is not enough.
which control alghoritm is better to do a flip? Are there any firmware where the algorithm is just implemented?
Or is better make a script in python where there are control and trajectories?
Hope in some usefull suggestion or some code to try and better undestand the code.
Thanks

arnaud
Bitcraze
Posts: 1827
Joined: Tue Feb 06, 2007 12:36 pm

Re: the goals is a flip

Post by arnaud » Tue Oct 30, 2018 2:32 pm

Hi, you most likely will need to work in the firmware since you need to control the Crazyflie in rate mode to achieve a flip and you most likely need to react quickly to the change of attitude (ie, enable rate mode, flip, reenable absolute mode when the angle of the platform is flat enough).

You can look at the paper from USC from Crazyflie 1.0 in the research portal: https://www.bitcraze.io/research/#publi ... azyflie-10. It describes making the Crazyflie 1.0 flip 1, 2 and three times. The same principle could be applied to Crazyflie 2.0, though the thrust margin is a bit lower on Crazyflie 2.0 so 3 flip might not be possible to achieve.

Davidefinocchi
Beginner
Posts: 4
Joined: Mon Oct 29, 2018 3:52 pm

Re: the goals is a flip

Post by Davidefinocchi » Wed Nov 07, 2018 9:23 am

i notice that when the drone go head down the motors shut-off, i want to try to disable this limitation, cause i found a trajectory that can be feasble by pid. It is possible to do it?

arnaud
Bitcraze
Posts: 1827
Joined: Tue Feb 06, 2007 12:36 pm

Re: the goals is a flip

Post by arnaud » Thu Nov 08, 2018 7:51 am

This is implemented there: https://github.com/bitcraze/crazyflie-f ... #L135-L141. If you comment this code out, it should disable the behavior.

Davidefinocchi
Beginner
Posts: 4
Joined: Mon Oct 29, 2018 3:52 pm

Re: the goals is a flip

Post by Davidefinocchi » Mon Nov 12, 2018 2:36 pm

I have another question, to control the drone during the flip, the controller use angular velocity and angular accelleration, it is possible obtain tha angular accelleration by cf client, with the logger or have i to do a descrete derivative of angular velocity?

arnaud
Bitcraze
Posts: 1827
Joined: Tue Feb 06, 2007 12:36 pm

Re: the goals is a flip

Post by arnaud » Mon Nov 12, 2018 3:00 pm

I do not think angular acceleration is something we estimate in the Crazyflie: the gyroscope gives us a reading in angular velocity. So you will need to estimate it yourself either on the ground or on the Crazyflie.

Davidefinocchi
Beginner
Posts: 4
Joined: Mon Oct 29, 2018 3:52 pm

Re: the goals is a flip

Post by Davidefinocchi » Thu Dec 06, 2018 9:46 am

we notice that we can't send a angular velocity packet type to quadcopter, it is possible to implement that on firmware modifying the decoder function in crtp_commander_generic? and the controller is able to compute this type of packet or we have to modify the PID controller?
If exist a code where is implemented which i'm asking please link me to that. thaks

arnaud
Bitcraze
Posts: 1827
Joined: Tue Feb 06, 2007 12:36 pm

Re: the goals is a flip

Post by arnaud » Thu Dec 06, 2018 9:56 am

crtp_commander_generic is the right place to implement a velocity setpoint packet. The PID controller should already handle it fine since it has been previously implemented using the rpy controller packet. I do not know of any existing implementation but it should be pretty easy to add the new packet type by looking at the other packet implementation as examples.

Post Reply