Hello Guest it is November 13, 2019, 05:03:08 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 - awander

Pages: 1 2 3 4 5 6 »
Mach4 General Discussion / Re: G91 is not recognized in M4 Turn
« on: November 11, 2016, 11:49:15 PM »
I just went through all the codes shown in my "Modals" line, and the following codes are there, but don't appear in the Mach4 Lathe reference:

G15, G49, G67, G69, G90

Mach4 General Discussion / Re: G91 is not recognized in M4 Turn
« on: November 11, 2016, 11:22:37 PM »
I'm not sure what you mean by that.

Mach4 General Discussion / Re: G91 is not recognized in M4 Turn
« on: November 11, 2016, 11:17:35 PM »

Thanks for this info.

So then, why does the status line in Mach4 Turn show G90?

Mach4 General Discussion / G91 is not recognized in M4 Turn
« on: November 08, 2016, 08:52:00 PM »
When I try to execute a G91 from the MDI window, I get "Unknown G code used" error.

The Status line still shows the machine is in G90 mode.

and today, cutting more of the same part, the red axis centerline is not there at all!

I tried changing colors in the toolpath, to make the axis and the rapids look different.

Axis was already set to Yellow, but as you can see in the screen capture in the original message, it is displaying in Red. Changing axis color is config/mach/toolpath does nothing.

I am cutting a part that I have made a bunch of times with Mach3.

Using Mach4, the part cuts correctly, but the Toolpath Display in Mach4 doesn't look like what the tool is actually doing.

See the attached files for the toolpath display, and the actual profile of the turned part.

EDIT: Now that I posted the question, I see what is going on. I was viewing the bottom red line on the toolpath display as the part centerline; it is actually the top red line that is the centerline.

But, another question-I don't see how to make Mach4 "color in" the toolpath drawing as it does the motions, like Mach3 did. Is this feature there, and I just haven't found it?

Mach4 Toolbox / Re: Scripts to control my VFD over Modbus
« on: November 14, 2015, 08:07:33 PM »
yup, the forum auto-:corrected: the "eight, close parentheses"

My VFD is a Hopewind HV300.

Mach4 General Discussion / Re: MPG thru modbus
« on: September 10, 2015, 12:47:12 PM »
OK, Brian sent me some code snippets over on the yahoo group, and my Modbus MPG is now working in Mach4, and it’s working better than it ever did in Mach3!

For the benefit of anyone else who wants to do this, here is the lua code I am using. This will have to be changed to match whatever registers you are storing things like MPG Selected Axis, MPG Step Size, and MPG Count.

*In my Screen Load Script:
mc.mcMpgSetAccel(inst, 0, 25);  --set up MPG parameters
mc.mcMpgSetRate(inst, 0, 100);
mc.mcMpgSetCountsPerDetent(inst, 0, 4);

*In my PLC Script:

**near the beginning:
testcount = testcount + 1  --this is standard in the latest Mach4 screens

**in the PLC First Run Section:
--  PLC First Run
if (testcount == 1) then –this section is included in the latest Mach4 screens, just add the lines below
    local inst = mc.mcGetInstance()
    local hregiPEncoderInit = mc.mcRegGetHandle(inst, "modbus1/iPEncoder")
    local iPEncoderInit = mc.mcRegGetValue(hregiPEncoderInit) --get value from pendant Encoder Register
    local Init_EncoderPos = iPEncoderInit –not sure if so many levels of variables are necessary here
    last_EncoderPos = Init_EncoderPos

**near the end:
--This section for setting MPG Axis based on modbus pendant Axis switch
local hregipAxis = mc.mcRegGetHandle(inst, "modbus1/ipAxis")
local ipAxis = mc.mcRegGetValue(hregipAxis)
--get value from pendant Axis switch
if (ipAxis == 2) then
    mc.mcMpgSetAxis(inst, 0, 0);
--    set Axis to "x"
elseif (ipAxis == 4) then
    mc.mcMpgSetAxis(inst, 0, 1);
--    set Axis to "y"
elseif (ipAxis == 8) then
    mc.mcMpgSetAxis(inst, 0, 2);
--    set Axis to "z"
elseif (ipAxis == 16) then
    mc.mcMpgSetAxis(inst, 0, 3);
--    set Axis to "a"
elseif (ipAxis == 32) then
    mc.mcMpgSetAxis(inst, 0, 4);
--    set Axis to "b"
elseif(ipAxis == 64) then
    mc.mcMpgSetAxis(inst, 0, 5);
--    set Axis to "c"
--"T" is "0"
--"Off" is "1"

--This section for setting MPG Increment based on modbus pendant Step switch
local hregipStep = mc.mcRegGetHandle(inst, "modbus1/ipStep")
local ipStep = mc.mcRegGetValue(hregipStep)
--get value from pendant Step switch
if (ipStep == 1) then
    mc.mcMpgSetInc(inst, 0, .01);
elseif (ipStep == 2) then
    mc.mcMpgSetInc(inst, 0, .001);
elseif (ipStep == 4) then
    mc.mcMpgSetInc(inst, 0, .0001);
elseif (ipStep == 8) then
    mc.mcMpgSetInc(inst, 0, .01)--for "V" mode
--set MPG increment

--This section for moving selected axis based on MPG register changes
--local inst = mc.mcGetInstance()
local inst = mc.mcGetInstance()
local hregiPEncoder = mc.mcRegGetHandle(inst, "modbus1/iPEncoder")
local iPEncoder = mc.mcRegGetValue(hregiPEncoder) --get value from pendant Encoder Register
local inc_pos = (last_EncoderPos - iPEncoder); --Calculate the inc position of the axis
mc.mcMpgMoveCounts(inst, 0, inc_pos) --move the number of counts
last_EncoderPos = iPEncoder

Mach4 General Discussion / Re: MPG thru modbus
« on: September 09, 2015, 11:01:42 AM »
As recommended, i looked at Brian's mousewheel jog example, and I am still as much in the dark as ever. There are not enough comments in the code for me to figure out what it is doing.

Also, it seems that you can set the MPGAxis, but how do you display the selected Axis?

Has anyone got an MPG working that they could share code for?

Pages: 1 2 3 4 5 6 »