Hello Guest it is March 28, 2024, 12:09:05 PM

Author Topic: G4 Dwell Setting _Smoothstepper  (Read 11014 times)

0 Members and 1 Guest are viewing this topic.

G4 Dwell Setting _Smoothstepper
« on: January 01, 2010, 03:50:09 AM »
Hi all,

Can someone confirm what I suspect?

When using Smoothstepper (any Plugin Version) the G4 Dwell units of time in milliseconds is ignored regardless if the setting in Mach3 "General Config" is checked.  I have been forced to express everything in seconds in my lathe G codes, which is not a problem, but annoying.

G4 dwell commands expressed in mS on my mill computer which uses a parallel port, behave as intended when mS is checked.

Just curious.

Regards

Chrisjh

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: G4 Dwell Setting _Smoothstepper
« Reply #1 on: January 05, 2010, 05:52:04 AM »
I can confirm that it is as you see and G4 is in seconds and disregards what you set in General Config.
Hood
Re: G4 Dwell Setting _Smoothstepper
« Reply #2 on: January 05, 2010, 04:43:13 PM »
Thanks Hood.

I was hoping it wasn't something that I had done wrong.

Now that it is confirmed I will ensure that my programs express G4 calls in seconds.

Regards

Chrisjh
Re: G4 Dwell Setting _Smoothstepper - still busted
« Reply #3 on: December 05, 2011, 02:24:57 PM »
It appears this is still broken as of v17efb (2011.10.30) -  Smoothstepper always interprets G04 in SECONDS, even if Mach3 General Config is set to milliseconds.

Can this be fixed?  Seems like it'd be an easy code change.  The smoothstepper was supposed to be a drop-in solution for buggy LPT ports, but now I'm faced with manually diddling MEGAbytes of NC and macro code to get it to work.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: G4 Dwell Setting _Smoothstepper
« Reply #4 on: December 05, 2011, 02:55:55 PM »
It likely can be fixed but Greg is the only one who can say for sure so maybe best asking on the warp forum.
In the meantime you could probably open your code in noteppad and do a search and replace for the G4's, should be able to replace them all in 1 hit if all values are the same.

Hood
Re: G4 Dwell Setting _Smoothstepper
« Reply #5 on: December 06, 2011, 09:28:59 AM »
Greg says it is a Mach issue:

I don't have any control over the dwell commands since Mach interprets the gcode and then commands the plugin. I brought this up to Brian and he was going to look into it. The SmoothStepper can do very accurate dwells if Mach commands it properly. I would ask Brian and see if he can change Mach. Dwells can be implemented as zero-velocity moves, and the plugin doesn't need to do anything. Or he could send a notification and the plugin can send a command to the device to have it delay.

In any case, megabytes of code and macros can be changed from ms to seconds in about an hour, assuming one is DOS-savvy, and with judicious use of grep.  Here's what I did:
1) There are four cases to search for:  "G04 P",  "G04P", "G4 P", and "G4P".   Both your macros folder (and subfolders) and your NC folders (and subfolders) must be searched.
2) Search each with:   grep -irl "G04 P" *.* >go.bat     This puts each filename with the occurrence into a list in a batch file.   (the grep options are "i"=case insensitive, "r"=recurse dir tree, "l" = output only filenames).
3) edit go.bat by putting "notepad " in front of each filename (or use your favourite text editor.  I use Notepad2, which I renamed to n2 for speed in typing). 
4) Run the batch file.   When notepad pops up each file, search for all occurrences of "G04 P", change to milliseconds, and save and close the file;  then the batch file will pop up the next file for editing.

In my shop, G4 is not used extensively, so total edits was manageable.