Hello Guest it is April 25, 2024, 08:50:25 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cbyrdtopper

91
I don't use Arduino, but I'm sure you can make a counter to handle this instead of using inputs. 
On the current machine I'm working on, this is what I'm doing.  I start the tool change sequence in Mach4, I move the Z Up to the tool change position and make sure the spindle and coolant are off as well as any other task that Mach4 can take care of; then I send a register # over to the PLC via Modbus; this register # is the requested tool; in the M6 Macro, I now wait for the PLC to finish rotating my carousel.   You can use the following API Call to wait for an input to become true before continuing, or if it times out, then you can do something else.
rc = mc.mcSignalWait(inst, mc.ISIG_INPUT21, 1, 5) --Wait 5 seconds for input 21 to become active
   if (rc~= 0) then --Check our return call
      mc.mcCntlSetLastError(inst, "There was an error")
   end

My carousel has an index switch, so it counts the number of rotations and stores that inside a register in the PLC.  So as it rotates, it counts up or down until the current carousel position counter equals the requested tool number sent over from Mach4.  Once it reaches that position, it turns on an output inside the PLC which is read as an input in Mach4, this input correlates with my mc.mcSignalWait call and it can continue with the macro. 

Then again, you can do exactly as you suggest, have a bunch of inputs you can use for the arduino.  I have an old hurco that has a lot of proximity switches that tell me what current tool position I am on in the carousel; It has a 20 tool position carousel, so 20 inputs telling my PLC what to do. I have my PLC look for the correct sequence of inputs that tells my register that it is a certain number and I do the same thing as stated above, once the current carousel position and the requested tool registers equal, then it sends a signal to mach4 to continue the m6 macro.

92
Mach4 General Discussion / Re: Jogging multiple Axes
« on: July 22, 2022, 09:11:27 AM »
Rexx,
What Craig is saying is that both axis will not jog synced together; one axis will be slightly ahead of the other axis. 
However, if this is acceptable for your application, then yes, it is solved.
He was just stating this for other people who might read this thread.... it isn't perfect, so if someone needs it to be synced together correctly they will have to do something different.

93
Mach4 General Discussion / Re: Jogging multiple Axes
« on: July 21, 2022, 08:49:58 AM »
No problem.
In my testing, it didn’t jogged perfectly synced.  So I would be aware of that. I assume it is from reading the 1st axis slightly ahead of the 2nd axis on the button press

94
Mach4 General Discussion / Re: Jogging multiple Axes
« on: July 19, 2022, 04:47:21 PM »
Are they independent of each other, or are they slaved?  I have never used slaved motors, but I assume they would jog together. 

Either way....
This will do what you want.  It is linked to the jog velocity, so changing the Jog Rate % in the jogging tab will adjust how fast this jogs.

So, make your button or buttons to jog your multiple axis.
I have noted on the first instance the conditions for the JogVelocityStart  and JogVelocityStop. 
inst, Axis#, and Direction. 
You may want to add 1 button to jog Postive and another button to jog Negative.

Once you make your button, do the following.
Put this in the Down Script for the button
--Start Jogging
local inst = mc.mcGetInstance()
mc.mcJogVelocityStart(inst, 0, 1) --inst, Axis#, Direction 1 is positive and -1 is negative.
mc.mcJogVelocityStart(inst, 1, 1)

Put this in the Up Script for the button
--Stop Jogging
local inst = mc.mcGetInstance()
mc.mcJogVelocityStop(inst, 0) --inst, Axis#
mc.mcJogVelocityStop(inst, 1)

95
Mach4 General Discussion / Re: Jogging multiple Axes
« on: July 19, 2022, 04:33:45 PM »
What are you wanting to jog to axis for? 
Is it for a gantry type machine or do you have something else in mind?  I'm looking now to see what can be done to jog two axis with a single button.

96
Mach4 General Discussion / Re: part zero
« on: July 14, 2022, 03:17:37 PM »
The Offset Tab is a great place to look at for setting your work coordinate zero.

97
Mach4 General Discussion / Re: Fusion 360 In-Process Inspection
« on: June 13, 2022, 03:37:25 PM »
You have a machine with Mach4 on it OEM? 
You can upgrade it.  You will have to copy all of your configuration stuff and put it into the new version of Mach4.  '
Make a copy of everything and store it for safekeeping.
I make templates for most things here at work.  Mostly I make parametric models in Fusion and then let operators adjust the parameters; but I do make templates for G Code as well using # Variables. 

98
Mach4 General Discussion / Re: Fusion 360 In-Process Inspection
« on: June 13, 2022, 02:53:50 PM »
Yes.  I've got OD Grinders that I made the code for that utilize all of those; I'm using Mach4 industrial on those machines.

99
Mach4 General Discussion / Re: Fusion 360 In-Process Inspection
« on: June 13, 2022, 02:14:32 PM »
Yeah, that's what I was talking about.  The G65 is a sub program call.  The P9810 and P9812 are the programs for Safe Moves (9810) and for the work offset (9812) with the arguments on the same line (the letters and numbers).  Mach4 industrial supports G65 sub programs. 

100
Mach4 General Discussion / Re: Fusion 360 In-Process Inspection
« on: June 13, 2022, 01:14:16 PM »
I didn’t get it to post anything on my end. What exactly are you posting out of fusion?

Can you add a the code it outputs?  I’m curious now.

The industrial version of Mach4 can read all of the macro programming that it outputs.  Conditional statements, if, while, etc are all ok in mach4 industrial.