Mini lathe conversion to CNC
(A signal connected to only one pin can not do anything)
Add net estop-ext iocontrol.0.emc−enable−in
Depending on how the external button is wired you might need to connect to input-18-not
I added in that line but when I try to start up LinuxCNC again it gave me an error saying that it was already linked to something.
After a little searching I found this thread for a HAL example for external E-stop: forum.linuxcnc.org/forum/47-hal-examples/25861-external-e-stop
It uses the ESTOP_LATCH component and I just changed the last line to match the mesa hardware and it seems to be working now. The Axis screen now shows the X button depressed when I push the switch and stepper motor also stops counting.
Then the working area for both axes will be in negative numbers, in machine coordinates.
But: you don’t work in machine coordinates, you work in work coordinates. Typically the X offset (stored as G54 and friends) will never change and will give true diameter for one tool, with other tools having tool offsets.
The Z offset in G54 will tend to be set to suit each job.
You could, but it would be awkward.
tml wrote: Ok, follow up question: let's forget about the work coordinates for a moment. If I want to, could I write my cnc program moves based on the machine's limit switch/zero position coordinates?
Pretty unusual with a mill too.
This might be a dumb idea, but I want to hear what others think ... I imagine it's an odd thing to do in a lathe but maybe more common in a milling machine?
Here is how my lathe is set up, and how I use it.
X=0 is at the limit switch with the slide all the way out. Z=0 is at the limit switch at the tailstock end.
So, for all the work I do, the machine coordinates are both negative.
Then to set up I take a test cut with tool 1 (tool 1 is turning.facing and always has zero offsets in the tool table). I then set the G54 X offset to read the true diameter as measured with a micrometer.
Test cuts with other tools can then be used to set their _tool_table_ offsets. The Z-offsets of other tools are set by touch-off to a faced off test cut with tool 1. I use a broken 6mm end mill as a dowel, jogging the tools away from the faced-off face until the dowel slips through. I guess you could also use a test-cut shoulder and measure the true offset with a depth gauge.
From then on I never deliberately change the G54 X offset. But I change the G54 Z offset to suit the job regularly. Typically I figure out where a good z=0 will be with T1, touch-off G54 to zero at that length, then face off. If it doesn't clean up then I touch-off G54 to 0.5mm and repeat. (this is using a facing macro that I have, which starts from the current tool position and faces off incrementally to z=0)
I am a novice, but let me try to explain my reasoning. It might help.
You could program from the home being X=0 and Z=0 (or X=Y=Z=0 for mill). However, the numbers have no relation to the part. I like to set X=Z=0 on the part. Then if I jog or use MDI the numbers used relate directly to the part.
You could program using X=0 and Z=0 at references on the part as home. However, if you move to machine X=Z=0 you end up at the part, or with X possibly inside the part. I use machine home for tool changes so this would cause trouble.
So, it keeps me straight to place home with X furthest towards me and Z furthest towards the tail stock. This is then the tool change position. Then set work coordinates with X=0 at the center of rotation, and Z=0 at end of part. Set these work coordinates to match your CAD drawing so the numbers displayed have a real meaning.
I do the same with my mill for similar reasons.
This all matches what Andy said.
Does this make sense?
First thing I do is click home all. The machine's homing sequence is like this: the cross slide goes toward X+ until it trigger the X home/limit switch and establish X zero, then moves back towards X- a distance of 7.230 mm (programmed X home position). Machine then moves towards Z+ until it trigger the Z home/limit switch and establish Z zero, then moves back towards Z- a distance of 5.000 mm (programmed Z home position). Screen then displays the coordinates X-7.230 and Z-5.0000.
What I just want to do right now is a simple turning operation on a long piece of stock. One end is supported by a live center from the tail stock. I simply want to make a light cut with a depth of cut of 0.2 mm and length of cut 28 mm. The stock is small diameter (5 mm) to be turned down to 4.6 mm. Distance from the tool's cutting edge to center of the stock is 5.475 mm. So I go into tool table and put -5.475 for X offset. Please let me know if this is right or wrong.
Now for the CNC program to do this turning task, this is my first attempt from looking at some samples:
G8 G90.1 G21 G18
G1 X2.3 F60
G0 X0 Z0
Basically I want the machine to just rapid the tool straight towards the stock then steadily bring it in more just enough for a light 0.2 mm deep cut. Then have the slide move towards Z- a distance of 28 mm to reduce diameter of that section from 5 mm to 4.6 mm. Then finally bring the tool back to original home position (X-7.230 Z-5.000). Does this look Ok?