Trim is an important part of any RC transmitter.  Here we’ll discuss what trim is, when you need it, and how to use it.

 

What is Trim

Adding trim to a drone is an easy way to correct any imbalances in the motors.  You can think of it as just a constant offset value that is added to your normal motor commands.

Let’s look at an example.  Imagine we are trying to fly forward:

  • THROTTLE = 0
  • PITCH = 70
  • ROLL = 0
  • YAW = 0

Straight

Sometimes, though, our motors or propellers won’t be in perfect condition.  The CoDrone can stabilize itself, but might still tend to lean towards a weaker motor.  If one of our right motors are weaker, our CoDrone will tend to roll to the right:

Not Straight

This unwanted roll can be balanced out by adding an artificial, opposite roll to our code.  This constant offset is what we call trim:

  • THROTTLE = 0
  • PITCH = 70
  • ROLL = 0 – 300 (Trim)
  • YAW = 0

Add Trim

If applied correctly, this trim can offset our motor imbalances and result in a level flight.  Notice that the Trim ranges from -800 to 800.

After Trim

How to Set Trim

There are a few ways to set the CoDrone’s trim.  The easiest method is to use the Set_TrimAll() function:

This will add a trim in the direction specified.  For example, if we wanted to add a positive Pitch trim of 300, we would write

Trim code is saved by the CoDrone internally, so even if you change your controller code and upload new programs, the trim you set will stay with the CoDrone.  Your trim setting will usually happen right after the CoDrone is paired.

A noticeable amount of trim will usually be about 300 to 400.

 

 

Advanced Trim Setting

Use this code to adjust your trim while maintaining flight control of your CoDrone.  This will allow you to pinpoint the amount of trim you need as you fly.

First copy and paste the trim code provided above into a blank Arduino sketch.  Compile and upload this sketch to your CoDrone controller. Instructions to use the code are provided below:
This code will help you trim your CoDrone.

– Touching the left sensor will send the Stop command to your drone
– Covering the right sensor will engage Trim Mode
– Covering both the left and right sensors will reset all trim values to 0

How to Trim:
When NOT covering the bottom right IR sensor, the controller will act as a normal controller.
Use this mode to test your CoDrone and see what trim is necessary.

To add trim, simply cover the right IR sensor with your finger and push the joystick fully in the direction
of the desired trim. Trim adds incrementally, so if you want to add a lot of trim just tap the joystick
multiple times (or hold it there). To properly add trim, you must be covering the right IR sensor while you move the joystick
in the trim direction.