Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: learman on June 10, 2010, 10:09:11 AM

Title: need a macropump
Post by: learman on June 10, 2010, 10:09:11 AM
Greetings

I would like to have a maropump that would jog my x axis +.020 if an input is not closed. I need it to do it only once(meaning not a continuous jog until it finds the input) and only when the system is in its stopped condition. Can this be done?
thanks
Josh
Title: Re: need a macropump
Post by: BR549 on June 10, 2010, 10:52:56 AM
Putting a motion code into the macropump is NOT a good idea and can be dangerous. The macropump is an automatic loop that runs continuously. ANYTIME the conditions were met the MACHINE will move on its own.

IF you can describe what you are wanting to do step by step maybe we can help you design a better function to work for your application.

Title: Re: need a macropump
Post by: learman on June 10, 2010, 12:38:35 PM
Thanks

Yes I agree! That is why I only wanted it to jog once .020.
Well my machine only uses one axis and if conditions are right I will lose -.001 every few cycles. I have went through solenoid valves put capacitors on them, shielded my wires all with no avail. I do have a poxy sensor that will disable the start button if it travels to far down, should this occur the operator will jog the system up and continue running parts (I have a macro that will zero the x axis each time the g code starts). I would like to get rid of the machine operator doing this and have the mach do it.
what do ya think?
josh
Title: Re: need a macropump
Post by: Zaae on June 10, 2010, 01:17:11 PM
Is this one file run over and over, or is it different files each time?
Title: Re: need a macropump
Post by: kf2qd on June 10, 2010, 01:24:16 PM
I would say that this is a situation where you are trying to bandaid an electro/mechanical problem. If you are losing position then you need to look at that problem because it will probably get worse.

OR - Home at the start of every cycle. This would mean on a cycle start you would retract to a home position and then do your motion.
Title: Re: need a macropump
Post by: learman on June 10, 2010, 01:37:35 PM
@kf2qd.. yep, bandaids and duck tape are my favorite. Its the same file over and over. I do recall trying a home position but it traveled past the position and smashed my proxy sensor
Title: Re: need a macropump
Post by: poppabear on June 11, 2010, 04:26:32 AM
well it might be easier to put a custom macro at the start of your g code file.
i.e. M1000.m1s 
I am not at my work computer so you will have to look up the OEM VB codes below.

You might want to double check my VB also, but you want to look for your input being active.
INPUTx below could be INPUT1-4   (or you could use the OEMs 1-15).
also on your general config page, you will need to set up your Step jog DROs with at least one of them with the value
of 0.02 in it, let us say that is the first value box.

'M1000.m1s

MyNeededInput = IsActive(INPUTx)

If Not(IsActive(MyNeededInput) Then
   If Not(GetOEMLED(*********)) Then        'look up the OEM LED code for the Machine is in Step/Jog mode (not continous or MPG).
      DoOEMButton(*********)                    'Do the button to put the machine into Step/Jog mode.
      DoOEMButton(*********)                    'set the step jog value to the first dro value box OEM button
      DoOEMButton(*********)                    'Push the Jog Button for the X+ direction
      While IsMoving()
      Wend
   Else
      DoOEMButton(*********)                    'set the step jog value to the first dro value box OEM button
      DoOEMButton(*********)                   'Push the Jog Button for the X+ direction
      While IsMoving()
      Wend 
   End If
End if

'scott



Title: Re: need a macropump
Post by: learman on June 11, 2010, 10:51:36 AM
Thanks Scott that sound just like what I'm looking to do!!

I have my proxy sensor in series with my start button so let me do some rewiring and i will get back with you on the VB.
josh