Oscillations after rotating

I’ve been working on putting together a program that draws out a logo and I’m running into some interesting things. More specifically, I’m having issues where the XRP will randomly oscillate after completing a turn for 10 or so seconds before continuing on. It doesn’t happen at the same time every time I run the same code. Any ideas what would be causing this? I’m guessing it has to do with the PID settings, so i may start tweaking that a bit first, but I’d appreciate any other ideas you may have.

ezgif.com-optimize (2)

1 Like

Sorry, I can’t help answer your question. But I really appreciate how your video shows how the marker fits in the holder and is free to move and rotate as the XRP moves! Thanks for sharing.

I’ve also seen this behavior sometimes, seems like the PID controller isn’t finishing when it should. I wonder if reducing the PID controller’s min_output would help?

0.35 seem high to me, I think something closer to 0.2 might do better. @TFossDK want to give that a try?

1 Like

So far that has seemed to fix the issue. If it pops up again i’ll reach out. Thanks @SparkFro

Sure thing!

@k.siegall how would you feel about officially incorporating this change in XRPLib?

Yea I can change that in the library - particular tuning values are always a little tedious but you’re definitely right that 0.35 as a minimum is a little large

1 Like

I’m seeing the same jittery problem today. I just reloaded the python dev environment
(switching back from the WPI/Java environment using this method) and the section of differential_drive quoted above looks like:

        if main_controller is None:
            main_controller = PID(
                kp = 0.1,
                ki = 0.04,
                kd = 0.04,
                min_output = 0.3,
                max_output = max_effort,
                max_integral = 10,
                tolerance = 0.25,
                tolerance_count = 3,
            )

And that’s completely different from what’s in the file linked above.
Did I end up with the wrong version of the library?

Those values are for the main_controller for the Straight function, not the Turn function. They look almost identical.