Hello Guest it is April 17, 2024, 09:26:29 PM

Author Topic: Cycle start controlled by VB and axis scaling  (Read 5796 times)

0 Members and 1 Guest are viewing this topic.

Cycle start controlled by VB and axis scaling
« on: April 06, 2014, 11:48:57 AM »
Good day all
I have retrofitted a Italian cnc router with Mach and CSMIO-IP/A. All works very well but the actual applications that used to be on the old controller. The machine has a left and right zone for machining. The left run under normal condition and the right zone seemed to be a G55 offset and x axis scaled to -1. Now, I need to create three buttons with three LED's, the first for left zone, the second for right zone and the third for both and when one of the three is enabled it will disable the other active one. How the machine use to work with the old controller, if say both zones were enabled you will be able to load the right zone's vacuum table with the board, clamp with foot pedal and while the left zone was cutting, you could press the cycle start button again which will lower the right zone's pneumatic stops (which you use as reference) and as soon as the left side has finished cutting, the cycle wil start again but now scaled to -1 on x with g55 offset, while machining the right zone, load the left zone, clamp and push cycle start while right zone is cutting and the hole process will repeat itself on the left zone. My first issue is, how can I get the cycle start to start again when the button is pushed during an active cycle busy cutting say on the left zone, finish the cycle, change offset to say G55 and x scaled to -1 because of the VB in the active button and run again but now with all the new data and machine on the right zone. Second, what type of VB can be used to do all this, third will the cycle start button still be controlled with oem trigger 1000 or just VB or both?  ???

This is quite a mouth full but I have to add this to complete the project as this is the main reason why the company bought these machines in the first place. Company that manufactured the routers has gone bankrupt, no more spares or upgrades on these machines.

Just a quick fourth question, do I need to have part of the VB in the macropump to constantly look for change in condition like for instance pushing the cycle start button again while busy with an active cycle or can all this be done with the VB in the buttons?

Kind regards and looking forward for some ideas that I can use
Cheers

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Cycle start controlled by VB and axis scaling
« Reply #1 on: April 06, 2014, 03:07:41 PM »
Honestly, I don't think Mach3 will recognize a second push of Cycle Start while g-code is running.

I used a similar machine for many years (Masterwood 327) at my previous job. There's a reason that those types of machines all use proprietary custom controls.
The Masterwood had separate Cycle Start buttons for each zone.

Here's what I might do.

Add an LED that you'd enable when you plan on working in "dual zone" mode. Add a button to toggle it on/off.
Add another LED to determine Left or Right zone as active.
Create an M Code to monitor the LED's. The M Code would be at the beginning of all your g-code.
If the first LED was off, then the M code won't do anything, basically allowing Single Mode operation.
When on, it would check which zone was active, and do the -1 scale and G55 when needed. It would also toggle the active zone LED so that the next cycle ran in the other zone.

So basically, every other program would run in opposite zones. But you only have one cycle start button that you'd need to press after each cycle finishes.

I'd also add an M-Code at the end of your g-code, to send the machine to specific park positions at the end of each cycle, to keep the opposite zone clear for loading. It would again look at the active zone LED, and send the machine to the appropriate location at the end of the cycle.

Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Cycle start controlled by VB and axis scaling
« Reply #2 on: April 08, 2014, 05:36:15 PM »
Hi Gerry

Thanks for the reply, that's what I thought. Luckely all the g-code on this machine will be done via Artcam, I will put the two M-codes in the Header and footer of the post processor. The good thing about it running via M-code in the cycle rather that macropump is that the outputs that needs to be turned off during the cycle start can then be done right at the start of each cycle, no delay. Correct me if I'm wrong, each zone inputs and outputs can then be switched with each zones button as well. Ex, if starting the right zone, the M-code look at the state of the LED, DoButton *** for right zone G55, scale x -1, which will be handled via the zone button and then DeactivateSignal (Output***) to switch off the pneumatic stops and then the cycle will get going.

Cool, I'm gonna do some playing on the weekend. Will keep you posted and if all works out, I will post the scripts here for other users to give a try.

Thanks again
Gordon

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Cycle start controlled by VB and axis scaling
« Reply #3 on: April 09, 2014, 12:15:23 PM »
I'm not exactly sure what you're describing.


However, what may be simpler is creating two cycle start buttons, and have the buttons set the offsets and scaling before executing the Cycle Start. This might actually be easier, provided you don't click the wrong button.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Cycle start controlled by VB and axis scaling
« Reply #4 on: June 09, 2014, 12:36:13 PM »
I am trying to do much the same thing for a horz. boring machine.  Coding the button pushes for the cycle start.....capturing the sequence or order in which the cycle start buttons were pushed and executing the cycle start(s) in that order.  Tough for me to get my head around,  Woodworker YES.....Programmer Hell NO.  Can anyone further this discussion?
Re: Cycle start controlled by VB and axis scaling
« Reply #5 on: June 10, 2014, 02:19:38 AM »
Good day

I have an idea how I am going to do this. I am going to ad one button and two LED's to the Mach main screen, one LED will be labled Left and the other right and I will use the button to toggle between the LED's. The company that I did the retrofit for uses Artcam to do all their toolpaths, so in the Artcam post processor I will ad a M code which for every toolpath which will then have the M code in the start of the g code. The M code will have a small macro to look at the state of the LED's. If left LED is active then call G54 with normal workoffset (left), if the right LED is active it will then call a second offest say G58 and then scale the x axis to cut in the opposite direction, now there is a tricky part in the way that I'm going to do this. In the bottom of the toolpath it will have a second M code where when the cycle is completed it will call a DoButton to change the state of the LED after each cycle. Now I'm thinking of adding second button and LED which will lock/unlock the left LED or right LED, this will then give you the option to toggle to left side and lock it there or vice versa, if unlocked you will then have the option to run both sides (each time you press cycle start it switches sides call by the M code.

Hope this helps, it's all still just an idea as I am only finishing the toolchanger this weekend and will then get to this part.

Cheers
Re: Cycle start controlled by VB and axis scaling
« Reply #6 on: June 10, 2014, 02:23:34 AM »
I forgot to mention that when the machine changes from right to left and the M code calls a G54, it will also have to scale the x axis back to +1. I haven't tried this yet but I presume that the scaling from +1 to -1 and back has to happen in the same spot, not sure

Cheers
Re: Cycle start controlled by VB and axis scaling
« Reply #7 on: June 10, 2014, 12:28:11 PM »
Sounds like we are looking at similar options!  I think the mirror image and offset is conceptually straight forward (how you choose to code it may vary).  The challenge I face is four (yes 4) stations: 1left(reference), 1 (mirror, offset) right, 1 (mirror, offset) center right, 1 ( offset) center left.  The four stations will be activated in a random order.  So the question is how to capture the order in which the buttons were pushed, then run the program(s) in that order then clear the order as the part programs run and add new part programs (cycle start button pushes) into the order.

Thoughts:

Use counters (timer) The largest number gets run first...program runs...then ends...sets timer to 0...find the next largest counter number...runs that program. and so on....

-4 Counters would be attached to 4 DROs, the DROs would get set (coded) by button pushes (cycle start) Stations 1,2,3,4.......
-Macropump analyzes and finds the highest counter number and runs the program.
-M30 with VB code to clear the counter and the DRO button code.
-??? how to set the "next" button push to a cleared DRO???


Other Suggestions or options?

Thanks

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Cycle start controlled by VB and axis scaling
« Reply #8 on: June 10, 2014, 01:01:26 PM »
Just use 4 physical buttons at the machine. Each button would call the offset, scaling (mirror), and then Cycle Start.
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Cycle start controlled by VB and axis scaling
« Reply #9 on: June 10, 2014, 01:36:33 PM »
Yup, got it!!! Buuuut: the rub is I don't want to stand at the machine and wait for the first program to finish and then load the next piece and push the the cycle start.  The idea is to be able to load parts at all four stations in a random order and have it machine all four parts in that order with out intervention in addition as one part finishes be able to load another.  This is for continuous machining AKA pendulum processing.  This might be a big request but seems doable.  I do not know the limits of Mach and/or VB and perhaps "Brains" maybe a better option.

Thanks for the quick reply!!!