Hello Guest it is April 20, 2024, 04:43:57 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.


Topics - CRS

Pages: 1
1
Mach4 General Discussion / MPG with Feed Hold SAFETY ISSUE
« on: June 13, 2017, 04:16:02 PM »
Hi guys, me again,

I wonder if anyone has experienced this. On one machine we have added an external MPG wheel to the front console, it works very well using Chaoticone’s script for his CNC4PC Pendant.  Slightly modified, but all good.  A five position rotary selector switch for OFF, and the four axes X, Y, Z, and A.

When running G Code, the MPG and Jogging are not available of course, but when Feed Hold is pressed, if the MPG is not in the OFF position, which can happen, and it is accidentally bumped, then it mimics the Cycle Start command and the G Code starts running again.  I must say, that makes you sit up and take notice!

Well, just make sure the switch for the MPG is in the OFF position….  Yes of course, but if things can go wrong, then they might.  It gets better.  When Feed Hold is press again or Cycle Stop is pressed in an attempt to halt the unwanted action, the screen freezes and the machine just keeps on running.  I assume Mach or the PC is still running the G Code in the background.  It then requires E-Stop to halt the action.  Not very convenient.

That part may just be on our set up for whatever reason, but I assume the MPG acting as a proxy Cycle Start is normal.  My thought is to set things up like on my current mill and I have seen elsewhere, where the selector switch unless in the OFF position actually prevents the Cycle Start from acting.  Not sure if that is what is happening internally, but that is the effect.

Is this a good solution?

Have a normally closed contact from the OFF position in the selector switch activate an input, say input 63, then modify the Cycle Start function to include that input in the things it looks for before it can be actioned?

I have the input happening and have attempted to add that input to the “if/then” statement in the Cycle Start script, but I really have no idea what I am doing.  I don’t want to just keep trying stuff as this is more than just a desire, it’s now quite a potential safety issue if I don’t get it right, or get it half right.

Any suggestions welcome and anyone with an external MPG wired in, be aware.  If using a pendant with a Dead Man switch, then that takes care of it, but we don’t want a Dead Man switch, as I believe one of your hands is rendered unusable while holding in the switch.

Craig.

2
Mach4 General Discussion / External MPG with CNCRoom MB2 and ESS
« on: May 25, 2017, 06:55:24 AM »
In case anyone may find this of interest.

I will try to detail my little success connecting a stand-alone external MPG into Mach4 via the Ethernet Smooth Stepper, using the MB2 (Mach Break-Out Board # 2) from CNCRoom in Thailand.

The main issue here is that the MB2 uses industry standard 24V for all its inputs and outputs.  Which is great for several other reasons, but meant I needed to get things back to 5V, as the MPG is rated at 5V.

I could have used some transistors as they draw less power than the LED in an opto coupler, but I had optos handy, so used them to connect the A & B Phase connection from the MPG into the two inputs in the MB2.  If anyone is interested I will make a sketch and attach as a pdf.

Weerasak from CNCRoom helped me to get the circuit correct, as I had it wired slightly differently and wasn’t getting desirable results.  Now it works like a gem.

I set up the ESS configuration with the two inputs mapped to AUX Encoder 0 Phase A and Phase B.  Then in Mach’s configuration, in the MPG tab, in the first row (Mpg #0) I set Encoder to AUX Encoder 0, Counts Per Detent to 4, I actually just set Acceleration and Velocity to 100%.  That may need some tweaking down the line, but for now it works perfectly.

By default this moved the axis 1 mm per Detent/Increment of the wheel.  I had downloaded a Lua script for a CNC4PC Pendant that Chaoticone had kindly uploaded some time back.  The script was written for 6 axes, so I edited it down to 3 axes and deleted all the stuff that I didn’t think I needed.  I renamed the function to simply MPG.  Hope that doesn’t offend Chaoticone.  And thanks for the script.  It works perfectly.

The Lua script gives you the ability to use a couple of external rotary selector switches to choose your axis to jog and also the speed at which to jog.  0.1mm per Detent, 0.01 and 0.001 mm per Detent.  The script works like a dream and with the speed set to 0.1 mm, I spun the wheel exactly 50 full rotations as fast as I could and it came up spot on at 500 mm, with very little lag.

Things that I learnt.  When running G code the Jogging and MPG are disabled.  But if you hit Feed Hold and then accidentally bump the MPG wheel, the cycle will inadvertently start again.  Not real flash when you realise that.  So as part of the rotary selector switch, it’s a good idea to have an off position isolating the A & B phase connections.

I will attach the Lua script in its modified form as well.  Hope someone can use this, I have taken enough from this forum,… maybe for once I can help someone else.

Craig.

3
Mach4 General Discussion / How to Emulate a Momentary switch?
« on: May 23, 2017, 11:48:32 PM »
Good day to all my fellow CNC enthusiasts.

It’s been a while since I have bugged you all, but here goes.

Is it possible to emulate a momentary switch in the Mach4 screen? Maybe some code in Lua that does a timed active state. I don't want a toggling switch like is on one of the screen sets for the spindle forward, reverse and stop.  It has to pull in a latching relay circuit for a spindle but not stay in an active condition.

Anyone seen anything written?

Craig.

4
Mach4 General Discussion / Lua success with external buttons to Mach4
« on: January 18, 2017, 03:51:02 AM »
Hi guys, I posted a little while back looking for some enlightenment with creating Lua scripts to get all my front panel buttons, MPGs and potentiometers talking to Mach4.

I am very happy to say that I have a large percentage of those buttons working with help of other members of this forum, articles and uploaded scripts.

Matevž from PoLabs did a great tutorial on how to connect up an exterior potentiometer to the Feed Rate Override as well as the Lua script that accompanies it. I copied that for my FRO as well as the Spindle Speed Override and both work very well.

As a quick reference the original PoLabs file from Matevž is in the attached pdf.

For anyone who has an interest here is the link to the PoLabs tutorial.
http://blog.poscope.com/mach4-tutorial-fro-using-analog-input/

Just one thing I can’t get worked out. The below line sets the FRO percentage.

local percent = analog/1*250 --Calculate percentage from 0% to 250%

My challenge is that the Spindle OVR goes from 50% up to 150%.  I have tried many embellishments, but can’t get it happening.  The spindle override must be expressed as a decimal percentage, so the max number is 1.5 (150%) and the minimum is 0.5 (50%).

Does anyone know how to express a percentage range in that line?

Thank to anyone who can enlighten.

Craig Smith

5
Mach4 General Discussion / Lua
« on: January 04, 2017, 11:54:54 PM »
Hi guys, my name is Craig, a boatbuilder in the middle of converting a small Hercus mill to Mach4.

I know Lua is not a new topic, but being new to forums, I don't really know how to go about asking.

Anyway, days I have spent trying to get my head around Lua.  I've read every thread I can find about Lua, watched every video etc., and done as many online tutes as my tolerance will allow.  My rule is, don't ask questions until I've put some time in and my head hurts.

I must say, I am out of my depth and my head really hurts.  I have a lot to ask, but for now just a couple of things which are eluding me.

Can someone enlighten me about what the "mc" that appears in front of mcLua and many other script lines actually means?  And what does API stand for?  Just those two things will stop me chasing my tail quite so much.

Thanks,

Craig

Pages: 1