Fly Crazyflie 2.1 inside a 200mm pipe

Discussions about all things Bitcraze
Post Reply
dedecun
Beginner
Posts: 6
Joined: Tue Jul 02, 2019 1:43 pm

Fly Crazyflie 2.1 inside a 200mm pipe

Post by dedecun » Tue Jul 02, 2019 2:01 pm

Hi, guys!

Call me crazy, but I want to fly the Crazyflie 2.1 inside 300mm pipes! I have built a mockup pipeline to start experimenting with. First attempt was with what I have out of the box, including the Flow deck and the Multiranger deck, controlling with the joystick (through cfclient) and I failed miserably! Take a look:

https://www.youtube.com/watch?v=qXTAszrpZHY

I can tell we have got problems with turbulence and ground effects there. Anyway, I thought I could build a small cage, inspired in the Rolling Spider Mini Parrot, so it would help me be a little resilient to bumping, considering I would bump for sure. It got a little better, but still bad:

https://www.youtube.com/watch?v=JMazRG9Sos4

I have investigated the behavior of Crazyflie in these experiments by looking at the sensor values to try to understand the situation. The sensor seem to be working properly, even though the surface of the pipe is metallic. What I concluded is that I will need to craft a custom low level controller that can cope with the turbulence caused by the confined space inside the pipe. Before devoting a lot of time in this direction, I would like to ask for some guidance from you, in order not to waste precious resources:

1 - Is the low level custom controller the way to go here? Is there any other faster way?
2 - Have you heard of anyone that tried to do anything similar to this?
3 - Do you believe this is feasible?

Thank you in advance for any enlightenment.

Cheers!



kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by kimberly » Fri Jul 05, 2019 7:56 am

Hi Dedecun,

Really awesome project! but quite challenging indeed. :shock:

About your first video, it seems like the area in the pipe was quite dark, which can be quite difficult for the optical flow sensor on the flowdeck to deal with. Moreover, I see that the pipe material is reflective, so that will not help with the IR range sensors under the flow deck and the multiranger either! The ground-effect won't help either,

1. Before you start and look into the low level controller, have you tried to look at the motion measurements and range measurements and see what happens with them (maybe flying manually for measurements if you are a good pilot :) ) ? You might need to coat the inside of the pipe with a mat finish and be sure there is a bright and textured surface for the flowdeck to fly on. You can also try to solely fly based on the multiranger and z-ranger ( disabling the flow sensor), but that will require some tweeking to the code.

2. I haven't heard of anybody doing this before with a crazyflie but 3. I would see it is possible.

Let us know if you did some measurements! Keep us up to date!

dedecun
Beginner
Posts: 6
Joined: Tue Jul 02, 2019 1:43 pm

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by dedecun » Fri Jul 05, 2019 9:16 am

Hi, Kimberly.

Thank your very much for your answer.

Yes, I had considered the problems you mentioned before thinking about looking into the low level controller. Sorry for not making that clear. Take a look at the following presentations with charts and video so you can take a look at the experiments and measurements. :

https://www.dropbox.com/s/ndvslvxjmnf32 ... .pptx?dl=0

Let me know what you think, and if you agree with my conclusions written in the slides. Remember to play it as presentation so you can watch the videos in the slides (they are all videos not pictures).

Cheers,

Andre

kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by kimberly » Mon Jul 08, 2019 8:42 am

Wow I'm impressed by the level of investigation you've already did on this. :) Very clear! Are you using the Crazyflie 2.1?

Okay so we can rule out the range sensors, and it seems that the ground effect is indeed not helping seeing experiment 8. A small note though on experiment 3: you should also look at the motion measurement of the optical flow sensor. Even though this is easier for the range sensors, I would still expect that the optical flow sensor is having difficulty with this color. It must be lighter and there should be a lot more texture.

However, it does seem that there is a very high chance that it is indeed the ground-effect. That will be a bit more difficult to solve, and it would indeed require either tuning the gains of the PID controller to respond quicker to changes of the estimates of the roll yaw and pitch. First of course try that, and if that doesn't work you should probably consider implementing something else.

Just a suggestion: have you looked at the following paper:
Smeur, Ewoud JJ, Guido CHE de Croon, and Qiping Chu. "Gust disturbance alleviation with incremental nonlinear dynamic inversion." 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2016.

It is a bigger platform, and they are not flying in a pipe, but they are able to withstand wind of a very strong fan (later publications even involve a windtunnel ). To implement an INDI controller on the Crazyflie would be a great addition! And with the new IMU on the Crazyflie 2.1 this might work for your problem as well.

dedecun
Beginner
Posts: 6
Joined: Tue Jul 02, 2019 1:43 pm

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by dedecun » Thu Jul 11, 2019 10:08 am

Hi, Kimberly.

Thank you for your help! :)

I have talked to Dr. Ewoud Smeur and he is willing to collaborate in the implementation of an INDI controller for the Crazyfle. I will try to do something under his guidance, and he might have some of his own student on it as well. What would be the best approach to contribute? Is there a contribution guide we should follow? Are you willing to support us in this contribution in any way?

Thanks again for your time and help!

kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by kimberly » Thu Jul 11, 2019 10:25 am

Awesome that you contacted him.

We have an contribution guide right here: https://www.bitcraze.io/contribute/. The best way is to keep us up to date on the process, and once you think you have a controller works stabily on the crazyflie, you are more than welcome to create a pull request to the github repository (crazyflie-firmware).

I hope to hear more about this in the future!

dedecun
Beginner
Posts: 6
Joined: Tue Jul 02, 2019 1:43 pm

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by dedecun » Fri Jul 12, 2019 9:01 am

Hi, Kimberly.

What would be the correct way to add a new possibility of a controller to be chosen by the user in the firmware? I believe there is an implementation of a different possible controller already (Mellinger) so maybe there is already an interface to add new controllers. If you can point me to the process of how to add a new possibility, or maybe to the PR or commits which added the Mellinger, it would be very helpful.

Thank you!

kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Fly Crazyflie 2.1 inside a 200mm pipe

Post by kimberly » Fri Jul 12, 2019 12:45 pm

Best would be indeed to look how the mellinger controller has been implemented. The initial commit can be found here:
https://github.com/bitcraze/crazyflie-f ... 61b069d591

But if you go to crazyflie-firmware/src/modules/src/controller_mellinger.c and hit 'History', you can also see the entire commit history.

And ofcourse, if you have any more questions on how to implement this, you can also start a forum thread in 'crazyflie nano quadropter - Developer discussions'

Post Reply