-
Notifications
You must be signed in to change notification settings - Fork 5
joystick12 - different calibration formulas #14
Comments
Made calibration formulas the same. |
Ok, so your changes reminded me of something I should have mentioned in the "general" email I sent out. Why the extra analog reads? In many of the drivers, I saw read analog functions that would always do 2 reads, throwing out the first one, with a comment like
I removed them all as I converted the drivers because this is wrong... ADC reads are already slow enough without doubling the time to get a single value. If all analog devices return weird values on the first read, then only two solutions should be employed:
Reading two values for every one you actually want is just a bad idea and just points to a deeper problem that should be fixed there. Can we just not do that? |
I agree, a fix for adc on edison should be handled in mraa or in the adc driver which provides access via /sys/bus/iio/devices/iio:device1/in_voltage0d_raw since this also exhibits the same artifact. Which would you prefer, an incorrect fast read, or a slower correct read? Because I'm encountering this stuff for the first time, I'm addressing it now. I see this on all analog sensors. How have you dealt with this in the past? Ignored it? A possible solution would be to have mraa mask this problem (two b2b reads?). Perhaps it's something that only happens on edison? A throw-away read in the init function is not enough to fix this since it re-appears in 30 seconds or so on the edisons I've tested. |
On 07/27/2016 12:54 PM, Noel Eck wrote:
So... even sysfs reads show this artifact? That implies a problem in
Neither, they both suck. In the case of a joystick it won't actually But we need to characterize this problem in more detail if we want it fixed. Just stick with single reads please - this may in fact be an edison-only
I've never actually seen the problem. But then I usually do not create Many of the analog sensors are "noisy" - they vary from sample to sample
I'm guessing this is something else...?
Probably only happens on edison would be my guess. G2 and edison act I have drivers that work fine on one, and not the other. We can't do I would write the driver assuming that the ADC value read is always If it is not giving you correct data, then it's a problem that MUST be Keep in mind this stuff needs to work on a lot of different platforms Having MRAA do two reads is just moving the "broken" fix, and If your kernel drivers are malfunctioning, then all bets are off - it's
If you can characterize the problem in detail, then send it up the chain |
The X and Y axis use different calibration formulas... Why? The original driver never supported calibration, and it's a good addition, but I am curious as to why the X/Y axes would need different formulas.
The text was updated successfully, but these errors were encountered: