I have encountered an issue with the unusual output of the SPL06 barometric pressure chip. Consequently, I have been examining and reconstructing the AP driver for this chip.
Here are some questions:
What is the AP expected or minimum rate for driver polling, especially barometer?
I have reworked most of the driver and I’m currently examining the coefficient registers. It appears there were some issues with types, causing the compensation to malfunction. I am addressing this issue now.
I have to solve it in days (not weeks) to know if board will or will not be usable for my copter.
I can test some code if you want, but It’s seems to me I’m much ahead of the PR you mentioned.
There were many misconceptions in the driver code such as reading invalidated data or wrong temp vs pressure timings.
Main problem is, it’s just slow.
5Hz is max. And it’s close to unhealthy driver.
Temp reading are terrible unstable. I can get 50 deg. Cent. diff on my desk. It depends on parameters used.
There is a big difference in timing and other stuff. The version you are running is far from working. Especially data from chip is not validated, timing balance between temp and pressure is wrong etc. The original version deliver almost random data. I was on it for last 7 day. Temperature compensation is dramatic. 10 deg diff makes hundreds of meters change in altitude.
PS. I tried to PR my changes for you review but was flooded with dozen of emails from GitHub.
I sent a link here, just for reference.
My opinion is this chip is just bad or fake. I will send board back.
If you follow documentation it will not fit in 500ms time for driver. It just need to much time to measure both temp and baro to fit time window. Sure you can go down with time but results are getting crazy.
The version you are testing is not following manuals.
Could be, I spent a week 24/7 trying to solve the issue, and my answer is - it does not work. SPL06 is just a bad baro.
I can’t PR as AP build system is to complicated for me.
If you are interested, here are links to what I have got finally.
It just two files. You can copy and past it easy.
Same should be in the PR I posted yesterday (PR includes modules mess as well, sorry, can handle it)
To be honest, it does not work as chip is a poor fake copy of good baros.
It’s temperature measurements and pressure calibration using it are both dramatic failure.
It’s just useless for drones.
I even tried to find someone using it in the air and found nobody
Ok please describe then what changes you think are necessary. The default status is that I am simply going to push ahead with my PR that works on the board that I have.
Check if temp you read is good. My board shows only about -15 or +35 deg. depending on how registers are configured. That’s main problem, chip can’t read temp. Could be my one is fake or broken but your is good.
Power board in stable temperature then move to hotter/colder (±10deg Centigrade is ok) area for 30min and then back. Investigate altitude logs. My board shows amplitude by hundreds of meters or even 1km. Still on the floor, but temp changed.
About the code:
Old code used to push it as fast as possible to get best documented measurements but do not check if results are READY before reading (false values in regs), so I added tests:
Registers readings take place only if data are valid. (308-404)
Some for chip initialisation, you can go further if chip is ready to work and coef registers are ready to read. (You can’t get proper reading if coef regs are unstable)
I rewrote the command mode as well but I think background mode is better.
Original version measured temp and pressure at a ratio like 1/50 … way to unbalanced to get proper results for any baro. Best is mixed 1/1 but docs shows 1/4 is ok as well. I left it as 1/1 in command mode.
Background mode is the another story. Thee are 3 documented configs named low power, standard and high precision. I defined them in code. Non is working well
@andyp1per The point here is the last image above. Look closer. 1000m change in altitude in 5 minutes (while cooling - blue line). Then 2000m (while heating red line). You can’t fly that way. Or am I wrong?
Few day ago there was a case here when drone flow away vertically. SPL06 baro on board?
I don’t have logs for my Pavo20 on me but these do not show the behaviour you describe - height is largely stable and temp shows some believable variation, albeit somewhat high (which is true of the DPS310 as well). I think you have a duff chip on a duff board.