Sonar Maxbotix only be used pointing down?

Hi @rmackay9

thank you very much!
I attach two logs with option log_disarmed=1.
With RNGFND =25 and with RNGFND =0
I noticed that with RNGFND =25 sonar range works, while with RNGFND =0 sonar range reads 0 but the screen (ctrl F) proximty works. I’m in trouble…
However the final configuration would be a small 4" quad with sonar for altimeter and frontal TF luna lidar for obstacle avoidance. Both sensors on I2c.
Thank you!

@Alberto_Ds,

Ah, if you’re seeing the distance on the proximity radar screen then it is working as expected.

I think the sonarrange field that you’re looking at is only ever used for downward facing lidar (on Copter at least).

1 Like

@rmackay9

Thanks Randy, yes the radar works! Then I’ll do a test flight even if sonar range is zero.
In the log I see the PRX data only if RNGFND ORIENTED=0, the PRX data disappears for RNGFND ORIENTED=25.

Correct?

However sonarrange works with sonar if (pointed downwards (see pictures above).
Down only. In case of RNGFND ORIENTED = 0 SONARRANGE no longer works

1 Like

@Alberto_Ds,

This all sounds correct to me.

2 Likes

Yeah, everything you described is the normal operation of it.

1 Like

Hi @rmackay9 @BrunoBagarini

Works as expected! The Jedi Force :slight_smile:

However, I had some problems with the compass. By simply changing the poshold braking parameters in the full parameter list, in the field the compass had lost its calibration data and the quad risked crashing. I had to do the calibration again (the dance) and the system worked (arducopter 4.4 dev)

2 Likes

@Alberto_Ds,

Congrats! great video!

Re the poshold braking parameters, I can’t imagine how changing those parameters could affect the compass. My guess is that its either a coincidence or some issue with the GCS updating parameters unexpectedly. All parameter changes are recorded in the logs at least if they occur while the vehicle is armed.

The compass calibration required message also comes up if the order of the compasses is changed or one is gained or lost. So a wiring issue (for example a broken cable) can also cause this message to appear on the next attempt to arm.

2 Likes

Thank you @rmackay9 ,

I didn’t quite understand what happened (never happened before), but I didn’t receive any message to recalibrate the compass, it simply indicated a wrong direction, but without warning I flew anyway and when I put loiter mode, the quad went out of control. I re-calibrated the compass with mission planner and the old dance system. Later I had some compass variance messages in fast maneuvers, but not logged as an error. I assume this is due to placing the sonar too close to the gps compass, but this is only a temporary arrangement. I think the sonar will be used as an altimeter and I will be using a small forward facing lidar for obstacle avoidance.

Could it be an i2c bus problem where I also connected the sonar in addition to the compass? Or not enough power supply of FC (kakute F4)?

Hi @rmackay9

I am trying the same sonar in the down position as an altimeter for surface tracking however, although the sonarrange is correctly displayed, the copter seems to ignore the presence of the down facing sonar. I set RNGFND1 ORIENTED 25 (down) and on Auxiliary Function Switches I left 40 (Proximity Avoidance). I could try 75:SurfaceTrackingUpDown, but I don’t think that’s the problem. In the dataflash log the sonar reading appears and appears to be correct. I’m using a CFW 4.4 DEV (fc 1MB) am I forgetting to enable something? Thank you!


@Alberto_Ds,

If you have an onboard log I can have a look. I’m pretty sure that this is not a software error but rather configuration problems.

Thanks a lot @rmackay9

This is a log of yesterday’s flight trying to stay under the copter in flight with an umbrella :slight_smile: but the copter only lifted due to ground effect.
I have now set RCx_OPTION to 10 Rangefinder … could it help?

2022-12-12 16-14-51.param (14.9 KB)

I think I found the problem thanks to the rangefinder reading on the yaapu telemetry. I could see the sonar getting out of range even at low altitudes. Could it be a sonar vibration problem? the sonar is in contact with the copter frame. In particular, the sonar “microphone” touches the frame. Do I have to isolate it mechanically? However when the reading is correct the copter behaves correctly.

@Alberto_Ds,

In general sonars are difficult to use. I have not used a Maxbotix sonar for many years but last time I did (see video below) it was important to create a cable with a capacitor in it.

Thanks @rmackay9 , I will watch the video carefully. However as obstacle avoidance (at least with the simple stop) as seen in the video it worked well. As an altimeter I changed the support to point it downwards, the rest is all the same. Cables included. What technology does DJI use on small low altitude altimeter copters?

Hi @rmackay9

it works, but only at low altitude (less than 2m), otherwise the sonar is too noisy. I don’t know whether to try the way of shielded cable and filter because I’m working on a small 4" copter with little space and lots of noise. Would a small lidar be better?
My sonar works in i2c

@Alberto_Ds,

I don’t have much recent experience with sonar but my guess is it can be fixed with the addition of a capacitor … but a lidar might be less trouble.

2 Likes

Today, I also had a test flight using sonar senser for obstacle avoidance. Resut is very satisfied.
-FC: Pixhawk 4
-FW: 4.3.2

1 Like

Good job!
I’ve noticed that the sonar works better as an obstacle avoidance than an altimeter. I can’t get a good functioning beyond 2m (even with shielded cable and 100uF capacitor). I’m using a small 4" copter which probably generates sonar jamming.

2 Likes

Hi @rmackay9

I tried with a small lidar (TF benewake LUNA LIDAR) and it actually works better than sonar. Unfortunately the used lidar model produces a lot of EMI with GPS fix problems. I partially solved it with a lot of shielding on the lidar. On a 4" copter the distances are minimal and the EMI problems are high

1 Like

@Alberto_Ds,

Ok, well, I guess that’s progress. thanks for the update.

1 Like