ethz-asl / rotors_simulator

RotorS is a UAV gazebo simulator
1.24k stars 759 forks source link

Quadrotor Ardrone Control #526

Open m-erdem opened 5 years ago

m-erdem commented 5 years ago

Hello all, Since last week I was trying to make ardrone follow waypoints. I start simulation by using default hovering example and then publish my waypoints to the corresponding topic. Until here everything is okay. However, after I start simulation and start publishing waypoints, ardrone cant fly stable and start to oscillate. The only reason that come to my mind is because of PID controller coefficients are not tuned well w.r.t. ardrone model. To understand whether I am right, I edited hovering_example.cpp file and give only waypoint [x: 1.0, y: 2.0.z: 1.0] as goal(to have movements on all 3-axis). Eventhough it goes to goal point, ardrone keeps oscilliating. I did the same procedure with firefly and it was more stable and didnt oscilliate after reaching goal point. To wrap it, ardrone PID coefficients are not well adjusted and causes oscilliations(If I am wrong please enlighten me). How can I tune controller by using Ziegler-Nichols or any other methods. In Matlab we have scopes and by observing outputs we can easily tune controller parameters. I am a newbie in ROS/Gazebo environment and need your help. If there is anyone who has a better PID coefficients for ardrone or wants to share their tuning way/parameters, I would be really appreciated.

ttdm commented 5 years ago

Hello,

I was just passing by. There are multiple things, first you should see this issue from 8 month ago https://github.com/ethz-asl/rotors_simulator/issues/488 . It does not totally fix the issues with the ardrone but it helps.

And then there is another issue, the moment constant, in "ardrone.xacro" is really low which means that you need a huge difference in rotors speed between your first&third and second&fourth rotors in order to have a little bit of yaw change. As a consequence, when you ask for a huge yaw change, the motor speed command is negative ( then truncated at 0 ), but it also creates some oscillations. As a fix, you can increase your moment constant, between 3 and 10 If i recall what I did ( too much will alse create instability ).