Hello Guest it is September 29, 2020, 11:19:21 AM

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 - smurph

71
How could I  run a extruder step motor from mach4/pokeys. How could the extruder know how much filament to extrude.
Use a step dir spindle and control the motor with the S word, M3 for start, and M5 for stop.  See the Spindle tab in the configuration dialog.
Quote from: machiner
How could I control the two heaters (base plate and extruder) from mach4/pokeys. There are several thermistors on the printer to feedback temperatures.
Bring the thermistors into a compatible ADC (analog input).  Then implement a heater control in the screen's PLC script or even a PMC ladder script. 
Quote from: machiner
I am hoping if I cannot run it all from MAch4, I could use the Smoothie board for the heaters and extruders and  mach4/pokeys for the Steppers.
Mach can do it.

Steve

72
Mach4 General Discussion / Re: Soft stop not working
« on: March 23, 2020, 04:30:05 PM »
Yeah, I'm generally not a fan of the Stop button.  My Matsuura MC500 didn't have a stop button on its' original control!  All it had was an E-STOP button, a feed hold button and a cycle start button.  When I retrofitted the machine with Mach 4, that is all I put back on it.  IMHO, on a Mill type machine, that is all that you need (and all I want).

Steve

73
For the reasons that Craig stated, reverse run isn't in Mach4. We have "cut recovery" instead of reverse run since reverse run was mostly used when a plasma flamed out.  The cut recovery process is really simple to use.  Just jog to near to a place on the path where you want to restart and hit the cut recovery button. 

74
Mach4 General Discussion / Re: Z zero randomly changes on its own
« on: March 10, 2020, 02:35:35 PM »
"Z axis commanded over SoftMax": What the error is telling you is that if you applied that offset in the DRO, it will cause a move that will violate the soft limits.  So I think this is purely a soft limit setup issue.  So...

The only changes that I have made to mach 4 are adjusting the steps per unit, velocity and acceleration.

If you have changed your counts per unit, you will probably have to change your soft limit setup.

Steve

75
Mach4 General Discussion / Re: g-code problem
« on: March 10, 2020, 05:11:21 AM »
Mach 4 isn't butchering anything.  Garbage in == garbage out.  :)

If you load that file, the status history will tell you what is wrong with it. 

File "C:\Mach4\GcodeFiles\valve test.NC", Line 18: K word given for arc in XY plane

You can't use I and K in the G17 (XY) plane.  G17 (XY plane) uses IJ, G18 (XZ plane) uses IK and G19 (YZ plane) uses JK.  Unless you changed it, Mach will startup in the G17 (XY) plane). 

So something is bogus coming out of the post processor.  So I don't know how that post is configured or if the drawing and CAM is setup for another plane, but it is wrong.  Also, there isn't a Safe Startup line in the G code that is normally defined by the post processor (maybe some setting?  I don't know MasterCAM).  The only thing in the header is G20.  If the CAM software is going to use use the G18 plane (XZ), then it should output G18 something like:

G20 G18 up at the top of the file somewhere. 

But if the MasterCAM post just can't do this, then, simply change the default Mach startup plane in the configuration dialog.  But I would lay odds that the post processor isn't configured correctly. 

Steve

76
Mach4 General Discussion / Re: Avid cnc dual Z
« on: March 10, 2020, 04:51:13 AM »
mc.mcAxisMapMotor(MINSTANCE mInst, int axis_id, int motor_id)
mcAxisUnmapMotor(MINSTANCE mInst, int axis_id, int motor_id)

You will need to pay attention to your homing too as both will need to be homed.  I would use C axis (linear W) to home the router instead of A.  You might want a rotary A at some point.  Make sure the C axis is included in your homing order.

The default mapping should be done in the load script, as the Mach config will be changed to whatever the motor the Z axis had mapped last. 

So if your spindle is motor 3 and your router is motor 4, the load script should contain:
Code: [Select]
mc.mcAxisMapMotor(0, mc.Z_AXIS, 3)
mc.mcAxisMapMotor(0, mc.C_AXIS, 4)

You might want the make the home all button map the Z and C axes to their default motors too.  Lots of stuff to think about here...  :( 

When running, you can swap the Z axis to the different motors with some script. 

Code: [Select]
-- To change Z from spindle to router
mc.mcAxisUnmapMotor(0, mc.Z_AXIS, 3)
mc.mcAxisMapMotor(0, mc.Z_AXIS, 4)
mc.mcSetPoundVar(0, mc.SV_HEAD_SHIFT_X, <X offset from spindle Z>)
mc.mcSetPoundVar(0, mc.SV_HEAD_SHIFT_Y, <Y offset from spindle Z>)
mc.mcSignalSetState(0, mc.OSIG_OUTPUT10, 1) -- marking we are using the router as Z (and possibly energize a SPDT to rout the M3 signal).
-- To change Z from router to spindle
mc.mcAxisUnmapMotor(0, mc.Z_AXIS, 4)
mc.mcAxisMapMotor(0, mc.Z_AXIS, 3)
mc.mcSetPoundVar(0, mc.SV_HEAD_SHIFT_X, 0)
mc.mcSetPoundVar(0, mcSV_HEAD_SHIFT_Y, 0)
mc.mcSignalSetState(0, mcOSIG_OUTPUT10, 0) -- marking we are using the spindle as Z (and possibly de-energize a SPDT to route the M3 signal).

This solution would probably be well served being written as a LUA module.  That way, screen scripts can call it and M codes can call it too. 

 I would also think about making M3 and M5 a script that energizes/de-energizes the appropriate relay to turn the spindle/router on/off depending on which is currently mapped to the Z axis.  I would probably do this with a SPDT relay wired to an output that is asserted when using the router commented above).  Sometimes it is better to do things in hardware...

Here is an example lua module to get you started.  I coded it up quickly and for brevity it does NOT check all of the API return codes.  Which you should do!!

Code: [Select]
local zControl = {
DESC = "Sample Z motor control module."
}

local spindle = 3
local router = 4
local routerOffsetX = 6.500
local routerOffsetY = -3.500

---  This can be called, if needed, but it is more of a utility function for the below module functions.
function zControl.UnmapMotors()
--Just unmapp everything to be safe.
local rc = mc.mcAxisUnmapMotor(0, mc.C_AXIS, router)
if ((rc ~= mc.MERROR_MOTOR_NOT_FOUND) and (rc ~= mc.MERROR_NOERROR)) then
-- expect mc.MERROR_MOTOR_NOT_FOUND or mc.MERROR_NOERROR
return 1 -- failure
end
rc = mc.mcAxisUnmapMotor(0, mc.Z_AXIS, router)
if ((rc ~= mc.MERROR_MOTOR_NOT_FOUND) and (rc ~= mc.MERROR_NOERROR)) then
-- expect mc.MERROR_MOTOR_NOT_FOUND or mc.MERROR_NOERROR
return 1 -- failure
end
rc = mc.mcAxisUnmapMotor(0, mc.Z_AXIS, spindle)
if ((rc ~= mc.MERROR_MOTOR_NOT_FOUND) and (rc ~= mc.MERROR_NOERROR)) then
-- expect mc.MERROR_MOTOR_NOT_FOUND or mc.MERROR_NOERROR
return 1 -- failure
end
return 0 -- success
end

---  Call this function to use the spindle on the Z axis.
function zControl.UseSpindle()
if (zControl.UnmapMotors()) then
return 1 -- failure
end
mc.mcAxisMapMotor(0, mc.Z_AXIS, spindle)
mc.mcSetPoundVar(0, mc.SV_HEAD_SHIFT_X, 0)
mc.mcSetPoundVar(0, mcSV_HEAD_SHIFT_Y, 0)
-- marking we are using the spindle as Z (and possibly de-energize a SPDT to route the M3
mc.mcSignalSetState(0, mc.OSIG_OUTPUT10, 0)
return 0 -- success
end

---  Call this function to use the spindle on the Z axis.
function zControl.UseRouter()
zControl.UnmapMotors()
mc.mcAxisMapMotor(0, mc.Z_AXIS, router)
mc.mcSetPoundVar(0, mc.SV_HEAD_SHIFT_X, routerOffsetX)
mc.mcSetPoundVar(0, mcSV_HEAD_SHIFT_Y, routerOffsetY)
marking we are using the router as Z (and possibly de-energize a SPDT to route the M3
mc.mcSignalSetState(0, mc.OSIG_OUTPUT10, 1)
return 0 -- success
end

---  This function probably should be called by the home all button script and the screen load script.
function zControl.DefaultMotors()
if (zControl.UseSpindle()) then
return 1 -- failure
end
if (mc.mcAxisMapMotor(0, mc.C_AXIS, router) ~= mc.MERROR_NOERROR) then
return 1 -- failure
end
return 0 -- success
end

return zControl

This is definitely advanced stuff and you are going to have to make this all work yourself.  Because nobody is going to have a machine that is setup exactly like yours, etc...  It is going to take some learning and patience.  But it can be done. 

Steve

77
It will run G code up to the point where there is movement and then stop.  It is motion inhibit, not cycle start inhibit.  So there are will be that distinction. 

Steve

78
Generic Fanuc will do.  If you want to get picky, Fanuc 21i  We made it Fanuc compatible so people didn't have to worry about a special post processor.

79
Mach4 General Discussion / Re: Replacing Pendant brain file with lua
« on: February 25, 2020, 03:23:53 PM »
Use the PMC ladder logic feature of Mach4.  It is very similar to Brains. 

Steve

80
Mach4 General Discussion / Re: RhinoCAM turning post processor for MACH4
« on: February 24, 2020, 02:43:04 AM »
Mach4 is Fanuc compat.  Any generic Fanuc post should work. 

Steve