Controlling scale and trickler

Right now I'm manually dispensing (using a volumetric measure) into the scale pan, then working up the weight to the desired value using a two-speed electric trickler. Essentially the powder dispensing and measuring portion shown in this video.

From what I gather reading the various documentation from the vendor, the scale can send out status & data and receive some basic commands via this serial port. The trickler, being electric with two push buttons for slow or fast speed shouldn't be too hard to control via a couple relays or something similar. Ultimately I'd like to have a setup where I can input a target value, push or click a button, and have it auto-magically dispense and trickle the charge to the desired weight (plus or minus a reasonable tolerance).

I've been tinkering with Python and PyQt a bit recently, and I get the impression that using the pyserial module I should be able to get the readout from the scale directly if desired. I will probably test first with HyperTerminal or something to make sure I'm 'seeing' the data first, then work on getting an interface going between Python and an application dialog. I think I have a serial-to-usb adapter around here somewhere; if not I can get one easily enough.

If I get the data directly from the scale to the computer, then I'd have to 'only' use the Arduino to control the trickler... and work out the code (in Python) to take the value from the scale and send to the Arduino via another serial connection how much to pulse the trickler to hit the target without going over. I do worry a little about the computer getting bogged down by some other process running unexpectedly - not sure if thats really a valid concern or not though?

If I have the Arduino get the data straight from the scale as well as control the trickler, then the only 'need' for the computer would be to send the desired target setpoint, and to retrieve the final value for display/recording.

Or... if I had some sort of LCD display and numeric keypad set up on the Arduino, would the computer be necessary at all (other than programming or setting special parameters).

Thoughts or suggestions?

TIA,

Monte

memilanuk: From what I gather reading the various documentation from the vendor, the scale can send out status & data and receive some basic commands via this serial port.

Mettler Toledo?

Nope, Sartorius GD-503

Using pretty much the same setup - GD-503 scale, Lee Perfect powder measure, and Omega two-speed electric trickler - as shown in the linked video.

Scale is accurate to +/- 0.01 grain; displays to 0.005 gn. The volumetric powder measure dispenses probably +/- 0.3 gn over the long term with a medium ‘stick’ (extruded granule) powder. Individual kernels weigh approximately 0.02-0.03 grains.

Might have to consider other options for the mechanical aspect of bulk powder dispensing; there are devices out there that translate a linear (up-down) motion to the rotary motion (up, down) of the handle on the powder measure. Measures using linear slide bars tend to not be very consistent as compared to rotary drum devices.

Hi Monte,

Here are some thoughts and suggestions. I finished a project like this recently, but with liquid instead of powder. It was my first real project outside of blinking a few LEDs. Programming the Arduino is pretty easy - you won't need Python for anything. Oh, and you may need something called a null modem to communicate with the scale.

If I have the Arduino get the data straight from the scale as well as control the trickler, then the only 'need' for the computer would be to send the desired target setpoint, and to retrieve the final value for display/recording.

I started out using the serial monitor to send the setpoint to the Arduino. In the setup() I also send a few commands to the scale, like having it tare itself, selecting the fast response mode, choosing the units, number of decimal places, start printing, etc. The scale I used (Setra) sends a string containing the weight plus a few characters to show if the reading is stable, the mode, units, etc. I read the whole string with a character array, then trim off the stuff I don't want.

Or... if I had some sort of LCD display and numeric keypad set up on the Arduino, would the computer be necessary at all (other than programming or setting special parameters).

Then I graduated to a touch screen to take the computer completely out of the picture. To do this, I used SoftwareSerial to allow communication with the touch screen and the scale at the same time (pins 2 and 3 for the touch screen, pins 4 and 5 for the scale). That way I can still use pins 0 and 1 to upload programs or troubleshoot without having to disconnect anything.

Tom

Tom,

In the process of browsing various threads in the forum recently I did see a few that mentioned LCD screens, and I’ve seen mention of SoftSerial as well. Good to hear from someone else who has used them to implement something similar.

I think it will be educational just to hook up to the scale w/ a computer and see what its actually outputting. The documentation I’ve browsed seemed to indicate it did just about what you described… I’m kind of unclear on how often it updates the weight info, and how I would use that to control the trickler. I mean, I do in kind of the 30,000 foot view kind of way - probably PID or something similar to get close to target weight quickly, then slow down as it gets closer to prevent overshoot? - but actual how to make that happen… is going to be interesting.

Got a ways to go before I get to that point, though.

Thanks,

Monte

If I have the Arduino get the data straight from the scale as well as control the trickler, then the only ‘need’ for the computer would be to send the desired target setpoint, and to retrieve the final value for display/recording.

Connect an LCD and a few buttons to set target weights and let the arduino do the lot.

The Interface manual from the Sartorius websites http://www.sartorius.com/fileadmin/fm-dam/sartorius_media/Mechatronics/Manuals/English/GD_GE/MAN-GD_GE_Interface_Description-e.pdf shows the scales use RS232 with configurable baud rates (150 to 9600), start, stop, parity & handshaking so should be easy to configure to work with software serial assuming it supports 7 data bits (or can be fudged using 2 stop bits). Data from the scales and commands to the scales are also plain ASCII

Interesting wrinkle... thought I had a serial-to-usb adapter here at home. Turns out I do, but its for 9-pin serial, not 25 pin (which is what the scale uses). I know the place I bought the scale from sells cables and adapters and whatnot... found out that this brand of scale, for whatever reason, uses a non-standard pin-out. Anywho, got a cable with the correct setup and adapter on the way.

Don't try and wire the serial from your scales direct to the arduino pins as you will probably blow it up. To simplify serial connections it's easier to use XON/XOFF handshaking instead of hardware handshaking. You would only need 3 wires RX, TX & GND.

So I wouldn’t need other pins for ‘CTS’ and ‘DTR’ as shown in the interface manual?

Actually what I had in mind originally was just using the 25 pin to 9 pin cable and serial-to-usb adapter and having the arduino access the scale via the usb (com) port… is that not viable, or is using i/o pins on the board preferable? As you can probably tell, I’m learning as I go here - no real hard-n-fast preconceived notions :wink:

I think it will be educational just to hook up to the scale w/ a computer and see what its actually outputting.

Yes, that's the first thing I did, too.

I'm kind of unclear on how often it updates the weight info, and how I would use that to control the trickler. I mean, I do in kind of the 30,000 foot view kind of way - probably PID or something similar to get close to target weight quickly, then slow down as it gets closer to prevent overshoot?

The scale I used has several update modes. See if your scale has a mode that outputs rapidly while the weight is changing, and use that mode. To control the trickler, run it at a fast speed at first, then switch to slow speed when you get close to the setpoint. The point where you switch speeds really depends on the response time of the scale. If it still overshoots despite running at the slowest speed (and if the overshoot is consistent) you can just reduce the setpoint by the overshoot. I ended up doing that, too.

memilanuk: So I wouldn't need other pins for 'CTS' and 'DTR' as shown in the interface manual?

Actually what I had in mind originally was just using the 25 pin to 9 pin cable and serial-to-usb adapter and having the arduino access the scale via the usb (com) port... is that not viable, or is using i/o pins on the board preferable? As you can probably tell, I'm learning as I go here - no real hard-n-fast preconceived notions ;)

Setting XON/XOFF handshaking on the scales & PC means you only need RxD, TxD & GND, no need for CTS, DTR & DSR. As the pinouts on the scales do not match standard D25 serial you will need to make an adaptor unless you can get an official cable from the scale makers.

Connecting to a PC via a serial to USB adaptor should be fine as the adaptor will be designed to cope with the possible +12V to -12V but Arduino UNO pins only like 0V to 5V.