Control yaw in GUIDED mode

Hi
I’m using DroneKit and a companion computer to send movement commands to my drone in GUIDED mode. When I send a movement command with DroneKit code like this:

    msg = vehicle.message_factory.set_position_target_local_ned_encode(
        0,       # time_boot_ms (not used)
        0, 0,    # target_system, target_component
        mavutil.mavlink.MAV_FRAME_BODY_OFFSET_NED, # frame
        0b110111111000, # type_mask (only position enabled)
        x, y, z, # x, y, z positions
        0, 0, 0, # x, y, z velocity in m/s
        0, 0, 0, # x, y, z acceleration (not supported yet, ignored in GCS_Mavlink)
        0, 0)    # yaw, yaw_rate (not supported yet, ignored in GCS_Mavlink)
    
    # send command to vehicle
    vehicle.send_mavlink(msg)

The drone should move to the waypoint; however, it exhibits aggressive and erratic movement on the yaw axis. I have tried to decrease the yaw speed using MAV_CMD_CONDITION_YAW but it hasn’t worked well.
I also attempted to use yaw_rate in SET_POSITION_TARGET_LOCAL_NED but that didn’t yield the desired results either.

For example, I want to send a movement command for the drone to fly 40 meters forward and 20 meters to the left while controlling yaw speed and acceleration.

I noticed the parameter ATC_SLEW_YAW but I’m unsure what it does. If I change this parameter, could it pose a danger to my drone?

Can anyone help me with this topic?

Regards

@joe_white

  1. how good has this vehicle been configured and tuned?
  2. Did you follow the documentation?
  3. Which method did you use to make sure you did not miss any configuration and/or tuning step?
  4. Which FW version are you using?
  5. Why are you not using pymavlink-python instead of dronekit-python?
1 Like

@amilcarlucas
First of all thank you for your reply.

  1. I am using the DJI S900 frame, which has angled arms. The website states: Each arm is designed with an 8° inversion and a 3° inclination, making the aircraft more stable when rolling and pitching, yet more flexible when rotating. For this reason, there is a noticeable gap in motor performance that can be observed in the RCOU parameters in the logs.
  2. Yes! I followed the wiki for tuning.
  3. Initially, I tried using Autotune; however, afterward, the drone shook excessively and high vibrations appeared. I then attempted manual tuning, utilizing a harmonic notch filter while following the wiki step by step.
  4. I am using ArduCopter version 4.4.4.
  5. I have worked with pymavlink before and even created a similar topic previously regarding pymavlink. Thus, I do not believe this problem is related to pymavlink or DroneKit, as I experienced the same issue with both.

Regards

Are you aware that both guided mde and yaw control have been improved in ArduCopter 4.5.7?

And that there is an Ardupilot methodic configurator software ?

1 Like

Thank you for your reply :handshake:

Yes, I read about that in the forums, but I have a big question and concern! If I upgrade the firmware, will I need to tune the copter again or recalibrate sensors such as Accelerometer/Gyroscope or Compass? Tuning is difficult for me and takes a lot of my time. For this reason, I haven’t updated it yet! If tuning is not needed, I can consider trying this upgrade.

Regarding this question, I saw it in your topics! However, I don’t understand how this GUI can help me.

My question, which I suspect has been forgotten and not answered, is: what is the ATC_SLEW_YAW parameter? Is it the PID gain for yaw? Is it harmful or dangerous to change?

Hi @joe_white,

Reducing ATC_SLEW_YAW will make the copter turn more slowly in Auto, Guided, etc. It’s not very dangerous to change.

There shouldn’t be any need to re-tune the vehicle after upgrading from 4.4 to 4.5. I don’t think you’ll need to do any compass or accelerometer calibrations either.

1 Like

That is the beauty of ArduPilot, you do not need to change anything when upgrading. The firmware does all changes (if needed) automatically.

Downgrading ( going back to an older version) does require you to manually load a backup of the parameters from that very version.

2 Likes

@rmackay9 @amilcarlucas
Thanks :handshake: :pray:

1 Like

To clarify a bit, when going back to an older version you may notice that some (just a few) parameters will return to the value they were when you were last running that older firmware. It may seem odd but what’s happening is when we move or rename a parameter, the old parameter name and value remains in eeprom… so when you go back to the older version, it basically picks up where it left off with that parameter.

2 Likes