### 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

You need to be a member of diydrones to add comments!

#### 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;
This reply was deleted.

### Activity

DIY Robocars via Twitter
RT @chr1sa: On May 22, we're returning to in-person AI @DIYRobocar racing at @circuitlaunch. The Amazon @awscloud DeepRacer team will be pr…
yesterday
DIY Robocars via Twitter
RT @breadcentric: On my CV: Hobbies: Training bananas to race on tracks #AWSDeepRacer #DeepRacer https://t.co/MKe14hNyux
yesterday
DIY Robocars via Twitter
RT @breadcentric: See how the April AWS DeepRacer races have ended and a couple bits of news: https://blog.deepracing.io/2021/05/09/aws-deepracer-league-2021-update-11-end-of-april-special/ #AWSDeepRacer #Machin…
Monday
DIY Robocars via Twitter
RT @sunilmallya: Representation Learning +Instance Transfer to learn new reward functions along with advantage based filtering of new exper…
Monday
DIY Robocars via Twitter
Apr 27
DIY Robocars via Twitter
Apr 27
DIY Robocars via Twitter
RT @f1tenth: Sliding (autonomously) into the weekend like ... 🤖😎 #f1tenth #robots #AutonomousVehicles @OpenRoboticsOrg @NVIDIAEmbedded @Aut…
Apr 25
DIY Robocars via Twitter
RT @chr1sa: One of the problems with autonomous car racing is that watching software drive is not a very exciting spectator sport. To help…
Apr 25
DIY Robocars via Twitter
RT @SmallpixelCar: Replaced AGX Xavier with @NVIDIAEmbedded Jetson Xavier NX. Now both cars look fast and clean https://t.co/jlcoY2EjZf
Apr 25
DIY Robocars via Twitter
RT @chr1sa: Yesterday we had a record number of competitors (36) in our monthly @DIYRobocars virtual autonomous car race. We kept it going…
Apr 25
DIY Robocars via Twitter
Apr 16
DIY Drones via Twitter
RT @chr1sa: After more than a year of only virtual races, @DIYRobocars returns to the newly renovated @circuitlaunch on May 22 for the resu…
Apr 11
DIY Robocars via Twitter
RT @DAVGtech: And now available with LiDAR 🔥 https://twitter.com/Heavy02011/status/1381137016381964293
Apr 11
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #9 - #ParkingLotNerds #thunderhillracetrack, CA Join us for the next race April 24th,…
Apr 11
DIY Robocars via Twitter
RT @DWalmroth: Weather's finally cooperating, looking forward to racing 1:10 scale autonomous cars outdoors again! @diyrobocars, @NVIDIAEm…
Apr 7
DIY Robocars via Twitter
RT @AIDRI_: I finally succeeded in optimizing the trajectory and speed of a car on a #racetrack. Next step: implement a 2d controller and…
Apr 7