PDA

View Full Version : What do I add to my cut file for a controlled loop?



knight_toolworks
08-03-2007, 12:23 AM
I have a v carve file I want the machine to move down the table a bit so I can unclamp the block and put another in and hit a key and cut another one. What do I need to add to the end of the file to do this? I mean K now what to add to the end to move it where I want. But I don’t want the spindle turning off and removing the turn off command did not stop it.

srwtlc
08-03-2007, 01:20 AM
Steve,

Here's one way that I've been doing that very thing for years. It requires a small momentary button wired into an input. I use the same as the Z-plate (input 1).

REPEAT: 'Place the repeat where you want the file to repeat from.

'Body of part file


WAITHERE:
&TEST=%(51) 'Testing the condition of the input switch. %51 is input 1, %52 is 2, %53 is 3, etc.
IF &TEST=1 THEN GOTO REPEAT
PAUSE .3
GOTO WAITHERE


The machine will stay in the WAITHERE loop until you're ready and push the momentary button to make it continue on.

knight_toolworks
08-03-2007, 01:25 AM
that would be easy as I could just attach the button to the z plate.
now I am not great person at programming. but where is the info on where the bot parks it's self?

srwtlc
08-03-2007, 01:56 AM
Steve,

You can test it with the z-plate if you want by just touching the plate to ground when your ready to continue.

Just before the WAITHERE, put the place that you want the tool to go to and wait. Something like J3,0.0,20.0,2.0. Make sure that the Z axis is where you want it before you jog off to the waiting location.

knight_toolworks
08-03-2007, 02:00 AM
ok then it goes back to the first line of the file?

srwtlc
08-03-2007, 02:23 AM
Wherever you put the "Repeat:" is where it will return to and start again

Here's a sample square cut at a depth of 0.0 and a safe height of 1.0. It will park at X0, Y12, and Z1. When you touch the z-plate to ground (push a momentary button), it will come out and do it again.

When you're done, while it's parked and waiting, hit the spacebar and then (Q)uit. The spindle will then turn off.

One word of caution, never try to insert a command while in the loop by hitting the spacebar and "insert command" and then resume with this little routine, things will go haywire and you'll have to reset your zero point.

SO,1,1 'Router on
PAUSE 3 'Allow spindle to come up to speed

REPEAT:

J3,1.0000,1.0000,1.0000
M3,1.0000,1.0000,0.0000
M3,5.0000,1.0000,0.0000
M3,5.0000,5.0000,0.0000
M3,1.0000,5.0000,0.0000
M3,1.0000,1.0000,0.0000
J3,1.0000,1.0000,1.0000

J3,0.0000,12.0000,1.0000 'Waiting location

WAITHERE:
&TEST=%(51)
IF &TEST=1 THEN GOTO REPEAT
PAUSE .3
GOTO WAITHERE

srwtlc
08-03-2007, 02:27 AM
Another option that I use is have the file ask how many blanks I have to do and count how many times it has done the file and once the count is reached, it parks and stops.

knight_toolworks
08-03-2007, 02:33 AM
how do you set that up?

srwtlc
08-03-2007, 10:40 AM
Here's a file that I use for cutting hangslots on plaques of various sizes along with some preset settings for specialty shape items that I do a lot of throughout the year. If you take a look at it, you can see how the counting is done in each of the various sub-routines.

Maybe you can use it as a template to tailor it for your needs.

Not all variations are completed yet as I've been adding some of the less common ones or specialty ones as I come to them.

I set it as one of the "Custom Cut" files so I can call it with a C#.

If you run it, the option to zero the tool won't work for you as I couldn't call up the standard ShopBot Zzero file because it won't return to where it branched off for some reason.



Hangslotter

7164 (8.0 k)

richards
08-03-2007, 10:50 AM
Steve,

I took the liberty to change the file that Scott Worden wrote for you. You'll notice that there are two things that are different:

1. A counter variable has been added, &count

2. Instead of using a switch, I just added a PAUSE command.

The way the program works is that you initialize the &count variable to the number of parts that you want to cut. Each time a part is cut, the gantry moves to the 'rest' position and waits for you to press the 'enter' key. When the count decrements to zero, the program ends.



SO,1,1 'Router on
PAUSE 3 'Allow spindle to come up to speed

INPUT "How many repetitions for this part? " &count


REPEAT:

J3,1.0000,1.0000,1.0000
M3,1.0000,1.0000,0.0000
M3,5.0000,1.0000,0.0000
M3,5.0000,5.0000,0.0000
M3,1.0000,5.0000,0.0000
M3,1.0000,1.0000,0.0000
J3,1.0000,1.0000,1.0000

J3,0.0000,12.0000,1.0000 'Waiting location

WAITHERE:
&count = &count - 1
IF &count < 1 THEN GOTO FINI

'Press enter when ready
PAUSE
GOTO REPEAT

FINI:
END

srwtlc
08-03-2007, 11:31 AM
Mike,

My reasoning for using the switch is that I never have to go back to the keyboard. Whether I'm doing 10, 20, or 100 plaques/parts, that saves a lot of trips back and forth from the jig/table and the keyboard.

The pause is a good no fuss (no switch to wire and mount) option though.

richards
08-03-2007, 01:02 PM
Scott,
I agree that a switch would be faster, especially if you're working at the far end of the table.

My approach is to use the most simple solution until the process works and then to add modifications to speed things up.

jsfrost
08-03-2007, 01:31 PM
Scott and Mike,

Thanks for solutions to a problem I plan to solve this weekend. From the code examples, it looks easy to code such that it loops on either keyboard or switch input. Operators choice depending on which is easiest.

bill.young
08-03-2007, 01:58 PM
Hey guys,

Be VERY careful about having something like a z-zero plate contact make the tool start moving. If there's an accidental contact with ground...maybe someone bumps the z-zero plate when changing blanks out and it grounds against the frame...the file would start running and it would be awfully easy for someone to get hurt. Even a momentary switch could be accidentally pressed

Maybe 2 momentary switches wired in series, so that both have to be pressed at the same time?

Bill

srwtlc
08-03-2007, 02:49 PM
Good point Bill,

My zero plate is well insulated and away from being bumped as well as my button, but I work alone. I was lazy and used what was available right at the gantry years ago when I first started doing it this way and with my new PRS, when it came time that I needed to get the button working again, I was lazy again.

7165

If you're going to use a button, it would be best to run another wire and use a different input.

beacon14
08-03-2007, 08:22 PM
For files I will be running more than once or twice I usually end up with something like this:


INPUT:

'all my user entered variables go here

BEGIN:

'machining operation(s) here

J2, 72,40 'this is where you put your desired
'parking location or call a Custom Cut
'file to turn off router, dust
'collector, etc.

DECISION: 'here is where the fun starts

INPUT "What now - [R]epeat, [N]ew sizes, [K]eyboard control, re[Z]ero, [0]End", &decision
IF &decision = 0 THEN END
IF &decision = R THEN GOTO BEGIN
IF &decision = N THEN GOTO INPUT
IF &decision = K THEN SK
IF &decision = Z THEN GOTO REZERO 'or call a Custom Cut file for rezeroing

GOTO DECISION 'after any choice is complete or in case of invalid input you go back to the menu"


Here is how I handle the router re-starting issue:


REZERO:

C2 'my customized Z zeroing routine
INPUT "Ready to restart router? 1 to restart 0 to end", &input
IF &input = 1 THEN GOTO DECISION
END 'any input other than 1 (or Enter key with no input) will end the file