An interesting observation about pigpio vs the old on-off library #167
Replies: 1 comment 1 reply
-
|
This is expected, mostly because old on/off version did not record the deltatime at the hardware but rather when the handler run: const hrDelta = process.hrtime(hrStartTime)
hrStartTime = process.hrtime()
const delta = hrDelta[0] + hrDelta[1] / 1e9
process.send(delta)This meant that actually we are not registering the delta time based on the actual impulse trigger but rather the time when the handler processes in the javascript code. That include latency and dependency on task scheduling from the kernel. It made delta Times inconsistent and dependent on the system Not to mention that we query hrtime() twice that makes things even worse because if there is any delay that would poison the next calculation... I dont see an option on on/off that would allow retrieving the original interrupt event time (though it may be possible to change the code but not sure). On/off uses Epoll that is basically polls the pin and sends a signal when state changes. This is similar to pigpio but not exactly (actually this is the reason why on/off works and pigpio not On/Off library has not been updated for 5 years. So that is not the way to go. The only way forward:
There is no way around this. to option one I have found this: https://github.com/sombriks/node-libgpiod Author says on the pigpio realted issue: joan2937/pigpio#589 (comment) That this is an alternative. But It does not seem to support interrupt (yet?)... We need to accept the fact that Rpi is not build with realtime hardware in mind. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In preperation for the 0.9.7 release I've been regression testing the improved physics engine with all the old recordings of a C2 RowErg. In this, I notice that a group of older recordings are a lot messier than the younger recordings. In fact, they contain so much data drops and oounces, that even the 0.9.7 version struggles to handle all the noise (although it is better capable). But some files are so messy that the drag calculation gets completely thrown off.
Looking at the boundary between good and bad files, I found that there is a radical change at 25-09-2022. Before that date, a session typically had thousands of stroke detection errors (i.e. the data wants to move to recovery/drive, but it is kept back due to the safety net of maximum recovery/drive time) and hundreds of drag calculation errors (i.e. a drag GoF below the set required GoF), even on 0.9.7 with identical settings. After that, a session hardly has any dragfactor calculation errors, and only occasionally a stroke detection error.
Looking back in the change logs, I found this change: the change from unfiltered On/Off to pigpio with bounce filter that happened at that exact date. To me, this is a clear indication that we need debounce filtering, but also something more reliable than On/Off (if we need to move to RPi 5 which doesn't have pigpio).
Beta Was this translation helpful? Give feedback.
All reactions