# SW Dev: Math model for control loop

Before to start development of the python code, I tryied to create the math model that can reproduce the theoretic dynamic behaviour of a quadcopter.You can find it in  control_loop.xls.[Rimoved. See here]

Please, if someone interested can send me its own quadcopted data (length motor-quad center,arm mass,motor mass,total mass,hover motor speed,PID parameters)I’d like to put in there to validate my model.

Hypothesis:

• configuration +copter
• case study: Roll

Data:

• R.target is the desired roll angle
• R.acc is the angular acceleration(calculated respect the angular motor speed w of the previous )

Dynamic balance is given by:

(F1-F3)b=I R.acc Kprop(w1^2-w3^2)b= I R.acc

with Kprop=(Mtot*g)/wh^2   I=(Mbar*b^2)12+2*Mmotor*b^2

R.acc=Kprop*(w1^2-w3^2)b/I

• R.vel is the angula roll speed calculated as integral of R.acc
• R.curr is the thoretical roll angle calculated as integral of R.vel. This value should correspond ot the return of a gyroscope mounted on board of the real quadcopter.

So using this model I can play with P,I,D parameters and find out teh best configuration.