Hello Guest it is April 25, 2024, 08:08:31 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.


Messages - sittinduck

Pages: « 1 2
11
General Mach Discussion / Re: Flatten my G-code
« on: July 10, 2013, 09:02:29 AM »
That's correct.  I'm fine with 100,000 lines G-code if it's auto-generated by a Mach3 pre-processing step and the comments are passed though to the flatten G-code.   The only time this wouldn't work is when my G-code calculations rely on variables that are set by Mach3, like the G31 probe variables #2000, #2001, #2002.    Also, flattened G-code programs will allow the Mach3 feed hold feature to function properly inside subroutines. 

Would anyone else find this useful?

I have it working in VBA, but there's nasty bug in CB calling recursive function that erases my CB local variables.  It's like there's a maximum depth for CB recursive function calls, beyond that it starts overwriting the stack and erases some CB local variables.  Very strange.  That's why I wish the Mach3 people would do it.


12
General Mach Discussion / Flatten my G-code
« on: July 08, 2013, 10:42:14 AM »
Is it possible Mach3 show a "flattened" view of my G-code program?  For example:
- all subroutines expanded
- all variables resolved
- all comments retained
- all calculations and variable assignments removed

The attached trace shows an example.  I think it is easy to reads.

13
General Mach Discussion / Re: Intermittent macro weirdness
« on: April 05, 2012, 07:43:59 AM »
I wish Mach would fully document when the waiting must be done, when calling the Code() function from a CB macro.  Clearly, if your CB macro depends on DRO values, you should wait for the machine to stop moving before reading those values.  Otherwise, it would seem it's perfectly safe to queue up all possible Gcode instructions... but this is a wrong assumption.

14
General Mach Discussion / Intermittent macro weirdness
« on: April 04, 2012, 11:17:28 AM »
I have a macro for single-profile thread milling that experiences an intermittent bug.  I've seen it randomly switch from incremental to absolute positioning.  My workaround is to pre-generate the thread milling Gcode, then it works 100%.  Attached is the Gcode that calls my VB macro (M5001.m1s) for thread milling.  And also attached is the Gcode produced by this macro.

I think the problem is that I don't wait for the machine to complete a Gcode instruction after calling the Code() function.  It's really not necessary and would only slow down the overall operation.  I used to have it wait after each Gcode instruction, but then the machine would momentarily pause at times.  It bothered me, so I removed all the waiting, now I've got this bug. 

Just before my VB macro exits and returns control to Mach3, it waits for the machine to stop moving.  This is the only wait in the macro.  I believe at some point during the operation it is switching to G90 (absolute positioning) where my Gcode is depending on G91 (incremental positioning) to be active.  It seems like it might be running a G90 instruction out of order, since that's always the last instruction executed.

Until I figure out what exactly is going on, I will continue to pre-generate my thread milling Gcode.

15
General Mach Discussion / Re: Gcode logging/tracing
« on: March 14, 2012, 09:15:29 PM »
A Gcode audit trail would generate a timestamped trace file each time a Gcode program is run.  I would only look at these files in case of a problem or machining error.

Yes, the loaded Gcode program could be interpreted by a VB macro once the measurements are known, to generate a simulated Gcode trace file.  However, the subroutines would need to be expanded because there's math inside them also.  I sometimes do incrementing or counting inside the subroutines.




16
General Mach Discussion / Re: Gcode logging/tracing
« on: March 14, 2012, 08:01:29 PM »
So is it possible to intercept the Gcode before it's sent to the controller?  I need an audit trail of all Gcode instructions with parameters resolved to values for the purpose of hunting down errors.  As you can see in the attached NC, it's hard to tell what the Gcode program actually did since most of the calculations are based on a measurement that's not known until the program starts.

A parameter is the # character followed by a number 1 to 10320.  Previously I referred to these as variables.  These are what need to be resolved to values in a Gcode trace, audit trail, or whatever you'd like to call it.

Can this be done with a VB macro, or does it require the Mach C/C++ SDK?  If someone points me in the right direction, I'll figure out the rest.  Thank you.



17
General Mach Discussion / Gcode logging/tracing
« on: March 13, 2012, 08:24:54 AM »
Is there a way to log or trace all Gcode instructions to a file?  Many of my Gcode programs use variables, and I would to see the actual Gcode instructions with the real values (not variables).  Attached is an example Gcode program.  It measures the inside depth of a part, then cuts a slot in a single CNC operation.  It's nice to have a record of the actual Gcode that got run.  Maybe an option to allow all Gcode instructions to be written to the Teach file?  The Mach3 Teach facility currently only logs Gcode instructions run from the MDI window and macros.

I have also done the same with a macro using my own custom logging and tracing, but that seems to be more complicated than necessary.  

In the attached Gcode program I need to see the actual Gcode instructions that got run, after the variables have been resolved.

18
General Mach Discussion / Re: Feedrate for 4th-axis rotary table
« on: August 19, 2011, 04:42:07 AM »
Al,

I thought it might be done with the C-axis too, however, in the latest version of Mach3, there's a place to specify the axis of rotation (X, Y, or Z) for the A-axis.  It's under Config->Toolpath->Axis of Rotation.  I don't think it is extra work for the Mach team, since they would simply plug in different axis DROs to the same feedrate formula, as follows:

X-axis rotary feedrate in deg/min = (360 * IPM) / (2 * PI * (SQRT(Z^2 + Y^2) - T))
Y-axis rotary feedrate in deg/min = (360 * IPM) / (2 * PI * (SQRT(Z^2 + X^2) - T))
Z-axis rotary feedrate in deg/min = (360 * IPM) / (2 * PI * (SQRT(X^2 + Y^2) - T))

OK, the following g-code is a example of "turning" the outer diameter of my part.  It will "plunge" sideways at 5 IPM, then rotate 360 degrees at 5 IPM, and repeat.  However, I must specify DPM (degrees per minute) for A-axis moves, instead of IPM (inches per minute).  The conversion is done with the formula (above).  It assumes Mach3 is zero'd to the center of rotary table.  I used a MS Excel app to generate the g-code.  However, Mach3 could very easily do this math, and probably should be doing it.

Code: [Select]
;TURN OUTER DIAMETER OF PART
;TOOL RADIUS IS 0.15625
N14 X0.469 F5
N15 A-360. F915.9997
N16 X0.4665 F5
N17 A-720. F923.5297
N18 X0.4639 F5
N19 A-1080. F931.1845
N20 X0.4614 F5
N21 A-1440. F938.9673
N22 X0.4588 F5
N23 A-1800. F946.8812
N24 X0.4563 F5
N25 A-2160. F954.9297
;FINISH
N27 A-2520. F954.9297


Rick

19
General Mach Discussion / Re: Feedrate for 4th-axis rotary table
« on: August 18, 2011, 07:32:57 PM »
I want to turn inner and outer diameters in a single CNC program.  In the attached photo I would be turning to a specific outer diameter.  The Y-axis DRO is always zero.  The Z-axis DRO is set to bottom of stock.  The A-axis rotates 360 degrees counterclockwise, then the X-axis DRO steps to the left 0.005", and the process continues until 0.02" stock has been removed.

If Mach3 cannot do it, I can just put the feedrates in the g-code when I generate it.  There is no interpolation to worry about.


20
General Mach Discussion / Feedrate for 4th-axis rotary table
« on: August 18, 2011, 06:19:32 PM »
Mach3 has worked great with my 4th-axis rotary table, rotating around the X-axis.  Now I have repositioned the rotary table to rotate around the Z-axis.  Then set Config->Toolpath->Axis of Rotation to "Z-axis".  However it is still using the Z-axis DRO to calculate the feedrate, when it should be using the X-axis DRO.  Has anyone gotten Mach3 to correctly calculate the feedrate for a Z-axis rotary table?

The calculation from IPM to DPM would be something like this:

Z-axis rotary feedrate in deg/min = (360 * IPM) / (2 * PI * (SQRT(X^2 + Y^2) - T))

where:
IPM is the desired feedrate in inches/min
X is the X-axis DRO
Y is the Y-axis DRO
T is the tool radius
PI is 3.14159...

Does my formula look correct?  Is it possible to input this formula into Mach3 anywhere?

Thanks, Rick

Pages: « 1 2