Hello Guest it is June 06, 2023, 11:17:49 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 - chrisjh

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 »
General Mach Discussion / Re: Mach3 Spindle Speed Problem
« on: September 22, 2010, 10:49:28 PM »
Hi Jaja,

The problem is not associated with Smoothstepper.  It is a Mach3 bug.

I overcome the problem by inserting the following lines of code (or something similar) into every program.

This code is a soft start routine for my mill spindle.

G00 G17 G21 G40 G49 G50 G64 G69 G80 G90 G94 F1000
M6 T6 (Ø5mm Spot Drill)
M3 S750 (Start spindle at 750rpm but spindle goes to approx 850rpm)
G04 P100 (Dwell for 0.1secs)
S1000 (Increase speed to 1000rpm. Spindle goes to correct speed from here on)
G04 P100
G04 P100
G04 P100

M8 (Coolant on)

G00 Z10
G00 X0 Y0 Z3



Hi Jaja,

I have attached my General Config Settings.  This works for me.

I set the debounce to 30.



Hi All,
You will never guess what there are.  My son asked me to make 50 following a trial of 10 made recently.
Made in two parts and screwed together.  I didn't have a suitable 5C Collet for the 3/8” square part so I made a round collet that was a slip fit across the corners of the square bar and them cross drilled and tapped it M6.
Both parts made in my cnc lathe.  Threading was done manually. Material is aluminium which I chromate converted at the end.
I am not 100% sure how they are used myself.

Hi Graeme,

I found the problem with random Feed Rate Overrides.  It was my code!

I was calling CSS (G96) along with Feed/Rev (G95).  This appears to confuse Mach3.  I deleted the G96 call and the problem went away.

However, the problem of spindle speed has always existed on both my mill and lathe.  I have overcome this bug in Mach3 by issuing the following sequence:

M3 S500 (The spindle starts and settles at 640rpm)
G04 P2 (Stabilize RPM)
S500 (the spindle slows to the correct speed of 500rpm)

What I was hoping for was a solution to the spindle speed issue by substituting a "reset" command in lieu of the second S500 command.  I guess that it is not that important as I already have a work around for it.

However, it would be nice to understand why Mach3 behaves like it does with initial spindle speed.



I have had a problem with Mach3 for years now in that sometimes at the end of a program the feed rate override goes to maximum (1500%).  What this means is the next time I run the program, the feed rate is not correct.  I can manually cancel the feed rate override with the Reset Button or reboot Mach3 or manually type in the desired feed rate.  What I want to do is put a feed rate override command at the beginning and the end of all my programs in an attempt to overcome this annoying problem.  I note that there is an OEM Code for Feed Rate Override Cancel Button (1014) but I don't know how to integrate this as a command into my programs.

If this can be done it will solve another annoying problem of Spindle speed going to a initial speed higher than the commanded speed which can also be corrected with a manual press of the Override Reset Button.

What I have in mind is:

M3 S500 (Spindle goes to 640rpm)
Issue Reset Command here (Spindle drops back to 500rpm)
Perform cutting tasks until Program End
Issue Reset Command here (to cancel any spurious Feedrate Override that may occur)

Is there an easy way to do this?



I don't recommend running motors at low speeds because, induction motors do not have much torque at low speeds and, as you have found, the current increases.  You will also find the motor will run hotter for two reasons:

1.  Increased current, and

2.  The fan in the motor will not pump as much air through the motor making the motor hotter again, compounding the problem.

If you need to run something at lower speeds you should use a gearbox or pulley system to reduce the speed and keep the motor revs up.

I have deliverately set the lowest speed of my lathe motor to 20Hz (which equates to approximately 576rpm) to keep the fan pumping air at a reasonable rate.



I too lost some hair and considered biting something really hard!!

I finally cracked it!!

Have a look at my experiences at www.cjh.com.au/PWM Spindle Control using Mach3.pdf

Hope it helps.



Hi All,

I see a lot of queries, especially from novices, regarding methods of Spindle Control.  There are a lot of topics covering this but most do not give a full explanation with examples in one place.  

What I have tried to do is put a lot of scattered info and the benefit of my own personal experience into one document.

Please take advantage of my experiences at www.cjh.com.au//PWM Spindle Control using Mach3.pdf



Hi Budman,
I use a convoluted way of generating the G Code.  Basically I use Solidworks to create my models and generate a dxf (ensuring that the scale is 1:1) of the profile (one each for the LH and RH views).  
I import the dxf profiles one at a time into BOBCAD V21 and use BOBCAD to delete all detail except for the profile of the actual shape to be cut.
Using BOBCAD I put a point where I want X0 Z0 to be using my procedure in red below. This ensures that the profile to be cut is in the correct Cartesian quadrant.

Procedure for moving a known point to UCS origin X0 Y0 with Bobcad dxf files

1.   Open the dxf file in Bobcad.

2.   View All to find the drawing.

3.   Add a point to the position on the drawing that you want to end up as UCS X0 Y0.

4.   Hover over this point and note on paper its exact X and Y coordinates. E.g. X127.574  Y29.236

5.   Select all (I use Control A).

6.   Select Change, Translate, By Coordinates.

7.   Ensure that the end points are all selected as zero.

8.   Into the start point for X, type in 127.574.

9.   Into the start point for Y, type in 29.236.

10.   Press OK.  The drawing should have moved so that the desired new origin point is at X0 Y0.

11.   Save the dxf file with the new origin.

I then use OneCNC to generate the code for OD Roughing and finishing.  I am fortunate that I do some work for several companies that allow me to use their CAD/CAM software.

Threading is simple.  I hand generate the code using the following lines of code:

(Select RH External Threading Insert Mounted On Boring Bar in Tool Block Hole 4)
(Tip to tip measurement between master tool and threading tool is 94.551mm, therefore X offset for threading  tool is 2 x 94.551 = X189.1)
G52 X189.1 Z-7.25 (Temporary Offset Position for Threading Tool Tip)
G00 X14.5 (X Clearance for start of thread)
G00 Z3 (Z Clearance for Start of Thread)
G00 X12.7 (Go to Major Diameter Position)
G76 X11.1 Z-20 Q1 P1.27 J0.1 L0 H0.15 I29.5 K3 C2.5 B0.05 T0
G00 X20 Z50 (Retract away from job)
G52 X0 Z0 F1000 (Cancel Temporary Offset)

The above threading code, even though is written in metric (mm), actually generates a ½”UNF Thread. All I do if I want a different type of thread is to change the major diameter, minor diameter (X11.1), thread length (Z-20), and pitch (P1.27) (All expressed in mm).  The meaning of the G76 line of code is described in the Mach3 Lathe manual and Rich’s excellent guide.

The Peck Spot Drill and Peck Drill Routines are, once again, hand written using Mick Grant’s excellent macros.  All I need to do is copy and paste this from program to program and only change the parameters that need changing.  Example below:

N1925 G94 (Set Rev/min Mode)
N1930 G97 S800 M3 (End Profile Routine Turn CSS off)
N1940 G99
N1960   (Spot Drill routine for Ø10 x 4.9mm Deep Hole)
N1980   (Using Mick Grant's M831 macro of 30Dec09)
N1990   G52 X51.654 Z-25 (Select Ø10 Spot Drill Offset Position X51.654 Z0)
N2050   G0 Z20
N2060   (Spot Drill Routine)
N2070   (Spot Drill 4.9mm Deep in 1.5mm Pecks with a "D" dwell of 250mS at bottom of hole and a "P" dwell of 500mS at the retract position)
N2080   ;M831 X0 Y0 Z-4.9 R1.5 Q1.5 W0.5 P0.5 D0.25 F90 I0 J0 L1
N2090   M831 P2080
N2100   G80
N2110   G90
N2120   G0 Z20 X111.654 (Rapid out and move to safe X position before moving to Drill Position)
N2130   (Peck Drill routine for Ø10.5 x 30mm Deep Hole)
N2140   (Using Mick Grant's M830 macro of 30Dec09)
N2150   G52 X111.654 Z0 (Select Ø10.5 Drill Offset Position X111.654 Z0)
N2180   G0 Z20
N2190   (Drill Routine)
N2200   (Drill 30mm Deep in 2.5mm Pecks fully retracting to Z1 with a "D" dwell of 250mS at bottom of hole and a "P" dwell of 500mS at the retract position)
N2210   ;M830 X0 Y0 Z-30.0 R1 Q2.5 W0.5 P0.5 D0.25 F90 I0 J0 L1
N2220   M830 P2210
N2230   G80
N2240   G90
N2250   G0 Z20 (Rapid out)

I then hand stitch the whole lot together in Notepad to complete the program using some basic templates that I have created or use a copy and paste method for changing similar programs that I have previously written.
The G52 Offsets Positions for each tool in the gang tool block were determined by calibrating the master tool X position by doing a light cut on scrap material, measuring the diameter of the cut and entering this into the X DRO Box. The positions of the Spot Drill and Drill were then easy to determine because I know the hole centres in the tool block. I had to use trial and error to get the threading tool offset correct and all this info now resides in an Excel Spreadsheet printed out on my wall so I never forget each offset.


I'm sure your nephew will be impressed!!  I am.


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 »