Zum Inhalt springen

CNC-Fräse: Unterschied zwischen den Versionen

Reox (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Reox (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Zeile 8: Zeile 8:
Ask on our Mailinglist for help: https://lists.metalab.at/mailman/listinfo/cnc
Ask on our Mailinglist for help: https://lists.metalab.at/mailman/listinfo/cnc


== Introduction ==
= CNC aka the Geil-o-Mat =


A CNC mill like the dear Geil-O-Mat has three axis that can be moved independently. A spindle with a [http://de.wikipedia.org/wiki/Fr%C3%A4swerkzeug mill cutter] typically removes material.
'''What is it?''' It is a CNC ([http://de.wikipedia.org/wiki/Computerized_Numerical_Control Computerized Numeric Control]) Machine, which is located in the Heavy Machinery Department of the Metalab.
[[Bild:geilomat.jpg|thumb|400px|right|Some pink work in progress...]]


Each axis is driven by one (Y and Z) or two (X) stepper motors. Basically, theses motors can only rotate in 1.8 degree steps, and hence no secondary encoder is needed for the machine knowing its current location. By a trick called "microstepping", currently the resolution is increased to 1/8 of 1.8 degrees.
Technical Outline:
As the stepper leads in to a "Zwillings-Trapezgewindespindel", the rotation is transformed into linear motion, one revolution= 6mm.
* '''Spindle speed''': 6000 - 24000 min^-1
Warning: If there is too much force for the motor to move one step, it skips the step, typically failing also in subsequent movements, resulting in an ugly noise, and shift in the positioning.
* '''Maximum step speed''': 2000 mm*min^-1
* '''Maximum Workpiece Dimension''': about 700mm x 60mm. Heigth depends on how you can fix the thing in there.
* '''Cooling''': Air (or liquids by hand
* '''Clamping''': Various - depends on your job


The motors are connected to a driver device, which sits on top of the whole machine. It creates the strong currents for the stepper drivers, out of signals from the PCs parallel port.
Runs via LinuxCNC (an Open Source CNC Software)


Hence, the computer has to send signals telling which axis should move one step forward or backward at a given instance. This can/is done by a software called "EMC". It is open source, and the thread doing this parallel port communications is using the patched real time Linux-kernel.
== Standard Procedure ==
[[Datei:Geilomat_warning.svg|200px|thumb|right|Warning Sign which is now implemented in the geilomat]]
There are some important steps to take, otherwise you can destroy everything - even the earth...
If you don't switch on the things in this particular order it can happen that the machine does things out of nowhere e.g. moves or turns on the spindle!!!


There are some GUIs for EMC, the most relevant is "AXIS", which graphically displays the current machine position, the paths it should travel the track history, and further stuff. Also manual movement can be performed.
* Start CNC PC (dont turn on the G4 (The "G4 Case" stepper control thing), neither the FU)
* Start LinuxCNC
* Check if the "Notaus" is physically triggered on the machine (Button is pressed)
* Now power on the G4
* Now plug in the FU ("Frequenzumformer")
** Wait until the FU is booted
** Check if 100.0 Hz is set on the screen of the FU
*** Otherwise rotate the rotary encoder that it is 100.0Hz
* Now remove "Notaus" from the CNC
* Power on the Machine inside LinuxCNC
* Move near Homing position
* Home the machine
* Warm up the Spindle as described here in the wiki


The language to specify the movement of the machine is called "GCODE". Some of its [http://linuxcnc.org/docs/html/gcode.html statements] are starting with G01,or G00, hence the name.
Now the machine is ready to use.
A simple Gcode can look like this:
; i am a comment
F100; move with 100mm/min while cutting
G0 Z10; fast move to Z-coordinate 10
G1 Z0; drill down until Z=0 with the speed given by the Feedrate
G1 X10; move to the new location X10 while cutting
G0 Z10; and back up with large speed.
M30; end program


One can do a lot of things, e.g. have variables (#1=10), and do loops , evaluate mathematical expressions (G1 Z[#1*2] ).
For milling the spindle needs to be warm. The manual says that you should first let the spindle run for about 1 minute on 6000rpm, then increment by 6000rpm for 1 minute until you reached your destination speed. If the spindle wasn't used for longer than one week, you should double that time.
So basically, real hackers write gcode by hand, while Chuck Norris sends movement commands to the steppers.
So better is to let it run for two minutes on each speed.
However, as we are all lacy, and things can get quite complicated, there exists software to convert 3d/2d CAD files, grayscale depthmap images, 3d-stl objects and other things into Gode. This is often called "CAM"-Software.


If you have a 2d-cad file (e.g. dxf) and specify depths for some areas that should be milled away, one speaks of 2.5D-CAM. This is performed e.g. by CamBam, or Camexpert.
There is a sample code in the Reference Section.
 
The biggest trouble is the '''radius compensation''' of the milling heads. You always have to cut on a path half a diameter outside of the actual position.  For this, there are various workflows. In Gcode, one can tell specify if one wants to cut left, right or directly on the actual path. This is called cutter radius compensations. Its a pain in the ass. Hence, often one uses no such thing, but either draws directly the offsetted lines in CAD, or has some software like cambam, which does this compensation and outputs already compensated "paths". The drawback of both methods is that one can not change the diameter of the cutter without recreating the gcode.
 
In the Gcode compensation, a "tool table" is used. Each cutter is index by a number, and in the table the diameters and other things are specified.
 
The current machine's state  is given by a coordinate triple, and some states (emergency swich, spindle speed, ...). The machine '''coordinate system''' is defined by the now automated homing routine. Thereafter, one can move the machine to a location, and "touch off", giving explicit coordinates for this location. Thereby the working coordinate system is defined. This is also the system displayed in Axis, However, in the background, the machine still works in the home-coordinate system for checking its movement limits. Clever!
 
== Nomenclature ==
Or the what is which device:
 
* CNC PC: a Linux machine running the LinuxCNC Software and sends out commands via Parallel Port
* G4: a old Apple G4 Case holding the stepper drivers
* Stepper Driver: Each stepper driver controls one stepper. There are 5 Stepper Driver in the G4: 2x X, 1x Y, 1x Z, 1x A (currently unused)
* Breakout Board: Is used to "convert" the parallel commands to a different protocol that the stepper drivers are using. Also has a VFD Port to control the Frequenconverter
* FU/Frequenzumrichter/Frequencyconverter: This Box controls the Spindle. It has a output of 100 to 400Hz on 3 Phases and gets controlled by the Breakout Board.


== Wie Spanne ich ein Werkzeug richtig ein ==
== Wie Spanne ich ein Werkzeug richtig ein ==
Zeile 97: Zeile 90:




== Standard Procedure ==
[[Datei:Geilomat_warning.svg|200px|thumb|right|Warning Sign which is now implemented in the geilomat]]
There are some important steps to take, otherwise you can destroy everything - even the earth...
If you don't switch on the things in this particular order it can happen that the machine does things out of nowhere e.g. moves or turns on the spindle!!!


* Start CNC PC (dont turn on the G4 (The "G4 Case" stepper control thing), neither the FU)
* Start LinuxCNC
* Check if the "Notaus" is physically triggered on the machine (Button is pressed)
* Now power on the G4
* Now plug in the FU ("Frequenzumformer")
** Wait until the FU is booted
** Check if 100.0 Hz is set on the screen of the FU
*** Otherwise rotate the rotary encoder that it is 100.0Hz
* Now remove "Notaus" from the CNC
* Power on the Machine inside LinuxCNC
* Move near Homing position
* Home the machine
* Warm up the Spindle as described here in the wiki
Now the machine is ready to use.
For milling the spindle needs to be warm. The manual says that you should first let the spindle run for about 1 minute on 6000rpm, then increment by 6000rpm for 1 minute until you reached your destination speed. If the spindle wasn't used for longer than one week, you should double that time.
So better is to let it run for two minutes on each speed.
There is a sample code in the Reference Section.
== Current Status==
* Max-Movement speed is approx 2000 mm/min.
* Homeing procedure in EMC is functional, and by that also soft-limits. Its now "nearly" impossible to move over some limits. Start EMC, turn machine on with f1/f2, press "home all", wait 30 sec. Than traverse to the wished zero of your working coordinate system, and touch off in all three axes.
* The Spindle, aka the Mechatron, is switched on/off automatically.
* Spindle speed must be set to a value between 6000 and 24000. Use GCode like M3 S6000
** The Spindle needs some warmup before running. Manual says One minute on 6000rpm, then increase in steps of 6000 until the whished speed is reached. stay for one minute on each level. If the spindle is very cold and has not run about a week double the times!
* Double sided boards kind of work, although its a bit tricky: [[PCB_CNC]]
* The Historical Documents were moved here: [[Geil-o-mat/History|History of the famous Geil-o-mat, formerly known as CNC]]
* The Whistlist, Todo stuff is now here: [[Geil-o-mat/Future|Future of Geil-o-mat]]
==Reference==
a usefull preamble for this mill:
M3    ; starts spindl clockwise (looking from above down)
S6000  ; 6000 min-1
G4 P60 ; wait for 60 seconds
S12000 ; 12000 min-1 until the whished speed is reached
G4 P60
F950  ; xyz feedrate 950 mm/min
G90
G21
[http://linuxcnc.org/docs/html/gcode.html Gcode reference]
=== Cheat Sheat ===
=== Cheat Sheat ===
Ersetzen Gcode-Zeilennummern im Texteditor Kate replace "N[0-9]* " by "" using regular expression.
See also in the [http://linuxcnc.org/docs/html/gcode.html Gcode reference] of LinuxCNC




Example Gcode Header for Geilomat:
Example Gcode Header for Geilomat:
  G21     ; mm
  G21     ; mm
  G90     ; absolute coordinates
  G90     ; absolute coordinates
  G0 Z10  
  G0 Z10   ; Go to saftyplane
G0 X0 Y0
  F500     ; 500mm/minutes movement speed
  F500   ; 500mm/minutes movement speed
  M3       ; switch on spindle
M7      ; staubsauger an
  S6000   ; Drehzahl auf 6000 min-1 einstellen
  M3     ; fraeser einschalten
  G4 P120 ; 2min warten bis motor warm ist
  S6000   ; Drehzahl auf 6000 min-1 einstellen
  S12000   ; Drehzahl erhöhen
  G4 P120 ; 2min warten bis motor warm ist
  G4 P120 ; 2min erneut warten.
  S12000 ; Drehzahl erhöhen
  G4 P60 ; 1min warten.
  (immer um 6000 erhöhen bis die Drehzahl erreicht wurde)
  (immer um 6000 erhöhen bis die Drehzahl erreicht wurde)
G54      ; use G54 coordinate system
G40      ; turn radius compensation off
G17      ; choose x,y plane
G0 X0 Y0 ; go to your 0,0 point rapidly


Typical gcode Tail:
Typical gcode Tail:
  ; the tail
  ; the tail
  G0 Z10 ; retract from workplane - safty plane
  G0 Z10   ; retract from workplane - safty plane
  M30 ; end program
  M30     ; end program


=== Parameters for typical jobs ===
=== Parameters for typical jobs ===
Zeile 317: Zeile 262:


Falls sich jemand mit der Anwendung der Formeln auskennt bitte melden. Weiters gesucht das Buch "Der Werkstatthelfer".
Falls sich jemand mit der Anwendung der Formeln auskennt bitte melden. Weiters gesucht das Buch "Der Werkstatthelfer".
= Technical Foobar =
== Current Status==
* Max-Movement speed is approx 2000 mm/min.
* Homeing procedure in EMC is functional, and by that also soft-limits. Its now "nearly" impossible to move over some limits. Start EMC, turn machine on with f1/f2, press "home all", wait 30 sec. Than traverse to the wished zero of your working coordinate system, and touch off in all three axes.
* The Spindle, aka the Mechatron, is switched on/off automatically.
* Spindle speed must be set to a value between 6000 and 24000. Use GCode like M3 S6000
** The Spindle needs some warmup before running. Manual says One minute on 6000rpm, then increase in steps of 6000 until the whished speed is reached. stay for one minute on each level. If the spindle is very cold and has not run about a week double the times!
* Double sided boards kind of work, although its a bit tricky: [[PCB_CNC]]
* The Historical Documents were moved here: [[Geil-o-mat/History|History of the famous Geil-o-mat, formerly known as CNC]]
* The Whistlist, Todo stuff is now here: [[Geil-o-mat/Future|Future of Geil-o-mat]]
== technical details ==
A CNC mill like the dear Geil-O-Mat has three axis that can be moved independently. A spindle with a [http://de.wikipedia.org/wiki/Fr%C3%A4swerkzeug mill cutter] typically removes material.
[[Bild:geilomat.jpg|thumb|400px|right|Some pink work in progress...]]
Each axis is driven by one (Y and Z) or two (X) stepper motors. Basically, theses motors can only rotate in 1.8 degree steps, and hence no secondary encoder is needed for the machine knowing its current location. By a trick called "microstepping", currently the resolution is increased to 1/8 of 1.8 degrees.
As the stepper leads in to a "Zwillings-Trapezgewindespindel", the rotation is transformed into linear motion, one revolution= 6mm.
Warning: If there is too much force for the motor to move one step, it skips the step, typically failing also in subsequent movements, resulting in an ugly noise, and shift in the positioning.
The motors are connected to a driver device, which sits on top of the whole machine. It creates the strong currents for the stepper drivers, out of signals from the PCs parallel port.
Hence, the computer has to send signals telling which axis should move one step forward or backward at a given instance. This can/is done by a software called "EMC". It is open source, and the thread doing this parallel port communications is using the patched real time Linux-kernel.
There are some GUIs for EMC, the most relevant is "AXIS", which graphically displays the current machine position, the paths it should travel the track history, and further stuff. Also manual movement can be performed.
The language to specify the movement of the machine is called "GCODE". Some of its [http://linuxcnc.org/docs/html/gcode.html statements] are starting with G01,or G00, hence the name.
A simple Gcode can look like this:
; i am a comment
F100; move with 100mm/min while cutting
G0 Z10; fast move to Z-coordinate 10
G1 Z0; drill down until Z=0 with the speed given by the Feedrate
G1 X10; move to the new location X10 while cutting
G0 Z10; and back up with large speed.
M30; end program
One can do a lot of things, e.g. have variables (#1=10), and do loops , evaluate mathematical expressions (G1 Z[#1*2] ).
So basically, real hackers write gcode by hand, while Chuck Norris sends movement commands to the steppers.
However, as we are all lacy, and things can get quite complicated, there exists software to convert 3d/2d CAD files, grayscale depthmap images, 3d-stl objects and other things into Gode. This is often called "CAM"-Software.
If you have a 2d-cad file (e.g. dxf) and specify depths for some areas that should be milled away, one speaks of 2.5D-CAM. This is performed e.g. by CamBam, or Camexpert.
The biggest trouble is the '''radius compensation''' of the milling heads. You always have to cut on a path half a diameter outside of the actual position.  For this, there are various workflows. In Gcode, one can tell specify if one wants to cut left, right or directly on the actual path. This is called cutter radius compensations. Its a pain in the ass. Hence, often one uses no such thing, but either draws directly the offsetted lines in CAD, or has some software like cambam, which does this compensation and outputs already compensated "paths". The drawback of both methods is that one can not change the diameter of the cutter without recreating the gcode.
In the Gcode compensation, a "tool table" is used. Each cutter is index by a number, and in the table the diameters and other things are specified.
The current machine's state  is given by a coordinate triple, and some states (emergency swich, spindle speed, ...). The machine '''coordinate system''' is defined by the now automated homing routine. Thereafter, one can move the machine to a location, and "touch off", giving explicit coordinates for this location. Thereby the working coordinate system is defined. This is also the system displayed in Axis, However, in the background, the machine still works in the home-coordinate system for checking its movement limits. Clever!
== Nomenclature ==
Or the what is which device:
* CNC PC: a Linux machine running the LinuxCNC Software and sends out commands via Parallel Port
* G4: a old Apple G4 Case holding the stepper drivers
* Stepper Driver: Each stepper driver controls one stepper. There are 5 Stepper Driver in the G4: 2x X, 1x Y, 1x Z, 1x A (currently unused)
* Breakout Board: Is used to "convert" the parallel commands to a different protocol that the stepper drivers are using. Also has a VFD Port to control the Frequenconverter
* FU/Frequenzumrichter/Frequencyconverter: This Box controls the Spindle. It has a output of 100 to 400Hz on 3 Phases and gets controlled by the Breakout Board.


== Debugging Checklist ==
== Debugging Checklist ==