Monthly Archives: August 2014

Beta2test. First video on the blog…

Back from holiday, I’m goning on with pid tuning.

this  very short  post is dedicated to my first  video with my quadcopter in action.

You can see that it can change its roll according to new required roll target.

stay in touch for new videos.


Beta2test.Before going on Vacation

During the last week  I  made some improvements on the code that I need to report here in order to avoid any  oversights after the upcoming vacations…

  • Added a function to tune manually the P,I and D  on the run.
  • in added a function to calculate an average during the D_correction calculation. This help to have a smoother value.
  • Display results every 0.2 sec, instead every cycle (trying to reduce cpu load).
  • improved log
  • Calculation of  the angular speed (roll_rate, pitch_rate and yaw_rate) in the sensor_py. Those values are coming from the derivate of the roll,pitch and yaw already filtered with the complementary filter. they are not the row  roll_rate,pithc_rate and yaw rate  from the gyroscope.

The main improvement has been the introduction of the  PID  for the roll_rate.I did a new  module called  where I put  two PIDs in series. This is a typical approach in the quadcopter controller. The first PID  returns the  Roll_correction. (this number represent the angle variation that I ‘d like to have in one step).

Dividing the  Roll_correction for the cycletime, it represent the angular speed (roll_rate) I’d like to have in one step.It is the target for my new roll_rate PID.The feedback is the angular speed calculated in the result is a really more stable quadcopter, less nervous and more quick on the response.

Below the graph that show the current state of the tuning.



As you can see, there is still an oscillation, but it is  between +/- 1 degree.Where I need to work is  fact that  the system never reach the target.(now I have a very simple roll_Pid , with I=0 and D=0. I’m thinking to set a v alue for the I also).