### Tricopter Stabilization help

Hey everyone I need some help/advice.I am in the process of finishing a tricopter build and and am having problems with stabilization.What I have tried so far is I take take the pitch and roll readings from the ArduIMU and trying to balance out the motors.If the value is greater than or less than a set accepted value an offset is changed.Similar to the principle of moving the fulcrum under a board to achieve a steady balance.here is an example:accepted tilt range +-5;If(roll >=5){Roll_Offset++;}If(roll<=-5){Roll_Offset--;}Rt_Motor_Power = Main_Power +Roll_Offset;Lf_Motor_Power = Main_Power -Roll_Offset;...The theory sounds good on paper but it seems not to be ideal for a tricopter. Am I on the correct path and just need to play around with my accepted range and amount I change the offset if the balance is off? I have looked at other peoples projects such as Jack Crossfire’s VicaCopter and either cannot find an explanation or cannot understand their source code. What is the correct way to approach tricopter stabilization.Thanks,Brandon

#### Replies

• Thank you so much for the help! I will try it out and let you know how it goes!!
• Developer
I agree with Ryan that you need a PID controller..start with just the P (proportional) part and then add the I (integral) part later.

double Pr = 2.0 // the P multiplier for RIGHT engine.
double Pl = -2.0 // the P multiplier for LEFT engine
double Pb = -3.0 // the P multiplier for BACK engine

// somehow you calculate Roll_offset and Pitch_offset or pull in from the IMU

Rt_Motor_Power = Main_Power + (Roll_Offset * Pr);
Lf_Motor_Power = Main_Power + (Roll_Offset * Pl);
Bck_Motor_Power = Main_Power + (Pitch_Offset * Pb);

You really should add the Integral (the "I" in PID) to make it somewhat self correcting but if you mess with the 3 constants at the top enough you might get it working.

Here's the link to wikipedia on PID controllers: http://en.wikipedia.org/wiki/PID_controller
• Developer
You want to do a combination of rate feedback and a PID controler to bank angle. Using rate feedback alone should make it flyable.

try something like this for starters

ail_effort = ail_pic * 1.0; //manual commands * deweighting gains
ele_effort = ele_pic * 1.0;
trt_effort = trt_pic;
rud_effort = rud_pic * 0.45;

ail_effort = ail_effort + (0-p)*kp_p; //rate feedback
ele_effort = ele_effort + (0-q)*kp_q;