Finally cracked the current batch of problems.

The are two classes of problems: never getting off the ground, or alternatively, leaping off the ground.

The inability to get off the ground regardless of prop type was due to my code disbelieving that near zero G readings were invalid; discarding the zero G readings meant the velocity integrated higher during warm-up phase, meaning the motion processing code thought it was rising faster than it actually was.  Once the zero G readings were included, then the floppy props worked, but for some reason the carbon ones still struggled to get off the ground.

The reason for this CF prop problem turned out to be the jitters during the prolonged spin up of the props.  The code tries to keep Zoe on the ground while the code winds the props up to hover speed.  At a micro level, this means the feet would lift off, the code would slow down the props, and the feet would hit the hard take-off surface;  this hard micro-collision causes a low reading which integrates to a falling velocity event though the quad was sat on the floor.  When the flight-plan finally flips to ascent, it has to overcome the integrated negative velocity, and so leaps into the air.  The fix is three-fold:

  1. don’t take off from hard surfaces
  2. get the quads off the ground ASAP – don’t wait around for the props to spin up
  3. add physical buffering so the 0g impacts don’t make it to the sensors – for example sitting the HoG on a soft foam pad, and adding soft balls to the feet.

This is work in progress.

There’s a third problem though which was troubling me with the CF props even once the previous two had been (partially) fixed – they still struggled getting Zoe off the ground compared to the floppy props despite their profiles being very similar.  I finally spotted the problem when I was swapping prop types.  The floppy props have a deliberately rough surface whereas the CF ones are coated in the gloss varnish, presumably to cover splinters in the CF.  Airflow at the prop surface is better over rough surfaces due to micro-turbulence, and that causes a better airflow and lift at the macro level.  The higher speed CF probs gloss surface was causing the air-flow to break away from the props at lower revs.  This results in a lack of expected lift, so the code spin the props faster making the situation worse.  Some sanding of the CF props to roughen the gloss surface improved matters significantly but again this is still work in progress.

Stall

How wings work 101.

I’m pretty confident this explains the radical behavioural difference between Zoe’s plastic and CF props: the higher pitch of the CF props means the airflow over the props would be disrupted at lower rotation rates and the props would stall producing virtually no lift; the code would then increase the props speed as a result, worsening the situation to the extent that Zoe would never get off the ground – which is exactly what is happening.

In particular, at the take-off transition from ground ‘hover’ to ascent, there’s a sharp increase in props rotation driven by the vertical velocity PID P gain as the target changes from 0m/s to 0.3m/s.  This immediate kick could well be hard enough to break the smooth airflow over the props, causing them to stall and thus kill the lift – it then never recovers as the motors spin ever faster to compensate for the insufficient lift.

However if I shift the bias towards the I gain, then the increase in motor speed is smoother, and this would result in the airflow speed increasing in line with the prop rotation, and reduce the risk of the props stalling.

I have a vague memory from somewhere that once a prop (or wing) stalls, it’s very hard to stabilize the airflow again; as an example, if an aeroplane stalled at high altitude, suddenly the only force would be gravity and the plane would drop like a brick; however, if the pilot points the nose of the aircraft down towards the earth, this would streamline airflow over the wings again and the pilot could then pull-up using the reinstated lift from the wings.

Why’s that relevant?  Because it means there’s no point trying to recover from stalled props for a quad; the solution is to stop it happening in the first place.

The interesting bit is whether it will be possible to tune the vertical velocity PIDs such that both types of props run with the same PID settings?


Only indirectly related, I could do with some additional PID to ESC calibration.  The PWM runs from 1ms to 2ms in 1us increments.  At 1ms, the ESCs are synchronised with the PWM and they stop their annoying whining, but it’s only at 1.15ms pulses that the props start spinning.  That shows up in flight as wobbly landings, and there is a risk that the PIDs could actually turn of the motors during flight; I need to update the PWM code so that it knows about the ESC minimum value.  I think this is only a few lines of code.

Angle of attack

I tried Chloe with the code changes I’d made for Phoebe, and she just wouldn’t behave; regardless of what PID tuning I did, she struggled to get herself off the ground, and once in the air, she wobbled enormously. Just like Phoebe, Chloe was flying with the super-cheap, super-strong OEM (other equipment manufacturer) versions of the T-motor props.

Finally I’ve remembered the correct term for the problem – the “angle of attack” of the props.  According to wikipedia, the critical or stalling angle of attack for a typical aerofoil is around 15° – 20° with respect to the airflow.  This is the point where the airflow at the leading edge of a prop starts to break off, producing turbulence over the tops side of the prop killing the lift.  To make things worse, the turbulence spreads and prevents good air-flow even over parts of the props whose angle of attack is under the critical angle.

With an aeroplane in flight, there is airflow at the plane’s flight speed through the prop – the pitch of the prop can be very high especially near the shaft as a result, and yet still the angle of attach stays under the critical limit..

But with a Quadcopter in hover, there is no airflow other than that created by the props themselves; hence the props angle-of-attack needs to be under the critical level when stationary.  Some simplistic measurements with a digital protractor suggests the OEM props pitch is about 28° at the steepest point, whereas that of the T-motors is about 17°.

So I popped some T-motor props back on Chloe to see what effect that had.  And Chloe behaved a lot closer to her previous behaviour.

But that raised the question of why Phoebe is flying so well with these OEM props?  Phoebe’s props spin a lot faster, so perhaps the airflow is high enough to keep the 28° pitch of the OEM props under the critical angle-of-attack?  Plausible, but just guesswork.

I’ll need to do more thinking, as I really want Chloe to be flying as well as Phoebe does with the OEM props – the price difference between these and the official T-motor equivalents is huge (a factor of 8).  I think the next step is to measure the rotation rate of Phoebe’s and Chloe’s motors in flight, and try to calculate the angle of attack for both.  I have an audio analyser app on my iPad which should identify the rotation rate as a peak in the FFT display.

This is one of those moments I wish I’d done aeronautical engineering at Southampton University rather than Physics at Cambridge, but I do have a book about Fluid Dynamics so I’ll take a look to see if there’s anything there.

Prop aerodynamics picture

Here’s a pics of  the two types of props I was describing yesterday.

Aerodynamic comparison

Aerodynamic comparison

Near the axel of the shiny cheap CF props, the prop surface is at 45° to the airflow, whereas with the T-motor props, it’s pretty much 0°.  The 45° props are ploughing through the air and as a result, it’s much more likely that the airflow breaks up into turbulence over the prop and lift is lost.  What’s more, once there, turbulence will spread along towards the tip of the prop, so a significant amount of lift is lost.  In comparison, the 0° props are slicing through the air and gently enticing it to flow smoothly across the prop aerofoil; risk of turbulence is much reduced, and so the props provide more lift.

P.S. I ought to explain my definition of ‘strong’ blades:  during tuning of the rotation PIDs, it’s not unusual for the quad to hit the ground on its side, with one prop embedded deep into the lawn.  In that situation, the cheap CF prop can hold the whole 1.5kg body of the quad up in the air whereas the T-motor ones cannot – they snap.  But given that’s way outside the ‘normal operation’ bounds of the prop design, it’s unfair to call the T-motors ‘weak’, they are more than strong enough for their intended purpose.  But the cheap CF props do keep the costs down when lawn-mowing is a routine part of flight testing!

Propeller aerodynamics 101

I know nigh on nothing about propeller aerodynamics; what I do know is based on common sense and evidence from today’s flights.

If you look at an aeroplane propeller, there’s quite a steep pitch angle near the axis of rotation.  In comparison, an aeroplane’s wings leading edge is virtually horizontal (zero pitch angle), and instead the wing ‘droops’ down towards the trailing edge.  That’s because the aeroplane’s propeller is effectively cork-screwing into a high speed airflow to provide propulsion along the same axis as the air-flow. In comparison, the wings are slicing through the same airflow to provide lift orthogonal to the airflow over them.

With a quadcopter (or helicopter), there is no similar cork-screw air-flow.  Event vertical movement is a slow airflow due to gravity.  And that means the props for a quadcopter need to slice rather than corkscrew through the air.

The expensive and breakable T-motors props are shaped like aeroplane wings.  The cheap CF props I swapped to because of their cost and strength are shaped like aeroplane propellers.

So when today on a whim, I swapped the cheap CF props with almost equivalently sized T-motor props, I had to do a huge amount of PID detuning; even though the T-motors’ were slightly smaller, their aerodynamics were like a ‘plane’s wing rather than a ‘plane’s propeller, and as a result the T-motor props produced a lot more power a lot more efficiently.

Luckily the cheap CF props have served their purpose well, getting HoG flying stably at minimal expense (£12 for 4).  But now I think I need to go back to the expensive (£80 for 4), but aerodynamically correct T-motor props for continued testing.  I just hope HoG doesn’t crash breaking a prop – I can’t afford £80 a time for replacements – that’s how I got into the financial mess I’m in at the moment breaking a set of these T-motors props at least once a week!