Go Down

Topic: Controlling syringe pump (Read 3042 times) previous topic - next topic

Feb 22, 2012, 03:04 am Last Edit: Feb 22, 2012, 03:41 am by Fieroguy19 Reason: 1
So I am completely new to using Arduino but have seen a few cool projects using it. Before I spend a ton of time learning about how to make sketches and buy a bunch of things I was wondering if my idea is even feasible. What I would like to do is control a syringe pump using the Arduino to make my own titrator. I know that it can monitor pH with a probe, but my main concern would be controlling the syringe pump. I have found the following syringe pump on ebay and after reading the manual for a while, think that it might be able to take commands but I am not sure if the programming languages are compatible. I have included a small portion of the pump manual so maybe that will help.

http://www.ebay.com/itm/Kloehn-VersaPump-3-23254-6-Way-Rotary-Valve-2-5ML-Syringe-Pump-Driver-Lab-Versa-/200712656833?pt=LH_DefaultDomain_0&hash=item2ebb6817c1#ht_4708wt_2542
The Kloehn VersaPump 3 (V3) syringe pump shown in Figure 1-1 is a
programmable, precision, liquid metering instrument with user-programmable
memory and Input / Output (I/O). It offers 6000 or 12,000 step resolution for its 3
cm stroke. Two to six port valves can be mounted, and syringes from 50 uL to 5 mL
can be used. The unit can accept individual commands or programs via its serial
communications interfaces.
Two-way, serial communications between the V3 and a controlling host is done via
an RS485 or RS232 interface. Up to 15 addressable pumps or other devices can
share a single, standard, bidirectional RS485 communications bus, controlled from
a single PC serial port at baud rates from 1200 to 38,400 baud. Two protocols, DT
and OEM, are supported, both of which are fully compatible with the Cavro
protocols. The unit may be interrogated for status or operating parameter values
at any time. Individual commands or groups of commands may be sent for
immediate or later execution by the pump.
Command strings, or programs, can be executed from RAM or may be stored into
and executed from the non-volatile memory (NVM). Up to 10 programs may be
stored. A program in the NVM can be set to self-start when power is first applied
to the pump and immediately after a Reset input. Program retention in the NVM is
typically greater than 15 years without batteries. Program looping and if-then
program flow control is supported.
Three external logic inputs and three logic outputs permit interfacing to a variety of
other devices. One input can be used to halt a dispense in progress. A built-in
digital voltmeter (DVM) is included. For applications which require more I/O, an
I/O expander card is available to provide 16 more inputs and 16 more outputs.
Many different program test-and-jump instructions allow the pump to respond to
external events and conditions as well as internal program conditions. External
inputs can be used to set internal programmed operating parameters. The I/O can
be used to operate a synchronized, two-pump, continuous flow application. Real-
time, remotely-controlled and monitored I/O is supported simultaneously with other
pump operations.

Chagrin

The unit says it has an RS232 interface so with the proper card slot connector (or some soldering directly to the pins) you could connect it directly to a computer to control it. From an Arduino you would need a TTL (0V to 5V signals) to RS232 (-12V to 12V signals) converter.

You need the documentation for the unit to know how to "talk" to it (the "DT or OEM / Cavro protocols"). You'd need to get those docs from the manufacturer; it's quite possible that the manufacturer doesn't even release the protocol but rather supplies software that it expects you to use instead.

Beyond that, for the $50 investment it could more than likely be brought back to life if you just ripped out the control board and implemented everything with an Arduino. Looking at the pictures it appears to have two stepper motors which you could interface with directly for control. Stepper drivers for small motors like these would set you back $15/each. There are probably also a few solenoid valves but those again are pretty easy to control.

Hard to say if it's a good buy or not. I'm also unclear as to how having a precision pumping unit alone would help you with titration.

jwatte

To go to RS232, you can use a MAX232 chip and a handful of small electrolytic capacitors, mounted on breadboard (for experimentation) or soldered into a small piece of veroboard (solderable breadboard.) That's less than $10 in parts. You'll probably pay more for the wire to hook it all up :-)
If $150 (Arduino + parts + pump + soldering iron + shipping) is not a bank-breaking amount for you, I say go for it -- sounds like a fun project!

Did you end up having any luck with this?  I'm trying to do the same, but I'm hung up at establishing the RS232 link... using a mega with the Sparkfun RS232 Shifter, and trying to pass commands through the mega between mac and the VersaPump (with the ...

But only the RX pin is getting up to the appropriate voltage range, TX is low... Not sure if my wiring is off, if the switches are set incorrectly, if the previous owners had some bizarre baud rate settings, or if there's something wrong with the unit...


So I have finally started working on this project. I decided that it would be easier to start with some more simple devices before working on this. So I bought one of the syringe pumps, 24v power supply, max3232 TTL to RS232 converter, and Arduino Mega. I went ahead and wired everything up to see if I could get it communicating with the Arduino. I used the MultiSerialMega from the library to try it out. I am pretty sure I had everything hooked up properly, using pins 18 and 19 connected to the max3232 converter, then connected to the pump. According to the manual, there are four switches that can be set so that the default baud rate of 9600 is set for the pump, so I set those. I was not able to get communication working properly, as there is supposed to be a return value sent back after you send a command to the pump. I did recieve some random characters from the pump a few times. When I measured the voltage of Rx and TX at the device, the RX in was at 0, while TX out was -8v. I am assuming there is something wrong with the serial converter or maybe I need to recheck my wiring. Should I be able to measure the voltage after the converter and get between -6v and -15v?

 

This is from the manual.
Baud rate 1200, 2400, 4800, 9600, 19200, 38400 baud
Data bits 8
Parity none
Stop bits 1
Flow control None
Physical protocols RS485, RS232
Logical protocols DT, OEM

 

 

Here is the instruction manual for the Versa pump.
http://www.google.com/url?sa=t&rct=j&q=kloehn%20versa%20pump%203&source=web&cd=1&cad=rja&ved=0CC4QFjAA&url=http%3A%2F%2Fwww.firsttenangstroms.com%2Fpdfdocs%2FVersa3.pdf&ei=5UcCUs0yzOTgA8uagJAB&usg=AFQjCNGYIPPXYaptL-_kttGOxurhII5p8w&bvm=bv.50310824,d.dmg

radman

If you have a PC with an RS232 interface I would plug it into the pump and check things out using hyperterminal.

That will confirm you have the serial port on the pump setup and working as you expect.

Then move on to using the Arduino.

Riva

What pins is it wired to. From the manual
Quote
3.4.1 Com Setup Switch
The four toggles are located on the Com Setup Switch shown in Figures 2-3 and
3-4  should all be set to the "On" position.


If you have a PC with an RS232 interface I would plug it into the pump and check things out using hyperterminal.

That will confirm you have the serial port on the pump setup and working as you expect.

Then move on to using the Arduino.

I don't have any computers with a serial port, but I may pick up a usb to serial converter if I can't figure this out soon.

#8
Aug 08, 2013, 06:27 am Last Edit: Aug 08, 2013, 06:52 am by Fieroguy19 Reason: 1

What pins is it wired to. From the manual
Quote
3.4.1 Com Setup Switch
The four toggles are located on the Com Setup Switch shown in Figures 2-3 and
3-4  should all be set to the "On" position.


These are actually physical on/off switches that are mounted to the board on the pump. I have them all switched to the on position so that the baud should be 9600.

Riva


What pins is it wired to. From the manual

And your using pins 7, 8 & 10 on the edge connector, connected to pins 3, 2 & 5 on the 9 pin D connector? If yes and it does not work the try swapping pin 7 & 8 over. What RS232 TTL converter chip/board/shield are you using and how is it connected to the arduino. You won't be able to connect it to pins 0 & 1 on the arduino if your using USB & Serial to the PC so will need to use either a Mega and connect to one of the other serial ports or use SoftwareSerial.

radman

What you are wanting to do is perfectly achievable so it will work once you have the physical wiring correct and have configured both ends to use the same baud rate etc.

However do you really need to use the serial interface for your application?
If it is possible to directly program the pump then perhaps all you need is a couple of outputs from the Arduino "start titration" and "stop titration".

You setup your titration and get the pump to run the titration program you have loaded directly into it.
You start the Arduino, it signals the pump to "start titration".
The pump begins to drop titrant into the titrand at the pre-programmed rate.
The Arduino monitors the pH and when it reaches the desired value signals "stop titration" to the pump.

Using the RS232 interface is more powerful but its use might not be essential for your application.

It is alive!!    But I feel really dumb for not catching a mistake in the library.  Doh!!  :smiley-red:
So it seems like I had it hooked up correctly all along. I found the mistake when I decided try to add some code to the MultiSerialMega code. When I looked at the code I realized that it was missing half of the original code!!  :~ I am running IDE 1.0 for ubuntu and the MultiSerialMega sketch only has code for sending data one way so that is why it was not working. So I just added the rest of the code and it started working.  :D :D  Now that I can communicate with the pump I can change the settings. Thanks for all of the help.

Go Up