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

And the most popular flight controller for INAV is…

Did you ever wondered what is the most popular flight controller? Hardware I mean. I can tell you 🙂 OK, maybe it will not be a full truth, since I have data only from INAV, but assuming that distribution for Betaflight and Cleanflight is similar, we might know what is happening…

Important, this is not the number of boards flashed with INAV, but rather number of times a board was connected to Configurator!

This counts TARGET software name, not retail name. For example, all clones of Naze32 will be counted as Naze32

Data was taken in June 2017, multiple connections during single user session are stored as single entry. Continue reading “And the most popular flight controller for INAV is…” »

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

FC Soft Mount With Adhesive Pads FTW!

I will not try to proof if you should soft mount a flight controller on a racing drone. I will only say, that few months ago I was against it, but lately I changed my mind. Stronger motors, stronger magnets, more torque, more speed and out of nowhere, incredible amount of noise can be fed into gyro signal. Sure, this is not required, but motors, ESCs and battery will thank you when you soft mount flight controller. Less, noise, less restrictive filtering required, lower signal delay, better flight performance.

In most places over internet you can find either a rubber standoff or double sided tape solution. Sure, that works, but there is something better. Dedicated, double sided adhesive, vibration dampening pads. There are many sources, and many names. I'm using Sekisui brand. Check ebay, Amazon, HobbyKing. Look for gyro pads, vibration pads, vibration dampening. I do not want to advertise any particular seller, so you are on your own here.

Sekisui adhesive gyro pads

Continue reading “FC Soft Mount With Adhesive Pads FTW!” »

Read More

AnyFC F7 and DIY buzzer for INAV

Because both original and Banggood clone of AnyFC F7 flight controller and missing buzzer support, its usefulness is somehow limited. There is no dedicated pin and driver. Next release of INAV (1.7.2) will finally solve this problem by reusing Motor #9 output as buzzer output.

But, some additional hardware will be required. To be precise, single n-channel signal MOSFET transistor like 2N7000. Connection diagram is shown below.

AnyFC F7 Buzzer driver with 2n7000 mosfet transistor

And this is how it can be soldered together.

AnyFC F7 Buzzer driver with 2n7000 mosfet transistor

AnyFC F7 with buzzer

That is all. Simple, right?

Read More

Pitot tube is coming to INAV

One of the things that INAV was missing, was a decent support for Pitot tubes, or more generally speaking, airspeed sensors. Autonomous flight, or landing, without knowledge about airspeed can easily lead to a stall. Stall can lead to crash. A crash leads to rebuild. Rebuild of big airplane is a nightmare. Although, for some time now INAV was able to use digital PX4 Airspeed Sensors (I2C, based on MS4525), but they are quite expensive and airspeed was only reported in blackbox logs. Not very useful, right?

Now, this is changing. Next release of INAV (1.8 probably) will bring at least support for much cheaper, analog, APM Airspeed Sensor based on MPXV7002 chip. Although some simple additional electronics (2 resistors to be precise) will be required, but this pitot tube should be available for all flight controllers with free ADC input (Current or RSSI). Fancy ADC remapping will allow to use any ADC without built in dividers (Vbat has dividers so can not be used) as pitot input.

mpxv7002 pitot tube for INAV

More than that, INAV 1.8 will (or at least should) bring PID scaling according to airspeed for fixed wings. This should result in better handling on both low and high speed.

mpxv7002 pitot tube for INAV

As you can see on the picture above, APM Airspeed Sensor is already installed on my small flying wing and is waiting for first flight tests this weekend. Logging only for now…

Read More

GPS Racer: worklog #5

I've finally decided to make a decent use of my GPS Racer quadcopter. Until now, I mainly used it to test new things for INAV and that is more less all. RunCam Owl Plus FPV camera turned out to be non-flyable in the night, so I've decided to go one step further…

RunCam Night Eagle

Runcam Night Eagle - night vision FPV camera 2

Yes, RunCam Night Eagle. I've seen couple of video reviews of this camera on YouTube and decided that this is what I really need: a good night vision camera. Not a camera that can see after sundown. A camera that can see in the night!
Continue reading “GPS Racer: worklog #5” »

Read More

AnyFC F7 and a missing baro problem

When Banggood decided to “forget” about MS5611barometer in their version of AnyFC F7 flight controller, they not only did not mounted MS5611 on it. They also made usage of any external barometer on that board almost impossible to use.

Why? Long story short: all STM32 MultiWii derivatives are unable (yet) to lookup for I2C devices across different I2C buses. So, if we define barometer to be connected to I2C bus #4, firmware will look to barometers only on I2C bus #4. But, since many boards uses multiple I2C buses, this creates a problem: AnyFC F7 onboard (and missing) MS5611 is connected to I2C bus #4, but I2C bus available on JST connector in I2C bus #2.

AnyFC F7 from Banggood without MS5611 barometer

While for Betaflight this is not a problem (BF pilots rather do not use barometer), it is a problem for INAV. AnyFC F7 target is unable to use any barometer if onboard MS5611 barometer is missing. OK, you can just solder one in place, but without hot air station and decent soldering skills this is not a good idea after all. This is why, until better solution is found, INAV will include ANYFCF7_EXTERNAL_BARO target. The only difference between ANYFCF7 and ANYFCF7_EXTERNAL_BARO is barometer support.

If you have MS5611 in place (soldered in or bought with one) or do not intend to use any baro, you should use ANYFCF7 target.

When you do not have onboard MS5611 and want to use external barometer (MS5611, BMP180/085 or BMP280) you should use ANYFCF7 and ANYFCF7_EXTERNAL_BARO target.

Until new official version of INAV is published, you might use this custom hex:
INAV_1.7.1_ANYFCF7_EXTERNAL_BARO.hex. It is based on INAV 1.7.1 and proven to detect external barometers via JST connector.

Read More

INAV 1.8: Automated landing for fixed wings

It's official: next release of INAV (1.8 or maybe 1.7.2) will incorporate an automated landing procedure for fixed wings. I was already writing about it 2 weeks ago, but now new code has been merged back and will be released.

Bear in mind, that this is not "state of the art" landing yet. It's rather a simple solution that can be used in emergency situations that will not crash an airplane, but rather put it on the ground without crashing. Procedure is quite simple:

  1. When Return-To-Home or Failsafe with RTH is engaged, go to Home position
  2. When Home is reached, start to loiter with defined radius and descend. Descent speed is limited to nav_landing_speed when altitude is above nav_land_slowdown_maxalt. When altitude is below nav_land_slowdown_maxalt, vertical speed is scaled down to one fourth of nav_landing_speed at nav_land_slowdown_minalt. So, on using default values, vertical speed is between 2m/s and 0.5m/s
  3. During descend, airplane is not allowed to raise throttle above nav_fw_cruise_thr when nose is up. This is to prevent airplane from gaining horizontal speed
  4. When nav_land_slowdown_minalt is reached, ROLL axis is locked to 0 degrees, PITCH axis is locked to nav_fw_land_dive_angle (default is 2 degrees) and motor is stopped when MOTOR_STOP is used or put to IDLE when MOTOR_STOP is not used. This puts airplane into a shallow dive to the ground

fixed wing landing in inav

That is all. Airplane should glide last few meters to the ground. Most designs should be able to do it without a problem. My testing platform did it like that:

Since there is no auto-disarm procedure yet, MOTOR_STOP is recommended to prevent propeller from breaking and motors/ESC from burning.

Read More