Wednesday 26 December 2012

Milling the first Cup

You may have seen the gcode i posted, it was looking great until i realized that the mill wasn't yetup to the job, the Z axis has about 2.5mm of backlash!!! that's just NASTY if your code makes this axis go up and down... really need to stop playing and attach a gas strut piston to hole up the head. get rid of the backlash, not too sure how that all works will have to find that web page that suggested it as a solution and double check what i am thinking.

So while i was setting up to cut the first of 24 coil cups for the magnetic bed i ran into a small electromechanical issue, the handle on the Z axis caught a wire which cause the loom to get pulled which in turn caught and pinched the Z stepper wires and proceeded to release the magic smoke that killed the axis' stepper driver. Not happy jan...

After i sorted that problem out i proceeded to attempt the first cut thats when i found the Z backlash to be bad, so i changed the code so it only drives the Z axis in the downward direction, making the backlash not a problem for now..

 I Loaded up the chuck with a 7mm 4 flute end mill cutter slapped a chunk of 25mm hex bar into the jaws of the dividing head and set the Z axis to be 16mm in SW and HW and hit play.. the results are below.

the gcode that's running in the above video is plunge 0.25 then spin then spin back then  repeat. today i have some new code that i wrote that will plunge as its rotating and not need to spin back to reset the axis.

I discovered that i really really need to mount the DRO scales permanently they have about 0.5mm of backlash in them.. i will replace the temporary double sided tape for screws.

in the video you cant quite see it but we jury-rigged an air blower up to clear the swarf from the job and spread it far and wide across the workshop..

we smashed a 7mm end cutter into a ball of brokenness when i was playing with some settings and spun the job in the chuck at a speed FAR FAR too fast the slider was reset between reboots and i forgot the defaults are still dangerous!... oh well another $5 on ebay.. i have more cutters to replace i have lunched a few while learning the limits of the mill, these cutters are dirt cheap so i dont mind..

I was meant to make the drive bolt for my printer as the first project but unfortunately i dont have the brass rod thats the right size for the job :( so i am keeping my self busy while i wait for the steel store to open :)

Tuesday 25 December 2012

Progress on the magnetic milling bed

While i wait to get the last belt for the Y Axis stepper, I want to make some more progress on the mill.

I am going to attempt to make 25 hexagonal coil cups, these are 15mm tall section of 25mm hex bar. I will take a length of hex bar that is 25mm across the flats and cut 25 sections 16mm long. once these are cut i will place each one in the jaws of the dividing head (which will be vertically mounted, that is,  it will turn in the same axis as the cutter turns.

I will then program by hand some Gcode that will lower the tool into the job 12mm deep as it rotates. this will cut a circular slot into the hex face of the job that will allow me to place a sewing machine bobbin into, this bobbin will have wire wound onto the coil, when placed in to the cup onto the center pin and the coil energized any bits of metal will be attracted to the cup and coil, with the coil is set in the cup with epoxy and each of the 25 cups welded into a flat bed i should be able to hold the job with the touch of a button on the UI. the holding force will be adjustable via a slider on the touchscreen.

the code to cut cups :)

%
G21
G90
; starting at 16mm need to get to 3mm, so 13mm of z travel in 0.25mm passes
; 13/0.25 = 52 layers to this program.

; this will mean when i turn the cups upside down get them welded i can then face that off
; to make the flat mounting surface, i then flip and repeat to make my flat working surface
; set the mill to the start position then start.

G1 Z15.75 F100          ; drop the cutter 0.25mm
G1 A360 F300            ; spin the job 360' slowly
G1 Z16 F1000             ; pull the cutter out of the job
G1 A0 F1000              ; spin the job back to the start postion
G1 Z15.75 F1000        ; drop the cutter back down ready for next pass

G1 Z15.5 F100           ; repeat
G1 A360 F300
G1 Z16 F1000
G1 A0 F1000
G1 Z15.5 F1000

G1 Z15.25 F100         ; and repeat some more
G1 A360 F300
G1 Z16 F1000
G1 A0 F1000
G1 Z15.25 F1000
.
.
.
.
.

G1 Z3.25 F100        ; more repeating
G1 A360 F300
G1 Z16 F1000
G1 A0 F1000
G1 Z3.25 F1000

G1 Z3 F100              ; done repeating
G1 A360 F300
G1 Z16 F1000
G1 A0 F1000
G1 Z3 F1000
G1 Z50                   ; job done pull cutter up to allow for next piece . should be able to just hit run between pieces.
%

i ended up using a spreadsheet application open office to write this code i found it easier that way as its repeated 52 times if i need to change a value now i just change the first block then the rest follow to match.

then i take these values and use a concatenate function to join them all for cutting and pasting to a text file.

I really need to find a application that can do this for me. ie write gcode for a dividing head.
i suppose if its not already done i could write something that takes a bunch of parameters and generates the gcode, this would probably result in a module for each type of operation like cut helix, drill hole patterns etc..

EMC Setup. Glade Vs pyvcp

Hands up all those who survived the end of the world :p

I have spent the last few days poking around EMC2 linuxcnc. For an Open source project this is Awesome, it has good documentation and good delivery of its end goal, control a machine and make it do our bidding.

I have been playing around making an UI that has all the functions i want, where i want them and working how i want them to work. So i read a bit of documentation and thought i had picked the path of least resistance, not really knowing what Glade was and having a little experience with python i went with the pyvcp option. this is great it allows you to do all sorts of things, control various parts of the machine, in my case a milling machine and dividing head. i went through the steps of setting up the parallel ports and defining pins to each hardware device i want to use.

Next i wanted to find some GUI interface that would allow me to control these hardware functions easily from a touchscreen. when i first created the custom vcp it was tacked onto the right hand edge of the existing UI window, this in theory is great makes life easy, in practice this is not so great for my setup, i am using a 800x600 LCD screen and i have a PCT touchscreen to match it, when the extra section of controls were added to the window it makes EMC's GUI go nuts. every time you click the mouse or touch the screen the page would jump between locating the top left corner of the window to the top left corner of the screen then next touch it would jump to show the bottom right of the window in the bottom right of the screen. this is not noticed if the window is smaller than your screen but if it is larger then you will see this problem. two solutions exist that i know of, use a higher screen res (not an option for me as i am hardware limited to 800x600), add the control panel as a second floating window and provide a way to switch between this and the original UI window.

i chose the second option, this works nice , the original UI is a little narrower than the screen so i anchored the new window to the top right of the screen and kept the original screen in the top left. this keeps a 1 inch section of screen that i can use to touch to swap between windows. i then populated the window with lots of big buttons and sliders that are nice to use in a touchscreen environment. i hear people screaming why not just use touchy.pyvcp interface that is supplied? please see the problem just above with the screen jumping around when the window is larger than 800x600. probably not the most efficient solution but it gets me to where i need to be. plus i have a few other features i wanted to add to the mix. and as it turns out its easy as pi to roll your own.

I added sliders for a grinding motor, coolant pump, work lamp brightness, spindle speed and jog speed. with these i added enable buttons, which i made latch with the classicladder PLC thats built into EMC, this was easy to do as i have learnt PLC programming a decade ago, even though i have never used it since it was easy to work out again all those classes in the basement of granville tafe came flooding back, my project was a railway level crossing, train sensors lights, bells, it was a great project.  the PLC is a very powerful tool it took me a little playing and looking at the examples to work out how the variables integrate with the UI and the HAL but i think i have three quarters of a clue now. I added jog buttons these buttons all work. I even programmed a home axis button with MDI commands :)

I was going great guns for a while. I stopped for some family time (ie Christmas) then came back to it. The last thing that i really wanted to setup was at the very least was a simple tool changer routine. My plan is to use a stepper connected to the 5th axis to rotate a carousel of tools at a set X,Y,Z location so the chuck could release and hold tools as they are presented to it. this is when i have hit a SOLID Brick wall. I should have read a bit more of the manual and the hardware integrators guide to see exactly what pyvcp can and cannot do (maybe i read it but didn't understand at the time that i need more features). i could write a massive PLC  ladder program to try and control the tool changer from that but it would be really hard and probably wont end up being doable.

I have come to the conclusion that i MUST use glade to get the control and program-ability i am going to require. this was a great learning experience and my efforts have not been wasted, i will use this setup until i make my tool changer.. then once i have the mechanical parts done come back to the UI.

while i am waiting to get my last toothed belt from my mates locked up workshop i have been thinking about what i can do to use my time and actually use the mill, while making the UI was great i want to get some chips flying. so i am going to try and make some progress on the mill in the fashion of the magnetic clamping bed. more next post.

Thursday 20 December 2012

Milling Cutters

If the impending Zombie apocalypse happens today this post is a little pointless :p but i came across a great website that supplies all sorts of milling cutters, even the exotic ones like tiny woodruff cutters.

As i need a cutter to cut my drive bolt for the printers extruder, i would really like to learn how to cut my own cutters, i have played a little and have come to the conclusion that i need to either make some sort of grinding tool with an indexing head/chuck.

I have nice shiny new dividing head that my mate built for me, so i am half way there. but as i am sure i have mentioned before that i am an impatient unit i was looking on the web at whats available. I came across www.harveytool.com and searching through their online catalog i found this cutter

Double angle woodruff cutter this tiny little cutter is the ideal profile for my hyeena bolt, 66108 is the one i think will do me. the measurements are all imperial so i will convert to metric so my brain can make sense of it.


D1                                        = 1/8th inch             = 3.175mm
Neck diameter                     = 1/16th inch            = 1.5875mm
(D1-Neck)/2 Shoulder size  = 1/32th inch           = 0.79375mm 
L2 Shoulder width               = 0.17in                   = 0.42mm
Shank Diam                         = 1/8th                      = 3.175mm
A angle of cut                      = 30'                         = 30'


looks like this guy is a little bit small to make my life easy. if i want to cut the teeth in one pass i need a cutter thats at least 3.5mm diameter, if use the next size up cutter 3/16 its 4.7625mm in diam. this cutter would be able to cut an entire tooth in one motion.  without needing to move along the shaft/gear/bolt. this larger cutter 66112 has a shoulder width of 0.5842mm at its widest. i had drawn my bolt to have a 1mm wide gap between the peaks of each tooth. so i will use the dividing head to turn the job while the cutter has made its initial groove. this will give me the option of cutting wider grooves as well as narrower grooves without having to buy two tools they are only $35ea.

so the more i think about whats required to make my own cutters i see that there is some really complex maths involved while this in it self is not too troubling it makes me think that the device that is required to cut cutters is rather complex. to cut the flutes on a straight cutter you need A,B,X,Y,Z this seems not too imposing until you add the word precision into the equation. if i want to be able to use cheap off the shelf grind wheels and stones i will have to be able to some how know what the diameter of the wheel or stone will be, if i can find a good diamond wheel i will be set as their diameter doesn't vary a great deal when compared to a carbide disc or stone. so i will need a way to touch the wheel to sense its cutting edge. this wont be too hard if use a micro switch.

thinking about the software side of things i would need to break it down into a series of passes.

1. Profile
      This will grind the side profile of the cutter, ie ball nose, woodruff, slot cutter etc.
2. Pluting
       This will grind the flutes into the cutter.



To grind the profile the cutting disc will be perpendicular to the rotating axis, that is if the tool steel blank is held along the X axis left to right. the cutter would rotate in the A axis and the grinding wheel will rotate in the Y axis at the same height as the center of the toolsteel. the grind stone would move in and out towards the rotating center of the toolsteel according to the profile required asnthe toolsteel rotates.

To grind the flutes the cutting disc/grind wheel will need to be pivoted in the B axis to the angle of the flute to be cut and offset to set the depth of cut, as the toolsteel is rotated the grinding disc will need to move along the X axis at the correct rate to make the screw/helix shape.

I theory this all sounds simple enough, write some gcode that makes the profile of the blank then write gcode that cuts the helix of the flutes. when it comes to practice it will be a different story, will post some screen grabs and explanations of how it will work soon.


Sunday 16 December 2012

Some Gcode

I couldn't help myself i had to see if i could write some gcode and see if it would do what i tell it.

what i did was first calculate the circumference of my blank 10mm rod. i then calculated how many teeth and grooves i can cut in to that surface. i worked out that if i have 1mm gaps and 0.75mm peaks i would end up with 17.5 teeth so i did the maths to even that up to 18 teeth. that gives me a 20' rotation between slices that will make my gaps 1mm and leave a peak of 0.74mm between the gaps.

the gcode to do this is specific to my cutter that i have made, it is a 1mm thick cutter with a 3.5mm diameter. if you were to think of a tiny T slot cutter then you are spot on..

G21                               #select metric mode
G91                               #select incremental referencing
G0 Y-19 F10                 # sets up cutter ready to eat metal

G0 Y7 F10                   # gets closer to the job
G0 Y3 F0.0005            # moves in for the cut.
G0 Y-10 F10                # move back from job
G0 A20 F10                 # rotates job 20' ready for next cut

G0 Y7 F10                   # and repeat 17 more times to cut all the teeth.
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10

G0 Y7 F10
G0 Y3 F0.0005
G0 Y-10 F10
G0 A20 F10
%


there you have it rather simple isn't i will post some pictures of what i make and some screen grabs of what the part should look like and you can all have a look and laugh at how different the two are :).

oh also this gcode will only cut one of the three sections that i require for my printer. i do like to make things hard for myself :0

Progress on the Mill build

Its nearly Christmas,

My mate found time to finish off 90% of the dividing head ( YAY ). I rushed it home with the PC and controller box, attached a power plug that i had been putting off until i had a reason to. Then proceeded to install a copy of ECM running on Ubuntu 10.04 from a liveCD image to a USB key then onto the 4Gb CF card. the motherboard seems to be a little slow booting up so i may sink another $50 into the build and buy a 8GB sata SSD and liberate the processor..

Once I had the OS and EMC installed I Proceeded to attempt to configure EMC. this turned out to be in total a 2 day ordeal. first the problems were getting the LiveCD image to actually boot, just had to find a magical usb key and the right settings in the bios and standing on one foot with one eye closed :).

I purchased the Stepper interface quite a while ago and the exact user manual for my board so i started looking on ebay, i couldn't find the exact seller with the same unit. I did find several that looked the same, but when i downloaded the data sheets for them the pin maps just didn't line up properly, the 5 axis data sheet had the right title and said it was for the 5 axis model but the pin table only showed 4 axis, another had only 3 axis, then finally i found one that had all five axis labeled..

I ran the stepconf program to configure the stepper drivers as per the data sheet, but weird stuff happened, so then i looked at my cable that i have made to go between the par port and the stepper driver, turns out that this was rather wrong, so i turned the ends around about 5 times until i finally got the right orientation so pin 1 is connected to pin 1 and so on. i tested the results and yet another fail, not sure where the problem was i started testing, i grabbed a LED and jammed it in the end of the cable, then clicked on things in the gui and all the pins matched their functions. So then i figured i should probably check the pin functions on the stepper board.. this was a little difficult, i had to first work out which pins would make a led light up then try and work out what that led meant, in the end i managed to get each Axis spinning in both directions when commanded to, some of the axis were being difficult but got there in the end.

At this point in time i have all the Axis responding to the GUI buttons, i have calibrated the XYZ Axis' according to the numbers, leadscrews have 16TPI = 1.558mm/Revolution, 200 steps per rev on the steppers, 1:1 drive ratio and 2:1 microsteps. this results in 251.9steps/mm. for the Dividing head it has 200 steps per rev, 1:3 ratio, and 16:1 microsteps, resulting in 26.7 steps per degree, this should be fine enough for what i want to play with. I should be able to cut some gears and worms, but first on the list is a triple hyena bolt. Arcol from the reprap forums has designed a really nice drive bolt that grips the plastic really well and doesn't clog up, i have asked in the past if he could make me a custom one that has three sets of teeth but at the time it wasn't worth his time as he gets his bolts that he sells made in a workshop by real machinists if anyone is wondering what sort of bolt they should use see Arcol's blog.

Before i have even bolted all the bits on to the mill i already want to program it... I want to write some gcode that will cut my bolt :) there are a few parameters that i will have to get from the Mill itself for the code to be complete but i will write it anyway, have i mentioned before i am an impatient and impulsive sort of person...
next post some Gcode to cut a Drive bolt..


 here you can see the dividing head sitting on the X axis, my mate made me a Angle bracket to mount the head to the bed as shown above, or to have the head pointing up so you could drill or slot a gear as well as cut the teeth.
here you can see how chunky it is compared to the rest of the mill. we should have no bounce or flex when this is mounted in either position. hanging out the side of the bed there you can see the profile piece that is becoming T nuts :)

here is a close up of the belt and pulley. in testing i have done on the bench here this little chuck has some torque behind it. the steppers are 269 ounce with a 3:1 ratio on it that should come out at over 60netwons/meter. that could be more torque than on the other axis :)