Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cnc:cnc_adventures:3-mill_something [2019/01/08 12:48] (current)
jin created
Line 1: Line 1:
 +====== Step 3: Mill something! ======
 +
 +OK so this is really where the rubber meets the road and is definitely harder than it looks.
 +
 +<WRAP center round important 60%>
 +**WARNING!**
 +I am writing this as I learn it myself so there'​s going to be ridiculous mistakes, mangled terminology and half-understood stuff littered throughout! As I learn more I'll try and come back and correct things but for the love of Jeebus don't think this is an example of how it should be done!
 +</​WRAP>​
 +
 +
 +===== 1st: Don't mill something =====
 +
 +First test is to see if the mill actually does what I you expect - I'd already tested the XYZ axes during setup so I was happy that each axis moved the expected amount in the expected direction, next step is to get the mill to run a program.
 +
 +When LinuxCNC fires up for the 1st time it has the default logo program loaded as an example:
 +
 +{{ http://​fuddymuckers.co.uk/​gallery/​s/​1000/​cnc/​linuxcnc_start.png }}
 +
 +Which is more of a 2.5D than 3D kinda thing and not a bad idea as a 1st test. The program is going to start 3mm above the work piece, plunge -5mm to engrave a 2mm-deep groove in the shape of the logo. It's easy to grasp and can be done on a random flat bit of something - in this case I chose to use a piece of paper and put a bit of pencil lead in the chuck.
 +
 +<WRAP center round alert 60%>
 +You'll notice in the screenshot LinuxCNC warning about latency errors, this is because it's running inside a VM hosted on a non-realtime OS, so it can tell that things are not happening at the correct time or in a timely manner. These messages can be ignored while we're farting around not really milling things, but would cause problems if you were really milling a lump of material - from an error or flaw in the workpiece to shattering the cutter and damaging the mill depending on how lucky you're feeling.
 +</​WRAP>​
 +
 +
 +{{ http://​fuddymuckers.co.uk/​gallery/​s/​250/​cnc/​redguy1.png}}
 +This is where the devil in the details starts to poke his naughty little head above the parapet. A mill isn't like a printer where you shove some A4 in the tray and hit "​print",​ oh no, there'​s stuff you've gotta do before you can hit the start buttock.
 +<​html><​br clear="​all"></​html>​
 +
 +==== 1st Problem: Size does matter ====
 +
 +Not everyone will have this problem but the Proxxon is very much at the wee end of the scale, so the logo thing doesn'​t fit easily on the bed. LinuxCNC shows the limits of the mill's travel (that you set up in stepconf) as a dotted red box, and you can see the example logo hangs out of the side:
 +
 +{{ http://​fuddymuckers.co.uk/​gallery/​s/​800/​cnc/​overhang.png }}
 +
 +Thankfully whoever wrote the code was good enough to include a scaling factor that can be easily set from the top of the program:
 +
 +<code [enable_line_numbers="​true",​highlight_lines_extra="​8"​]>​
 +( AXIS "​splash g-code"​ Not intended for actual milling )
 +( To run this code anyway you might have to Touch Off the Z axis)
 +( depending on your setup. As if you had some material in your mill... )
 +( Hint jog the Z axis down a bit then touch off )
 +( Also press the Toggle Skip Lines with "/"​ to see that part )
 +( If the program is too big or small for your machine, change the scale below )
 +( LinuxCNC 19/1/2012 2:13:51 PM )
 +#<​depth>​=2.0
 +#<​scale>​=1
 +</​code>​
 +
 +I'm lazy so I decided to just halve it, very complex code here, see if you can spot what I did:
 +
 +<​code>​
 +#<​scale>​=0.50
 +</​code>​
 +
 +This involved saving the "​splash"​ code as a new file so I could modify it. I also installed the Kate text editor to do this.
 +
 +==== 2nd problem: There'​s no place like 0,0,0 ====
 +
 +Also known as homing. Basically, you've got to know where you are! This is a harder subject than you'd think as (usually) the important thing is the tip of the tool and the surface of the work piece, both of which are in different places each time as you change tools and work pieces.
 +
 +Some mills have limit switches and home switches wired in which tell the controller when the axis is at an end-stop or a certain known location, allowing the machine to self-home and also avoid crashing by trying to drive beyond an end-stop. Having a big red emergency stop switch wired to your mill is a very good idea and one I'll be investigating.
 +
 +My mill has no limit or home switches so you've got to do it manually - hitting the "​home"​ button in LinuxCNC for an axis means the software will assume that axis is now at its "​home"​ position as setup in ''​stepconf''​... in my case I made the centre of each axis the "​home"​. So, you can use the "​jog"​ controls to move the mill until it's home, and then hit the "​home"​ button.
 +
 +In addition, LinuxCNC will not do stuff if it thinks any of the axes aren't homed - quite sensible really if you think about it.
 +
 +Anyway, that's home sorted, right? **WRONG!**
 +
 +Your mill may be "​home"​ but unless you are starting with a perfect lump of stuff perfectly positioned and a perfectly tool of perfect dimensions set perfectly in the chuck, you need to get set-up so the tool is actually going to touch the work piece at the right spot and not, for example, be happily milling shapes into thin-air an inch above the piece - or worse, milling shapes an inch down into the bed of the mill!
 +
 +So, **AS FAR AS I CAN TELL RIGHT NOW** you need to "touch off" (fnarr) and tell the software where the tool head is relative to the work piece. This literally means to jog the mill until the tool is touching the work piece, and then tell the software where it's touching. This modifies the [[http://​linuxcnc.org/​docs/​2.7/​html/​gcode/​coordinates.html#​cha:​coordinate-system|coordinate system]] in a way I am not currently equipped to explain, other than "it works"​.
 +
 +==== The Bad Touch ====
 +
 +OK so with those two problems explained, it's time to actually do something. I mounted a bit of pencil lead in the chuck, a piece of paper on the bed, and jogged the mill until the lead was touching the paper:
 +
 +{{ http://​fuddymuckers.co.uk/​gallery/​s/​500/​cnc/​20181222_173735.jpg }}
 +
 +I then hit the "touch off" button for each axis and entered the location - for X I wanted to shift the whole design over to fit within the mill's available travel, so I entered 40mm, for Y it was about right so I left it at 0, and for Z I double-checked what the program was about to do:
 +
 +It was going to start at +3mm, move down 5mm to engrave (with a cutter) 2mm deep into the surface (-2mm). Now, I don't have a cutter fitted so I don't want it to try and smash a pencil lead into the deck, so I set the coordinate as -2mm with the lead touching the paper.
 +
 +I double-checked everything and hit the "​go"​ button, and things whirred into action...
 +
 +{{http://​fuddymuckers.co.uk/​gallery/​s/​500/​cnc/​20181222_173741.jpg}}\\
 +Gimme an **L**!
 +
 +{{http://​fuddymuckers.co.uk/​gallery/​s/​500/​cnc/​20181222_174239.jpg}}\\
 +Gimme an **inux**!
 +
 +{{http://​fuddymuckers.co.uk/​gallery/​s/​500/​cnc/​20181222_174555.jpg}}\\
 +Gimme a **C** an **N** and a **C**!
 +
 +Yeeeaaah, I did a thing! And nothing broke or caught fire!
 +
 +That's so exciting I've got to go and sit down with a cup of tea.
  
cnc/cnc_adventures/3-mill_something.txt ยท Last modified: 2019/01/08 12:48 by jin
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0