Hello Guest it is March 29, 2024, 02:34:09 AM

Author Topic: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???  (Read 5101 times)

0 Members and 1 Guest are viewing this topic.

Offline 2CVer

*
  •  14 14
    • View Profile
I have a router with Mach3 version R3.043.066, SmoothStepper ESS version ESS_v10r2d1d and a PMDX-126 breakout board. This is all running on a dedicated bare bones PC with Windows XP SP3 installed. The machine has been running perfectly with good repeatability and no missed steps. I wanted to install the 2010 ScreenSet from cncwoodworker because it has a really neat set of macros including a couple that make tool changes a breeze. So I installed the screen set, following the installation instructions to the letter. I installed a fixed plate and movable plate on my machine and hooked these up to the correct input on the PMDX-126 and configured the probe in Ports&Pins. So now for a quick test. Clicking the Quick Zero icon in the 2010 ScreenSet initiated a probe and my Z started to move down, but the stepper was clicking as it lost steps. When the tool reached the movable plate it stopped and reversed direction. But, instead of backing up 1mm it carried on backing up to where it started from. Something not quite right here so I decided to look at the M889 macro while Mach3 was still running. The code all made sense and I put a couple of comments in and saved the file. Just out of curiosity I clicked the Quick Zero button again and this time the Z axis moved down without missing steps until it reached the plate and then backed up 1 mm, changed the feed rate to SLOW and went to touch the plate again. After it got the touch it did a G0 to clearance Z exactly as it was supposed to.

So I thought, great - I've fixed it so I shut down Mach3, fired it up again and repeated the test and this time it was not fixed unless I opened and saved the macro file whilst Mach3 was running. I did this test about 12 times and got repeatable results - first time after program start it doesn't work, but if you then open and save the macro code whilst Mach3 is running the macro works correctly every time.

Has any one got any ideas how to track this down. My suspicion is that the SmoothStepper and the ScreenSet are not working nicely together. Or maybe it is the SmoothStepper and Mach3 when executing macro code. I have used the SmoothStepper for hundreds of hours and never had any hint of missed steps until now. This is the first time I have used a macro to generate and execute G-code. Does Mach3 execute G-code in a macro differently to executing it from a file?

Any help is gratefully received so TIA.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #1 on: April 05, 2015, 10:56:34 AM »
There are probably several hundred people using the 2010 Screenset with Smoothsteppers, and I haven't heard of this issue.

There's really no interaction between the screenset and the Smoothstepper, so the screenset shouldn't be causing any problems.

Here's something you can try. Copy all the code from the M889 macro.
Load the default 1024 screenset.
Go to Operator > Edit Button Script, and click on the Auto Tool Zero button. When the editor opens, paste the M889 macro code in there, and click File > Save.
Close and restart Mach3, and click the Auto Tool Zero button.
Does it behave the same way?

The only thing I can recommend is to try an older version of Mach3, like 3.043.062 or 3.043.057. You can get them from the FTP site.
Version 3.043.066 is known to be buggy in some areas.
Gerry

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

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

Offline 2CVer

*
  •  14 14
    • View Profile
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #2 on: April 05, 2015, 11:42:23 AM »
Thanks for the help Gerry. I think you're right. After further testing this afternoon, I've discovered that it is the G31 that doesn't work properly. If I run the following test program that simulates what the macro is doing:

F300
G90 G31 Z-120    (Probe downwards until either the plate or Z-120 is reached)
G91 G01 Z1        (Move up 1mm from the touch point)
F25
G90 G31 Z-120    (Probe downwards again slowly)

With the tool starting about 50mm above the plate, the first probe movement loses lots of steps but does touch the plate, backs-up and re-probes slowly. At the end of the program I zero the Z axis and then jog Z upwards by 100mm. If I then run this bit of code:

F300
G01 Z0.1

This moves the tool smoothly and without losing steps to just above the plate. I can then just get a 0.1mm feeler under the tool (it's tight, but expectedly so). This proves that steps were not lost in the rapid jog upwards and the G01 downwards (unless exactly the same number of steps were lost in both journeys).

My next thing will be to go back to the earlier version of Mach3 as Gerry suggested and see if that fixes the problem.

Offline 2CVer

*
  •  14 14
    • View Profile
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #3 on: April 05, 2015, 01:25:53 PM »
I uninstalled Mach3 version 3.043.066 and installed version 3.043.062 and retested. This did not fix the problem so I went back to version 3.043.057. This version did fix the problem.

As ever, great advice from Gerry - thank you sir.

Now what issues will I encounter that were fixed between version .057 and .066 I wonder???

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #4 on: April 05, 2015, 02:17:30 PM »
According to the change log, it's almost all Lathe fixes.
Gerry

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

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

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #5 on: April 05, 2015, 06:11:28 PM »
When you do anything in a macro that causes movement you should put a 'while ismoving' after it. That pauses the macro until the movement stops and you will get predictable results.

In Mach 3.43.058 and later there was an internal change in how Mach controlled the size of one of the buffers used to talk to the plug-ins. So if you use .058 or later be sure to use the latest SmoothStepper plug-in or things won't work properly. I recommend version .062 as I have seen too many reports of odd behavior introduced in .066.
Happy machining , Jeff Birt
 

Offline 2CVer

*
  •  14 14
    • View Profile
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #6 on: April 05, 2015, 06:27:29 PM »
The macros I'm running were written by Gerry (Ger21) and contain the required While IsMoving() ... Wend code. I did, however, add a sleep 100 in each loop to give windows a chance to grab some clock cycles, although this is probably not necessary in Windows XP, which does multi-tasking properly (unlike earlier versions of Windows prior to NT).

I thought I'd got this fixed, but just done some more testing and I'm losing steps as the G31 is executing. If I move the tool to Z100 (work units) and execute G90 G31 Z20 F300 the tool moves downwards, but with lots of missed steps until it hits the plate, when it stops. If I move back to Z100 and execute G90 G01 Z20 F300 the tool moves downwards smoothly with no missed steps. This problem now seems to have nothing to do with macros. For some reason the G31 can't reliably move in Z without losing steps.

I've tried Mach3 version 3.043.062, but that didn't fix the problem and I'm currently on .057, so I'll go back to .058 and see if that is any better.

Jeff, is there anything in the config of Mach3 or the SmoothStepper that I should look at?

TIA

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #7 on: April 05, 2015, 06:37:52 PM »
I don't think your missing steps has anything to do with the Mach 3 version. It is more likely that it is a mechanical or motor tuning issue. It could even be electrical noise fooling the probe input.

Juggling Mach versions always seems to cause more problems than it fixes. My advice is to stick with .062 and make sure you have the latest SmoothStepper plug-in and driver.
Happy machining , Jeff Birt
 

Offline 2CVer

*
  •  14 14
    • View Profile
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #8 on: April 05, 2015, 07:01:30 PM »
Thanks Jeff, I'll go back to .062. I have the latest SmoothStepper ESS plugin from the Warp9 website already installed.

If the problem was a motor tuning issue, wouldn't it affect the identical G01 motion in the same way? As far as electrical noise is concerned, the wire from the touch plate is just a length of instrument wire that goes to a junction box. The same type of wire is used to pickup the spindle body and it goes to the same terminal block. From there they both go to the PMDX-126 via unshielded 2 core flex. Should this all be shielded and one end earthed?

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Macros cause missed steps with 2010 ScreenSet & SmoothStepper???
« Reply #9 on: April 05, 2015, 07:22:15 PM »
If your not seeing missed steps with G01 then it is probably not a motor tuning issue. More likely noise of wiring related.

So your using the spindle as a common (ground)? That is mixing up AC "earth" ground and DC Common, that is a sure path for noise to enter your system.
Happy machining , Jeff Birt