ColiderMite
Posts: 2
Joined: Sun Jun 30, 2019 1:39 pm

How can i use 4 slaves on the raspberry pi?

Fri May 14, 2021 6:35 pm

I first wanted to use 4 Arduino UNOs as slaves where each controlles 2 stepper motors(later 3)
but it had its limitation using it over serial with nanpy and i2c cant hande it

So i thought about using 4 Raspberrys as slaves which controll the stepper
but i don't know if that would be realy the better way
and if yes i also don't rly know how i should do it

I would be really happy if someone could help me it

ghp
Posts: 2002
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: How can i use 4 slaves on the raspberry pi?

Sat May 15, 2021 4:40 pm

To control arduino, you could send serial (hardware serial) commands out to all of them in parallel. Prepend an identifier byte to each command which identifies the very arduino which should take the action. Each arduino is programmed to listen only to his id.
Receiving data from the ardiuino back to the pi is not possible this way, at least not in a simple way. Using tristate logic controlled by pi could be used to implement half duplex communication.
RS485 sender-receiver which allow half duplex communication could solve this in a simpler way.

Instead of using 4 arduino, each controlling 2 stepper, you could try to use one raspberry pico, controlling 8 steppers.
Pico has two cores, each running at 125 MHz. Performance should not be a problem and synchronizing the steppers is simpler if done on one processor.

Have a look at gcode interpreter. There are some libs for arduino; could be a good starting point.

User avatar
scruss
Posts: 4186
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How can i use 4 slaves on the raspberry pi?

Sat May 15, 2021 7:48 pm

Or you can control up to 16 servos with an inexpensive PCA9685 board.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

LTolledo
Posts: 5557
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: How can i use 4 slaves on the raspberry pi?

Sat May 15, 2021 8:52 pm

there is an option board that lets an RPi control up to 4 stepper motors
example shown below:
RPI-CNC stepper motor controller board.jpg
RPI-CNC stepper motor controller board.jpg (61.52 KiB) Viewed 352 times
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

ColiderMite
Posts: 2
Joined: Sun Jun 30, 2019 1:39 pm

Re: How can i use 4 slaves on the raspberry pi?

Sun May 16, 2021 8:54 am

scruss wrote:
Sat May 15, 2021 7:48 pm
Or you can control up to 16 servos with an inexpensive PCA9685 board.
Yeah I also looked at this one but it is for servos and not for stepper

User avatar
scruss
Posts: 4186
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: How can i use 4 slaves on the raspberry pi?

Sun May 16, 2021 5:30 pm

Sorry, I misread. I really thought you meant servos.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Automation, sensing and robotics”