Page 1 of 2 12 LastLast
Results 1 to 40 of 47

Thread: My Homemade CNC

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    My Homemade CNC

    Took me couple of months to make it.

    It's controlled by a PIC16F877
    3 Axis, 4 Motors
    Precision: Logical: 1000'th of an inch, Actual: probably 10'th of an inch

    The code for the microcontroller I wrote it in MikroC, about 500 lines, and overclocked it to 24MHz but still not fast enough

    The code for the computer I wrote it in VB6, about 600 lines of code.

    Here are the pics:
    Attached Images Attached Images    

  2. #2
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: My Homemade CNC

    Well done!! I like these kind of projects.

  3. #3
    Hyperactive Member BillGeek's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Posts
    440

    Re: My Homemade CNC

    That is brilliant! It rates up there with Wossy's LCD display.

    How did you get the COMM controller working? I don't have an idea of what goes on with this electronic circuitry stuff. I started trying out the PIC programming, though I didn't get far with it.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: My Homemade CNC

    That's a great CNC. I tried making a CNC just like that once, I only got as far as buying a pen.

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: My Homemade CNC

    Really nice!
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    Quote Originally Posted by BillGeek View Post
    That is brilliant! It rates up there with Wossy's LCD display.
    No it doesn't. That plotter is about 700 times better than my poxy LCD experiment.

    Nice work CVM.
    I don't live here any more.

  7. #7
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: My Homemade CNC

    I see no difference between the success of this and the LCD, can you write out "Kregg is an Ubuntard" Then we can compare.


    Seriously, good work CSM

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    The amount of work CVMichael has done looks massively more involved than my project, I didn't have to program a PIC chip either, that is no mean-feat in itself. I'm filled with awe at that plotter's greatness.
    I don't live here any more.

  9. #9
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: My Homemade CNC

    That's awsome CVMichael!
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows

  10. #10
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: My Homemade CNC

    How do you learn to do stuff like that?

    Edit: PS. Can we get a video of it in action?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  11. #11
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: My Homemade CNC

    shweet!

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    I will answer more of your questions when I get home (I'm at work now).

    Quote Originally Posted by Atheist View Post
    How do you learn to do stuff like that?

    Edit: PS. Can we get a video of it in action?
    I have a video with it, but it's 3:49 minutes (3 min, 49 sec), and 680 MBytes I have it on my home web-site. The movie is HD quality (30 Fps, 1280x720, Camera: Lumix TZ5), that's why it's so big.

    I can give you a link to it, but I DON'T want to make it public because it will KILL my bandwidth because of it's size.

    Send me a PM if you want to see the movie.

    PS. The movie is MOV type, how can I compress it ?

    Maybe I should compress it first, before I give the link to anyone... *thinking* ... probably I should do that....
    Last edited by CVMichael; Apr 14th, 2009 at 09:32 AM.

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: My Homemade CNC

    Try something like RadTools to compress it, then upload to youtube so your bandwidth isn't hit.

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    I uploaded on YouTube, but I get "This video is not yet processed."

    How long does it take to process ?

    Quote Originally Posted by Atheist View Post
    How do you learn to do stuff like that?
    Well, there are many things you need to know to do it. And I learned a LOT of things by doing it.

    I started to learn electronics when I was 11 years old. It was my hobby. I was one of those quiet shy guys, that everyone picked on (I don't want to go into details on that). But let's say that I spent a lot of time in house, playing with my electonics, figuring thigs out by trial and error, there was no one to teach me. When I was 16, I came to Canada, where I started right away to learn programming in C and VB as a hobby, and also at school. At school I was basically teaching the teacher, and in college I jumped 2 levels. I did programming classes from semester 4 in second semester, and it was still easy for me.

    Mid last year, I realized that I did not do any electronics for like 10 years, and I missed that sooo much. So I set myself a bigger task than I should have: To make a robot.
    I have the right combinations of skills to do it: electronics, programming, and some hardware (but that's not that hard to learn).

    I started, and not long after I realized that many parts that I needed, have to be custom made. My father works with CNCs at his work, but I could not rely on him (every time I tried it took way to long to get what I wanted). So I dropped the robot (temporarily), and set myself to make my own CNC so I can use it to make the parts for the Robot.

    Last year, I did not even know what a Microcontroller was, now I am in love with them I bought the full MikroC, and also bought a Programmer (ICD2). It was a very difficult start, but once I learned the basics, everything else is easy.

    So... that's my story in short.

    Anyways... By the time I finished writing this message, the one YouTube also finished processing.

    So here it is !

    http://www.youtube.com/watch?v=izudmpqHE74

    What do you think ??

  15. #15
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: My Homemade CNC

    Very impressive

    Can it draw micky mouse?

  16. #16

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    Not yet, I still have to change the program to draw curves. I guess I could draw curves by drawing small lines.

    I still have to do some more programming to make it work the way I want it too...

    I guess the next step after that is to make it interpret diferent file formats that I give it, and convert that into my own code.

    So, in terms of programming, there is still a lot to do.

    [edit]
    Do you have a picture of micky mouse that can be easily interpreted to lines & coordinates ?

    [edit 2]
    This one looks achievable (I think):
    http://www.howtodrawguide.com/wp-con...ite-papers.jpg
    Last edited by CVMichael; Apr 14th, 2009 at 10:45 PM.

  17. #17
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: My Homemade CNC

    So it works with the coordinates that you supply it? I was wondering how you were doing it, then i saw the program in the video. Makes sense.

    i was thinking something simpler like this:
    http://people.mozilla.com/~faaborg/f...onicMickey.png

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    Here is the actual code to draw the "HELLO"
    Code:
    Private Sub cmdProgramTest2_Click()
        CNC.Speed(X_Axis) = 15
        CNC.Speed(Y_Axis) = 15
        CNC.Speed(Z_Axis) = 11
        
        MakeMove X_Axis, 40000 - CNC.X_Pos
        MakeMove Y_Axis, 7000 - CNC.Y_Pos
        MakeMove Z_Axis, 30000 - CNC.Z_Pos
        
        CNC.Speed(X_Axis) = 12
        CNC.Speed(Y_Axis) = 15
        CNC.Speed(Z_Axis) = 10
        
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        
        MakeMove Z_Axis, 8000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, -4000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove X_Axis, 4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, 4000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove Z_Axis, -8000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        
        MakeMove X_Axis, 2000
        
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove Z_Axis, 8000
        MakeMove X_Axis, 4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, -4000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove X_Axis, -4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, -4000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove X_Axis, 4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        
        MakeMove X_Axis, 2000
        
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove Z_Axis, 8000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, -8000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove X_Axis, 4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        
        MakeMove X_Axis, 2000
        
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove Z_Axis, 8000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        MakeMove Z_Axis, -8000
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        MakeMove X_Axis, 4000
        MakeMove Y_Axis, 1000 - CNC.Y_Pos
        
        MakeMove X_Axis, 3000
        
        MakeMove Y_Axis, 0 - CNC.Y_Pos
        
        MakeMoveXZ -1000, 1000, 15, 15
        MakeMove Z_Axis, 6000
        MakeMoveXZ 1000, 1000, 15, 15
        MakeMove X_Axis, 2000
        MakeMoveXZ 1000, -1000, 15, 15
        MakeMove Z_Axis, -6000
        MakeMoveXZ -1000, -1000, 15, 15
        MakeMove X_Axis, -2000
        
        MakeMove Y_Axis, 2000 - CNC.Y_Pos
        cmdZeroAllAxis_Click
    End Sub

  19. #19
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: My Homemade CNC

    It's completely static though, how about dynamic printing?

  20. #20
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: My Homemade CNC

    CVM that is insane!

  21. #21
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    CNCPrint("Klegg is a ubuntard!");
    I don't live here any more.

  22. #22

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    Quote Originally Posted by MaximilianMayrhofer View Post
    It's completely static though, how about dynamic printing?
    Yea, I know... There is still a lot of programming to do...

    Today I will be working to add sensors to know when it reached the "end of line".

    For example, If the current position is 1000, and I give the command "MakeMove Z_Axis, -1000000", right now it does not know to stop when it reached 0 (Zero). I am talking about the hardware side. So, when it's executing that command, the motor does not stop even though it reached the end and cannot go anymore.

    I already have ONE working sensor on the X axis:
    Name:  20090413 004b.JPG
Views: 5652
Size:  37.0 KB
    But I still have to install 7 more !
    Last edited by CVMichael; Apr 15th, 2009 at 08:25 AM.

  23. #23
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: My Homemade CNC

    Quote Originally Posted by wossname View Post
    CNCPrint("Klegg is a ubuntard!");
    CNCPrint("Klegg is an ubuntard!");
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All Threads • Colors ComboBox • Fading & Gradient Form • MoveItemListBox/MoveItemListView • MultilineListBox • MenuButton • ToolStripCheckBox • Start with Windows

  24. #24

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    When I will make the "CNCPrint" function, I will pass the parameter string through a grammar & spelling check. And when it's wrong it will give an error message.

    How about that ?

  25. #25
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: My Homemade CNC

    You could stand to do a bit of OO on that. Come up with a few primitive classes that will draw lines, scalable lines, curves, and scalable curves based on parameters suppied. Then build a series of classes that make use of the primitives to build scalable letters and symbols (font classes), and then you, too, can write "Kregg is an Ubuntard!." with simple calls.
    My usual boring signature: Nothing

  26. #26

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    There are 3 ways to draw / move curves (that I can think of)

    One is to calculate all the points of the curve, and send the arrays of data to the microcontroller, and handle the points as sets of tiny lines. But this means you need a fast connection between the computer and mictrocontroller and also a large buffer (memory) on the microcontroller.

    Second option is to make the code of the microcontroller calculate those values as it's moving, and only pass the parameters of the curve, like center points, radius, start from, end at, etc... This requires a faster microcontroller.

    Third option, to pass the formula to the microcontroller along with it's variables (values). This requires even faster microcontroller, but I think the most flexible. (Imagine passing a formula for a fractal )

    And of course a combination of any of the above would be even better.

    Unfortunatelly, the microcontroller that I'm using right now does not have a large memory, does not have a fast connection to the computer, and it's already overclocked !

    So, I think I will have to buy a faster one (and most likely I will).

  27. #27
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: My Homemade CNC

    How much will a faster microcontroller cost you CVM?

  28. #28
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: My Homemade CNC

    A faster microcontroller may not be the solution. How much faster of a PIC chip can you get? Consider offloading the task to a second chip.
    My usual boring signature: Nothing

  29. #29

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    This is the microcontroller that I am using now: PIC16F877, and this is the one I want to get PIC18F4550. There are even faster ones, but this one has the same # of pins, and simmilar pin configuration (input & output).

    It's double the speed, and the same price as when I bought the PIC16F877. Since I bought it the PIC16F877, they doubled the price , before it was the other way around, the PIC18F4550 was more expensive...

    When I bought the first PIC16F877, in the local electronics store, it was $20 (I bought one). After a few weeks I found www.microchip.com, and bought 4 of them with $20 !!! The downside is the delivery cost. So I bought other chips, and other microcontrollers also, but unfortunatelly I did not figure out how get them to work yet (I have to admit, I did not try that hard)


    "offloading the task to a second chip", well the problem with that is the communication between them, and the connection between them, it takes extra processing for each chip just to "talk" with eachother, and of course extra programming to make it "talk" with eachother, and a separate program on each chip. Synchronizing them would be the most difficult part (I think).

    I already thought about that, and when I tried, I found out that in order for them to communicate, I have to use a protocol called I2C. There are 2 problems with that. The protocol is a Master / Slave type of communication. The chips' hardware supports only Master. The Slave can be simulated with software (i.e. program in the chip). MikroC has functions already made for Software I2C, BUT you cannot use Interrupts when using Software I2C. And I have to use interrupts to control the motors.

    So that's why I want a faster microcontroller as opposed to linking 2 (or more) together.

    And in terms of price, considering what the microcontroller does (i.e. replacing hundreds of other chips through programming), $5 is not a lot at all... Of course, because of the delivery costs, I will buy a few of them, and maybe other chips to make it worth while.

  30. #30
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: My Homemade CNC

    Actually, to draw the curve you would use the same MakeMove(X_Axis) and MakeMove(Y_Axis) statements you are currently using, and simply vary the speed of the motor along the x or y axis at some constant rate. Simple mathematics will allow you to create any kind of curve you like just by varying the speed at the appropriate rate. Of course, I am making the assumption that you can execute an alter speed command while the motor is running.

    Otherwise, you would want to try for a dense array of points.

    EDIT: Of course, even if you can only execute one command, like a make move command at a time, you can vary the voltage to the motor independently and achieve the same result.
    Last edited by MaximilianMayrhofer; Apr 16th, 2009 at 12:48 AM.

  31. #31
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: My Homemade CNC

    Perhaps its good to look at HPGL or Gerber to get an idea.

  32. #32
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    PIC programming is a nightmare if you're limited to using chips with a small number of IO pins. It took me 2 weeks to make a 16-pin (total) chip play "Happy Birthday" on a piezo speaker (with 8 associated flashing LEDs). What a nightmare.

    Get the biggest, most pin-festooned PIC chip you can afford and then you'll have a ton of resources. Alternatively you could get an FPGA
    I don't live here any more.

  33. #33
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: My Homemade CNC

    I like Atmel with her AVR family more then PIC. The problem with PIC is also that they change the product line often. But this is all my opinion.

  34. #34
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    CVM, how do you make the stepper motors work?

  35. #35

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    Hi wossname,

    I cannot find the exact schematic on the net right now, when I get home, I can post the exact one that I'm using.

    It's basically this one, with small modifications:

    Here is a thread on an electronics forum about a problem I had with another motor that I was playing with:
    http://forum.allaboutcircuits.com/sh...ad.php?t=12814

    So the input from that schematic goes directly to the output of the microcontoller. You can actually see this in the pictures on my CNC.

    When I started to learn about microcontrollers, I looked up books, and first one I found was programming with PICs, so I invested money to buy books (2 books), and chips using PICs. Only after a while I found out about the other types of microcontrollers. And since I already started that way, I did not want to switch...

  36. #36
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    I'm still in awe of these machines you've made.

    How come the vertical axis is so tall? Is that so you can mount a larger tool on it like a drill or laser or something?

    My 2d pen plotter will be a pitifully small feat compared to yours but I'll provide a link to it when it's finished.

    Good job.
    I don't live here any more.

  37. #37

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    This CNC is dismantled, I don't use it anymore... take a look at the second one I made.

    The vertical axis is tall because I want to be flexible.
    Mostly for the reasons you said, and so that I can make (sculpt) bigger object, not just thin and flat object, and...

    Another thing I want to do with the CNC is a 3D scanner. For example I put a coffee cup on the CNC, and with a touch sensor (something like this), I can plot each point on the computer, and render the coffee cup on the computer in 3D.
    For this I need a large Y axis so that I can put big objects on it...

    My 2d pen plotter will be a pitifully small feat compared to yours but I'll provide a link to it when it's finished.
    That would be nice to see !! post it as soon as you have something. Maybe I can (or other ppl) can give you ideas on improvements?

  38. #38
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    That scanner idea is so cool. Did you make the probe yourself?
    I don't live here any more.

  39. #39

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,802

    Re: My Homemade CNC

    I made an attempt to create a touch probe, and it came out pretty good (using a 5mW laser ), but if I get the chance to buy a real probe (that I can afford), probably from e-bay, then I would rather do that... of course, then I will have to figure out how to connect the probe to my microcontroller...

  40. #40
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: My Homemade CNC

    I'm still actually making the parts for my machine and I'm basically improvising as it goes along. I'm trying to make the tool mount modular as far as possible. So potentially a simiple scanning tool might work.

    I was wondering about using a simple electrical contact as a touch sensor. Basically move the Z axis down slowly until there's a signal and then move up again and slide over a bit. Then rinse and repeat until the area is scanned. This sounds much harder than the rest of the project put together actually!
    I don't live here any more.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width