Can you use multiple SlewRateLimters

Our robot it more tippy going in reverse compared to driving forward. Can you have two slewratelimiters, one for driving forward and one for driving backwards? Then just apply the appropriate limiter based upon the direction your moving? I’m just nervous that the “memory” of the slewratelimiter (as mentioned in wpilib) well cause problems due to swapping which one is used based upon direction.

You’d want some strategy where you only switch which is in use when the output crosses zero, and reset the history while not in use. Otherwise, you would be liable to get large steps in your output.

Alternatively, what triggers the tippiness to be asymmetric? And, more specifically, is it actually triggered by the velocity being negative? or the acceleration making the velocity more negative?

In the latter case, a single asymmetric slew rate might be able to do it (IE, use a different rate limit based on whether the output is increasing or decreasing).

It’s sudden stopping while driving backwards that causes it to tip excessively. COG is center of bot (6wd), but our rear wheels are traction. So the rear wheels basically ‘toe-pick’ you in to tipping when you stop fast. We don’t tip over, but I wanted to correct that in code

This should be supported in 2023; we had a recent PR merged that covers this case.


Are you using speed control or power control? If the latter, then you might find that switching to speed control (that is, some flavour of PID controller) will automatically compensate for the fact that the application of a given power level has more effect in some situations than in others.

If you do go with two slew rate limiters, I recommend that you always feed (that is, call calculate on) both, but only use the result from one.

Try this balancing act

We’ve used the roboRIO built-in accelerometers for tilt calculation, too.

Or just program your own custom slew rate limiter as we did in the middle ages when the D-Link radio would fail if you changed speed on a CIM too fast.

I was planning on playing with our navx and their anti-tip sample code after our off season event in 3 weeks

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.