Hello Guest it is April 16, 2024, 08:36:19 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.


Topics - rbjem

Pages: 1
1
Hi everyone,  I am looking for advise on how to go about programming some files to make them easy to change at the machine. My parts typically have 1-4 holes in them and a slot (this is extremely simplified, but will serve well for the example). Each piece is usually custom so I end up having to make a separate file for, 1 hole and a slot, 3 holes and a slot, 2 holes and no slot, etc... This gets tedious when you have 30+ similar parts that all need multiple configurations.  I could program a file for exery permutation, but would love to have a single file capable of making any configuration of that part.

Essentially, I would like to be able to have a provision to individually enable/disable hole 1, hole 2, 3,  4 and the slot. I was originally planning on using GOTO or IF/THEN statements in the G Code, but then found out Mach3 cant do that.   :'(

I was thinking I could set variables at the start of the code that I can edit to be 1 or 0 (on/off). Then write a macro that calls a variable, checks if true or false and enables/disables block delete to turn off the next bit of code.  I would run the macro before each hole or slot.  

Here is a basic eaxmple of that:
Quote from: G Code
#120=1  (hole 1 toggle)
#121=0  (hole 2 toggle)
#122=1 (slot toggle)

(Cut Profile)
... gcode...
... more gcode...

(DRILL HOLE 1)
#200=#120 (set blockskip toggle for next subprogram call)
M26 (call blockskip macro)
/ G0 X1.5 Y2. (move to hole location)
/ G1 Z0.
/ G2 I-.25
/ G1 Z1.

(DRILL HOLE 2)
#200=#121 (set blockskip toggle  for next subprogram call)
M26 (call blockskip macro)
/ G0 X1.5 Y3. (move to hole location)
/ G1 Z0.
/ G2 I-.25
/ G1 Z1.

(CUT SLOT)
#200=#122 (set blockskip toggle for next subprogram call)
M26 (call blockskip macro)
/ G0 X.5 Y1. (move to location)
/ G98 (slot.nc)

M30


Corresponding Macro:
Quote from: M26
trigger = GetVar (200)   'block skip enable disable variable

IF [trigger = 1]  then turn off blockskip  <-- I know this is not the right command...  have not figured it out yet.
End IF

I tested this out this morning (well not the macro, only the code by manually toggling Block Delete at M0 stops) and found out that I cant enable/disable block skip delete in the middle of a file. It can only be toggled before you start running the code.  So this method seems like it wont work like i had hoped.  :-\

Does anyone have any other ideas on how to individually toggle or skip past different portions of the code in a way that is easily modifiable from the machine? In the above example, I used holes and slots, but the portion I want to toggle could just as easily be a chamfer or a 3d contour.

Maybe I need to go a totally different route, but I am running out of ideas...   Any suggestions would be greatly appreciated.


Regards,
rbjem

Please note that I am not a gcode expert by any means, I know just enough to be dangerous. >:D

2
General Mach Discussion / Macro generated GCode hesitation
« on: January 10, 2013, 05:18:32 PM »
I have made a macro (only after I found out I couldn't do it solely with gcode) to create some gcode, and have an issue with stuttering that I am wondering if anyone could shed some light on. 

First background info...

I am trying to create a helical toolpath so that I can quickly change parameters for different situations.  I have it coded to the macro to: (starting from the bottom of the cut) make a vertical move, helix around at a desired pitch and radius until I reach a certain z height, then exit the cut vertically.  This then repeats after increasing the cut radius by a small stepover. So far I have gotten this all to work.



My issue is that when executing the macro, the machine moves like it is in absolute stop (G61) mode rather than constant velocity.   I am guessing the issue is due to the way the code is calculated for each step, but am unsure if it is due to my code, or if this is a limitation of mach3. When the angle increment is set to a low value motion slows to a crawl. 

Here is the snippit of code that I am having an issue with:
(I made the program in polar coordinates (G16), so Y is equivalent to angle)
Quote
        Do   'Begin helical interpolation
           CURRENT_Z_HEIGHT = (CURRENT_Z_HEIGHT +(PITCH * ANGLE_INCREMENT / 360))  'increment height for this move
           CURRENT_ANGLE = (CURRENT_ANGLE + ANGLE_INCREMENT)   'increment angle for this move 

                CODE "G1 Y" & CURRENT_ANGLE & "Z" & CURRENT_Z_HEIGHT
              
   
           If CURRENT_Z_HEIGHT >= (TOTAL_HEIGHT - FLAT_LENGTH) THEN   'stop at top of helix
                 Exit Do
      
           Else
                 End If

        Loop

This portion executes then is looped back up to the top after incrementing the cut radius.  So essentially I am trying to program a loop in a loop.  Maybe there is a method to do this entriely in a gcode file, but so far it has eluded me. 

Any suggestions, insight, or alternative methods would be appreciated.

3
General Mach Discussion / New computer = weird problems
« on: February 02, 2012, 01:39:25 AM »
My limit/home switches are acting very bizarre.   I have been struggling with this issue for half the day, doing searches, tweaking, testing, repeat but no luck.

I bought a new (to me) computer today and formatted the HDD and installed XP Pro, drivers and Mach3 R3.043.022 lockdown version. I did this because my old computer would freeze every so often (no bluescreen, just completely lock up) and it got to the point where I couldnt handle it anymore.  I have set the parallel port in the bios to EPP mode.

I am using a different Mach3 version, (I was previously on R3.042.040) but am using the same .xml config file.  I am using hall sensor switches and my BOB is from candcnc using their table IO board.

The problem is that the LEDs on the diagnostics screen are showing my home switches going off and on sporadically which is causing limits to trigger when I home it.  My BOB is showing a constant signal, but the diagnostics screen is definitely not showing that.  I have made a video to show what is happening (I disabled limits for this).

http://youtu.be/mqcbvgfKKKI

My original configuration had debounce values at 25 with no problems, and I have incrementally tried up to 10,000 but nothing solved the underlying issue. 

Does anyone have any idea what could be causing this problem?  I will reinstall Mach3 tomorrow unless someone has a better idea.

Thanks,
rbjem
 

Pages: 1