after some work in the past two years i have the impression, that the values for „smoothed_confidence“ and „this_ping_confidence“ are swapped in the „distance2“ (1223) message. I have set up the s500 for a ping rate og 10Hz (100ms).
the depth values seem to be reasonable, the smoothed depth is slowly varying, compared to the „this_ping_depth“, but the values for smoothed_confidence change more rapidly than the values for „this_ping:confidence“.
Any ideas / suggestions ?
I checked the code and it agrees with this definition in the manual:
Is this the same structure that you are referring to?
the code is ok, i checked it with code that came from the ping library. —> swapped
than i wrote my own code, that exactly uses the structure in the API definition, same effect.
Here is the structure that i am currently using:
typedef struct s500_distance2_t // structure response packet “distance2”
char sop0; // Start of Packet ´B´
char sop1; // Start of Packet ´R´
uint16_t payload_length; // length of payload
uint16_t packet_id; // packet id (1223)
uint32_t this_ping_distance; // most recent ping in mm
uint32_t averaged_distance; // average over last 20 pings in mm
uint8_t this_ping_confidence; // this ping confidence of distance (0 to 100)
uint8_t averaged_confidence; // confidence of averaged (last 20) distance (0 to 100)
uint32_t timestamp; // timestamp in msec from start.
and here the data from a mission in .csv format:
distance, confidence, smoothed_distance, smoothed_confidence, timestamp
The same also happened in the past, when i was using the data from “profile6t” message, seems to be
the same issue. (and also for the deprecated 1303 message)
That looks like a startup issue. The signal looks good so the this_ping_confidence is high. The averaged signal has more data to work with (the last 20 pings), so until most of the past 20 pings agree with each other it reports lower confidence. The same effect might be observed in the case of a rapid change of distance. Granted, there is room for improvement in the algorithm.
I think it is not a startup issue. The data above is not the start of the Mission.
it is a cutout of the middle of the mission.
i did some other tests yeseterday and found the same behaviour. The „smoothed“ confidence did rarely reach 100% while the „this ping“ confidence was most of the time at 100%.
The bottom hardness may be an issue. in this case it was rather soft with much water plants…
But anyway, the swap also occured in the last year, when i measured „hard rock“ in the mediterranean, which was done with the „original“ code from the ping library.
i think, that the swap occurs in the firmware of the S500, because it it present in all packets i have tried so far.
i will do some further tests this afternoon in an area of the lake, where the bottom hardness is higher.
I have also found an issue concerning the ping rate
but more on this later…
The issue with the „swapped“ confidence shows up only, when in shallow waters (0…5m).
I tried in depths below 20m and all worked fine. The smoothed conidence behaves as it should.
There is also another issue concerning the ping-rate. If in shallow waters and auto range mode, the ping rate varies somehow. In deeper waters, the ping rate is exactly as programmed.
I think, that this bevaiour are side-effects of auto gain and auto range modes.
You are correct, the irregular ping rate is due specifically to the auto range mode and this will be particularly noticeable in shallow water where the ping rate will normally be higher. The reason is longer pings are periodically sent to check that the algorithm has not gotten locked onto some near obstruction when the real bottom is substantially further.
Regarding the “swapped” confidence, perhaps “startup” is not the right word, but I believe it is due to the smoothing algorithm which considers a series of 20 pings and how well they agree with each other.