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

Smooth ramping for ATR and TT #7

Open
wants to merge 148 commits into
base: main
Choose a base branch
from

Conversation

surfdado
Copy link

If you want to try it out...

lukash and others added 30 commits March 17, 2024 10:59
A carbon copy of the Float package from the v1.3 commit:
b2c2750

Except for paths and Makefiles adjusted to the new name, and a few
auto-generated files omitted.
lefthook is a git hook manager.
Remove useless comments and move long trailing comments that mess up
clang-format.
Doesn't make sense to call fabsf() on a boolean, assume the intention
was to take absolute value of the tiltconst variable.
Using qmlformat and a lot of hand-editing where it gave suboptimal
results.
Signed-off-by: Dado Mista <dadomista@gmail.com>
When going backwards (battery forward), the sign for the accel_gap is
inverted. Without the fix, the wrong ATR strength was being applied, so
e.g. setting only ATR uphill, the nose would instead angle down on a
downhill if going battery forward.
From AppUI (or Float Watch) it was possible to enter flywheel mode without
actually passing the sanity check!

Signed-off-by: Dado Mista <dadomista@gmail.com>
Signed-off-by: Dado Mista <dadomista@gmail.com>
Check against roll tolerances when starting dark ride

Signed-off-by: Dado Mista <dadomista@gmail.com>

darkfix
Reverse stop condition now also checked in wheelslip state!

Signed-off-by: Dado Mista <dadomista@gmail.com>
200ms instead of 500ms

Signed-off-by: Dado Mista <dadomista@gmail.com>
Drop the version in settings.xml, it adds more complexity than it's
worth. Use semantic versioning and make version a string.
The simplestart/posi features shouldn't override the footpad sensor
state to FS_BOTH, as that should represent the true value of the
sensors. Instead, add a function that evaluates whether the sensors are
engaged and which takes simplestart and posi into account.

One of the practical advantages is the user is now able to see the true
state of the sensors when only one side is activated, as opposed to
always seeing both sides are.
Keep board explicitly engaged in flywheel mode instead of overriding
float_conf adc thresholds.
Do the evalution in footpad_sensor_update().
lukash and others added 28 commits March 17, 2024 10:59
Also fix atr_filter_enabled config value being reset in an init
function.

The _reset name is much more descriptive, the function serve to reset
any runtime values that haven't been cleared after stopping (so that the
values remain available for backward reference).
Fix: Fix duty on LED status bar always showing at 100%.
Fix: Fix disappearing battery percentage on LED status bar.
Fix: Fix LEDs configuration not picking up some values after startup.
Fix: Rename the Specs -> LED Pin option values to be more descriptive.
Convert brightness from 0..1 float to 0..100 integer

Fix: Fix setting brightness for LCM module (Floatwheel)

Signed-off-by: Dado Mista <dadomista@gmail.com>
Fix: Fix Torque Tilt using ATR step sizes instead of its own step sizes.
Fix: Fix showing wheelslip and duty pushback alerts in Flywheel mode.
Fix: Fix beeper beeping on board startup.
Signed-off-by: Dado Mista <dadomista@gmail.com>
Fix: Fix a crash in LEDs Cipher transition when front or rear strips
 have 0 LEDs configured.
Fix: Fix a (Watchdog Timer) reboot when reinstalling Refloat (in case
 LEDs are disabled)
Signed-off-by: Dado Mista <dadomista@gmail.com>
Signed-off-by: Dado Mista <dadomista@gmail.com>
@lukash
Copy link
Owner

lukash commented May 16, 2024

Not entirely sure what's the purpose here, if it's just a quick'n'dirty for me to try, ok. Otherwise, the code should go into a function, not be copy-pasted. Also, it may be possible to implement the ramping in a simpler way, which would potentially have a bit different curve but maybe that doesn't matter (it could even be better, we probably have no way to tell which is better except by feel and differences will be minuscule). Once I have some time (haha) I can try to figure out a code-wise clean solution. I don't really use ATR or other tilts much though, so I'm not sure I'll be able to judge it well (hence I didn't even try this yet...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants