Absolute Pressure Error

Hi. I have Peakshawk 2.4.8 and a barometer MC5611. I have a problem with this sensor. The parameter is set to Bus1. The data from the sensor is displayed correctly in SCALED_PRESSURE2. At the same time, I have “Absolute Pressure Error”. Any help is welcome. Thanks in advance.

Hi @vrr20, welcome to the forum :slight_smile:

I’ve moved your comment to its own post, because the thread you posted it in was specifically for the Pixhawk 4, which you do not have.

I’m a bit confused by this. The Pixhawk has an MC5611 barometer has part of its internal sensor suite, but that should appear in SCALED_PRESSURE - SCALED_PRESSURE2 is normally used for an external barometer (like our Bar30 (MS5837-30BA) or Bar100 (Keller 7LD-PA)).

Could you please clarify

  1. Are you running ArduSub on your Pixhawk (and if so, which version)?
  2. Do you have an external barometer? If so, is it actually using an MS5611 sensor, or something else?
  3. Are your sensors fully plugged in, and does the issue persist when you reboot your Pixhawk? In this similar post from a while ago the problem ended up resolving itself after similar checks.

Thanks Eliot. It looks like I didn’t describe my problem correctly. I use the MC5611 as an external barometer as a separate device. Yes, I use ArduSub. Tried different versions: 4.0.3 OFFICIAL, 4.2.0 DEV, 4.1.0 BETA. At the same time, I see in the logic analyzer that there is an exchange on the external bus - the pix makes requests and the barometer answers it. You can also see it in the settings press_abs2 and press_temp2. They practically coincide with press_abs and press_temp. However, I still get the error “Absolute Pressure Error”.

Yeah, I’ve asked internally and we’re not really sure what’s going on here.

There’s some possibility the MS5611 is clashing with the existing internal one in the Pixhawk, but that doesn’t seem to be the case given you’re apparently getting independent readings out of it.

A few ideas:

  • Does it perhaps help to do a barometer (pressure) calibration in the Sensors page?
  • Is your GND_PRIMARY/BARO_PRIMARY parameter set to 2ndBaro (1)?
  • Is MS5611 enabled in the GND_PROBE_EXT/BARO_PROBE_EXT parameter?
  • Does resetting the parameters help?

Hi Eliot. BARO_PRIMARY parametr set to 2ndBaro. BARO_PROBE_EXE set to 4(MS5611). In MavLink insector a SCALED_PRESSORE2 field, that displays the correct data from the my ext sensor in the form of temperature and pressure. When trying to calibrate the pressure, the system responds that the “depth sensor is not connected”. And I see my error message “Absolute Pressure Error”.

I think I’ve managed to figure this out:

  1. “depth sensor is not connected” is reliant on ap.depth_sensor_present
  2. which is conditional on the sensor being a water type sensor
  3. which is currently only set for Keller LD and MS5867 sensors

Part 3 there will partly be the case because those are the only sensor types we’ve tested with for use under water, but in the case of the MS5611 specifically is also potentially important because that’s a sensor that’s already used internally in the Pixhawk, and registering the internal sensor as a measure of the water pressure is a really bad idea.

Given you seemingly have an MS5611 sensor that you want to use in the water (I’m assuming you’ve already confirmed that’s a viable use-case of your sensor), you could make a custom firmware build* that just also sets that as a water type sensor (it will be in the same file as the MS5687 part). Note that you’ll need to be extra careful, because if the sensor fails and MS5611 sensors are registered for water use then the firmware will likely fall back to using the internal sensor, which could be quite confusing since it will be reporting supposedly valid but completely illogical depth values.

*Note that ArduSub-stable is currently a bit problematic, and we’re planning to make ArduSub 4.1 the new stable quite soon, so it may be better to use ArduSub-beta instead for the moment.

if I understand you correctly, you need to change the condition in the AP_Baro_MS5611.cpp file

if (_ms56xx_type == BARO_MS5837) {
    _frontend.set_type(_instance, AP_Baro::BARO_TYPE_WATER);


if (_ms56xx_type == BARO_MS5611) {
    _frontend.set_type(_instance, AP_Baro::BARO_TYPE_WATER);


I wouldn’t recommend changing it like that - instead it’s better to allow both, e.g.

if ((_ms56xx type == BARO_MS5837) || (_ms56xx_type == BARO_MS5611)) {
   _frontend.set_type(_instance, AP_Baro::BARO_TYPE_WATER);

There may also be some way to specify that only external MS5611 sensors can count as water type, but that would likely be more complicated to set up.

Thank you Eliot for your support and clarification. I solved my problem in a slightly different way. I told the system that I should use the MS5837 as an external sensor and made a substitution in the code:

First I changed the code for reading data and counting the CRC for MS5837 to the code for MS5611
And this is for converting pressure and temperature:
switch (_ms56xx_type) {
case BARO_MS5607:
case BARO_MS5611:
case BARO_MS5637:
case BARO_MS5837:
Now my MC5611 is instead of MC5837

I think that this is not my last question, most likely there will be more questions. Thanks again for your support

1 Like

Interesting approach - glad you seem to have solved your problem :slight_smile:

Out of interest, is your sensor custom, or is there some commercially available waterproof MS5611 that I just haven’t heard of before?

See you around :slight_smile:

In fact, we don’t have a depth sensor that is structurally similar to the Bar30, there is just a sensor soldered on the board. We ordered it, but it will take about a month to go to us, and this is too long. There is an analog pressure sensor with a current output, called EAMPT-131. I managed to emulate the MC5611 on the blue pill (for some reason there were problems with the MC5837). I connect an analog sensor to the blue pill ADC, and taking data from it, it sends information about pressure and temperature via i2c to Pix.

1 Like

I plan to measure the temperature with DS18B20

Hi Eliot. Me again with questions). Our device has some specifics. In addition to engines, there are reservoirs with pumps located in the bow and tail of the boat. They fill or pump out water from the tanks, thereby controlling the depth and pitch. It’s in a static position. When driving, rudders are used for stabilization. The question is how to create a custom frame consisting not only of motors, but also with outputs for relays and servos.

I was thinking of using the blue pill again to convert the PWM signal for the servo to a signal for the relay.

Interesting vehicle :slight_smile:

ArduSub already has support for both relays and servos via joystick button functions, but there’s no integrated support for variable buoyancy components or control surfaces in the vehicle frame / motion control code - they would need to be controlled either manually or by an external program.

This thread may be worth a read.

Yes, this is very important for us.