sjstein / miniRDproject

A miniature railroad controller for train sims
0 stars 0 forks source link

hysteresis in throttle control #2

Closed sjstein closed 3 months ago

sjstein commented 3 months ago

The current break-point for determining each notch for the analog throttle control allows oscillation.

Adding a bit of hysteresis into this would be a good update. e.g:

if the breakpoint between N0 and N1 is denoted b0:

where d is some integer value (tbd)

The above assumes the throttle action has increasing analog values with increasing notch - this may be backwards (so then just reverse sense of above)

Also, maybe the d(elta) value above would be better served if different for each break point

sjstein commented 3 months ago

Currently being tested in branch 2

sjstein commented 3 months ago

Closed via pull request #4