Hello Guest it is April 26, 2024, 01:23:51 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 - rrc1962

51
Mach4 General Discussion / Re: Huge feedrate error
« on: June 12, 2016, 07:47:23 PM »
So....I got this M code working.  Not sure what I did, but now it works one time.  If runs as it should, but to get it to run again, I have to shut down M4.   Most of the time, I have to use task manager to shut it down. 

Isn't there a way to trap runtime errors here?  It runs fine in the editor, so debugging there is of little use.

52
Mach4 General Discussion / Re: Huge feedrate error
« on: June 12, 2016, 06:01:45 PM »
I should also mention that if I load a gcode file that has say...F100 in it, The feedrate sets properly.  This only seems to be happening using mc.mcCntlGcodeExecuteWait.  Also interesting is that no matter what I set the Feedrate variable to, it will not go higher than 9IPM.  I can say 'F3000' or 'F900000'.  Either way, the system feedrate gets set to 9IPM.

53
Mach4 General Discussion / Huge feedrate error
« on: June 12, 2016, 05:56:16 PM »
Consider the following M code.  It should read the feedrate from a DRO, which is does (300), set the feedrate to 300, move to X5Y5 then back to zero.

Code: [Select]
function m200()
    local inst = mc.mcGetInstance()
    local Feedrate = mc.mcProfileGetDouble(inst, 'PersistentDROs', 'droPLFeedRate', 1)
    mc.mcCntlSetLastError(inst, 'Set Feedrate')
    code2 = 'F ' .. Feedrate .. '\n'
    code2 = code2 .. 'G01 X5 Y5\n'
    code2 = code2 .. 'G01 X0 Y0\n'
    mc.mcCntlGcodeExecuteWait(inst, code2)
end

if (mc.mcInEditor() == 1) then
    m200()
end

It does not set the feedrate to 300IPM.  It sets it to 3IPM.  The Feedrate variable is correct.  Same thing happens if I replace Feedrate with a '300'.  So thinking that I just need to multiply the Feerate variable by 100, I try this...

Code: [Select]
function m200()
    local inst = mc.mcGetInstance()
    local Feedrate = mc.mcProfileGetDouble(inst, 'PersistentDROs', 'droPLFeedRate', 1)
    mc.mcCntlSetLastError(inst, 'Set Feedrate')
    code2 = 'F ' .. Feedrate * 100 .. '\n'
    code2 = code2 .. 'G01 X5 Y5\n'
    code2 = code2 .. 'G01 X0 Y0\n'
    mc.mcCntlGcodeExecuteWait(inst, code2)
end

if (mc.mcInEditor() == 1) then
    m200()
end

This sets the system Feedrate to 9IPM.  Do I have a setting wrong?  Seems like the only code that will run inside mc.mcCntlGcodeExecuteWait is simple.  This one is similar.  The G31 executes but the feedrate is a fraction what it is told to be.

Code: [Select]
function m200()
    local inst = mc.mcGetInstance()
    local Feedrate = mc.mcProfileGetDouble(inst, 'PersistentDROs', 'droPLFeedRate', 1)
    mc.mcCntlSetLastError(inst, 'Set Feedrate')
    code2 =  'G31 Z-2 F100\n'
    code2 = code2 .. 'G92 Z0\n'

    mc.mcCntlGcodeExecuteWait(inst, code2)
end

if (mc.mcInEditor() == 1) then
    m200()
end

The Feedrate is running at 1IPM.  Also can't get any of this to actually run by calling the M code.  It runs in the editor, but not when the M code is called.

54
Mach4 General Discussion / Re: change motor counts with lua
« on: June 11, 2016, 08:32:02 AM »
Yes I retyped it. I checked and it is correct on the PC running Mach4.

We are trying to do this because I am making a tube plasma and I must be able to do arcs in the Z and C axis and Mach doesn't support cylindrical interpolation. Therefore, I have the machine set up as a XYZ machine and I'm just changing the motor counts based on the tube diameter. I can make it work by just closing and reopening Mach and selecting a different profile, but I was hoping to make it work with less user interaction (just an M code).

Why do you need to do arcs?  Why wouldn't a segmented line arc do the same think.  We tried it both ways in M3 and cutting the tube with the rotary axis set up as linear was a pain.  Too much for the operator to do to make it work correctly.  If you set up the rotary axis as angular and post angular code, you don't have to change anything in Mach.

Also, when you set the rotary axis as angular, the tool path display shows a rotating tube during the cut.  I've had a number of people ask which controller software we use because "Mach3 is not capable of that".  If you treat the tube like a flat sheet in Mach it will depict a flat sheet in the TP display.

55
Mach4 General Discussion / Re: arcs with a linear and rotational axis
« on: June 04, 2016, 08:14:02 AM »
Correct. If memory serves, Mach...or Mach3.... Can't do an IJ arc in rotational mode.  To do arcs you would need to treat the rotational axis as a linear axis.  To run it as a rotational axis, you would need ca, softaware capable of producing that code.  The cam software would output something like G01 X1 A1, which would move the X 1" and rotate the tube 1 degree. 

It usually takes a specialized software for working with tube.

56
I'll reply to this one as well..  :-[

I need to get a handle for the signal first.


I made this same mistake a few days ago.  Used the output rather than the handle to the output.

57
Mach4 General Discussion / Re: Run From Here
« on: June 02, 2016, 06:32:33 PM »
Cool...Didn't even think to try that.   

58
Mach4 General Discussion / Teach file equivalent
« on: June 02, 2016, 06:17:44 PM »
Is there a tech file equivalent in M4?  Something like the function M3 to write to the teach file, then load it?  If not, I can just write a file using Lua file IO then load that file, but the teach file function in M3 made it real easy.

Thanks

59
Mach4 General Discussion / Run From Here
« on: June 02, 2016, 04:41:37 PM »
Is there a way to determine if the Run From Here button has been pushed?  I need to do that or initiate RFH with a script where I can trun on an LED at the same time.  Then later on I can look for the state of the LED.  I see RFH as an option for button actions, but can't find a function in the API for Run From Here.

Thanks

60
Mach4 General Discussion / Re: arcs with a linear and rotational axis
« on: June 01, 2016, 06:21:54 PM »
In Mach3 we used the A axis as the rotational axis.  In General Config we set the A axis as angular.  Once you do that G1 A1 would rotate the A axis 1 degree.  You're CAM software has to be capable of producing rotational code though.  The other way to do it is to move the rotational axis using linear moves, which means you have to scale the Y axis steps per unit based on the tube diameter...and when you do that, it affects you acceleration on the axis as well.

The easiest way is to set your rotational axis to angular in Mach and use a good tube CAM software, like Hypertherm's Rotary Tube Pro.  When you set the steps per unit on the rotational axis, it will be the number of steps to rotate 1 degree.