Hello Guest it is March 29, 2024, 09:40:51 AM

Author Topic: Starting off with MACH4 and Macros  (Read 5452 times)

0 Members and 1 Guest are viewing this topic.

Starting off with MACH4 and Macros
« on: August 15, 2016, 07:18:31 AM »
We are nearing completion of our first CNC router and now need to decide between MACH4 and MACH3.   I know neither, but know people with experience of MACH3 who say that MACH4 does not do macros well.
We have the CS labs CSMIO/IP-S motion controller and two servo motors on the X axis – will MACH4 support a master/slave configuration like this satisfactorily?
The router (designed and built by friends) is designed to be flexible with a variety of different configurations:
•   3 axis main table
•   3 axis low table for extra height
•   3 axis vertical table for cutting tenons in the ends of rails
•   3 axis horizontal spindle on main table
•   4th axis - horizontal on main table
•   4th axis - horizontal on low table (normal, permanent position)
•   4th axis vertical for big "wood turning"
•   2nd spindle small spindle brought into play on a pneumatic ram instead of tool changer
I am assuming that we can create the different configurations in MACH4 and use macros to flip axis orientations, change soft limits, home position etc. 

My big question is are we better going for MACH4 or MACH3 and will MACH4 do all we need?

The secondary question is can we use existing MACH3 macros in MACH4 and save rewriting them?  Or can they be translated somehow?

I hope for replies from several people with positive experiences of MACH4 saying that it will do what we need and do it well, together with some indications of where we might start with these things?

Many thanks

Nick, Acorn Furniture, Wales









Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Starting off with MACH4 and Macros
« Reply #1 on: August 15, 2016, 08:06:01 AM »
Mach3 macros will need rewritten for Mach4.
Mach3's macros are a variant of VB, Mach4's are Lua.

The slaving etc will be determined by the motion controllers (CSMIO) plugin.

At the moment I still use Mach3, several reasons, but the main ones are  that I am familiar with it, it works well enough and I can scrape by with VB scripts for macros etc.
If I can get a grip of Lua and the CSMIO plugin has improved since I last looked, then I may try Mach4 soon on a real machine. At the moment I am just messing around with it on the desktop computer.

Mach4  is a big learning curve for me and Lua especially is going to be a nightmare for me as I am not a programmer and so far it makes no sense at all. VB at least makes some sense to me ::)


So if you are a programmer and think you can cope with Lua then maybe Mach4 is worth a look but test it out first with the CSMIO plugin as I do not know how well that works.

You can also test out Mach3 and see how it goes for you and then decide which one would be best suited to you at this moment in time.

Hood
Re: Starting off with MACH4 and Macros
« Reply #2 on: August 15, 2016, 08:20:14 AM »
Minor correction. Mach4 can support slave motors directly in software.

This does not prevent a plug-in or a hardware device from also providing slaving,
but these are different concepts.

Steve Stallings
www.PMDX.com

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Starting off with MACH4 and Macros
« Reply #3 on: August 15, 2016, 08:52:18 AM »
Steve, would that be dependent on the controller and how it is implemented or could it be forced?
Suppose what I am saying is, would that have to be an option in the motion controllers plugin as to whether you can choose Mach4 or Plugin for the slaving?


Hood
Re: Starting off with MACH4 and Macros
« Reply #4 on: August 15, 2016, 09:09:23 AM »
When Mach4 is providing the slave function in software, the plug-in and motion
device will just see it as two axes that happen to be doing the same thing at
the same time. This should work with any device. The two motors on the same
axis must be configured with the same tuning assuming you are driving the two
ends of a gantry or similar arrangement.

Homing can be a bit more complicated. If gantry squaring using two home switches
on one axis is expected, then there may be additional issues and I have not tested
to see what needs to happen. If only one home switch is used for a gantry with
two motors, just assign the home signal for both motors to look at the same switch.

Steve Stallings
www.PMDX.com

Offline Pedio

*
  •  200 200
    • View Profile
Re: Starting off with MACH4 and Macros
« Reply #5 on: August 15, 2016, 12:03:09 PM »
I am using a gantry style CNC with an 8' gantry. I use the PMDX motion controller and Mach 4. It is simple to set up the slave axis in Mach 4. My motors turn in the opposite directions on the slave and this was simple to assign. Also, once you slave a motor in Mach 4 it will force you to keep the velocity and acceleration for both master and slave the same. Not that I have ever tried to set the master and slave to different values and seen the Mach 4 error box  ::)

It is very easy on Mach 4.

Also, I am no Lua coder, however, I have been able to add lots of buttons and Lua scripts. I tend to find something close to what I want to do and just copy it.

There is a lot of new stuff being made for Mach 4.

I am not sure if this would work for you, but perhaps you could have a different folder with Mach 4 for each configuration of the machine you would want to use. I know you can have multiple copies of Mach4 in different folders. You could have an icon on your desktop for each configuration of your machine. Mach 4 will not let you run two configurations at the same time so it would avoid conflicts or race conditions. I would do something like make the background of the screen a different color so there would be no doubt about what version of the machine the operator was running.

This would seem to be a much easier way to approach the machine you are talking about, however, I am sure the pros on this board can offer a better option.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Starting off with MACH4 and Macros
« Reply #6 on: August 15, 2016, 06:47:11 PM »
Thanks for the info Steve.


Re: Starting off with MACH4 and Macros
« Reply #7 on: August 30, 2016, 04:56:07 PM »
Thank you everyone.  The question has got simpler, for now at least, because MACH3 works and MACH4 crashes on the XP machine we are using :-(

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Starting off with MACH4 and Macros
« Reply #8 on: August 30, 2016, 08:07:31 PM »
Windows XP is 15 years old. Don't expect a modern program like Mach4 to run well on it. Mach4 ideally needs a much faster PC than Mach3.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Starting off with MACH4 and Macros
« Reply #9 on: August 31, 2016, 03:28:13 AM »
I initially had issues testing Mach4 on an XP computer, the specs of the computer are slightly down on what is recommended for Mach4 with regards the CPU, 1.8Gig as opposed to the recommended 2Gig but memory and video card exceeded the recommendations.
I found out that I needed Service Pack 3 and after that it ran fine with one exception. Mill and router are fine but Lathe, although running fine, would not shut down correctly. Mach4GUI.exe was left running in the background and you had to use Ctrl Alt Del to stop it.
  I have since discovered that it is the Canned Cycles loading with Mach Turn that is the problem. I have deleted them from the screen and Mach4 will shut down correctly. In addition I can still open the Canned Cycles via the wizard button and even when opening them that way Mach4 will still shut down correctly, so looks like it is something to do with them getting loaded in the Run Script, when they are part of the screen set, that is the problem.

Hood