Hello Guest it is June 08, 2023, 05:58:11 PM

Author Topic: thc in macropump  (Read 3374 times)

0 Members and 1 Guest are viewing this topic.

thc in macropump
« on: September 27, 2010, 12:46:07 PM »

I'm using my Z axis to drive a dispensing pump (as in my previous posts.) The pump's pressure (ie whether the Z axis advances or not) will be regulated by a logic on/off signal from a strain gauge/amp/comparator circuit. The circuit appears to work fine as a spice model, parts are on order for the circuit itself, so all's well there, barring signal to noise ratio problems.

I'm hoping to run a macropump to control this using DTHC. So the macro will keep the dispensing pump at optimum pressure whenever mach is running, by doing a 'THC down' whenever the pressure drops off a bit.

Trouble is, beyond defining this as rather fluffy pseudocode, I'm unclear about what the code might look like. I don't want to confuse myself further by looking at the wrong macros for inspiration.

Can anyone suggest a bit of code that already exists that might do some/all of what I need? My code understanding is not fantastic, but hopefully I could see how it works. Then me/my friend who enjoys programming/ can put something together that does the job!


Richard B

Offline BR549

  •  6,965 6,965
    • View Profile
Re: thc in macropump
« Reply #1 on: September 27, 2010, 10:09:50 PM »
You might want to look at the  Mach  THC plugin. 

(;-) TP
Re: thc in macropump
« Reply #2 on: September 28, 2010, 03:42:07 AM »
If you mean the one by Brian Barker, I believe this is for analogue inputs. Mine is digital input, and I was under the impression that Mach 3 already has DTHC built in, so wouldn't need a plugin. Do you know where any code for running THC exists?

Something like

If Mach on then
If sensor input = 1 then THC down
Else if tool change macro is running then THC up
Else if do nothing

This is just pseudo code sketch.

Does something like this exist in useable form?

Not sure where to look!

Rich B

Offline BR549

  •  6,965 6,965
    • View Profile
Re: thc in macropump
« Reply #3 on: September 28, 2010, 09:35:04 PM »
I think you should be able to just map the 2 signals as inputs directly to the thcup  and thcdown functions in config. Maybe NO code needed

Just a thought, (;-) TP
Re: thc in macropump
« Reply #4 on: September 29, 2010, 05:37:02 AM »
That's what I was starting to think, then I thought 'can it really be that simple?' I could dummy up a logic on/off signal, set it all up, and see...

Will keep you posted

Rich B