Fine tuning my Quadcopter - log analysis, random oscillations, SiK radio disconnecting

Hello,
I have built myself a quadcopter with Holybro X500 frame, Pixhawk Cube, Holybro telemetry 433MHz SiK radio, 30A ESCs, 10-inch props. I use QGroundControl, Arducopter with ChibeOs.

Could you, please, help me fine-tune it, look at the latest log and try to find possible issues? This is my setup:

Initially, I crashed several times, broke legs and props in manual mode. Once the quadcopter even flew away in LOITER mode (the GPS pole broke). After I fix it, according to my layman’s opinion, I think it flies like a dream! Albeit I must say I do fly it in AUTO mode mostly.

1) Could you, please, help me look at the log from the latest (successful) flight? Even though everything went smoothly I do have some concerns.

http://padoli.com/flight/sample_log2.bin

I started in LOITER mode, let the drone hover for a few seconds and if everything looks stable I switch to AUTO mode.

2) My SiK radio does not stay connected. It frequently disconnects and I can barely see the location in QGroundControl. What could be the problem? I never had a flight where I would get the telemetry to my QGroundControl without interruption even for short flights.

3) I don’t know how to interpret this IMU chart from the given log file. Is it all good or do I need to be worried?

4) I have never done an AUTOTUNE. Is it something I need to do? Or is my quad good and safe to be used as-is?

5) I have imported the given log into MissionPlanner on my Windows machine and ran auto analysis tool which gave me this result. I don’t know how to interpret it well:

> Vehicletype ArduCopter
> Firmware Version V4.0.3
> Free Mem 0
> Skipped Lines 0
> Test: Autotune = UNKNOWN - No ATUN log data
> Test: Brownout = GOOD - 
> Test: Compass = WARN - WARN: Large compass offset params (X:28.38, Y:-246.97, Z:199.19)
> WARN: Large compass offset in MAG data (X:28.00, Y:-246.00, Z:199.00)
> mag_field interference within limits (9.33%)
> Test: Event/Failsafe = FAIL - ERR found: FS_BATT 
> Test: GPS = GOOD - 
> Test: IMU Mismatch = WARN - Check vibration or accelerometer calibration. (Mismatch: 0.96, WARN: 0.75, FAIL: 1.50)
> Test: Motor Balance = WARN - Motor channel averages = [1549, 1582, 1654, 1666]
> Average motor output = 1612
> Difference between min and max motor averages = 117
> Test: NaNs = FAIL - Found NaN in BAT.Curr
> Found NaN in BAT.CurrTot
> Found NaN in BAT.EnrgTot
> Found NaN in CTUN.TAlt
> Found NaN in CTUN.DSAlt
> Test: OpticalFlow = FAIL - FAIL: no optical flow data
> Test: Parameters = FAIL - 'MAG_ENABLE' not found
> Test: PM = FAIL - 67 slow loop lines found, max 7.67% on line 62667
> Test: Pitch/Roll = GOOD - 
> Test: Thrust = GOOD - 
> Test: VCC = UNKNOWN - No CURR log data

As you see, there are some fails and warnings and I have no clue how serious they are.

Conclusion. The quad flies well and besides the dropping connection to my QGroundControl over the 433MHz radio everything seems to be working. But I crashed in the past and I would like to avoid it and solve any potential problems that may arise now. Can you guys help me double-check everything? I want to have a dependable quad ready to fly safely at any time. Many thanks!

Your setup is showing a lot of oscillations.
Have you done an autotune?
Are all the props exactly level?
Is the copter balanced around its centre?
Do you have frame/arm flex happening?
You can see here the oscillations between desired and actual.

The flight controller is hanging onto control but it wouldn’t surprise me if it got out of control if disturbed too much.
You are also needlessly using power.
The oscillations in yaw give a hint that the props aren’t level.

Make sure the telemetry radio is running off it’s own 5v supply, not the serial port 5v from the flight controller. Also move it a bit further away from the FC and GPS if possible.
Personally, I’d worry less about the telemetry radio for now and more about getting the Tuning and reliability before running such long auto missions.

Apart from the imbalance, motor 4 working hardest and operating most of the time at maximum, motor 1 is working a lot less - indicating a motor mount or frame twist. The fact that motor 2 doesnt work low like motor 1 tells me there’s also a weight imbalance.

image

If you fix that motor mount twist (and that’s what it will be!)

  • and all the motor outputs a nice and even when hovering
  • and motors are still going to a high output
  • then you are going to have to lose some weight or change motors/props to increase thrust

You are not measuring current for some reason, although voltage is working OK. I’d look into that and fix it.
And set these:
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2

Try ATC_INPUT_TC,0.2 to smooth out the RC input and see if that feels better.

PIDs and all look very standard. Set these params then definitely read up on Autotune and run that.
MOT_BAT_VOLT_MAX,16.8
MOT_BAT_VOLT_MIN,13.2

Here’s the tuning guide:
https://ardupilot.org/copter/docs/tuning-process-instructions.html
And a helper spreadsheet:

For Autotune test Loiter mode before you do Autotune, to ensure the aircraft can hold position.
Probably do Yaw autotune first, the safest option. Check the AUTOTUNE_AXES parameter.

  • arm and take off, try Loiter mode, switch to Autotune mode
  • wait for twitching to finish (telemetry will announce Autotune success)
  • DONT change modes, just bring the aircraft back and land, disarm.
  • wait a few seconds for new parameters to save

Recharge the battery and Autotune another axis, or both Pitch and Roll together.
Once all three axis are completed OK and you’ve done a few test flights (and gathered more logs) you can run Autotune again, all 3 axis at once - it wont take as long as the first time.

No, I haven’t done yet. When is it the best time to do the AUTOTUNE, after or before I solve the vibration/oscillation issue?

When you say “level” it means exactly parallel with the ground, correct? They probably aren’t exactly because I eyeballed it without using any tools. I guess I will try to use some kind of spirit/bubble level tool to make it exact. Or any other suggestion that may help to get it right?

I don’t know how to check it correctly. Look at the picture. Again, I eyeballed it and moved the components around to distribute the weight roughly the same. It may vary based on how exactly I strap the battery on and also whether or not I attach a GoPro for the flight.

Please, can you advise me on how to check for it? The frame and arms are carbon fiber. I made sure the bolts are tightly secured.

Many thanks for your response @mboland I truly appreciate it :slight_smile:

Shawn, many thanks for your input too!

Yes, the graph is nicely showing how each of the motors is working differently hard. As I already wrote above, I am not sure exactly how to get the weight distribution right. The battery will never be straped exactly the same and sometimes I do mount GoPro and sometimes I don’t :confused: I guess there will always be some imbalance?

Again many thanks @xfacta for the nice step by step write-up. I am going to try to do exactly what you are suggesting. Let’s see what the result will be.

Vibrations must be fixed first as they will directly affect the IMU’s.
Your vibrations are looking good as you can see here (IMU1 only) except for the start of the missions where Z increases for some reason.
Looking at you RCout in conjunction with this you are pushing the copter at high speed, am I right?


VIBES are looking good with no clipping, this is the main one to look at.

Oscillations are a whole different beast and these are what you will be trying to reduce in tuning.

Use a level to get your centre plate level (on which the FC is mounted) then check each motor to make sure they are also level. A 2 axis spirit level as used on model Heli’s is probably the simplest and cheapest.

For best motor performance find the centre of gravity and try to align it with the centre of thrust.
Basically the centre of the main frame where the arms converge.
The easiest way to see if you are close is to do a flight and hover it in one place for a minute or so and review the RCout logs to see how even your output is.

Frame flexing is a whole different issue.
Just get the copter tuned for static hover and any frame flex will be more obvious in flights after that but I wouldn’t be too concerned initially.

So Autotune would be the next step.

You should check your balance whenever you change a battery or add a gopro or anything. Side by side imbalance will usually be minimal, unless you are mounting something heavy on the sides. The one you should check is front to back which is affecting by battery and gopro placement. I use a simple nylon string with loops on each end so I can attach them to the sides of the quad where the legs are attached to the body, and simply push the battery forward or backward until it stops leaning. Easy, simple and fast.

@xfacta as you know the telemetry radio is connected to the flight controller using this cable:

How do I provide an independent 5V power supply (like 3 AAA batteries)? Do I cut the red 5V and black GND little cables as shown on the picture in blue circles? Or do I just plug in a USB cable with 5V in addition to the existing telemetry cable?

Gentlemen! I have remabalanced my quad, leveled the motors and did a quick test flight. I am looking at the log now:

http://padoli.com/flight/sample_log3.bin

what do you think? Do the oscillations, imu, and vibes look good now? I haven’t done AUTOTUNE and I am waiting until have this sorted out.

OK, vibes are good, motor outputs are much more reasonable and Vcc is better.
Current monitoring is not working - that will be very handy, required really.

There’s still stability issues though. Read back through the other posts above, there’s parameters you still havent set, specifically MOT_BAT_VOLT_MAX and _MIN at first glance.
And these are surely wrong:
MOT_SPIN_ARM,0.05000000074505806
MOT_SPIN_MIN,0.05999999865889549
Use the Mission Planner motor test to check what they should be. I’d expect something around 0.1 and 0.13

This is the tuning guide:
https://ardupilot.org/copter/docs/tuning-process-instructions.html
and a helper spreadsheet:

A good test is some hovering and then some maneuvering in ALTHOLD mode with just pitch stick movements then roll stick movements. That gives more tuning info than just running and Auto mission.
You should run Autotune if the copter is easily controllable with RC.

@xfacta Shawn, many thanks for your help!

I have changed all the parameters as you suggested. I even managed to turn on the current monitoring (but that is not reflected in the latest log here).

I did some hovering in the ALHOLD, the quad was drifting as expected but I maintained control.

Then I switched to LOITER and soon switched to AUTOTUNE (only yaw). The quad started twitching and drifting quite a lot so I had to manually input pitch and roll to keep over my property. Is that normal? Light wind was blowing.

Eventually, I guess the twitching stopped and brought it back down. Waited several seconds and turned it off.

Log here:
http://padoli.com/flight/sample_log4.bin

How do I know something was actually learned from the AUTOTUNE?

I would like to do pitch and roll AUTOTUNE as well but I am afraid the quad will fly away I am not too comfortable with STABILIZE mode yet.

Start Autotune from Position Hold. Then it won’t stray so far. It will still drift around a bit but it won’t head for the hills if you don’t take action.

Nothing was learned from Autotune. Looks like you turned it off before it was complete and disarmed with it off. Read the Wiki.

Hi, I know this is very late, but I’m also building an X500 quadcopter and I’m having similar instability issues. What did you do exactly to rebalance it and level the motors? Thanks!