Hi everyone,
So i decided to build my own quadcopter half a year ago and i finished everything, the drone is built, the controler is working (i built my own with arduino) and motors spin as the should. So basicly everything is working. I decided to use PID for the stabilization and its working a bit wacky. I am using MPU6050 to calculate the angle, which is working fine. So the problem is that when i turn the P gain up, it oscillates like it should, but the oscillations grow bigger. I checked everything and its working as it should, the PID refresh frequency is 400Hz. In one loop it reads sensor data, calculates the angle, the error and PID. So in theory, it should be working. I understand it should be oscillating, but i dont get why the oscillations keep growing and get bigger over time! Of course, if i turn the P gain down, the grow slower, but there just isnt any P gain where they dont grow and get bigger over time. Even if i use the smaller P gain (if i use really small gain the output of the pid is too small to actually make any changes to the motor speed).
My hypothesis is that the motors i am using have so big delay that the PID is working as it should, and the signals to the motor drivers are being sent at the right time, but the motors actually produce thrust with such a delay that it overshoots more and more because it doesnt correct the angle at the right time but with delay. Could this be the problem?
With best regards, mate115
So i decided to build my own quadcopter half a year ago and i finished everything, the drone is built, the controler is working (i built my own with arduino) and motors spin as the should. So basicly everything is working. I decided to use PID for the stabilization and its working a bit wacky. I am using MPU6050 to calculate the angle, which is working fine. So the problem is that when i turn the P gain up, it oscillates like it should, but the oscillations grow bigger. I checked everything and its working as it should, the PID refresh frequency is 400Hz. In one loop it reads sensor data, calculates the angle, the error and PID. So in theory, it should be working. I understand it should be oscillating, but i dont get why the oscillations keep growing and get bigger over time! Of course, if i turn the P gain down, the grow slower, but there just isnt any P gain where they dont grow and get bigger over time. Even if i use the smaller P gain (if i use really small gain the output of the pid is too small to actually make any changes to the motor speed).
My hypothesis is that the motors i am using have so big delay that the PID is working as it should, and the signals to the motor drivers are being sent at the right time, but the motors actually produce thrust with such a delay that it overshoots more and more because it doesnt correct the angle at the right time but with delay. Could this be the problem?
With best regards, mate115