Autonomous flight without using any external position system

Discussions about autonomous flight in general, regardless of positioning method
Post Reply
ranjeetkumar
Beginner
Posts: 10
Joined: Fri Oct 12, 2018 11:05 am

Autonomous flight without using any external position system

Post by ranjeetkumar »

Hi all, I gone through sensor filtering and study of the data and now i could get position of the crazyflie 2.0 without using any external positioning system. I am using pressure, acceleration (in vertical direction), as a feedback i see average error of 20cm. I am using averaging filter to filter pressure data and clubbing it with accelerometer data which is somewhat less noisy that pressure to know when the copter is still.

Now, I want to hover my crazyflie at a particular height (say 1.5m with and error say 20cm approx), can someone suggest me what controller to use? I have used PID, Fuzzy logic controller, but nothing works. Crazyflie goes to the height but comes back to ground, then goes back again, everything seems messy.
What controller would be suitable to use? Please suggest the associated parameter values with the controller, and I have done simulations of the same, but practically it does not work. :?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Autonomous flight without using any external position system

Post by arnaud »

From your description it seems that you do not have a controller problem but more likely a sensor/estimation problem.

The existing PID controller in the Crazyflie ca do a decent job at keeping a heigh setpoint giving good quality height estimate, this can be seen when using the z-ranger or flow deck or in our latest blog post.

So I would say that the default Crazyflie PID will work as long as the height estimate is good. If you are only using the pressure sensor, it could be that the airflow from the propeller is creating a pressure difference at the sensor that is offsetting the measurement?

Ps. I edited your title from "with" to "without" since it seems to be what you are after :-)
ranjeetkumar
Beginner
Posts: 10
Joined: Fri Oct 12, 2018 11:05 am

Re: Autonomous flight without using any external position system

Post by ranjeetkumar »

arnaud wrote: Thu Mar 28, 2019 1:19 pm From your description it seems that you do not have a controller problem but more likely a sensor/estimation problem.

The existing PID controller in the Crazyflie ca do a decent job at keeping a heigh setpoint giving good quality height estimate, this can be seen when using the z-ranger or flow deck or in our latest blog post.

So I would say that the default Crazyflie PID will work as long as the height estimate is good. If you are only using the pressure sensor, it could be that the airflow from the propeller is creating a pressure difference at the sensor that is offsetting the measurement?

Ps. I edited your title from "with" to "without" since it seems to be what you are after :-)
yes Arnaud, thanks for correcting the title, as far as position estimation is concerned, there is a an error in the pressure as the copter takes off but after going above 40-50 cm , that effect also becomes small, anyway I will recheck the position estimation thing and use the inbuilt position controller in the crazyflie.

I am mentioning the pid values for Z(height) for crazyflie 2.0, please confirm if I found the correct values in the package. (Kp =5000, kd = 6000, Ki = 3500) Moreover, please suggest me how fast should i run the PID loop.
Thank you.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Autonomous flight without using any external position system

Post by arnaud »

These PID values look quite big compared to what I can gather from connecting a Crazyflie and looking at the parameters. You can connect the Crazyflie with the client and look in the parameter tab for the different level of PID tuning. The position PID runs at 100Hz.

Are you using the internal position PID or are you estimating and controlling everything over radio from a computer?
ranjeetkumar
Beginner
Posts: 10
Joined: Fri Oct 12, 2018 11:05 am

Re: Autonomous flight without using any external position system

Post by ranjeetkumar »

As far as orientatoin is conerned, internal controller of the crazyflie is being used, i am just giving 'twist.angular.x' and 'twist.angular.y' as ''0". Controller is taking care of making the orientation "0". but, I am not using the internal position controller, i have written pid controller to control position. I am written the controller in a script and communicating with the crazyflie using crazyradio and computer system.

Please tell me how can i use the internal position controller? :?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Autonomous flight without using any external position system

Post by arnaud »

In order to use the internal position controller you need to send a setpoint that enables the internal position controller. In your case the zdistance setpoint might be appropriate it will instruct the Crazyflie to hold a given altitude: https://github.com/bitcraze/crazyflie-l ... er.py#L105.

This link is to the python lib, from your wording it seems that you are using ROS? If so, the way to use other setpoint needs to be implemented in the ROS Crazyflie driver.
Post Reply