Hexacopter with ArduCopter V3.6.0-rc7 on Pixhawk v2: two sonars, none working for weeks. Same problems as in:
Copter V3.6.0-rc6 two sonars (Maxbotix I2C, Benewake TFMini): glitch
which had no answer.
It flies very well if both sonars are disabled, in PosHold, AltHold and Auto. If any sonar is enabled there are constant sudden altitude changes and EKF error changes, and even it starts going up without limit towards the moon with the selenites in some modes.
The sonars are:
-Maxbotix I2C (ultrasonic).
-TFMini serial (infrared).
Being of different technology, I understand that they can coexist without interfering. Anyhow, I did a few tests with only one sonar connected, and nothing changed.
It has also two GPS’s installed. Briefly:
After many unsuccessful sonar tests, since any sonar can need a big current when triggered, and after observing some ripple on the +5V Pixhawk supplies logs, I decided to supply both sonars directly from the Pixhawk servo pins, which are directly connected to the +5V converter on the Pixhawk power supply (a typical one with two XT60 connectors, shunt and 5V converter between them), building special cables.
Four tests follow, one at home (almost successful) and three unsuccessful ones at the field. Sonar altitudes correspond to RFND.Dist1 and RFND.Dist2 in the logs, which are compared with BARO.Alt.
- I tested at home (indoors, no GPS’s lock), flying the hexacopter lifting it around 1.5m:
These are baro and sonars altitude logs:
Both sonars follow baro altitude, but Maxbotix I2C sonar has a negative glitch.
- At the field I first tested with both sonars, lifting the hexacopter around 8m:
Maxbotix I2C follows baro only 2m, and then goes to 8m with glitches:
TFMini reports going up to 800m:
The voltages seem perfect:
This appears in the log:
ERR, 744795297, 24, 1
MSG, 744795528, EKF primary changed:1
which I can’t interpret.
- Next I repeated previous test done at home, lifting the hexacopter around 1.5m:
As on previous test, Maxbotix I2C follows baro only 2m, and then goes to 8m with glitches:
and TFMini reports going up to 655m:
So doing the same than at home (up 1.5m), outdoor results are very different.
- Next test was disabling and disconnecting the TFMini sonar, lifting the hexacopter around 8m:
Again, Maxbotix I2C follows baro only 2m, and then goes to 8m with glitches:
-Unusable sonars with extreme values, being worse on the TFMini.
-Both sonars were tested with an Arduino; no known malfunction, and the two cannot be bad. The TFMini was recently purchased (firmware upgrade is mentioned elsewhere, but both sonars fail).
-Same test (up 1.5m) gives different results at home than at the field.
-It happens as if there is an instability somewhere, but I understand RFND.Dist1 and RFND.Dist2 as measurements.
What can I have misconfigured, or be doing wrong?
On Copter Complete Parameter List:
Serial rangefinder protocol: 9 (SERIAL5_PROTOCOL 9).
Rangefinder type 2 MaxbotixI2C (RNGFND_TYPE 2).
Rangefinder type 20 BenewakeTFmini (RNGFND2_TYPE 20).
This is an example of a perfect flight in Stabilize, AltHold, PosHold and Auto modes with both sonars disabled: