Despre Interfata Mach 3
Despre Interfata Mach 3
html
Referin Z-39
You can learn to program a CNC router with a few basic commands that can be mastered in a day or two.
Have you ever used flashcards or CDs to learn a foreign language? To learn a new word, you read it from a card or listen to a native speaker say it in the new language, then you get an
English translation. I think you can take a similar approach to learning G code, the programming language that controls CNC routers.
G-code is simple, and every machine uses it. Commercial machines come with fancy software that adds some proprietary code to every program, but the basic commands are always the
same. Ill translate some G-code into English so you can see how it works.
Whether you want to cut a straight line or an arc, drill a hole or route a pocket, you need to use the appropriate command. Think of G-code commands like phrases in a foreign language.
Heres a list of CNC phrases to get you started.
Syntax
You tell a CNC machine what to do by typing a command, followed by coordinates. If you want to cut a straight line, your code might look something like this:
G1 X3 Y0
In English, this means Cut a straight line that ends at 3 in the X-axis and 0 in the Y. Check out these G-code commands, followed by their English translations.
G0 X10 Y0: Move full speed to 10 in the X-axis and 0 in the Y-axis.
G1 X15 Y15: Cut a straight line ending at 15 in the X-axis and 15 in the Y-axis.
G2 X1 Y1 R0.5: Cut a clockwise arc with a radius ending at 1 in the X-axis and 1 in the Y-axis.
As you can see, some commands require additional parameters. The G2 command above is followed by a parameter for the arcs radius. Youll see the parameter P below, which is used with
tool radius compensation. Check out this link for more information about G-code parameters.
Tool Radius Compensation
In all of the above examples, the router bit will be centered over the X and Y coordinates. When this is true, the final size of whatever youre cutting will be smaller than the specified
dimensions by the diameter of the bit. To fix this, you have to use a G41 or G42 command, which initiates tool radius compensation. Take a look at these bits of G-code and their English
translations.
G41 P0.125: Compensate for the router bits radius by cutting 1/8 to the left of the specified X and Y coordinates.
G42 P0.125: Compensate for the router bits radius by cutting 1/8 to the right of the specified X and Y coordinates.
Example Program
To program this part on a CNC router, we need to know all the coordinates shown here.
Lets look at the code required to cut the 4 x 4 part shown above. If this part is 3/4 thick, well need to make several shallow passes to cut all the way through the material. The
following code will give us a 1/8 deep cut. To get to full depth, wed simply repeat the code several times, adding -.125 for each pass to the Z coordinate in the second line. The first line of
code is whats called a lead-in move, which gives us room to initiate tool radius compensation.
G0 X-1 Y-1
G1 Z-0.125 (add -.125 to this line for each pass)
G42 P0.125
G1 X0 Y0
G1 X4
G1 Y3
G3 X3 Y4 R1
G1 X0
G1 Y0
G1 Z0.2
G40
G42 P0.125: Compensate for the router bits radius by cutting 1/8 to the right of the specified coordinates.
G1 Z0.2: Retract the bit so that its .20 above the material.
Heres a look at the part in a G-code viewer. Notice the lead-in move at the bottom left.
When using tool radius compensation, think about the direction of the cut. If youre moving clockwise, cut to the left of your coordinates. For counterclockwise cuts, compensate to the right.
You may need to experiment to get the hang of tool compensation.
Speaking/Writing G-code
Practice using the G0, G1, G2, G3 and G40/41/42 commands by writing some simple programs. You can download a G-code viewer here that will let you see the results of your code. Try
programming in millimeters by writing G21 in the first line. When you know these commands, you know enough G Code to create all sorts of CNC programs.
Sign up for Build a CNC Router from Popular Woodworking University for complete plans, drawings and instructions for building your own CNC machine. Youll learn even more about G-code.
Once you unpack the boxes please go over all the parts and make sure
that non are missing or damaged.
The 1st step is to assemble the X axis carriage (the horizontal axis)
Mount the bearing support plate onto the carriage as shown above
Now mount the 2nd bearing support plate on the other side of the carriage
Another look at the carriage - insert the 4 bearings
make sure that the wider side of the bearing is
facing the inside of the carriage.
Mount the motor mount (the part that has the larger hole)
Make sure that the ACME screw with its machined side is
facing the hole - this is where the stepper motor will be mounted
and connected to the ACME screw via the stepper motor coupler.
Secure the two shafts using two 8-32 screws
On the other side, mount the end plate (the one with the small hole)
Insert the small bearing in the small hole
then screw in place the two shafts as shown above
Secure the motor shaft to the ACME screw with the coupler.
Mount the new Y tower onto the horizontal axis as shown below.
Secure the two shafts with two 8-32 screws as shown below
You may want to flip the tower on its side in order
to have access to the two mounting holes
To test the hot wire, set the hot wire power supply
to the lowest voltage setting and the highest current
settings. Slowly increase the voltage, and at the same time
you will notice that the current will rise as well.
http://www.rcfoamcutter.com
Hot Wire CNC Foam Cutter Electronics
www.RCFoamCutter.com
There are two software packages that will run the machine
1 Mach3 - www.machsupport.com
2 DevFoam and
For Mach3
Mach3 is available at http://www.machsupport.com/
The free version of Mach3 will control the machine, but is limited
to 1000 lines of g code.
Next, select from the Config menu, "Ports and Pins" but this time
select "Input Signals" and set the EStop to active low - as shown below
The next step is to set the "steps per inch" for the board
The ACME screw and Lead Screw on these machines is 3/8-12
This means the screw will turn 12 times in order for the carriage
to advance 1 inch.
Stepper motors are 200 steps per turn - so this means, that the
combination of the lead screw and the motors will give you 200*12=2400
steps per inch. To make things a bit more complicated, the board has the ability
to drive the motors in microsteps - microstepping means that for each pulse
the computer the motor will advance a part of a step.
The board can be configured for
full step - 2400 steps per inch
Half step - 4800 steps per inch
1/4 step - 9600 steps per inch
1/8 step - 19200
Hot Keys
The next step is to set the hot keys
Hot keys are keyboard keys that have special functions.
Since this board will control 4 axis (two for the left side and two for the right side)
we will need a total of 8 keyboard keys to control the machine
We would use the up/down/left/right arrow keys on the right side of the keyboard
these 4 will control the right side of the machine
For the left side of the machine we will use the D A W and Z keys on the left side of the keyboard
From the config menu, select "system Hot Keys" and then follow the instructions on the screen
By default, the right side of the machine is already setup, the left side of the machine will need
to be setup
Follow the steps in the image below
Foamworks setup
www.rcfoamcutter.com
https://www.instructables.com/id/Homebuilt-DIY-CNC-Router-Arduino-Based-GRBL/