Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: moorea21 on July 24, 2010, 10:08:55 AM

Title: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 24, 2010, 10:08:55 AM
Hi,

I have a plotter that uses incremental movement of the 'z' axis to drive a material deposition pump. (Another axis (A) causes a small piston to oscillate and print the material onto a flat surface.) I had originally wanted to use the spindle drive for driving the pump, but my ncPod controller does not do spindle control, apparently.

There is a slight problem with pressure regulation, which I intend to solve by fitting a load cell, with circuitry to generate a logic 1 when the pressure falls below a predetermined value, and logic 0 when pressure is satisfactory. I hope to use the logic 1 signal to start the pump (ie cause the z axis to step), and logic 0 to shut it off again, thereby achieving pressure regulation.

Is there a way in Mach 3 to start/stop an individual axis in response to a logic input? It might be a bit like giving an Estop signal to just the one axis.

Does anyone know if Mach can do this? Or should I think about putting an Arduino on the machine to control the z axis seperately to Mach 3? Bear in mind that the z axis s not being used to position anything, just to provide pump presssure. The actual printing is done by the A axis, which must remain under mach control.

Any ideas?

Rich
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 24, 2010, 12:30:54 PM
I've just thought:-

If I write a VB module that works like:-

Do until input1 =0  'ie do until the pressure reaches minimum value, triggering logic1 from pressure sensor circuit
          G01 Z(Z+1)  ' ie increment Z (pump) until correct pressure is reached

can I call it in the Gcode and have it run in the background for as long as the machine is on? I'm sure the syntax is way off; this is just really to describe how it might function.
I haven't used VB with Mach before, in fact I only started to learn VB about 2 weeks ago, so if someone could tell me if I'm on the right track or not, that would be great

Thanks,

Richard B
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 24, 2010, 12:34:56 PM
I seem to have mistyped; should be:

Do until input1 =0  'ie do until the pressure reaches minimum value, triggering logic 0 from pressure sensor circuit
          G01 Z(Z+1)  ' ie increment Z (pump)

that's better!
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: Tweakie.CNC on July 25, 2010, 12:20:43 PM
Richard,

You are on the right lines.

The Macro Pump runs in the background and could control the functions you require with your VB code.
Here is one link but there are many if you do a search  http://www.machsupport.com/forum/index.php/topic,13576.0.html

Tweakie.
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: Hood on July 25, 2010, 05:49:54 PM
I am not sure if this will work as I dont think you will be able to switch an axis on and off whilst other axis are running.
You could possibly do it by having the move in each line of your code but having a physical relay controlling whether the axis actually gets the steps or not. That would then maybe lead to other problems in that that axis motion would be taken into consideration by Mach when doing a move.
The best solution may be to externally drive the axis somehow by using the macropump to switch on/off a pulse generator.

Hood
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: poppabear on July 25, 2010, 09:31:15 PM
another option might be, to swap out your Z axis stepper, with some kind of straight motor, with on/off control, have your load cell trigger the Motor on, and off.

another option (depending on how much money you want to do), you could just set an Air Pressure cylinder and set the pressure for that cylinder to what you need your compressor would keep that amount. you could user your current pressure cell to drive the on/off of the solinoid that would open close your piston to push your stuff.

you could use other options as well, analog devices with modbus, or other things like PoKeys, etc., I guess it all depends on if you makeing money with the machine or not.

I think cutting on/off the Z axis while mach thinks it is running, your going to run into accel/decel probs..

scott
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: Hood on July 26, 2010, 03:24:02 AM

I think cutting on/off the Z axis while mach thinks it is running, your going to run into accel/decel probs..

scott

Scott, yes that was my concern doing it that way, you would have to have the feed set so that switching on.off the pulse didnt stall the stepper which in turn would impact on the other axis.

Hood
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: Tweakie.CNC on July 26, 2010, 04:33:59 AM
Rich,

I made the assumption that your plotter Z axis is just 'pen up' / 'pen down' and operates the pump from one of these two conditions - is this the case ?

Tweakie.
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: stirling on July 26, 2010, 06:20:13 AM
If I understand correctly - you want the Z to be driven at some fixed rate under the control of your logic signal and independantly of the "commanded" axes.

A possible way of doing this is to use Mach's THC. If your logic signal is wired to THC down (say) then as long as your signal is active Z will move down and will stop when your signal goes inactive - completely independantly of X and Y motion.

You will of course need to modify your screen set to include the THC control.

Ian
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: kf2qd on July 26, 2010, 09:38:15 AM
Sounds like you just need an output on/off. 

If i understand correctly - you are extrududing some material - you need to extrude at some pressure. It sounds like you need to have a signal for extrude on/off and then let the pressure control be part of the extruder and don't worry about it being an axis. Axis's are for motin in the X Y & Z planes. Is the extrusion amount in any way deopendent upon what Z & Y are doing, or are they supposed to be programmed so that they are moving at the proper speed so you get the correct deposition?

Otherwise you are going to have to always be moving Z in large enough moves so that it can provide enough volume to exceed the pressure which would be better done with just on/off control.
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 26, 2010, 04:43:04 PM
Okay, been offline for a while, lots to reply to... good!

Hi Hood:-

I thought of using a relay to 'dump' the step/dir signal so it never reaches the motor; thought it might be a problem because you can't guarantee to switch it if afterrather than during a pulse. Shame about not being able to switch an axis on/off when machine is running, like you say, but I was thinking of there being a macropump (thanks Tweakie) which just generates "G1 Z1" every time an input to mach 3 receives a logic 1. Would a pulse generator mean using a dc motor? Or do you mean altering mark/space ratio on a switch mode power supply to an AC motor? It on;y needs to be a tiny motor driving a screw thread. It has a motion control 35NCLA linear stepper at the moment, does very well.( 5V, 0.46A per phase, 4 wire)

Poppabear:-

I see your point on acceleration/ deceleration, but there is another 'axis' (A axis) that runs during plotting, that worka as an 'applicator'  by taking a dab of paint extruded from the syringe driven by the z axis, and 'tattooing' it onto the page. It runs at about 2000 cycles per minute; this is a real 'drag' on the X axis,: I wonder if a tiny Z axis move may not make any difference? as it involves the least hardware changes, I'm tempted to keep my fingers crossed and try it. The code below is want I have been running the machine off to test it. It works as my final code will, except that in this case THE Z COMMANDS ARE WRITTEN IN, rather than generated by a macro. It explains how the 'axes' A and Z work for me, though.




G01 F35000 X0.80 Z0.4 A-4                    (plotting begins here; A-4 means 'lift applicator to it's maximum height, so it picks up some paint from the extruder/syringe)
G01 X0.85 A4                                 (A4 means 'drop applicator down onto cpaper, so it leaves a dot of paint there)

G01 X0.9 Z0.7 A-4                            (Note the Z position increases by .03; this value gives good results, but still need constant pressure for best performance)
G01 X0.95 A4                   

G01 X1 Z1 A-4                 
G01 X1.05 A4                   

G01 X1.1 Z1.3 A-4             
G01 X1.15 A4                   

G01 X1.2 Z1.6 A-4             
G01 X1.25 A4                   

G01 X1.3 Z1.9 A-4             
G01 X1.35 A4                                 
G01 X1.4 Z2.2 A-4                            (plotting ends here)



Hood again:-

"Scott, yes that was my concern doing it that way, you would have to have the feed set so that switching on.off the pulse didnt stall the stepper which in turn would impact on the other axis."

This sounds important; but I don't quite know what you mean by "having the feed set...". If the stepper is only getting clean step/dir signals from the macropump when an input is present, does that conform to what you mean?

Tweakie:-

The plotter has no Z axis as such, I just happened to wire the extruder pump to that output on the ncPod controller; similarly, the A axis doesn't work as a positioning axis either, it just drives a little applicator thingy.

Stirling:-

Hadn't heard of THC before, sounds exactly what I'm looking for. Will it adjust my Z axis position in response to a logic input to Mach3, without interrupting other axe's moves? If so, great, assuming my ncPod supports this...

I was wondering if, although it sounds weird, I should just run my plotter in Mach3 plasma rather than Mach 3 mill; but then I noticed there are only 3 axes in Mach 3 plasma. Which is easier, adding another axis to Mach 3 Plasma, or adding the THC button to Mach 3 Mill? Also, where should I look for information on THC? Not much in this forum, only a little in the basic documentation, and no 'guide to using Mach3 plasma' either.

Kf2qd:-

The extrusion is controlled by Z axis. In my code, no plotting occurs when there is a "Y" axis move, all it does is straight horizontal lines. As you can see from the code, the A axis movement is 'tied' to the X axis movement. Currently the Z is, too but this is the bit that needs to change.

Thanks all,

Rich B
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: Hood on July 26, 2010, 05:19:52 PM
If all you are needing is to pump when a signal is seen and the actual pumping isnt too critical then I would think a small DC motor with a relay interrupting its supply would be suitable. Could  do it via a macropump but really if its an external signal then it would seem silly to take that signal to Mach then for Mach to pass it back out again, most logical would just be direct it straight to the relay..

If it needs to be more critically controlled then THC as Stirling mentioned may be the answer but afraid I have never used THC so cant comment on it.

Hood

Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 26, 2010, 05:44:56 PM
Hi Hood,

I guess the important point is, how critical is the pump... not sure. If I hadn't already got a linear stepper on there that works well enough (but just needs a bit more control), then I would be pleased with the simplicity of your idea, and do it like that. Also it would free up another axis, which I may find useful at a later point. (I won't go into that here, yet). The extruder pump needs to withdraw fully on tool change ('syringe full of paint change' in my case), so needs to be under Mach control anyway. I could trip that from inside my tool change macro, or I may go with the THC or even just Z axis control, for now. Hopefully enough people out here you can guide me to the right resources.

Thanks for your advice,

Richard B
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: stirling on July 27, 2010, 11:17:46 AM
I think Mach's THC functions would do what you want but if you already have an arduino that may be the way to go. Also I don't know if your ncpod supports THC - I think for example the smoothstepper doesn't - whether that's of any relevance I don't know. I'm just thinking that by using the eeno you'd have complete programable control over the pump and be able to let Mach get on with the X Y interpolation which is what it does best.

FWIW - co-incidentally I'm currently working on an eeno based THC for Mach.

Ian
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 27, 2010, 11:24:36 AM
I don't have an Arduino at the moment, but they sound like fun. Why use the Arduino for THC if Mach already has it?
If smooth steper doesn't do THC, probably the ncPod doesn't either, but I'll ask them.

Rich B
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: stirling on July 27, 2010, 11:44:22 AM
Why use the Arduino for THC if Mach already has it?
Mach has THC software but you still need THC hardware to interface between Mach and the plasma cutter. A bit like Mach puts out step signals and reads input signals but you still need drivers for your motors and switches for your limits if that's not too crap an analogy. For example - if you *were* to use Mach's THC control of Z then it would "think" your pump sensor was the THC hardware sending a torch down request.

Ian
Title: Re: z axis driven pump: pressure regulation /logic input question
Post by: moorea21 on July 27, 2010, 11:51:02 AM
That makes sense...

Rich B