DIY Dosing Pump Controller Atmega128

Slug,

Lets be realistic here. The AC mains frequency error is almost non existent with any significance to my application. As long as the motor has enough torque to not slip phase, then any error is completely irrelevant.

a 2 pole induction motor runs at 3600 RPM @ 60 HZ
a 4 pole induction motor runs at 1800 RPM @ 60 HZ
1 8 pole induction motor runs at 900 RPM @ 60 Hz

Now lets look at the AC mains error for each:
http://www.ligo.caltech.edu/docs/G/G020245-00/G020245-00.pdf

here is a 1 year error plot for part of the us grid.
2freq1.gif

Now lets throw the .01 or so average error out the window and call it a full Hz!!!

So:
a 2 pole induction motor runs at 3540 RPM @ 59 HZ
a 2 pole induction motor runs at 3600 RPM @ 60 HZ
a 2 pole induction motor runs at 3660 RPM @ 61 HZ

a 4 pole induction motor runs at 1770 @ 60 HZ
1 4 pole induction motor runs at 1800 RPM @ 60 Hz
a 4 pole induction motor runs at 1830 RPM @ 60 HZ

1 8 pole induction motor runs at 885 RPM @ 60 Hz
1 8 pole induction motor runs at 900 RPM @ 60 Hz
1 8 pole induction motor runs at 915 RPM @ 60 Hz
Notice a pattern? Frequency to RPM is linear... so we can ignore the number of poles and just talk about motors.

Now lets reduce each down with gear reduction to 1 RPM and 10 RPM

2 poles at 3540 RPM @ 59 Hz reduced via 3600:1 reduction = .98333 RPM
2 poles at 3600 RPM @ 60 Hz reduced via 3600:1 reduction = 1 RPM
2 poles at 3660 RPM @ 61 HZ reduced via 3600:1 reduction = 1.0166 RPM

2 poles at 3540 RPM @ 59 Hz reduced via 3600:1 reduction = 9.8333 RPM
2 poles at 3600 RPM @ 60 Hz reduced via 3600:1 reduction = 10 RPM
2 poles at 3660 RPM @ 61 HZ reduced via 3600:1 reduction = 10.166 RPM

No lets look at those error rates with respect to the average dose of 100ml

PUMP RPMS:
0.98
1.00
1.17
09.83
10.00
10.17

PUMP SIZE 0.1 ml/Revolution
0.98 RPM @ 1000 minutes = 98 ml
1.00 RPM @ 1000 minutes = 100 ml
1.17 RPM @ 1000 minutes = 117 ml
09.83 RPM @ 100 minutes = 98.3 ml
10.00 RPM @ 100 minutes = 100 ml
11.7 RPM @ 100 minutes = 117 ml

PUMP SIZE 1 ml/Revolution
0.98 RPM @ 100 minutes = 98 ml
1.00 RPM @ 100 minutes = 100 ml
1.17 RPM @ 100 minutes = 117 ml
... etc

As you can see the error is also linear with respect to the peristaltic pump capacity.

No lets drift back to reality. We used an error of an ENTIRE RPM or about 1.5%. Our power is not nearly that bad. The reality is that the Frequency error is .01 -.04 Hz or about .05% (100 times or so less!) Again, please refer to the plit and see that the .05% I use below is still almost off the chart of reality. with .001 - .002 being the trend.
Shall we:

50.95 Hz = 0.991 RPM
60.00 Hz = 1 RPM
60.05 Hz = 1.0008 RPM

AND THAT IS ASSUMING THAT THE ERROR PERSISTS THROUGH THE ENTIRE DOSING PERIOD! Reality is that the frequency errors are intermitant, otherwise all of our clocks would be off all the time. They do run off of the frequency supplied by the power plant!

Do I need to go any further to demonstrate that TIMING a peristaltic pump in our application produces no reasonable error for an any reasonable pump size and dose between 1ml and 10,000 ml per day? It is MORE accurate than YOU filling a measuring cup and more accurate than the concentration ratio of the 2 part mixture you purchased or mixed.

So I don't agree timing the motor while be as accurate, accurate enough for this application I suppose.
is relevant in what sense to how much precision for what process? To say that your statement is picking hairs is an understatement.. it is picking with a scanning electron microscope.

I am sorry if I sound like a jerk, but I don't like misplaced or misapplied logic, especially when it is used to in attempt to show a well thought out process to be "in error". I tired to briefly and kindly explain my reasoning, but you still insisted on correcting me as if I did not understand the facts. I do understand the facts and used them in making the decisions for this projet. Please do not take this the wrong way. I am not being thing skinned, but rather ensuring that the facts are fully illustrated with regards to the subject and points put forward.
 
Last edited:
Now lets talk about "feedback" from the motor and/or pump.

You appear to be making the argument that one could/should check the encoder/hall effect to determine the error state...

Lets look at that logic as well.

1) The most common error in this type of system is a failed tubing set. The "feedback" would only indicate that the head is still turning... who cares if the tubing burst.

2) In a timed application the rotational feedback is pointless for the same reason.

So in both applications a pressure based feedback loop or flow flag is much more applicable and has nothing to do with counting rotation.

The medical peristaltic pumps DO feedback on both FLOW and ROTATION. Why? A dead motor means a dead patient!

That said, sure rotation feedback would be nice when using (2) or more heads so that if a motor fails, the other motors stop dosing to prevent an imbalance.
 
A flow meter would be optimal but wouldn't be economically feasible. I have been doing top off with a peristaltic pump for at least 7 years. I changed the tubing once and it wasn't even close to needing it. I think there is a better chance the motor would stop turning due to various issues in the system.

Let's say you came home and the power was out. Did your system get dosed or not? And how much? I am not saying a timed system isn't any good. But a system with some type of feedback is better and if I was going through all the work, albeit fun work :) , to build a dosing system it seems like a shortcut to leave this out.
 
I can (and will) use code to determine mains power status. I can also adjust or suspend schedules based on external input. Is the feeding timer running? If so, that means the return pump is off and dosing should be suspended or pushed. I will also be using float switches in the resevoir containers to monitor supply level and suspend dosing per pump based on the status of ANY single or combination of float switches.
 
slug,

"I have been doing top off with a peristaltic pump for at least 7 years. I changed the tubing once and it wasn't even close to needing it."

What pump & tubing do you use?!? With my combination of Masterflex 7518-62 & #24 tubing, I need to change my tubing weekly


Bean,

The reason that I agree that having the feedback is important, is that I always prefer to use DC motors for the variable speed capability. In the case of the DC motor control I feel that feedback is always a good idea.

For the AC power case ( assuming that the torque required will cause minimal phase slip or stalling ), then you are OK.

Just dont underestimate the torque required to turn the masterflex heads.... Youd be better off with an AC gearmotor & reduced RPM.

Stu
 
For the L/S #35 pumps, starting torque is less than 100 Oz. and operating torque is less then 75 Oz. worst case even with Viton (85A) at our working pressures.

http://www.coleparmer.com/techinfo/techinfo.asp?htmlfile=PH_TorqueReq.htm&ID=562

If I use the #35 masterflex pump, then I will certainly reduce it down to between 1 and 6 RPM for dosing... for water changes I may run higher RPM.

The ismatic pump head I have IS also AC 24V and has a built in motor that runs (3) tubing sets.

So in the end, I will likely dose Alk. Calcium, and Mag with the 3head ismatic pump on 1 channel with 3 float switches. I dilute the mag to match the alk/cal strentgh. I will use another 2 channels to do water changed with the larger masterflex pump heads. That will utilize all 3 onboard relays, even though the system can handle 8 discrete channels.

Once a week for your masteflex tubing... yikes! I am not sure I like that idea and may look for a less abusive pump head!
 
An optical encoder would be easy to add to the shaft
and very easy to program up using bascom.

I wrote a lot of things in bascom in the past (repeater controllers,
etc), it is a very nice platform to work on.

One of the things I found is for many apps the AVRs are almost too fast.

I wound up using lower freq xtals and time loops to make things less touchy.

It has been a few years since I really wrote anything serious.
I was going to write an aquarium controller, but got lazy and just bought one.

Mabie now that I hava a bit more time I may get a chance to
start building again.

I need to get my CNC mill setup again so I can cut some boards.

Good Luck.
 
<a href=showthread.php?s=&postid=13823167#post13823167 target=_blank>Originally posted</a> by Harry_Fish
An optical encoder would be easy to add to the shaft
and very easy to program up using bascom.
Yes it would. It would be even easier to just replace the non encoded 24V motor with an encoded version.

If I was building this setup for a specific pump or motor, I would not hesitate to do just that! The magnets and hall effect sensors were the work around for easy adaption of just about ANY setup. I know some folks here have expressed interest in building this thing, but the reality is that at best maybe 1 or 2 people will in the end. It is a lot of work to toss in features to accomodate such a small end user audience.

I wrote a lot of things in bascom in the past (repeater controllers,
etc), it is a very nice platform to work on.
I have yet to find anything other than VB itself that I like more!

One of the things I found is for many apps the AVRs are almost too fast.
Yup... but they are cheap and easy to work with. I would rather toss in a few waits than hack my way around a PIC with PICBASIC :)

It has been a few years since I really wrote anything serious.
I was going to write an aquarium controller, but got lazy and just bought one.
Pretty much where I am at. Instead of a "controller" I am building a doser, a light timer (sunrise, moon phase, etc) and then maybe a top-off and feeding controller/ temperature and ph logger.


Thanks for the kind words. Lets is know how the CNC mill project comes along. I have one in the planning statge (for 5 years :D)

Bean
 
I just need to get a chance to put the mill back together and re-align
it (and hope it is still in good shape, been packed for a year).

I too like the AVRs over the PIC and the nice part is you can make
a programmer out of a few resistors so if they have the skill to
build the board they can program it.

On the controllers (Repeater) I put on a programming
header so it could get an easy field update.
 
I have not messed with the boot loaders and instead went ahead and purchased a USB ISP programmer. Once i get everything else done on my list, I may look into boot loaders. MY main interest is the Atemega128. The new Xmegas are out but I have not idea what they do other then run faster....

Bean
 
For a simple LPT port programmer Look Here:

http://pldaniels.com/flying/stk200-simple.png


That is what I used as first later I went to one that uses a 244 buffer chip.


Also (in case you did not know) you can read a pre-programmed
chip with bascom and save it to a file to flash into another chip
(as long as it is not locked)

This is good if you loose the sorce code, and need to make a copy
or in the case of the AVR butterfly etc. it lets you keep a virgin
copy to put it back to original.

I wish Bascom was a bit more popular as I too am not a fan of C and
have been programing in various flavors of Basic for almost 30 years.


I'm just happy to see someone doing cool projects with Bascom.
 
It would appear that Mark Alberts (the developer) has put a lot of work into it lately. I fear if not enough people use it, it will die a slow death. I have even considered purchasing the 8051 version... and playing with them.

PICBASIC has a huge following, as do many of the C compilers for PICs and Atmels... If people knew how powerful and easy BASCOM was it would take off like wildfire... sadly for some reason people are not exposed to it.
 
Yep, and the PICs do need a "programmer" + it cost a bit more

I think I paid $69.00 for bascom when I first bought + it has free updates.

At the time they wanted close to $300 for the PIC basic + the cost of a programmer.

a little more than I wanted to spend.
 
<a href=showthread.php?s=&postid=13822932#post13822932 target=_blank>Originally posted</a> by stugray
slug,

"I have been doing top off with a peristaltic pump for at least 7 years. I changed the tubing once and it wasn't even close to needing it."

What pump & tubing do you use?!? With my combination of Masterflex 7518-62 & #24 tubing, I need to change my tubing weekly
Stu

Tubing I'm using is 6485-15 made by Norton with a masterflex head.
 
slug,

Which masterflex head? There are LOTS of models out there.

Mine is the "extra super duper precision" model.
I think thats why it kills the tubing... it squeezes it harder.

Stu
 
Howq many hours (minutes?) would you say you get out of a tubing set stu?

Do you change it before it breaks or do you wait until it fails?
 
My setup is a HV-07518-62 head with 96420-24 tubing.

I run it at ~40 RPM (24/7) which is about 100 mL/min.

My tubing lasts about three weeks before it fails/splits ( it still keeps pumping, it just leaks down the tubing as well... ).
So, I have learned to just replace just a 3" section every week. Takes aboout 30 seconds.

Stu
 
Last edited:
The tubing I have is pharmed.

I don't know what pump head I have. It only has "use no 15 hose", "MasterFlex", and a patent no. written on it.
 
The usage time of your tubing is realted to both what your pumping, the type of tubing (composition) and the wall thickness. Tubing life span is rated in hours. Most tubing bought cheaply is tygon tubing. It has about the shortest life span of all the tubing compositions. None of the tubings hold up real well to Kalkwasser as tuings do not like highly alkaline solutions. Occlusion adjustments are possible on some pimp heads (squeezing amount) but it still does not greatly increase tubing life, but can greatly decrease it. The best way tio increase tubing life is to just move the tubing a few inches. The only part of the ubing that really wears is that part that is between the rollers.

If you are just using the pump for plain ATO (RODI) water use Norprene tubing as it lasts for over 4000 hours versus as little as 20 hours for some of the other tubings.

This is a link for tubing chart lifespan data.

http://www.masterflex.com/techinfo/techinfo.asp?htmlfile=Tubing_LSLife.htm&ID=773

Ooops I see it is already posted.

Last time I checked the Saint Gobain site all they sold were the silicone type tubings, which are all pretty short lived. If you are going to pump highly alkaline solutions you will have short life spans for your tubing unless you move all the way up to using PTFE nearly rigid tubing in special heads with an I/P pump. Several thousand dollars or more as I have never seen that combination available used.

I guess an easy general way to look at it is if the tubing is a clear tubing it very likely will not last long regardless of the brand name. The longer lasting ubings are beige to brown and black tubings, until you change to the nearly rigid tbing.
 
Last edited:
Back
Top