Hello Guest it is January 20, 2021, 09:31: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.

Topics - soruud

Pages: 1
Mach4 General Discussion / Mach4 Spindle lag problems
« on: September 25, 2018, 06:09:36 AM »
Hi. I got a serious problem with my Mach4 Spindle.

Spindle are running, and 1 or more axis are moving But when all axis movement stops my spindle does an short halt. Not long, but I can see it on the spindle and
hear clicking noise from the servo spindle motor. If 2 axis are moving and 1 axis stops it's ok. It happens only when last axis stops. This happens both in manual
and G-code running mode. There is no difference whenether I move axis with external buttons or buttons onscreen.
I tested several orginal WX4 screensets, and are pretty sure this error must be in MAch4 Core or maybe some settings in my SmoothStepper ???

My machine setup are like this:

Mach4 (latest release)
ESS SmoothStepper
Pokeys 57U for external button panel
Spindle 1,8kw AC Servomotor
X and Y 750w AC Servomotor
Z 1,3kw AC Servomotor
A 200w AC Servomotor
PLC for lubrication, tool release and some safety stuff

Any suggestions anyone ? This is kinda gamebreaking.

Mach4 General Discussion / PMC. Need help to toggle an output
« on: September 24, 2018, 04:05:30 PM »
Hi. I need help to make my external panel button toggle an Mach4 output. This is for Airblow. I already used the M07 for Mist.
I would prefer to do this in PMC, but can do it in LUA too. Just need some help to make it work.

My button is at my Pokeys pin 40, and my Mach4  Output is 11.  (For LUA solution my button will be mapped to Mach4 input 40)
In G-code I just use M111 (ON) and M211 (OFF), so I just need to make it work on external button for override.

Can someone please help me type a LUA script or attach an PMC file for me ???

By the way.. Is it possible to make PMC run an M-code? If so please show me how. That would end my problem  :)

I would also like to do my FeedRate Override and Spindle speed +-10% buttons in PMC if possible. Today I am doing this in Pokeys Pedant, and it kinda sux.

Thanx :)

Mach4 General Discussion / Mach4 Coolant Toogle Problems
« on: September 21, 2018, 02:53:30 PM »
Hi. I got a big problem when setting up panel button to toggle coolant on/off.
I tried to do it in PMC Ladder, but every time Mach4 starts my water pump starts as well :(
Then I tried to to it in screen load script, and the same thing happen.

This is my script:

[mc.ISIG_INPUT38] = function (state)
if (state == 1) then
     local inst = mc.mcGetInstance();
     local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON);
     local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 0) then
         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
         mc.mcCntlSetLastError(inst, "Coolant On")
         local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
         mc.mcCntlSetLastError(inst, "Coolant Off")

Please help me. What is wrong with my script? And why is my functions in PMC running without me pushing my button?

Mach4 Toolbox / Axis movment indicator LED
« on: June 28, 2017, 03:23:18 PM »
Hi. I would like to make LED's on my panel to light up to indicate movment on each axis. So when my x-axis moves in positive direction I want 1 output to be activated, both if
axis are started by an G-code or by me hitting X+ jog button or using my jog wheel... Same for each axis and direction.
I really tryed to do this, but no luck so far.

Can some one help me with this one ?


Mach4 General Discussion / Jograte use mm/m in stead of %
« on: June 07, 2017, 03:57:42 PM »
Hi. I would like my Jog rate speed to be defined in mm/m and not % of my max rapid speed. The reason for this is that I got 1/4 speed on my Z axis compared to X and Y axis. So my Z axis is allways slow in compare.

Lets say I define 2000 mm/m as 100% Jog rate This is my Max Rapid on Z. The other axis can move 8000, but 2000 would be nice as top Jog speed.
How can this be done?

Please missunderstand me correct... Ofc. If I turn my Jograte to 100% now as it is, I will get my 2000mm/m on Z.. But then I got 8000 on the other axis, and that is too fast  ;)

I belive I have seen something like this before, maybe in this forum, but now I cant find it.  Help some1  ??? ??? ??? 

My control panel buttons has arrived  ;D Directly from CNTD's factory in China.
I must recomend them if you need buttons or sensors, end switches for projects. They got exelent service, and very fast shipping.
They sendt me 270 buttons on Friday, and I got it home with UPS today. 3 days. Price wasnt bad either. 256$ shipping included :)
All buttons where nicely packed separately in plastic and boxes of 20 pcs. It looks pretty professional. Quality allso looks to be good.

See attached picture

Downloadable Product Sheet PDF: https://drive.google.com/open?id=0BxBCBb731KryS0g2NHpTQlFEdUE

Hi. I need to know how to make an DRO to show what is my current CS It can allso be LED's with label G54, G55..
I would allso like to set G90 or G91 with buttons on screen. Cant find out how to do this...

Thanx  :)

Mach4 Toolbox / Jog Inc with keyboard or external buttons
« on: May 19, 2017, 12:30:30 PM »
Hi. When Jog mode are set to Incremental, jog-buttons on screen works as inc.step as it should  :). But keyboard buttons keep go Continous... Is that normal ???
If I map hardware buttons to Jog functions in Mach Input / Signals (ex: Jog X+) the jogging will work but continues after I release the button. I got to push again to stop jogging, and the same happens even in Incremental mode.
How can I map my hardware Jog buttons to make it work just like the buttons on screen? even in Incremental mode...
This should be pretty easy to fix I guess.. IF you know what to do... I dont.. :(
I know there is plenty og ppls in this forum with tons of knowledge... Still no awnsers to most questions asked here... How come?

Mach4 Toolbox / Mapping screen button to pokeys ExtBus pin
« on: May 16, 2017, 04:54:16 PM »
Hi. What is wrong with this script below?
I wrote this as a down script on an button in screen editor to trigger an output on my Pokeys56U ExtBus board.
I dont get any errors, but it wont work either...

Do I NEED to assign all inputs and outputs to signals in MACH edit? Or is it possible to adress directly as I tried here?

function testing()
local inst= mc.mcGetInstance();
local out4= mc.mcSignalGetHandle(inst, ("PoKeys_30346 PoExtBus/PoExtBus 01.2"));
mc.mcSignalSetState(out4, true);

Mach4 General Discussion / Need some minor LUA adjustments...
« on: May 15, 2017, 03:15:41 PM »
Hi. I got a LUA script for an Pedant, but I need help to adjust it a bit for my needs.
This Lua is written for pedant with 2 selector knobs to set MPG Axis selection and STEP rate.
I will use momentary pushbuttons for this if possible. So I will use 4 buttons for X Y Z A axis, and 3 buttons for STEP rate 0.1 - 0.01 and 0.001.
Can someone please help me?  I should mention that I dont know much about LUA... ???

--Go to the closing } of the SigLib table in the screen load script and
--delete it. Then paste all of this code in its place.
--The new closing } for the SigLib table is on line 48 of this script.
--          CNC4PC Pendant         --
-- These simply run the CNC4PCPendant function if their state changes.
[mc.ISIG_INPUT10] = function (state)

[mc.ISIG_INPUT11] = function (state)

[mc.ISIG_INPUT12] = function (state)

[mc.ISIG_INPUT13] = function (state)

[mc.ISIG_INPUT14] = function (state)

[mc.ISIG_INPUT15] = function (state)

[mc.ISIG_INPUT16] = function (state)

[mc.ISIG_INPUT17] = function (state)

[mc.ISIG_INPUT18] = function (state)

[mc.ISIG_INPUT19] = function (state)


-- CNC4PC Pendant function.
function CNC4PCPendant()
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT10)    -- Is mapped to Port 2 Pin 4 *X Selection
   local XSelection, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT11)    -- Is mapped to Port 2 Pin 5 *Y Selection
   local YSelection, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT12)    -- Is mapped to Port 2 Pin 6 *Z Selection
   local ZSelection, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT13)    -- Is mapped to Port 2 Pin 7 *A Selection
   local ASelection, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT14)    -- Is mapped to Port 2 Pin 8 *.001 Selection
   local Step001, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT15)    -- Is mapped to Port 2 Pin 9 *.010 Selection
   local Step010, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT16)    -- Is mapped to Port 2 Pin 10 *.100 Selection
   local Step100, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT17)    -- Is mapped to Port 2 Pin 15 *Estop
   local PenStop, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT18)    -- Is mapped to Port 2 Pin 12 *B Selection
   local BSelection, rc = mc.mcSignalGetState(hSig)
   local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT19)    -- Is mapped to Port 2 Pin 13 *C Selection
   local CSelection, rc = mc.mcSignalGetState(hSig)
   local PenJogOn, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT10)-- Is mapped to Port 2 Pin 1 *Jog on LED
   if XSelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 0) --X Axis
      mc.mcCntlSetLastError(inst, "X Selected")
      mc.mcSignalSetState(PenJogOn, 1)
   elseif YSelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 1) --Y Axis
      mc.mcCntlSetLastError(inst, "Y Selected")
      mc.mcSignalSetState(PenJogOn, 1)
   elseif ZSelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 2) --Z Axis
      mc.mcCntlSetLastError(inst, "Z Selected")
      mc.mcSignalSetState(PenJogOn, 1)
   elseif ASelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 3) --A Axis
      mc.mcCntlSetLastError(inst, "A Selected")
      mc.mcSignalSetState(PenJogOn, 1)
   elseif BSelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 4) --B Axis
      mc.mcCntlSetLastError(inst, "B Selected")
      mc.mcSignalSetState(PenJogOn, 1)
   elseif CSelection == 1 then
      mc.mcMpgSetAxis(inst, 0, 5) --C Axis
      mc.mcCntlSetLastError(inst, "C Selected")
      mc.mcSignalSetState(PenJogOn, 1)
      mc.mcMpgSetAxis(inst, 0, -1) --No Axis
      mc.mcCntlSetLastError(inst, "No Axis Selected")
      mc.mcSignalSetState(PenJogOn, 0)
   if Step001 == 1 then
      mc.mcMpgSetInc(inst, 0, .001)
   elseif Step010 == 1 then
      mc.mcMpgSetInc(inst, 0, .010)
   elseif Step100 == 1 then
      mc.mcMpgSetInc(inst, 0, .100)
   if PenStop == 1 then

Pages: 1