4 Motors - Position / Velocity tracking
Posted: Sun Sep 06, 2020 9:23 am
I have a platform, lifted & lowered by 4 linear actuators (DC Servo Motor + Encoder + Limit Switches).
I'm using 2 x 15A Roboclaw Dual Channel controllers connected to an Arduino through Packet Serial.
I need all four to stay locked together, so the platform stays level.
I've tried closed loop Velocity - then setting the same velocity on each. Over short distances, they track OK but eventually they drift.
I can move to a position - but then they do not all move at the same velocity.
The only option that seems to work is a position move over a short distance, wait for all the motors to catch up (stop) then repeat. The trouble with that is it's slow - and jerky as the motors have to accelerate & decelerate for each step.
The best approach so far is to use PWM control & read all the encoders. If an encoder count is higher than the mean of the four, slow that motor down a bit. If lower, speed it up. It works fairly well at low speeds.
I guess I could implement a PID on the difference between the mean and actual - but I think the issue I'm running into is the Serial speed - and the delay between reading an encoder and the speed changing, leading to oscillation.
Is there a way to lock two or ideally four motors together so they track position / velocity?
I'm using bi-directional limit switches - and detecting when all four motors have stopped moving to zero the encoder counts. I've tried to find a way to read the state of the limit switches (S4 & S5) - but the values returned do not always match the switch state. Is there a better way?
I'm using 2 x 15A Roboclaw Dual Channel controllers connected to an Arduino through Packet Serial.
I need all four to stay locked together, so the platform stays level.
I've tried closed loop Velocity - then setting the same velocity on each. Over short distances, they track OK but eventually they drift.
I can move to a position - but then they do not all move at the same velocity.
The only option that seems to work is a position move over a short distance, wait for all the motors to catch up (stop) then repeat. The trouble with that is it's slow - and jerky as the motors have to accelerate & decelerate for each step.
The best approach so far is to use PWM control & read all the encoders. If an encoder count is higher than the mean of the four, slow that motor down a bit. If lower, speed it up. It works fairly well at low speeds.
I guess I could implement a PID on the difference between the mean and actual - but I think the issue I'm running into is the Serial speed - and the delay between reading an encoder and the speed changing, leading to oscillation.
Is there a way to lock two or ideally four motors together so they track position / velocity?
I'm using bi-directional limit switches - and detecting when all four motors have stopped moving to zero the encoder counts. I've tried to find a way to read the state of the limit switches (S4 & S5) - but the values returned do not always match the switch state. Is there a better way?