I’d like to start two arduinos at exactly the same time. They will run their codes simultaneously. What is the best way to do this.
Thank you
Jim
(email removed)
Tell us more.
Define “exact”.
Even if you turn them on exactly at the same time, sooner or later they will drift apart due to differences in the clock speed.
So whatchya trying to accomplish?
a7
Your idea won't work for several reasons, so please explain the problem you are actually trying to solve.
The two Arduinos would either have to share a common clock or otherwise self synchronise between themselves.
That is not a trivial task for a few reasons and may involve extra hardware.
You should by this time already know how to use the forum but some reminders below.
Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Details are EVERYTHING !
I’m driving two step motors and need to send them pulses completely independent from each other. I thought that maybe using two unos would give me this flexibility. They do not need to started “precisely” at the same time, and minor resolution issues are not a problem. And if I can do this from one board that would be fine too.
ballscrewbob:
Details are EVERYTHING !
You can find them in OP's several other threads about two stepper motors.
Leo..
A single boards and multiple steppers may be the prefered method.
So many examples on the internet for only two steppers I wont even explain but google will help you out no end.
Some of what you want to do will depend on what you need to achieve.
Are they just doing an X, Y function ? on a horizontal surface or something more exotic ?
Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.
Continued cross posting could result in a time out from the forum.
Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
From what I understand, the code that informs both motors has to run to completion before repeating. What I need to do is send commands to one stepper so that it proceeds on its own, while the other stepper gets different commands on its own time frame. This is how programs such as Mach3 operate.
And that is easily possible with GRBL on an Arduino which for all intents and purposes is a G-CODE processor.
Mach3 is a G-code GENERATOR and not a control program.
I think you may be misunderstanding the usage of MACH3.
Suspect you need to research a little more before embarking on this journey.
Look up GRBL and g-code as it sounds like that is the area yo may be delving into.
Again what is the intended final purpose of your project ?
I use Mach3 to do what Im hoping to do using an Arduino.
Here is exactly what I’m doing:
One motor is sent a repeating pattern of move+, move -. The speed will be a constant.
For the other motor I do the same thing. The program will run indefinitely so there is no end point.
I hope I am explaining this clearly.
MACH 3 only generates the G-CODE and sends it to the Arduino.
The Arduino needs to translate that into movements and GRBL installed on the Arduino will do that.
However if it is a set pattern then there is probably no need for either of those two items.
Libraries like Accelstepper should have dual (or more) independent motor control built-in.
Here is a random example, which might or might not be ok for your motors or drivers.
But it shows you how to use two motors interlaced. Many more examples on Google.
Leo..
Yes, I am aware Mach 3 generates g code. And then you feed it as pulses to the motor drivers. I’m not familiar with GRBL. Please tell me what it does. Is it a gcode interface that instructs the arduino?
GRBL resides on the Arduino and translates the g-code as it arrives from the sending program to movements.
You can google that many ways it which it works as there are so many ways it can be applied.
Maybe somebody has already done something similar to your application ?
So far everything you have said is do-able on a single Arduino.
BTW MACH does NOT feed pulses it feeds G-CODE COMMANDS which are NOT pulses.
The pulses are generated by the ARDUINO after it interprets the g-code command !
Fair enough, the computer generates the pulses in my current set up. Thank you for your help. I’ll check out. I sincerely doubt anyone is doing what I’m doing but I’m sure as far as the arduino goes, these sort of control has been done. I’ll let you know if GRBL works for me.
Your computer is sending COMMANDS to something NOT pulses something between the computer and the motors is sending the pulses !
Please supply pics of your current set up.