Syncing to motors in addition to joystick motors

We have two motors one for each wheel and we use the joysticks. We have a mobile goal slide lifter, and each side has a motor so there are two motors. The student who is coding said it is impossible to code to sync two motors. I know last year we had this problem, and there is a way. Can you help us?

It looks like the community gave you some feedback here.

Your options would be, in order of complexity.

  1. Just send the same value to both motors, they will not really be synchronized but will tend to realign as they hit each end of travel.
  2. Use mechanical synchronization, couple the two motors using a long axle.
  3. Encode each motor and use software to compare the relative position of each. This requires a control loop in your software that will determine the error in position between the two motor and adjust the speed of one or both to compensate. Search the forum for things line “P controller” or “PID control”.