Keeping Arm height equal while having preset arm positions & PID loop


I’m trying to program our robot’s arm to move together in EasyC v4 using a potentiometer while having preset positions. How would I go about doing this if both potentiometers are occupied by the preset arm position program?

Here’s an example for keeping the arms together:

Left_pot = get analog 1
Right_Pot = get analog 2

If left_pot > right_pot: left_lift_motor = 63
If right_pot > left_pot: right_lift_motor = 63

And here’s an example for preset arm positions

left_pot = get analog 1
If btn1: setpoint = 100
If btn2: setpoint = 200
If btn3: setpoint = 300

if setpoint > left_pot: lift_motor = -100
if setpoint < left_pot: lift_motor = 100

As you can see, each sample will occupy a potentiometer.

Also, is there any advantage to having a PID control loop for drive trains during operator control? It doesn’t seem like a human would need a PID control loop assisting them during the operator control.

It doesn’t seem hard to combine the two functions.
If both arms move to the same set point, then they will be moving together, right?

They will be moving together but might not move in sync.

Let me rephrase:

Right Arm might be 10 degrees more than Left Arm
If both arms move to same position, right arm will always be (left arm + 10 degrees) until it reaches the setpoint.

how about just use one pot for both arms?