Hello BMorse.

BMorse

Joined Sep 26, 2009
2,675
Take your time, having something done right the first time is always good..... Trust me, it took me a few years before I finally got around to finishing my PCB Mill/Drill + General Engraver.....

B. Morse
 

Wendy

Joined Mar 24, 2008
23,408
Do you have to invent your own CNC language? I know it is pretty simple overall, but just wondered if there is a standard.
 

BMorse

Joined Sep 26, 2009
2,675
Do you have to invent your own CNC language? I know it is pretty simple overall, but just wondered if there is a standard.

No you do not have to "invent" your own CNC language, there is actually a standard protocol :

LIKE ANY COMPUTER-BASED system, CNC has a protocol -- that is, the way you have to program it to do its work. The primary protocol is CNC (Computer Numerical Control) language. CNC language is often specific to a particular machine from a particular manufacturer, but some elements are constant. For example, any line or block (the two terms are interchangeable) of program that appears on a display screen consists of six "words." Following is an example of a line of a program:

N01 - the line (block) number

G02 - the preparatory code

X3.0 - movement in the X-axis

Z4.5 - movement in the Z-axis

F.5 - feed speed


M30 - miscellaneous code

G codes, and to a certain extent M codes, are the foundation of CNC programming. G codes prepare and introduce certain operations to occur on the machine. They are a two-digit number (00 to 99) preceded by the word address letter "G." This G code determines the mode of operation for the machine. There have been attempts to standardize G codes among manufacturers and many are common to some degree, but many companies still use proprietary codes that are particular to their machines. Regardless of manufacturer, G codes are used to perform the following four operations:

1. Select a measurement system (English or metric);

2. Program for compensation and differences in tool lengths and diameters;

3. Select a movement system, i.e., rapid traverse or programmed feed rate;

4. Select a preset preset Cardiac pacing A parameter of a pacemaker that is programmed permanently when manufactured sequence of events known as canned cycles.

A few G codes that seem to be standard across brands of CNC equipment are G00 (rapid traverse for point-to-point positioning), G01 Linear interpolation, G02 (circular interpolation)

M (for miscellaneous) codes act as on/off switches for the functions they control. They vary widely between different machines (even more than G codes) because the number of programmable con trolled switching functions vary widely from machine to machine. A few of the more common ones are M00 (program stop), M03 Spindle control ( Like G codes, M codes are also modal and nonmodal. If a machine has a particular need, for example, to turn vacuum on and off, an M code will be included in its programming protocol.

At a bare minimum, any CNC machine's programming codes should comply with ANSI/EIA standard RS-274-D; that is:

A = Rotation about the X axis

B = Rotation about the Y axis Y axis,
n See axis, Y.

C = Rotation about the Z axis

F = Feed rate commands

G = Preparatory functions

I = Circular interpolation X-axis offset

J = Circular interpolation Y-axis offset

K = Circular interpolation Z-axis offset

M = Miscellaneous commands

N = Sequence number

O = Sequence number for the secondary axis

R = Arc radius

S = Spindle speed

T = Tool number

X = X-axis data

Y = Y-axis data

Z = Z-axis data

Taken together, these codes tell the machine what to do, but not where to go. That function is left to the machine axes and coordinates.
here is a CNC program I had created in eagle to do a small circuit board, this is just the milling file, normally drill files are separate....

Rich (BB code):
( This file generated  9/11/2007 09:46:24a )  ( T01 0.023622 )
 ( T02 0.032000 )
 ( T03 0.040000 )
 G20
  G90
 M05
 G00 X0.0000 Y0.0000 Z1.0000 
 M06 T01  ; 0.0236 
 G00 Z0.1250 
 M03
 G04 P3.000000
 G00 Z0.125000
 G00 X-0.1750 Y0.1000 
 G01 Z0.0000 F8.00  
 G01 Z0.125000
 (R0.1250  P3.000000)
 (G00 Z0.125000)
 G00 X-0.1750 Y0.4500 
 G01 Z0.000000
 G01 Z0.125000
 M05
 G00 X0.0000 Y0.0000 Z1.0000 
 M06 T02  ; 0.0320 
 G00 Z0.1250 
 M03
 G04 P3.000000
 G00 Z0.125000
 G00 X-0.2500 Y0.3250 
 G01 Z0.0000 F8.00  
 G01 Z0.125000
 (R0.1250  P3.000000)
 (G00 Z0.125000)
 G00 X-0.2500 Y0.4250 
 G01 Z0.000000
 G01 Z0.125000
 (G00 Z0.125000)
 G00 X-0.2750 Y0.2250 
 G01 Z0.000000
 G01 Z0.125000
 (G00 Z0.125000)
 G00 X-0.5250 Y0.1000 
 G01 Z0.000000
 G01 Z0.125000
 (G00 Z0.125000)
 G00 X-0.6750 Y0.2250 
 G01 Z0.000000
 G01 Z0.125000
 (G00 Z0.125000)
 G00 X-0.7250 Y0.1000 
 G01 Z0.000000
 G01 Z0.125000
 M05
 G00 X0.0000 Y0.0000 Z1.0000 
 M06 T03  ; 0.0400 
 G00 Z0.1250 
 M03
 G04 P3.000000
 G00 Z0.125000
 G00 X-0.4250 Y0.3500 
 G01 Z0.0000 F8.00  
 G01 Z0.125000
 (R0.1250  P3.000000)
 (G00 Z0.125000)
 G00 X-1.1250 Y0.3500 
 G01 Z0.000000
 G01 Z0.125000
 (File Footer)
 T01 
 G00 Z0.0620 
 M05
 M02
B. Morse
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
I hope this is going to be that complicated. Even though this is my first attempt, it's going to be great project made via communication from this forum.

The supply is progressing, the first part is almost done now.
It will be one beefy PSU. With independent 4 outputs. Two 0 to 30V fully variable @ 8 Amps continues current sourcing capability. CV and CC mode selectable. Two 5V @ 5A, short circuit protected, and yes, 5V source is also current sourcing adjustable. And my best feature, built in Voltage and Current digital meters with 4 digit readouts.

Manage to light up a resistor in my face :eek: at the testing stage.
not bad, huh! just one resistor turned to ash. Tells me the power transistor is capable of handling current surges of quite a high level. :D.

Cheers

Rifaa
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
That would be a no :( those things are to come by.
But I am pretty confident around fire.
Reminds me, let me tell you a little story.

I think you knw about the ultrasonic cleaner that is used to clean mobile phone circuit boards. Well, a friend of mine gave me one and it was broken. And I couldn't get the oscillator to work, since it was a cheap Chinese model with IC no's scraped off, it ended up in the junk.
I had the tray removed and was hoping to heat up a board to, I really don't know how I came with this stupid idea. I poured in some thinner and had the tray clamped on to my bench. put the dirty board inside and lit a Bunsen burner underneath. The heat was turned all the way down to be safe and after a while the thinner was not heating up and the dirt does not seem to be coming off. frustrated I turned the heat, and all this time I was pretty near the tray looking into it.
So after a while it still wasn't heating up, I got a bit angry, so I turned my hot gun and put it underneath with the burner.
Pretty soon my eyes started to water, so now I now it's heating.
After a while.... POOOOOOOOOOOOOOOOF!!.
The whole tray caught fire. Nearly burned my eye brows. But the good thing was I did not panic, instead sat their thinking now how the hell am I going to put this out, being a liquid I cannot cover it with a dry cloth and it was too hot to touch, and all in all it was midnight.
So slowly I held the tray with plier, removed it from the vise it and slowly without spilling any thinner, I took it out and lit the whole street with fire and ran over it. :D.

I leaned a lesson though

NEVER HEAT THINNER WHAT SO EVER, AND NEVER PANIC AROUND A FIRE.

 
Last edited:

retched

Joined Dec 5, 2009
5,208
Oh, jeez-us. That reminded me of a time a friend and me were building a go-kart. He had a horse farm with the horses long gone. There were bathtubs everywhere used as watering troughs, and old tractors, lawn mowers, scrap parts, every where. So we got the frame together and mounted the motor with its itty-bitty gas tank. It was fun, but ran out of gas too quick. So a few days later we are walking around his farm looking for stuff and lo-and-behold, a nice 2 gallon riding mower gas tank in a water trough. Genius opened the lid to look inside, but it was dark. So, he lit a lighter to see inside.

NO - MORE - HAIR.

Well mostly, no bangs, no eye brows, lashes, and half of the hair on the back of his head was gone.

Stunk...bad..

Be careful, kids.
 

retched

Joined Dec 5, 2009
5,208
Yeah... You should of been there. He had a raccoon mask of burn around his eyes (Not to bad). So for the next hour, we drove around the horse track in a '69 Mustang he was rebuilding that had no windshield, so the wind would hit his face, cooling him. We were waiting for his parents to go out so we could get in the house without them freaking out over their sons newly and oddly crafted hairdo.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Yeah... You should of been there. He had a raccoon mask of burn around his eyes (Not to bad). So for the next hour, we drove around the horse track in a '69 Mustang he was rebuilding that had no windshield, so the wind would hit his face, cooling him. We were waiting for his parents to go out so we could get in the house without them freaking out over their sons newly and oddly crafted hairdo.
:D Please stop...
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Hey.
Got the supply working, but I am not satisfied with the meters, I like to have 4 digit read out, so that I can get 2 decimal accuracy. The 7107 IC's only give 1 decimal.
So I am thinking of using a PIC to make a 4 digit read out.
Does any one have any idea where I can find this type of hex or asm that is already made.
I have plenty of 16F88's. Will this suffice my needs.
If it does I think I can try to make one ASM.

B Morse.

Regarding the engraver, what type of μC will I need to control all the axis from my PC.
Can you give me a heads up so that I can order it before hand. It's OK if the PIC is big, The bigger the better for later improvements.
I am checking out the screw threads that you sent me, I think I will buy them, haven't decided yet.

I'll be posting the stepper and the drivers I have real soon.
Before that I need to get some solder. I ran out just now.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
By the way Mod's, How about moving this thread to the project forum.
Since it's going to be forum project to some extent.
just a thought.
 

BMorse

Joined Sep 26, 2009
2,675
B Morse.

Regarding the engraver, what type of μC will I need to control all the axis from my PC.
Can you give me a heads up so that I can order it before hand. It's OK if the PIC is big, The bigger the better for later improvements.
I am checking out the screw threads that you sent me, I think I will buy them, haven't decided yet.

I'll be posting the stepper and the drivers I have real soon.
Before that I need to get some solder. I ran out just now.

Well, when I built this particular machine I used what I had available at hand. I had a lot of Pic16F84A's so I used those..... You could probably build a much better controller using a newer pic, and control all 3 axis with one pic, I used 1 F84A for each axis to control the UDN2998W Dual HBridge to drive these NEMA23 Bipolar steppers (This is not the easy way ;) ).....

But you can use an off the shelf IC to perform the same task without the hassle of writing code..... I am actually in the midst of trying to design a 4 axis controller using these ic's from allegro >> http://www.allegromicro.com/en/Products/Part_Numbers/3982/ (this is the easy and best way :rolleyes: )

Possibly going to base the circuit for this IC on RepRap's Ver 2.3 Motor driver circuit, but just using the motor driver part of the circuit.. http://dev.www.reprap.org/bin/view/Main/Stepper_Motor_Driver_2_3


But, if you want to try and control the stepper yourself using a uc, the F88 you have will work just fine..... But I would highly suggest using a stepper motor IC instead and save some time avoiding the hassle's of writing phase sequencing algorithms :D


And for the screw threads, make sure your steppers are adequate to turn whatever size screw you choose, and the screw size depends on how big the machine is you are building.... so I would really focus on the motors first and find out more about them, since you mentioned these are salvaged, are they all the same for each axis??
 
Last edited:

BMorse

Joined Sep 26, 2009
2,675
Another tip:

I know it is very exciting putting something together like this and you are very eager to get it done and working.... BUT, you have to slow your pace and you need to take the time to determine a few things before you jump head first into something and start spending money on parts......

Money was one consideration I had to make when I built my cnc, basically, I had no budget at all so I had to make due with what I had laying around and trying to piece together this dream machine or mine.... well, I was in for a lot of disappointment along the way(which you can avoid if you take your time and do things the right way...), one of my main downfall was the motors, I had these motors I salvaged from some printers and scanners and I thought I was well on my way, well, these motors couldn't do squat for any decent sized machine, (Unless i just wanted to make a really small "laptop" cnc :) ) anyways, enough of the rambling....

You need to double check your motors, do some research, make sure they are going to be capable of accomplishing what you want, their torque and speed will determine the size of your machine..... In the pic below, it shows 2 different setups, the top stepper is my current setup with the NEMA23 steppers, (Notice the size...) the bottom motor is one salvaged from a flatbed scanner, now if you look you can see the smaller motor is only capable of driving small loads, hence the small screw drive (1/4-20 threaded rod) and the small axis rails.....

Stepper size difference.jpg

BTW, after some research I found my steppers specs...

Rated phase current: 2,1 A
Phase resistance: 1,1 Ω
Phase inductance: 2,0 mH
Holding torque bipolar: 60 Ncm
Detent torque: 6 Ncm
Rotor inertia: 124 gcm2
Weight: 0,5 Kg
Insulation class: B

From this information I figured out what I needed to run them.... so the first step should have been motor research, then control and power supply would be next...... try not to "put the carriage before the horse" so to speak... so lets see some specs and photos for your motors ;)

 
Last edited:
Top