Controlling stepper motors for a robot arm

Hy!

I'm making a 6 axis robot arm that has stepper motors powering the links. The robot arm has attached some limit switches for homing purposes. This whole robot arm is controlled by an Arduino Mega, and then for each motor there is a stepper motor driver (CL57T).

The variables for the motors are sent via serial. The first variable is the position for each motor wich is recieved in radians, then easily converted in steps, taking into consideration the microstepping, the gear reduction of the motor and the gear reduction of that specific link (motors are connected to a coupling and then via belt to the driven gear of that specific link).
Until now everything works great, tested each motor individually and they work perfectly.

I'm having problems running all the 6 steppers in parallel with the Arduino. They dont need to be coordinated (like not all motors need to be in position at the same time), they should have different speeds and the only condition is that they should start at the same time. I'm recieving the speed in radians per second and I can convert it in steps per second, but after that i dont know how to run the motors according to the speed and in parallel.
I am controlling the motors with pulses HIGH, LOW, delay repeat. The only way to control the speed is by changing that delay.

If you have any solutions, any libraries that might help or info on this problem I would be so glad to hear it.
Thanks!

1 Like

What speed is needed for the motors?
You could try my MobaTools library to control the 6 steppers. With an Arduino Mega every motor can run up to 2500 steps/sec - even all at the same time. The lib also supports acceleration and deceleration when starting and stopping the motors.

1 Like

Just read a part of the documentation for this library, looks really good.
The speed is usually at most 2000 steps/ second fror the actual motors, wich after the gear reduction becomes something like 30 rpm or so. For now I am running at low speeds but still, they need to be proportional to those initial values recieved via serial cause otherwise the end effector wont follow the correct trajectory. Each motor has its own speed cause of the different reduction rates (for example one motor has 10:1 and the other has like 50:1).
Also that ramp up and ramp down feature for the velocity is really great.

Thanks a lot!
I hope tomorrow I'm gonna test some code with the help of this library and see how the robot arm performs.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.