PDA

View Full Version : Saving machine settings between sessions



Neale
05-05-2014, 04:54 PM
My current CNC router is really quite slow. I'm cutting some 3D shapes at the moment which can take about 12 hours, although this is partly because what I'm cutting is fairly fragile and can't support fast or heavy cutting. Because I don't trust the machine to run by itself for long periods (I leave it running to go into the house to make a coffee, but drink the coffee in the garage because I'm not happy to leave it much longer) I pause LinuxCNC and stop the spindle if I need to leave it, say, overnight, until I can recommence. Although I can note the gcode file line number and go back to a specific line, I still can't shut down the control PC because I shall lose my current machine position. No, I don't have home switches, and I'm not sure if those would give sufficient repeatability anyway.
I'm wondering what other people do, and if, say, Mach3 can be configured to save machine position and pick up again from cold as long as the machine hasn't moved. Actually, I'm not absolutely sure that LinuxCNC couldn't do this, although I haven't seen anything about it.
I'm expecting answers along the lines of:
- if you built a decent machine, you would trust it run unsupervised (and that's just one reason I'm building a Mk2);
- if you built a decent machine, you could cut fast enough that you could do a job in a single session (see previous point, but also first sentence above);
I'm still wondering whether to go Mach3 for the Mk2, partly to allow use of an external motion controller and get away from parallel port issues, and occurred to me that this might be another reason.
This question was also prompted by the fact that my PC just stopped during a cut earlier this afternoon and refused to reboot. I blew the dust out, reseated everything, and it rebooted. I've lost the home position anyway, but it started me thinking about controlled shutdown.

Thoughts, comments?

deisel
05-05-2014, 05:18 PM
I don't know anything about Linux and not much more about mach but if you make a note of the code line you pause it on then send/jog it back to its start point of the job before shutting down can you not then enter the code line you want it to resume from insuring the machine picks up where it lt left off.
in mach I pause then use the run from here button on the screen a lot,

gavztheouch
05-05-2014, 05:41 PM
If you have stepper motors they may jump a lot of steps when you power them up. You could pause the g code, note the program line number then move to 0,0,0. If possible you could clamp the axis in position so they don't move when you power up the next day.

routercnc
05-05-2014, 09:45 PM
I'm not totally sure but I think if you jump part way into gcode from a cold re-boot it might not carry on correctly as feedrates may not be set (they may have been set a few lines earlier) and some gcode lines may only contain the minimum commands assuming the previous ones have just been processed. I have tried to jump into gcode previously and have various problems, although can't remember specifically what happened.

I know this doesn't apply to long 3D work, but all my jobs are split into short gcode operations, such as drill a hole, profile a shape, etc. If something goes wrong I can hit e-stop and rewind to redo that specific operation.

If I can't machine the complete part in one session I jog (MDI > g0 x0 y0 z-20) to X0, Y0, Z-20, then switch off. When I quit mach3 it asks if I want to save the fixture, which I say yes, but it never does so on the next session I set the coordinates to 0,0,-20 (local coordinates, not machine coordinates) and I'm ready to continue.

On really important work I've fixed DTIs to the X and Y axis, positioned at -10,-10 relative to the origin of the part to be cut. They are out of the way for normal machining, but if it all goes wrong I can jog back to 0 on the DTIs, set the coordinates to -10,-10, and re-run the code.

EddyCurrent
05-05-2014, 10:22 PM
The home switches create a zero for the 'machine' coordinates but you could create one yourself.
If you positioned the machine where you think the home switches would be you could measure the X,Y positions using a vernier for example and call that zero. Now on subsequent days you just have to jog it into the same position and zero the axes, Z is just set to top of stock normally so that's repeatable. (just noticed 'routercnc' said the same thing)
I don't know about Linux but with Mach you can run it from a particular line in the G code but keep in mind that you may have to start the spindle manually because the line of code that starts it may not be present at your start position.

Neale
05-05-2014, 10:42 PM
Not only don't I have home switches, I don't have any automatic spindle control, so I'm quite used to starting it manually! In the past, I have used the "move back to machine (0,0,0)" technique at the end of a session to save having to tweak things at the start of the next - just need to hit "manual home" on the 3 axes and I'm ready to go. Hadn't thought about doing this if I have to pause a session, but will need to note machine/work offsets and current gcode line number. Point about missing out bits of header noted, but in practice I couldn't necessarily jump back to the line where I stop as I need to make sure that if, for example, it moves X only then I have to make sure that Y and Z are correct first, so going back slightly earlier in the file may make sense. Not a big deal to manually type any feedrate-type parameters first. Not sure what things like default for G64 are with LinuxCNC but I can look that up. LinuxCNC also lets you start from any line.
Thanks for comments, guys. Sometimes you need someone to point out what you knew but had forgotten... Now back to drawing the Mk2 while riding shotgun on this interminable cut. I was at least able to pick up accurate enough reregistration to carry on more or less from where I was when the PC failed.

Neale
05-05-2014, 10:47 PM
If you have stepper motors they may jump a lot of steps when you power them up. You could pause the g code, note the program line number then move to 0,0,0. If possible you could clamp the axis in position so they don't move when you power up the next day.

Interesting point. There is a bit of a bang and judder when I first turn on the control electronics, although I haven't looked to check whether or not the motors appear to move by any noticeable amount. I had assumed that this was unlikely to be more than moving to the nearest whole step rather than microstep, and with my relatively fine-pitch leadscrews (1.5mm) this wouldn't be much of a linear movement. If I did this kind of restart during my current job, then this would be well within the roughing machining allowance.

Wal
06-05-2014, 01:07 AM
but will need to note machine/work offsets and current gcode line number.

Not necessarily - Linux CNC remembers the last used G54 offset (provided your machine shut down ok), so you'll only need to re-zero the machine coordinates, G54 will still be stored. Very handy...

Regarding leaving machines unattended - I wouldn't. You can build it as well as you like, but nothing can account for the unexpected! Call me paranoid...

Wal.

JAZZCNC
06-05-2014, 01:30 AM
If you don't have good Home switches then the next best thing is to run the machine into some hard stops and call this machine Zero. Then from this you can accurately get back to any point on the machine and equally find any point in G-code by using the run from here in Mach3.

Working from a hole or mark on the machine isn't accurate enough IMO and the only sure way is thru either repeatabile home switches or pyhsical hard stops.

Neale
06-05-2014, 08:27 AM
If you don't have good Home switches
My 3D printer uses small microswitches and I have had problems with one of those - the z axis needs repeatability to better than 0.1mm and it struggled to achieve that. I'm going to change to optical switches for that machine. What kind of performance would you expect from the kind of proximity switch that seem to be very popular for routers? Any recommendations? Accurate homing is part of the "save session state" process, I guess.

EddyCurrent
06-05-2014, 10:08 AM
These are the ones I used and they work fine so far 2pcs DC 10-30V 30mA NPN NO 3-wire 4mm Inductive Proximity Sensor Switch SN04-N | eBay (http://www.ebay.co.uk/itm/2pcs-DC-10-30V-30mA-NPN-NO-3-wire-4mm-Inductive-Proximity-Sensor-Switch-SN04-N-/350884473166?pt=LH_DefaultDomain_3&hash=item51b258294e)

Because the Home switches are not safety related it's okay to use normally open type, I used NPN because they act like a switch to short the bob input to ground and I like 3 wire type so that the supply voltage can be 24v dc.


http://www.youtube.com/watch?v=IGO47l62T2o

Neale
06-05-2014, 01:47 PM
Thanks, Eddy - if they are repeatable to "a couple of tenths" as per the video clip, that's good enough for me!

EddyCurrent
06-05-2014, 03:54 PM
Use a good 'target' with a square edge like the one here (second pic.), http://www.mycncuk.com/forums/gantry-router-build-logs/6565-ready-steady-eddy-23.html#post56428
it's a piece of 6mm thick steel on an aluminium bracket, make sure no other nearby metal will influence it.
Sensing distance is 4mm so you want to set it in the middle with a 2mm gap.

JAZZCNC
06-05-2014, 05:46 PM
What kind of performance would you expect from the kind of proximity switch that seem to be very popular for routers? Any recommendations? Accurate homing is part of the "save session state" process, I guess.

Yes accurate homing as saved my arse many times along with "Run From Here".

Most of the cheap prox switches on Ebay either those Eddy suggested or the round bullet type with threaded body work well and are very repeatable. I mostly use the Round type has they are easier to mount and reach or fit into more places better.

JAZZCNC
06-05-2014, 11:33 PM
Ok well Neale you got me wondering about repeatabilty of those switches and as it happens i'm just setting up a machine so lashed together a test for you of the Ebay switches I use.
Think these where the ones.? http://www.ebay.co.uk/itm/10pcs-New-LJ12A3-4-Z-BX-Inductive-Proximity-Sensor-Switch-NPN-DC6-36V-/271280668347?pt=UK_BOI_Electrical_Components_Suppl ies_ET&hash=item3f29967ebb

Anyway thought a Video was in order so here you go hope it helps.!!


https://www.youtube.com/watch?v=A11Zvi3nAFE

Neale
06-05-2014, 11:47 PM
Interesting demo, Jazz! Better than +-0.01mm repeatability, which is better than I would have expected. You look as if you are bringing the ballscrew towards the sensor from the side, and maybe it would be even better if you came at it end-on? But I guess we're starting to talk numbers which are down in the region of ballscrew and nut clearance, etc, and as you say in the video, it's certainly good enough for a router! I'll be looking to use something like this, now I've seen what it can do in practice.

JAZZCNC
07-05-2014, 12:01 AM
Interesting demo, Jazz! Better than +-0.01mm repeatability, which is better than I would have expected. You look as if you are bringing the ballscrew towards the sensor from the side, and maybe it would be even better if you came at it end-on?

Well possibly but it's not a good idea because you can smash into them so it's always better to slide by.! . . . But yes although I knew they where more than good enough for a router I was quite surprised and before the Video I'd done loads of tests on each axis just to be sure and they where all about the same so consistant repeatabilty across the differant switches.!!

If you look at the video around 4.02 mark you'll see another switch that is the traveling limit switch for X axis and at 4.08 you'll see the washer that is the target.!
This way I can adjust the limit distance by moving the target and keep the wires/switches to a minimum.

Neale
07-05-2014, 12:22 AM
I'd assumed that you needed to approach end-on to get repeatability, but knowing that you can take a safer approach and still get good results is useful info.

JAZZCNC
07-05-2014, 12:33 AM
I'd assumed that you needed to approach end-on to get repeatability, but knowing that you can take a safer approach and still get good results is useful info.

Again it's down to how you approach or more the point the speed you approach. If you fly upto the switch then yes repeatabilty will drop but as you could see at 1mtr min it still did a good job with the side approach. How much better it would be end on I'd have to test to find out but that will have to wait for another time as this machines due to leave me soon.

m_c
07-05-2014, 09:17 PM
Sliding past is usually more accurate.

The difference is, as you approach from the side, you have a solid egde that disrupts the inductive field more rapidly at close range, than if you approach end on where you have a solid lump that slowly disrupts the inductive field as it approaches from a distance.

However, if you want accuracy, I personally use optical slot sensors, as they're far less affected by temperature, and have a much smaller switching point, however they need to be reasonably well protected from contamination.
To give some theoretical figures, I just checked, and the last slot sensors I used are officially repeatable to 0.03mm over thier entire operating temperature, whereas having just checked the inductive sensor datasheet for the ones on my current lathe, and they list a +/-10% tolerance over their full operating temperature range, with switching distances of 8mm+/-10%, which gives a much wider switching point of 1.6mm +/-10%!
Off course, in practice repeatability is usually very good.

My current lathe uses inductive sensors, as they only provide a rough position which is then refined using the servo encoder index pulses to give highly repeatable homing (0.6 microns if my memory and calculations are correct!)

If you want to waste 15minutes, check out thise thread - Accuracy of Homing Devices? Pro's and Con's of Different Sensors (http://www.machsupport.com/forum/index.php/topic,18323.0.html)
It has a couple links to other tests, and towards the end I helped Dickeybird setup accurate homing using a microswitch combined with a slotted disc and slot sensor.