-
Notifications
You must be signed in to change notification settings - Fork 4
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
Brownout fixes #21
Brownout fixes #21
Conversation
I believe the initial issue with nonsensical limiting was that the sum of the minimum currents for each subsystem added up to above the sustainable current, so the ratio became negative and strange things happened. The minimum currents for each subsystem should be tested, as well as the sustainable current value. Also, Liang brought up that we should run all subsystems at once (without brownout protection) and see if we are even capable of triggering a brownout on low battery. |
A few things from testing this on the robot:
topic 1: the current logic uses an ideal ratio of total draw to scale all subsystems.
topic 2: calling setCurrentLimits, getCurrentDrawn, ... every loop is quite expensive |
The ideal ratio logic should scale subsystems based on how much they're drawing. The ratio is determined from total draw and max sustainable current, but the actual scaling for each subsystem multiplies their draw by this ratio. Higher drawing subsystems will be given higher limits than lower drawing subsystems. |
Do you think a thread would make this better? |
I think using a ratio based on a subsystem's minimum current (or maybe implement a max? each subsystem is only capable of drawing so much at full throttle, so a max is feasibly, moreso for mechs than dt) and its draw might be more useful. Then like Liang said we can see if a subsystem might need more power in the first place. |
Really, with printed amounts? In my testing max was around 80, but then I guess I wasn't using DT. |
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.
doesn't seem like the logic has changed, so we really just need to test this to see what aspects we need to fix i guess
@ky28059 if you have nothing to do during 6th you should test this code, so we can try implementing it asap. |
Also, remove climb from brownout calculations as it will be dormant outside of climb and during climb we don't want to be limiting it.
Hopefully this was the issue with brownout limits
Merged into #32 . |
For testing and (hopefully) fixes to brownout jittering behaviors.