Skip to content
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

Add synthetic current backend and correct SITL current computation #22197

Merged
merged 4 commits into from Nov 23, 2022

Conversation

Hwurzburg
Copy link
Collaborator

@Hwurzburg Hwurzburg commented Nov 14, 2022

replaces #22117 per dev call

@Hwurzburg Hwurzburg added DevCallTopic WikiNeeded needs wiki update labels Nov 14, 2022
@Hwurzburg Hwurzburg force-pushed the new_batt_backend branch 6 times, most recently from 4f22f87 to 985c5e9 Compare November 14, 2022 21:21
@tridge
Copy link
Contributor

tridge commented Nov 15, 2022

in tfs_validate_current1() need to use math.round() to round both values to closest 0.1A (deci-amp)
in common.py 11883

@Hwurzburg Hwurzburg force-pushed the new_batt_backend branch 3 times, most recently from 437f288 to 60f76bc Compare November 15, 2022 04:15
Tools/autotest/common.py Outdated Show resolved Hide resolved
Tools/autotest/common.py Outdated Show resolved Hide resolved
@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Nov 15, 2022

@tridge apparently our python "math" has no round function

will try just "round" and emulate 1 decimal precision.....success!

@Hwurzburg Hwurzburg force-pushed the new_batt_backend branch 2 times, most recently from 960afe0 to 63fb94a Compare November 15, 2022 17:50
@Hwurzburg
Copy link
Collaborator Author

Hwurzburg commented Nov 16, 2022

Tested on Vehicle BAT0 monitor analog on autoplilot...BAT1 synthetic current, autopilot voltage sensor
BAT 0 Curr
first ran full throttle on another log and set params : max volt 12.6 max current 13.6 then ran again
resting voltage the same (should be if the currents match and using the same voltage sensor)
looks good to me

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to be wildly wrong in the face of separate-thrust-and-lift quadplanes?

libraries/AP_BattMonitor/AP_BattMonitor.h Outdated Show resolved Hide resolved
libraries/AP_BattMonitor/AP_BattMonitor.h Outdated Show resolved Hide resolved
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tridge tridge merged commit ef65274 into ArduPilot:master Nov 23, 2022
@Hwurzburg Hwurzburg deleted the new_batt_backend branch November 23, 2022 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants