I am primarily a software developer and out of interest, have started
working on robotics. So, apologies if my questions are a bit basic to
you all.
Am primarily using Python and Rust for my coding.
I currently have an intel nuc running Ubuntu 22.04; have connected servos
using USB. I also have an old Raspberry Pi 3+ which I’m not currently using.
Am looking to connect about 12 additional things (primarily
servos and linear actuators)
As I’m using the nuc, was wondering if I could continue using it for
connecting all this by having a usb compatible board; do you think
that is a good approach.
If yes, could you please suggest a board that would fit all this,
including with external power supplies, if needed.
As in using an Single board computer as a “translator” between your Nuc and your motors?
Yes that will work great.
You might choose this approach if your project has lots of expensive calculations. You nuc can handle the expensive functions and the SBC can focus on listening for commands and controlling the motors.
This would lead to a responsive robot.
It might be that the Raspberry Pi 3+ is totally sufficient, it has plenty of outputs(GPIOs) that can control your motors. It also has wifi/ethernet to receive your the instructions from the computer.
You could also use UART or a Socket approach via USB.
I took a similar approach last Christmas when I was making an audio reactive Christmas tree.
The computer handled the complicated sonic analysis and the raspberry Pi focused on the lights.
This project used Rust to control the raspberry Pis GPIO pins. (python would work fine too).
Was looking at the code for the lights project and it looks interesting.
Am grappling with async Rust right now
Yes, I was looking at using the nuc for the heavy lifting and something else for the lower-level controls. Right now, I’m not using the pi; instead, have got the rust code directly talking to the servos via the servo board which is connected by USB.
I’m a bit new to the hardware space (as you can probably make out). Would 1 board be enough / have enough power to drive multiple servos / linear actuators - am expecting to have about 12 when I get through with this. Or is there an approach with additional boards and power supplies?
@Pixmusix is on the ball here. You might be able to do this straight from the computer but some more info on that servo board will be great. Otherwise your Raspberry Pi should be more than enough to talk to the board with its GPIO.
Sorry if I get the terminology wrong; I’m a newbie to the hardware but it’s been a fascinating journey and I’m hooked.
This is what I have. It has 5 servos connected sequentially and has enough power for them. It is connected to the nuc through a usb-b to usb-a connection. I have also connected a webcam to the nuc through a different usb port and I can interface with them through /dev/ttyUSB0.
I’m looking to connect 2 or so pan-tilt kits along with a few servos (SG90 or similar) and interface with them. Was wondering whether I needed a raspberry pi to interface with them or whether they could be connected like the servos I have in a separate board which is then connected to the nuc using usb.
Ah cool!
Never seen this before but looks awesome.
Sound good! It may have enough power for more.
I’m sorry but I don’t recognize the board. It looks purpose built.
There is that orange plug which looks like power and it might have enough depending on how hard and how often you’re driving the motors.
Do you know what this board is called? I might be able to google it and give you something more concrete.
The board in your picture looks like it’s loosely based on an Arduino.
I can see 6 Analogue Pins and 14 GPIO plus some others that double as Serial Data and Clock for a protocol. What I don’t know is whether or not they share IO with the Motor Outputs you’re already using. Doesn’t look like it. If not there available, and ideal, to run the SG90 and pantilt kits. Would need a datasheet for this to find out.
Not really my area sorry. @Jack is CE staff so might have more information for you.
No worries at all
Two years ago I was in your shoes. Software engineer working with systems languages sprinkled in with a bit of C#. I bought a travel computer monitor from CE and since I was browsing picked up a Raspberry Pi 4 just to see what all the fuss was about. It’s been a deep rabbit hole; had a lot of fun and still learning. Found this place useful.
This is the board; got it some time ago but have only been playing with it for a month or so.
It is power; connected externally to a power brick similar to a laptop one.
I do want to drive the motors hard and frequent so, am ok with getting a different board and connect to the pi (though preferably the nuc), if needed.
Probably a few pan-tilt kits; not sure how rugged they are or how well they’d work for very frequent operation. Would you have any suggestions?
Thanks, will raise a separate ticket for the technical questions.
I bought a pi from here 2 years ago but the hardware part was a bit intimidating which is why it took me so long to get into it.
I’m really enjoying interfacing the code with the components and watching them work The python part is easy but being a sucker for punishment, got into Rust and asyc.
Ah interesting.
Those GPIO pins are for connecting a controller to. Silly me… that’s why there arduino shaped
This means you have 6 outs and thats all she wrote.
There will be plenty of power to drive those 6 as often as you need.
Another question- if I have multiple raspberry Pi, what’s the most efficient way for one to send data to another assuming that among other things, python / rust code is running on both? I would like as low latency / high-speed as possible without it being a maintenance nightmare (coming from a software background).
In a typical software engineering scenario, I’d look at sockets, async messaging (pub/sub or mqtt) or API style (eg. python fastapi) using wifi / ethernet cable with a hub. I’m comfortable handling the security around any of this. Would you have any recommendations or (other) suggestions?
Raspberry Pis 3-5 are essentially tiny 4 core computers so a network solution would be fine .
Depending on what kind of data you want to send it might be the best approach.
It might be overkill for controlling motors.
2
Another search term you could explore is interrupts.
For example,
Agent A and Agent B share a “BUS” which contains 1 byte of data (which is usually enough ).
Agent A leaves a message in the BUS for agent B.
If Agent A wants to talk to Angent B then A would send a HIGH signal to one of B’s GPIO pins which triggers a HARDWARE interupt.
Agent B stops what it’s doing and reads whatever Agent A put on the BUS.
3
I haven’t personally replicated this but @James46717 is a respected regular here.
4
Some search terms for light weight requirements are “UART” and “Serial”