-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADC system refactor #13833
ADC system refactor #13833
Conversation
This generally looks like the right direction. At some point I'd like to update all the ADC access to go through ORB rather than In a configurable system with an ADS1115 on I2C how were you planning to specify which channels correspond to voltage, current, etc? |
Drivers can provide adc samples with device ID and channel information which stay unchanged during power cycles. The most configurable solution would be two parameters on a function. For example, battery monitor checks params "INPUT_DEVICE_ID" & "ADC_CHANNEL", then it can filter uorb msgs which have device_id field matched. If there should not be this much flexibility, using start-up configuration is another choice. |
a28fd60
to
6e6775a
Compare
I have updated ADS1115 driver as a example and a wrapper for analogue differential sensor. They works as below:
I haven' t connected a real airspeed module on to ADS1115 because I did not bring it home but that is enough to show how this new design work. I would make a battery wrapper as well very soon. Any ideas? |
6e6775a
to
a945bdc
Compare
|
09eb743
to
b3ddc4a
Compare
Now it supports generating battery monitor and RC RSSI reports from configurable adc reports. Remainder tasks including creating correct startup scripts which set the coresponding parameters for each boards. |
A critical problem exists if multiple adc drivers publishing. Some of topics may be overwrite and the subscriber would fall to catch. This is mostly a subscriber side problem and can be fixed if there is any polling logic. |
In what case are there multiple? |
Related, I had create an analog airspeed "driver" in #13586. |
void | ||
ADC_DifferentialPressure_Wrapper::init() | ||
{ | ||
_dp_report.differential_pressure_filtered_pa = 2.5f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this is incorrect.
Let me know when this is ready for an overall review. The battery_status changes need a careful review and test on existing systems. If it makes sense you might consider carving this off into small little pull requests that are easier to review and test in isolation.
|
Should I deprecate this PR and create those instead? To bring back |
I'm not sure what you mean. |
|
Deprecated. |
4a8160c
to
3a3bbce
Compare
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Describe problem solved by this pull request
Refactor adc. Moving adc out of DriverFramework. Aim to get a more flexible adc system.
Describe your solution
adc_report.msg
contains more useful informationThis adc system works like mpu9250 with similar deviceID management. It supports multiple adc drivers and support multiple adc subscriber.
ADC driver publish
adc_report
, analog battery/airspeed driver wrapper subscribe the uorb topic and pick up information they need.Old architecture-specific call in
drv_adc.h
should be deprecated.Additional context
WIP, support needed.