Constant Yaw Rate Quadrotor

A new flight mode was implemented on to the modified Arducopter firmware that is capable of maintaining constant yaw rate while the quadrotor is able to be controlled by the pilot in respect to the inertial frame. Such a flight mode can be used in localization applications (SLAM) or imaging. Sensors that have a narrow field of view but requiring to map situational awareness aroun the quadrotor is mounted on motors which move the sensors with respect to the quadrotor body reference frame. Such method requires an additional actuator which leads to the requirement for more complex power suppies and control to control the sensors.

However, as the quadrotor is an agile platform and the control is very well established and performed in current practices. Solid mounting the sensors and moving the quadrotor itself for localization and imaging is proposed in this project. Such approach can reduce the complexity in implementing an additional actuator and weight which can be critical for aerial vehicles.


  • Frame : F330
  • Flight Controller : HKPilot Mega 2.7 (Ardupilot 2.7)
  • Motors : NTM Propdrive Series 28-26 1200kv
  • ESC : Multistar 20A ESC (OPTO)
  • Battery : Zippy Flightmax 3000mAh


Download Firmware

A simple code modification was done on the Arducopter Firmware so that the quadrotor yaw rate is not received from the remote but maintained to a constant value.

Arducopter can be downloaded from the Arducopter repository. Wiki and tutorials for Arducopter is shown in the Ardupilot website


Modify Firmware

The modification is done in the control_sport.pde as the code below. The reason I modified the sport mode code is that by modifying the existing flight modes, it is easier to configure flight modes using Mission Planner. You can also add new flight modes following this tutorial

static void sport_run()
    int16_t target_roll, target_pitch;
    float target_yaw_rate;
    int16_t pilot_throttle_scaled;

    // if not armed or throttle at zero, set throttle to zero and exit immediately
    if(!motors.armed() || g.rc_3.control_in <= 0) {
        attitude_control.set_throttle_out(0, false);

    // apply SIMPLE mode transform to pilot inputs

    // convert pilot input to lean angles
    // To-Do: convert get_pilot_desired_lean_angles to return angles as floats
    get_pilot_desired_lean_angles(g.rc_1.control_in, g.rc_2.control_in, target_roll, target_pitch);

    //Modified Yaw Rate mode
    //Constant Yaw Rate in stabilize mode
    g.rc_4.control_in=3000; //To override the RC input which influence any parameters in the code
    target_yaw_rate = get_pilot_desired_yaw_rate(g.rc_4.control_in);

    // get pilot's desired throttle
    pilot_throttle_scaled = get_pilot_desired_throttle(g.rc_3.control_in);

    // call attitude controller
    attitude_control.angle_ef_roll_pitch_rate_ef_yaw(target_roll, target_pitch, 18000);
    // body-frame rate controller is run directly from 100hz loop

    // output pilot's throttle
    attitude_control.set_throttle_out(pilot_throttle_scaled, true);

To be able to control the quadrotor with respect to the inertial frame, ‘simple mode’ should be configured using Misson Planner or in the modified code.



The quadrotor performed a spin stabilized flight mode at a rate of 180deg/s. This is fast but not fast enough to do SLAM missions with a fixed sensor onboard.

However, faster yaw rate caused heading drift due to the latency of the magnetometer. The current trade off is that to have control in the translational motion in respect to the inertial frame, magnetometers are needed for exact heading information.

But, in high spinrates magnetometers drift which results in poor controllability. A better magnetometer is needed or a good reference sensor for orientation is needed in high speed rates.

Another issue was while spinning, when the quadrotor was moving for example in the y direction and then change the direction in to an orthogonal direction, yaw rate dicreases for an instant. This is because the high lean angle.
To fix the issues there needs to be more code modifications on the estimation and control codes to fee the coupling between the yaw and the pitch.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s