Matrim_Cauthon91
Posts: 4
Joined: Fri Jul 03, 2020 2:35 pm

Multiple Automated Syringe Motors

Mon Jul 06, 2020 10:24 am

Hello,

I am currently 3/4 of the way through building an automated syringe pump (I have already written the software and GUI). But I was hoping to get some more information on building the hardware for the system.

I was hoping to find the best way of controlling up to 8 NEMA17 Stepper motors? Should I use an Arduino or is there an additional component that I can add to the Raspberry Pi etc.

At the moment they do not have to run simultaneously, but one after the other. So only one syringe will be running at a time.

Here is a link to a similar syringe - it will not be entirely dissimilar to this - https://www.appropedia.org/Open-source_syringe_pump

Thanks in advance!

blimpyway
Posts: 523
Joined: Mon Mar 19, 2018 1:18 pm

Re: Multiple Automated Syringe Motors

Mon Jul 06, 2020 9:55 pm

It depends on how many pins you have available.
most drivers have an "enable" or "sleep" pin.
So you can have all motor drivers sharing the same STEP/DIR lines and eight "enable" lines to enable one motor at a time.

cleverca22
Posts: 2509
Joined: Sat Aug 18, 2012 2:33 pm

Re: Multiple Automated Syringe Motors

Thu Jul 09, 2020 4:08 am

and if you dont mind a select group of them moving at the same rate&direction, you could enable several at once, then send a series of step pulses

if you need differing rates, things get more complex, as you may need to turn enables on/off across the whole array, and give 2 a step, then 1 a step



hmmmm, i wonder, you might be able to abuse the DPI to drive up to 12 steppers at once, with relatively low overhead and high precision to the speed and step counts

the intended use of the DPI is to take a 24bit-per-pixel image from ram, and blast it out 24 GPIO pins at a defined pixel clock
with a pause between each scanline for hsync and front/back porch, and a longer pause for vsync and its porches

the DE signal (display enable?) on gpio1 tells you when its valid pixel data (not a sync or porch)

https://github.com/librerpi/rpi-open-fi ... #L142-L185

and this example code, will shove a uart stream into one of the color channels

in theory, you could take each bit in the 24bpp, and treat it as a seperate digital signal, and then just fill the image data with step&direction pairs

for example, take the red channel, bits 0:1 control one stepper, 2:3 control a second stepper, and so on, up to 12 steppers total

and then DE is tied to the enable pin (though all 24 bits go low during sync anyways, so thats not a step pulse)

then all you need to do is generate a frame of image data, that moves all of the steppers at the desired rate&direction (you can even change direction mid-frame or stop mid-frame), and use the DRM page-flipping api to switch to the next packet or a "hold" packet (all 0's)

jhbower
Posts: 1
Joined: Thu Jul 09, 2020 8:57 am

Re: Multiple Automated Syringe Motors

Sun Jul 12, 2020 6:30 am

As suggested in a previous post, you can send step and direction pulses to all the drivers, and just turn on the enable pin for the particular drive (motor) you want to have move. I've done this with a mix of 4 Nema 23 and Nema 17 motors ( a total of 8 motors).

I am confused by the statement that you have "already written the program and GUI, yet you haven't decided on whether to use a PI or an Arduino, seems like there would be substantial differences between programs and the GUI (or at least the programming of it).

You will want to figure out what flavor of driver you want to use, the drivers will need their own power supply.

mwrich4
Posts: 128
Joined: Wed Jul 25, 2012 1:24 pm
Location: Stuart, Florida

Re: Multiple Automated Syringe Motors

Sun Jul 12, 2020 8:19 pm

I used a separate board for my GUI with macro-control and sent low-level commands to an autonomous motor controller via an RS-485 board network bus.

The Pi or Arduino may simply be the microcontroller in his project. Driving motors requires an RTOS (or another lean environment) if you don't want a varying clock output for the steppers.

cleverca22
Posts: 2509
Joined: Sat Aug 18, 2012 2:33 pm

Re: Multiple Automated Syringe Motors

Sun Jul 12, 2020 8:23 pm

mwrich4 wrote:
Sun Jul 12, 2020 8:19 pm
The Pi or Arduino may simply be the microcontroller in his project. Driving motors requires an RTOS (or another lean environment) if you don't want a varying clock output for the steppers.
thats what my DPI hack/idea solves

you just pre-load a large waveform, and the hw will blast it out 24 pins at a defined sample rate

only limitation, is that all signals must go low at regular intervals, so you would have problems with things like CNC, where the inertia wont be happy with a complete halt for 2% of the time its moving
the clock wont be entirely perfect, but its predictably imperfect, and you can then plan around that

but a syringe wont be moving fast enough to really be bothered by the speed having a duty cycle

Return to “Automation, sensing and robotics”