I was wondering if somebody could help me with my project.
The project I want to make is with 9 linear actuators that move a frame up and down.
The problem is that I need to synchronize all the motors because of otherwise damaging the motors.
These actuators have potentiometers but the value are fluctuating quiet a lot.
I tried to help this problem by looping 100 times through the value and getting an average value of the potentiometer but so far no luck.
I was thinking of using one motor as reference (of the potentiometer) and comparing all the other readings from the potentiometer to this one, and seeing if the the readings are the same and otherwise extending the actuator or retracting the actuator.
But I really have a problem trying to write this sketch.
If anyone is familiar with something like this an can guide me in the right direction it would be much appreciated!
Have you written anything yet?
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
Can you please post a complete copy of your sketch so far, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
We need this info so we can give answers that are relevant to you project.
Nine actuators - would you be looking at one arduino to run all nine, or were you thinking of having some sort of master/slave arrangement? Most arduinos don't have nine A0 inputs. Maybve some will.
Will all of the actuators need to be zeroed? As in, move each one in and out manually, and tell the sketch that where the pot reading is now, that's where 100% is.
How are you telling the sketch where ou want the actuators to be, once its running? Command on the serial port? (My usual code for dealing with noise is
value = .75 * value + .25 * newValue;)
Is there some way other than your noisy potentiometer to work out where the actuator is? Quadrature encoder?
What brand/model number are the actuators? Is there a data sheet? A URL?
Perhaps a low-tech solution might suit you better? Some gearing? A common shaft driving nine threaded rods?
Hi Tom George,
sorry for the first post.
Here is the code that I've got till now.
(In this code I am only checking the values for motor1 and 2 because otherwise it is even more difficult for me)
I'm sorry but the code exceeds 9000 characters so I have uploaded it here:
I'm totally not good with drawing schematics so I hope this can help a bit.:
@PaulMurray: I have add your suggestion for smoothing the values.
And here is some extra info:
I'm using the following items:
- arduino Mega
- 2 pushbuttons (+pulldown resistors)
- 9 Linear actuators (from aliexpress)
- A power supply from PC 1000W
- I take Also 5 Volt from this supply for Arduino, Potentiometers, RelayBoards and breadboard