Need Help With IK Controls

I started working on a procedural walk system using IK Controls and I ran into a bit of an issue.

Whenever the IK Controls’ targets get behind the legs, the legs just rotate 180° for no apparent reason.

I’ve set the IK Controls’ poles and rigged the model properly, but the issue is still there.

Here’s a video of what keeps happening:

Here’s what the structure of the dino looks like:

And here’s what the IK Control properties look like:

Does anyone have a solution to this?

For anyone wondering, I found a solution.

Removing the pole completely from both IK Controls and setting the type property to “Position” solved the issue.