Weird "jump" when moving a joint at 180 degrees

Hello guys, I get a weird “jump” when trying to animate a robot from blender, the main issue is that the goal is to control the physical robot from blender, but If I use the angles from the armature that jump will most likely crash the robot. How can I deal with this so it keeps the elbow turning up. Tried using a pole target but it messes up the rotation on the base.