Im trying to do a prototype for move something in 3d, my idea is using 2 stepper motors one for make a spin of 360º around z axis and the other one to make a spin of 180º around y axis.
Im beginner at Arduino, im trying to learning fast. I searched Accelstepper for moving more than one stepper at the same time. The problem is that now i have a coordinated moving, they have their own way at the same time, but i want that each other makes their own movement, but NOT COORDINATED.
In that case i would play with the spin for make the perfect movement for my project.
i post the code
the stepper motors are from robotshop: RB-Soy-03
Arduino one
and the driver a simple uln2003a mades by myself
sorry, stepper1 makes the spin around z axis and stepper2 the other one (y axis)
mmm so for make uncoordinated movement which library i would have to take?
There are 3 libraries for dealing with steppers - Stepper, AccelStepper, and MultiStepper.
Stepper is designed to make it easy to make a stepper step once or n times, blocking any other stepper from moving while that happens. Acceleration and speed control are up to you to work out and implement.
AccelStepper allows two or more steppers to step at the same time, and allows for acceleration and speed control. But, the individual steppers are not coordinated. That is, if you have two steppers moving a carriage along the X axis and along the Y axis, and you want to move 200 steps along the X axis and 100 steps along the Y axis, the Y axis motion will be completed before the X axis motion.
MultiStepper allows two or more steppers to step at the same time, and allows for acceleration and speed control. The individual steppers ARE coordinated. That is, if you have two steppers moving a carriage along the X axis and along the Y axis, and you want to move 200 steps along the X axis and 100 steps along the Y axis, the Y axis motion will be completed at the same time as the X axis motion. This results in the carriage seeming to move in a straight line from one point to the other. In reality, it follows a stair-step pattern, but the steps are tiny, so it looks like a straight line.
If you want motion along only one axis at a time, then use Stepper. If you want to me able to move about two axes at the same time, but don't want to coordinate the movements, then use AccelStepper.
PaulS:
MultiStepper allows two or more steppers to step at the same time, and allows for acceleration and speed control. The individual steppers ARE coordinated.
mofalafel:
so for make uncoordinated movement which library i would have to take?
I don't know what you mean by uncoordinated. It could mean any of several requirements. Please describe how you want the two motors to move.
The difference between coordinated and uncoordinated is a bit like the difference between full and not-full. Full is simple to understand, but not-full could mean lots of things.
Im doing a lidar scanner 3d, so i have to move the lidar (garmin lidar v3HP) to scan all the space around him in 3d. The way it s that the movement od the two stepper motors are coordinated i will get the same point in every spin, for that reason i need uncoordinated movement.
About your replies im sure that i will use accelstepper library.
I will do the code again
some idea?
Its a lot of videos on youtube about the projcet putting "lidar scanner 3d diy"
mofalafel:
The way it s that the movement od the two stepper motors are coordinated i will get the same point in every spin, for that reason i need uncoordinated movement.
For me that does not add any clarity. Please use some other words in place of "coordinated" and "uncoordinated"
Do you mean, for example, that you want one motor to complete its movement before the other motor starts moving?
Robin2:
For me that does not add any clarity. Please use some other words in place of "coordinated" and "uncoordinated"
Do you mean, for example, that you want one motor to complete its movement before the other motor starts moving?
...R
Okey, i want that one motor have one movement (360º clockwise and comeback at x rpm and n times) and the other have (180º clockwise and comeback at other rpm and times differents than the other) this means uncoordinated
Consider that the loop function triggers each stepper in order, an orderly trigger is not going to give unorderly responses.
You might consider making a functions for each motor drive and trigger those functions off their own events or have the functions run in a round robin type of way.
I think, from reading the postings, you would want for each motor functions to run 'independently' and off for some event, time or some other trigger. There are several libraries that will give you event control of the functions, time or round robin or some other thingy of your own choosing.
There is The Scheduler, uMT, and freeRTOS, to name a few. I have tried uMT and use freeRTOS. I understand that there is a version of freeRTOS for the Arduino product line, I have not used. I'd pick freeRTOS. The problem you will find is the UNO does not have enough umph to run those products. uMT, a great library, runs great on a Due (a very good introduction/gateway to freeRTOS) and is supposed to run on a Mega with limitations.
mofalafel:
Okey, i want that one motor have one movement (360º clockwise and comeback at x rpm and n times) and the other have (180º clockwise and comeback at other rpm and times differents than the other) this means uncoordinated
That is much clearer and it should not be difficult to achieve.
this link will be going to the pdf with the specifications of the motors.
And other question, they have 1.8º per step but also they have 6 wires for make the step shorter like half step or quarter step, but can i change it in my case?
For that sort of stepper motor you should use a specialized stepper motor driver such as the Pololu A4988. When you mentioned the ULN2003 I assumed you were using the small 28BYJ-48 stepper motors. The A4988 can do several levels of microstepping.