Hi artefact,
The IK that you have set up will not work for this. The rotation of the base doesn’t need an IK, nor would it be advised to tell the IK for four (five) joints to be limited to only one rotation. The 2D IK solve is faster, more precise and easier to manage IMHO. To put everthing in one Goal, would also create more keyframes in one object, rather than in at least two, also much easier to mange and to change.
I find that a robot arm has a very limited expression that way anyway. Forward kinematic or even a complete set up with Pose Morph would be much nicer. But I really don’t know your target, so here is your file.
Scene file:
https://www.amazon.com/clouddrive/share/ezbwtI56aZWxrhTo779L1I42RNx2IJySW5mswJRSMwX
The objects in the file are named with the needed extensions (needed as in artist workflow) as in “R.H” Only rotate in Heading, or “P.X+Z” only move this object in X and /or Z. Anything else, while in Ik, leave alone. Perhaps the Pole might need an adjustment.
A few tutorials as suggestions (always meant as a suggestion to the whole series
http://www.cineversity.com//vidplaylist/robot_arm_suggestion
This page is a must read, if you are serious about character animation. It might be a little bit “dry” but in this page is the core knowledge for the IK arm set up, hence why I suggest it.
https://help.maxon.net/us/#TCAIK-ID_TAGPROPERTIES
Enjoy