I have a lift (wheel chair Lift) with two linear actuators. originally they were synced by relay and torque switch controls which caused a very rough unacceptible ride and causes the machine to bind in the process. The original equipment was designed by a company called ConvertaStep which promptly went out of business. I currently have installed rotary encoders on the Screws that are moved by motors in the Linear actuators as I thought the RPM would be slower and more easily counted. I plan on using the mega 2560 board. I have found sketches to run the dc motors and also some for encoders, but not sure how to compare the two encoder counts to speed up or slow down the the slower or faster motor and keep them in sync. These motors are rated at 30Amps 12VDC and must be able to run both directions. The encoders have multiple dip switch settings for Pulses Per Revolution so I can change or adjust for greater precision for optimal timing on the Arduino Boards.
So I am looking for someone to help me with a sketch to sync the two DC (Motors) actuators using newly added encoders in such a way that the unit moves more smoothly and doesn't bind as the motors are changing speed to match each other.
I would think there some two wheel robot sketches out there to that would do something similar but haven't found anything yet.
Please post links to the specifications or product pages for the encoders. I have never encountered any that have adjustable PPR.
in such a way that the unit moves more smoothly and doesn't bind as the motors are changing speed to match each other
The binding is caused by differing relative extensions of each riser of the lift. You have to match the motor speeds and the extensions.
If the two arms of the lift are correctly aligned at the home position, then one approach would be to count rotational increments of each lift axis and adjust the speed of one motor to match the two. The same approach (matching wheel rotation increments) is used to have a two-wheeled robot run straight.
A PID algorithm, with the input (error term) being the difference between the two encoder counts, will solve the problem.
Paul_KD7HB:
Forget the word "sync". Can't be done. What you want is to define one actuator as "master" and control the other "slave" to match the master signal.
Paul
Syncing can be done by a feedback loop on the position difference, and mixing that (PI or PID treated) difference
signal into both motor drivers with opposite signs - neither is master or slave.