Hello all, I've started a pet project and need to control 3 motors at once, but have minimal experience in arduino. I need to know which board(s) are capable of doing this so i know where to begin, but all im finding is that arduino cant do more than 1 at a time.
If it matters its a bldc paired with a magnetic encoder, a linear actuator, and a stepper. I need at least 2 to be able to operate at the same time. I was looking at the arduino due.
Probably a bad choice since all the I/Os are at 3.3V and that will limit you choice of motor drivers/controllers.
No reason why you can't just use an Uno.
From what ive seen theres 3.3v & 5v. So i should do 5v? And ive heard the uno being thrown around, can it run multiple simultaneously? Have a dac for magnetic encoder?
The DAC (aka digital to analog converter) is a kind of output, and the magnetic encoder is an input device, so the "connecting encoder with DAC" looks no sense for me.
I don't recommend you to use a Due since the board is not very popular among hobbyists - so if any problem occurs in your project, not many people can help you.
To clarify; most microcontrollers cannot do 2 things at a time.
But they are sufficiently fast to perform several tasks in such a way that it seems simultaneous.
Something like:
loop(){
Read position motor 1.
Calculate desired speed motor 1
Adjust speed motor 1
Read sensor 2
Do something
Stop motor 2
Calculate desired speed motor 3
Set desired motor speed
}
In the meanwhile the controlller can process the interrupts from encoder motor 3...
You do not want 3 parallel cores to handle 3 motors. It will make programming much more difficult as you need to align information exchange in between cores.
Thanks for the insight!
But for what im doing they all will actually run independently. No need to know what the other is doing. Just need to control all of them from one remote with either analog controls or touch screen
oooh, ok. so you were saying that spi has those connections. I thought that spi was a single type and all those were as well. sorry for the confusion. do i need to connect all of the pin types from the encoder or just one? for instance the uno r4 wifi has cs, copi, cipo, & sck. The only one the encoder has that matches is cs.
ok thank you so much. i was unclear on that diagram if what it showed was the connections on the encoder itself or the encoder connecting to external devices. im currently also trying to watch videos that explain things so i can see whats going on.
so i connect this to pins d10 to d13 (uno r4 wifi), place it behind my bldc with an encoder magnet attached to the shaft. Connect bldc to uno. Then i need code to read the output from the encoder, and use that data to control the bldc correct?
does the bldc need a relay or motor driver between it and the uno as well?