Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: oldmechano on October 11, 2010, 01:45:13 PM

Title: custom application
Post by: oldmechano on October 11, 2010, 01:45:13 PM
Hi, I was wondering if I could get some insight into a specific Mach3 application that is not controlling a milling machine or lathe.

The machine I have Mach3 loaded to is a automated stapling machine... it has a fixed staple head (from another machine) using a custom built and designed table (my work) I got asked to load the software and get this machine running correctly.

My steppers, proxy's, and controller were bought as a kit along with the software. I have 2 sliding tables (X,Y) on top of one another and my working head is fixed. The machine acts like a giant sewing machine. My path generation comes from my designs and I can edit on the fly in the software as needed.

I read the instruction manual, which I found to be a bit lacking and on top of that the guy who sold me the equipment is being a bit vague with his "support" because he will make extra $$ if he has to make a service call to sort me out.

I found it strange there would be no troubleshooting guide in the manual - or did I miss that section?

My main issue is my machine head is actuated with an air cylinder running off a solid state relay... I tried to activate it with M3 M5 code but it was extremely slow and did not fire (hooked up to a test light for safety reasons) I tried several variations and when I took the M codes out it fly's!

I was thinking about trying coolant ON/OFF to see if that works... if that does not work is my only other recourse writing a custom macro?

Again, I just hooked this stuff up and only have a few hours running it... mostly head scratching.

Thanks.
Title: Re: custom application
Post by: Hood on October 11, 2010, 03:06:10 PM
M11/M10 may work for you better. What happens is if you have M11P1 output 1 will switch on with very little delay and M10P1 will switch it off,.
However it will not actually switch on or off until you command a G0 or G1 move.
Hood

Title: Re: custom application
Post by: oldmechano on October 11, 2010, 04:06:33 PM
I will try those codes the next time I fire it up... I usually start with G90 G0 before moving to my first location, then I was using M3 M5.

Thanks for the suggestion.
Title: Re: custom application
Post by: Hood on October 11, 2010, 04:26:50 PM
Depending on how your machine actually works you may have to use a couple of dummy axis moves to switch it on and off, eg if you dont use a Z axis you could enable one and have a G0Z0 after the M11P1 and then maybe a G4P* if you need a pause then M10P1 and then another dummy Z move to switch it off.
Hood
Title: Re: custom application
Post by: oldmechano on October 11, 2010, 05:10:46 PM
Yes, I don't use Z axis - there are no Z call-outs in my paths at the moment... right now it is just trial and error.

Mostly I want to see if I can make it work without writing a macro if I can help it.

Thanks for the suggestions - I will implement ASAP and will let you know what works with this particular machine setup.

I can't work on it till later this week because the PC (used) fried the motherboard due to a power surge!

Cheers.
Title: Re: custom application
Post by: oldmechano on October 20, 2010, 10:23:18 PM
So I finally got to work on the machine again after building some parts for it - busy in the shops for a while... I fixed my PC issues and wrote some new programs. I wired in a 110V solenoid to my air cylinder and got it to fire with M3 and M5 but it is still very slow - about 2 seconds on the firing and it does not cycle with my machine head with splits out staples every 1/2 second.

The boards in the controller box are custom wired for one output which is functioning properly, it's just not fast enough... the staple head works on a flywheel/clutch assembly with is powered by a 1075RPM 110V motor - the flywheel engages every 90 degrees of rotation... the staple head is actuated by the air cylinder/solenoid which pulls on a rod attached to the clutch mechanism.

All the mechanics are working great except this delay in the code... the only other issue is getting the proximity switches set up correctly... the home works correct but the other end still touches the switches - I will probably be able to figure that out by playing with it a bit more.

I am not sure if the slow response thru the use of M codes will be resolved without writing a macro... we were also considering using some type of timer on the cylinder similar to what is on some drag racing shifting systems - they are able to control the switching in microseconds of an air cylinder - just a thought.

Any suggestions would be appreciated.

Thanks, Alex.
Title: Re: custom application
Post by: Hood on October 21, 2010, 02:55:06 AM
2 seconds to fire? or are you meaning 2 seconds from start of fire to switch off again? Check you dont have any delays set for spindle on General config page.
Have you tried the M11/M10?
Hood
Title: Re: custom application
Post by: oldmechano on October 21, 2010, 05:54:25 AM
2 Seconds from start of fire to switch of again (M3 with M5 on next line) I will check for delays this morning. I did try M11/M10 but there was no function at all - just skipped right thru without registering any output (running from diagnostic window - stepping thru one line at a time) - maybe something in the way I wrote that code?
I will recheck this morning also.
Title: Re: custom application
Post by: oldmechano on October 21, 2010, 09:08:54 AM
I checked in General Config... I did not see an spindle delay - at least nothing jumped out at me as being wrong. I rechecked my G code path... nothing up with it. M11/M10 are not recognized... it just skips right over those commands. The only program that is currently running properly is with M3/M5 but as I said 4-5 times as slow as what I require.

A few questions:

1) On the diagnostics page there are some M/G code buttons - there is a page that comes up once they are selectted... are those the commands that the software recognizes or are they just for reference? because M11/M10 are not on that list...

2) On the diagnostics page Abs Max XYZ (far right on the page) - can this be reset somewhere to zero all those numbers as in the current position? I am trying to zero my machine head under the work piece and am having difficulties with the software thinking it needs to go to another position outside of set limits... is there a toggle between absolute and incremental?
Title: Re: custom application
Post by: docltf on October 21, 2010, 10:30:20 AM
oldmech

 move your electric solenoid from the air supply to the trigger of the staple gun.this could help with the amount of time used to fire the gun.
it will make the action more positive and easier to control with code.this way you can control a relay for the trigger solenoid with the port settings for
the Z axis and g-code.it would get you some pretty good trigger speed.

bill
Title: Re: custom application
Post by: ger21 on October 21, 2010, 11:37:17 AM
The spindle delay is set in the spindle tab of Ports and Pins.
Title: Re: custom application
Post by: Hood on October 21, 2010, 01:12:35 PM
Please show an example of the code with M11 and M10 in it as it works fine here.
Regards the spindle delay options, my mistake, its on Ports and Pins, Spindle Setup.
Hood
Title: Re: custom application
Post by: oldmechano on October 21, 2010, 02:00:35 PM
Thanks for the suggestions... will try all out within the hour.

sample of code:

G90
N1 G0
N2 X0.0000 Y4.4625 F50.000
M11
M10
N3 X0.0000 Y4.6975
M11
M10
N12 G0
M0
M30
Title: Re: custom application
Post by: Hood on October 21, 2010, 02:24:38 PM
If you read what I said regards M11/M10 you will see you need to command a move before it will actually operate. That is why I suggested you set up a dummy axis. Added to that you need to specify the output which you wish to operate, you do this with the P word, eg M11P1 will switch on OutPut 1 when you subsequently command a G0 or G1 move.
You may also have to introduce a dwell time via a G4 because if you dont then the outpout will be switched on and off instantl;y and your solenoid may never see the signal, you can set the dwell as milliseconds if you wish (General Config page, last column).
For the code to work you would need

G90
N1 G0
N2 X0.0000 Y4.4625 F50.000
M11P1
G0Z0.0001
G4P1
M10P1
G0Z0
N3 X0.0000 Y4.6975
etc
Title: Re: custom application
Post by: oldmechano on October 21, 2010, 06:59:57 PM
Sorry for the confusion... that sample was only one of the versions I tried... I also tried this with no effect :

G90
N1 G0
N2 X0.0000 Y4.4625 F50.000
M11P1
G0Z0
M10P1
G0Z0
N4 X0.0000 Y4.9325 
M11P1
G0Z0
M10P1
G0Z0
N12 G0
M0
M30

I also tried a version of the above only with P1 after the M codes... no G0Z0 - no change...

I think the only difference I see is a slight Z value and it has no G4 dwell in it... was not sure how critical it was... anyways it skipped right over this also... none of the other suggestions worked and I do have the solenoid right at the trigger and only running about 6 inches of airline, so there should be no mechanical delay. I will try exactly what you suggest as code.
I also looked at that spindle setup and again did not see anything glaring... will try to post pic of the screen - working on a minimal PC setup...

Thanks.
Title: Re: custom application
Post by: Hood on October 21, 2010, 07:13:13 PM
As said you will need a delay of some sort between the M11 and M10,  whether that is a G4 or a longer distance on the Z move is up to you which way would work best. I think the G4 would be the easiest as you could change that quickly to find the optimum setting. Again remember on General Config page you can set G4 to be in milli seconds if you wish, so for example G4P1000 would be 1 second.

As for the spindle settings here is where I mean, remember though this will not affect the M11/M10 but just M3/M4/M5.
Hood
Title: Re: custom application
Post by: Hood on October 21, 2010, 07:21:59 PM
Also remember if you are going to use the Z axis to act as the trigger for the M11/M10 you will need to enable it in Motor Outputs.
Hood
Title: Re: custom application
Post by: oldmechano on October 21, 2010, 08:25:44 PM
Tried M11/M10 code exactly as you wrote... still no results and no lights on output 1 on diagnostic page... I have not checked motor output if enabled... here is a screen shot of my spindle setup - everything set to Zero...

I will keep trying but that's it for tonight... it's 8:30 and I have been on it all day - time for a Scotch !
Title: Re: custom application
Post by: Hood on October 22, 2010, 02:14:26 AM
Unless the motor output for Z is enabled it will not work.
If you still dont get it to work then please attach your xml and I will test here with it to see if I can find the issue.
Hood
Title: Re: custom application
Post by: Tweakie.CNC on October 22, 2010, 02:47:00 AM
I have tried various combination of commands in order to switch my laser on and off with the minimum possible delay.
I was getting good results with the M10/M11 combination up until I loaded a later revision of Mach (can't remember the original version number)  when unpredicted results started to occur. Despite a considerable amount of time being spent on various combination's of commands and tests the problem has yet to be resolved. This has led me back to the 'axis direction pin' method of control which is undoubtedly the fastest and most reliable method.

I have described the method I use here http://www.cooperman.talktalk.net/files/27_files/Page652.htm

This may be of some assistance to you if you need to achieve absolute minimal delays in triggering an external control coincident with axis movement.

Tweakie.
Title: Re: custom application
Post by: oldmechano on October 23, 2010, 10:41:58 AM
We had to shut down testing the other day so the machine could be disassembled for painting... my partner's shop is a two hour commute for me to work on it.

I have an XML file I started with the other day - I did save the changes I made before we shut down but I forgot to save the latest to my USB key before I left for the day. I got the machine to home and zero repeatedly and I also set my soft limits to be in the correct range after uncoupling the motors and jogging into that range manually.

I have to rewrite some new G code because we changed some fixtures around.

I need to get all this sorted out by Tuesday morning when I go back to the shop. If you could look at this XML that would be great because I am just starting out on this software and slowly learning it... I had no idea how many setup parameters there would be with this package before we bought it - I thought it would be much easier! Any help would be appreciated.

Here is what I started with yesterday:

Title: Re: custom application
Post by: oldmechano on October 23, 2010, 10:50:22 AM
One other thing - I also need to know how I can lock off the software within the screen so no one can mess with the settings once I get it all set up... I can lock the Windows with a password, but I need to be able to lock that XML down so all my operator can do is run different G code programs.

This machine is going onto a plant floor but will be run on a limited basis (prototype testing) and not on a full production basis so there will be all kinds of people capable of screwing with it when were not around.

Anybody have an idea?

PS - once I get it all finished I will post some pictures or video on this site once the owner gives me permission.

Thanks.
Title: Re: custom application
Post by: Hood on October 23, 2010, 02:36:28 PM
Just tried with your xml and it works fine but you will have to enable the Z axis.

There is an option on General Config called No System Menus (or similar) that will hide all menus after you have restarted Mach. What you will have to do though is make a VB button on your screen so you can switch them back on. The VB would be DoMenu(1,3)  That will open General Config and allow you to change the setting back and then you can restart and the menus will be there.
You can if you wish make the button invisible so that no one but you knows its there.
Hood
Title: Re: custom application
Post by: BR549 on October 23, 2010, 03:01:50 PM
You canlso use the LOCK/UNLOCK feature in Mach.Look under the operator tab.When you LOCK it mach lets you set a passwaord to UNLOCK it.

It locks out any changes by an operator.

Hope that helps, (;-) TP
Title: Re: custom application
Post by: oldmechano on October 23, 2010, 03:44:10 PM
OK under Pins N Ports/Motor Outputs - When I enable Z with a green check mark do I also have to specify step pin # and dir pin #? what is that? and do i have to enable a Z home? seems confusing because my Z is a dummy axis...

I can't check M11/M10 till I get back to the machine on Tuesday...

As far as locking out the settings - I need my operators to be able to load 3-4 different G code programs... will they still be able to load programs from the file menu?

I will try the Lock feature here at home on my PC.

Thanks.
Title: Re: custom application
Post by: oldmechano on October 23, 2010, 03:59:40 PM
I think I just answered one of my questions on my own... the lock feature allows loading programs, but locks out changes being made to the setup- great.

Now I need to only show one screen... Is it possible to only show the Program Run screen?

There is a screen discussion sub forum, I will look in there to start...
Title: Re: custom application
Post by: BR549 on October 23, 2010, 04:54:09 PM
I am not sure what this meant BUT

" I got the machine to home and zero repeatedly and I also set my soft limits to be in the correct range after uncoupling the motors and jogging into that range manually."

The softlimits are set BASED on the Ref/ home position.In the way you did it it might not be the same next time you start up and ref home.

Normaly you startup mach, Ref/Home the machine .  Then the softlimits are based on the Machine Position Values.

Just a thought, (;-) TP
Title: Re: custom application
Post by: Hood on October 23, 2010, 05:07:25 PM
I think I just answered one of my questions on my own... the lock feature allows loading programs, but locks out changes being made to the setup- great.

Now I need to only show one screen... Is it possible to only show the Program Run screen?

There is a screen discussion sub forum, I will look in there to start...

Yes, easy to do, download  Screen4 or MachScreen and open the screenset you are using then delete all the buttons that take you to the other pages, you will have to press and hold  shift key first and then you can click on the button then when selected just hit delete on your keyboard. Once you have removed the buttons you can then save the screenset as a new name and when in Mach you use the view menu then load screens.
If you dont wish to actually delete the buttons you could change what they do by selecting them by Ctrl and double click then change the OEM to 1 for each. What that will do is when a button is pressed it will stay on screen1 which is programme run.

Hood
Title: Re: custom application
Post by: Hood on October 23, 2010, 05:41:13 PM
OK under Pins N Ports/Motor Outputs - When I enable Z with a green check mark do I also have to specify step pin # and dir pin #? what is that? and do i have to enable a Z home? seems confusing because my Z is a dummy axis...

No, just leave port and pin as zero and no need to set up a home for Z.
Hood
Title: Re: custom application
Post by: oldmechano on October 23, 2010, 07:39:00 PM
Great - Thanks for all the info...

I am really learning a lot on this first build and hope all of this will be used the next time we retrofit a machine... we have plans to build a few more for personal use - mill, lathe, plasma

Now I can't wait to get back there and sort this out!

Cheers, Alex.
Title: Re: custom application
Post by: oldmechano on October 26, 2010, 06:17:43 PM
OK - So I am back at the shop today... Got to give props to Hood - that M11/M10 worked a treat once I had Z axis enabled... set G4P0.00001 and it fires my air cylinder like a paintball gun.... Thanks Hood - your the MAN !!!

We did some testing - no problems... exactly the way we need it. We then had to shut down to do some electrical hook ups... fired back up and now a huge problem ! lost the former setting even though we saved at exit... now on the diagnostics screen our pins/ports are not lit up even thought we have settings on that page? is this a hardware problem?

My controllers are lit and my parallel port is lit... is it possible there is a communication problem with parallel port?

I have rebooted and I still can't seem to home the system... I can jog and zero but it won't home - I think I can get all my home and limits back but I was under the impression that those LEDS on that diagnostic screen had to be lit up... if the motors are moving I should have LEDS on pins n ports on the diagnostic page - no?

Any help appreciated...

This seems to be our last hurdle - I got my screen minimized to a run only screen and locked out so if I can get back all my former setting it will probably run good again.

Title: Re: custom application
Post by: oldmechano on October 26, 2010, 10:24:37 PM
Well... getting pretty good at solving my own problems... I reloaded Mach and used my last know XML with the "good" settings from "latest documents" file on the PC - that got me back to having the LEDs on my Pins N Ports current state in diagnostics. Now it is running like a champ again but it seems like it needs frequent reboots - I have no idea if this will be stable enough for a real plant environment... we will see, after Friday it's out of my hands  ;D

I would still like it to fire faster as any move laterally (X direction cross table) puts my staple slightly off because the tables are moving faster than the head can fire causing the pattern to shift. I either speed up the fire rate or slow the tables down to get them in sync... the problem is the patterns I am doing are 900 code lines long - about 1 min 20 secs, which is a pretty long cycle time in a manufacturing plant... so there is no choice but to fire faster.

To fire this faster I went from G4P1 to G4P0.00001 - this made a big difference... but I tried P0.000001 and there was no difference... should I just keep adding decimal places? or is there another setting I should tweak?
Title: Re: custom application
Post by: Hood on October 27, 2010, 02:59:38 AM
I dont know what the minimum is for a dwell but I suspect is will likely be 1 millisecond, so going more on the decimals is unlikely to help.
Hood
Title: Re: custom application
Post by: oldmechano on October 27, 2010, 05:52:27 AM
Yes, I had a feeling that was all there was... I guess I has found the machines limits - normal when combining machinery with electronics.

Thanks for all your help.

Cheers, Alex.
Title: Re: custom application
Post by: Hood on October 27, 2010, 07:29:15 AM
Wonder if adjusting your motor tuning may help a bit here, what rapids and accel do you have and what feed are you running in your code?

Hood
Title: Re: custom application
Post by: kf2qd on October 27, 2010, 10:33:22 AM
You might need to put what I call a reset circuit between Mach and the stapling machine. As it is flywheel driven and will repeat if the solenoid is held in. It would need 2 relays, with the second 1 wired as a latch. Relay 1 is just on off from Mach, Relay 2 is latched by a switch that is tripped as the staple head starts down. Use a noramlly open contact on the first relay in series with a normally open contact from the second relay.

    signal from MACH             Coil from Relay 1
|------| |----+----------------------------------( )-----|
|             |                                                       |
|             |   Switch on Head         Relay 2           |
|             +---------| |--------------+---( )----------|
|             |                                  |                    |
|             |     N/C on Relay 2        |                    |
|             +----------|/|-------------+                    |
|                                                                    |
|           N/O Rel 1      N/C Rel 2      Solenoid      |    
|---------------| |-------------|/|---------( )-------|
Title: Re: custom application
Post by: oldmechano on October 27, 2010, 11:42:15 PM
WELL... We had a surprise visit from the machine owners today at our humble two man shop... we did a trial sample run and they are very satisfied with the machine and the product output - I can't divulge the real product output because of liability issues, but they have been in business for 100 years and were surprised by the output they have gained thru the Mach3 software... we had the machine running at the limit that is possible with 30 year old hardware hooked up to new generation software...

I am not sure at this point they seemed to be worried about the speed - 7 seconds for the small sample and 50 second for the big sample... they are more worried about the complexity of the software and who they can trust to operate it... again, they are going from a manual input to a computer controlled repeatable output - no comparison in there eyes... they are not worried about the machine, but they seem to be worried if the operator can keep up with the product loading demand !

I am running the recommended speeds and feeds, at this time the trigger speed and flywheel output are almost matched on the product samples. I am running point to point with only minimal "phantom staples" - start to finish (M11 start with X,Y lines then M10 end) dragged extra staples into the sample which were undesirable to the customer.

I may play with the motor tuning if I have time... they are planning to ship it out 2000 km East of me in 2 weeks time, and as a designer/programmer I will not have any further direct contact with the machine past tomorrow. I might only be called on to produce programs from my basement office half a Continent away...

I would like to thank everyone who replied to my humble pleas for help and congratulate Mach on supply low cost competitive multipurpose software.

In the future I hope I can post a results thread on this project, but at this time I am limited contractually not to disclosure any information for legal purposes.

Cheers and a toast to all forum members and hosts !

Thanks, Alex.

PS - Hope to post on another project soon...
Title: Re: custom application
Post by: Hood on October 28, 2010, 02:54:57 AM
Sounds like it worked out :)

Look forward to the next project.

Hood