GPS Racer: worklog #9 – double rangefinder setup

My GPS Racer is less and less fun project. For last few weeks it acts as sensor platform for my attempts to bring rangefinders and terrain following modes back to INAV. This time in a way that will work.

Two weeks ago it was carrying HC-SR04 sonar (crappy device). Week ago it was carrying US-100 (much better device). This week it is carrying both US-100 sonar and VL53L0X lidar!

INAV with US-100 Sonar and VL53L0X Lidar

DigitalEntity apparently had too much spare time and he finally wrote (ported) a driver for VL53L0X and starting from version 1.8 (probably) INAV will be able to use this cheap lidar.

INAV with VL53L0X Lidar

Yes, VL53L0X is cheap and that means it's not state-of-the art device. First of all, it has limited range. 2m is all it can do in a room. No idea how it will behave in sunlight. Hard to guess, but I'm afraid that 1m will be all it will able to do in real life conditions… But we will see in a next few days.

Read More

INAV jumped over the bench

Let's say I have almost a good news about sonar support in INAV: yesterday I flew terrain following mode with experimental INAV code. And did not crashed when shooting video below. I did crashed next code version, but that is only a minor detail, right?

  1. When shooting that video I did not touched throttle stick. Altitude control was 100% automatic
  2. It is US-100, not HC-SR04 ultrasonic rangefinder!
  3. US-100 was connected to Omnibus F4 Pro using experimental I2C interface with ATtiny85
  4. If you want to try it, here is the code. But be prepared to crash 🙂

Read More

If not HC-SR04 then what? US-100 maybe….

A week ago I wrote that HC-SR04 ultrasonic rangefinder is crap and it is still true. Only around 1m useful range and very jumpy behavior above are at least problematic…

There is a better solution. US-100 ultrasonic rangefinder. Comparing to HC-SR04, it has at least twice the useful range. My preliminary tests gave solid readout over concrete up to 2 meters and something. Let's call it 2 meters. But what more important, US-100 was reporting out-of-range state instead of some random values when being out of range! Huge step forward comparing to HC-SR04.

us-100 is much better than HC-sr04

Unfortunately, better does not mean good. US-100 also has some problems.

us-100 is much better than HC-sr04  ut still not good

Readouts becomes "jumpy" at the edge of useful range and they are far far away from declared. But OK, declared always means "perfect conditions". Still, trust me on this, comparing to this, HC-SR04 is crap…

Read More

HC-SR04 is crap and there is nothing you can do about it…

Only few days ago I mentioned that I started to reintroduce sonar support to INAV. When DigitalEntity told me that popular HC-SR04 is crap I did not belived him. I expected that “official” 4m range on a noise-machine aka quadcopter is unrealistic, but data I recorded today clearly shows: HC-SR04 is crap and is absolutely not suited for quadcopters and probably other UAVs. Why? Because it goes nuts and starts to pick background noise instead of surface.

Let’s take a look here:

Bottom trace shows pseudo Signal-to-Noise-Ratio (SNR) while top one shows raw HC-SR04 altitude and INAV position estimator altitude (GPS, barometer and accelerometer combined). As you can see, it’s not that bad. There is a correlation between both of altitudes and SNR is pretty low.

Same thing is happening here. Quadcopter descended to land, both altitudes went down to finally meet at zero. SNR is low too. Nice.

But, very bad things starts to happen as soon as altitude crosses 1.5m. Not only SNR goes up, but HC-SR04 starts to report completely unreliable data! If it was reporting out-of-range state, it would be fine. But no, it keeps reporting something between 1 and 2 meters while real altitude is much higher. Total crap.

Conclusion is simple: HC-SR04 can be used on multirotors but only on very low altitudes. Something like 0.75m over concrete. Or 0.5m above short grass. Or even less over long grass. Definitely not good enough for terrain following flight mode.

Next week I will test US-100 ultrasonic rangefinder. It is supposed to give much better results. I hope so…

Read More

GPS Racer: worklog #8 – sonar test platform

I honestly admit, that my 6″ quad (codename GPS Racer) was never very pretty. It was just ugly with that GPS tower on the front. Today it got even uglier: I’ve equipped it with HC-SR04 sonar connected via I2C bus (ATtiny85 to the rescue).

Why, you might ask, have I done something so useless? Answer is simple: to make it less useless. There are at least few problems with sonar and modern flight controllers. First of all, most new boards does not have connections for it. Second of all, it does not work reliably.

HC-SR04 test platform for INAV

It just don’t. It was no unreliable that INAV, for example, disabled it for some time completely. Right now it is back, but used only during landing on multirotors. No terrain following or anything like that. Continue reading “GPS Racer: worklog #8 – sonar test platform” »

Read More

Connecting ultrasonic rangefinder (Sonar) to Cleanflight

Keeping constant altitude with a drone is not a trivial task. Specially, if drone is supposed to keep give altitude very precisely few meters above the ground. One of the reasons for it is difficulty of reading precise altitude. Barometer can drift when atmospheric pressure changes and can produce a lot of noise. GPS is very inaccurate when dealing with altitude. One of the options is to use some kind of rangefinder. Ultrasonic for example. Cleanflight and its derivatives supports exactly one kind of those: cheap HC-SR04 sonar. There are plans to integrate different sonars, but none of official builds supports it yet.

dav

Continue reading “Connecting ultrasonic rangefinder (Sonar) to Cleanflight” »

Read More