Full cnc controller

Page 1 of 6 1234 ... LastLast
Results 1 to 12 of 69

Thread: Full cnc controller

  1. #1
    Registered
    Join Date
    Apr 2007
    Location
    france
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Full cnc controller

    hello
    i have build a full cnc controller who can control full cnc machine without computer
    the board read the gcode in a sd-mmc card and drive the motors up to 50khz
    for the moment it do only linear interpolation (3axes) and drive the spindle with pwm and can switch on /off the coolant
    a manual mode can jog all axes in contius or in increments of 0.01 , 0.1 , 1 , 10 mm
    the remote mode is for rs232 com for sending one after one line of gcode
    the display is a simple KS0108 128*64 graphic lcd
    i have inclued a bootloader for flashing MCU without remove it
    when someone want to test i put the pcb on line and the firmware

    Similar Threads:
    Attached Images Attached Images
    Attached Files Attached Files


  2. #2
    Registered Crevice Reamer's Avatar
    Join Date
    Mar 2008
    Location
    USA
    Posts
    3655
    Downloads
    0
    Uploads
    0

    Default

    Very interesting! Kudos!

    CR.



  3. #3
    Registered slp_prlzys's Avatar
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    222
    Downloads
    0
    Uploads
    0

    Default

    great job, I tried to do the very same thing, but was not able to complete it due to lack of knowledge .

    mhel
    "This is intentionally left blank."


  4. #4
    Registered
    Join Date
    Mar 2006
    Location
    china
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    arnaud2 ,I want to test it,please put the pcb and schematic ,or email to me:zhangyue9331@126.com,thanks.



  5. #5
    Registered
    Join Date
    Apr 2007
    Location
    france
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    here is the pcb
    i have not doing schematic but it's easy tu understand how it works
    you must at the first programming the pic18f4620 with bootload.hex and after put the program with the bootloader software

    it have some little bug but that are modified in the next time

    if you have question

    Attached Images Attached Images


  6. #6
    Member Chris D's Avatar
    Join Date
    Apr 2005
    Location
    USA
    Posts
    438
    Downloads
    0
    Uploads
    0

    Default

    Very impressive work!

    Chris



  7. #7
    Registered
    Join Date
    Apr 2006
    Location
    egypt
    Posts
    169
    Downloads
    0
    Uploads
    0

    Default

    Very impressive work



  8. #8
    Registered
    Join Date
    Apr 2008
    Location
    Egypt
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    Very impressive work!



  9. #9
    Registered ImanCarrot's Avatar
    Join Date
    Nov 2005
    Location
    UK
    Posts
    1468
    Downloads
    0
    Uploads
    0

    Default

    Respect!

    That is some neat engineering

    I love deadlines- I like the whooshing sound they make as they fly by.


  10. #10
    Registered
    Join Date
    Sep 2006
    Location
    romania
    Posts
    218
    Downloads
    0
    Uploads
    0

    Thumbs up yap, nice

    Can you post schematics?
    What I really like to see is the source code, or the algorithms used for interpreting G-codes
    I can share my own design, with pic+ ethernet...



  11. #11
    Registered
    Join Date
    Apr 2007
    Location
    france
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    i cant give all the source code but i can give some routines of the program must be 100% free and i dont want that someone make buisness with it

    it is integrally writen with mikrobasic (aproximative 2500 lines of code)
    90% is only the menu and the display

    for driving the motors it use a simple bresenham algorythm

    Code:
    sub procedure do_line
    
    if px>maxx then fail=1 end if
    if py>maxy then fail=2 end if
    if pz>maxz then fail=3 end if
    
    if px<0 then fail=1 end if
    if py<0 then fail=2 end if
    if pz<0 then fail=3 end if                                 
    
    dx = ax - px
    dy = ay - py
    dz = az - pz
    
    dx = dx * stepratio
    dy = dy * stepratio
    dz = dz * stepratio
    
    stvel = 50000/(stvel1*stepratio)
    
    speed2 = 50000/(speed*stepratio)
    speed3 = 0
    
    acc2=acc
    
    coord = 0
    coord1 = 0
    coord2 = 0
    
    mx = 0
    my = 0
    mz = 0
    
    inv = -1
    ct = 0
    
       if dx < 0 then portb.6 = 1 dirx = 1  dx = dx*inv
                 else portb.6 = 0 dirx = 0  end if
                       
       if dy < 0 then portb.4 = 1 diry = 1  dy = dy*inv
                 else portb.4 = 0 diry = 0  end if
    
       if dz < 0 then portb.2 = 1 dirz = 1  dz = dz*inv
                 else portb.2 = 0 dirz = 0  end if
                 
       if dx > stepratio then spi_glcd_write_text("   MOVE",15,1,1) end if
       
       if dy > stepratio then spi_glcd_write_text("   MOVE",15,2,1) end if
       
       if dz > stepratio then spi_glcd_write_text("   MOVE",15,3,1) end if
    
       vm = sqrt((dx*dx)+(dy*dy)+(dz*dz))
       vm2 = vm
       
    
       
       if speed2 < stvel then speed3 = stvel  vel = 1
                              endvec = acc*((stvel-speed2)/10)
                         else speed3 = speed2  vel = 0
                              endvec = 0
                         end if
                         
          while (vm>0)and(porta.4=1)and(fail=0)
          
          if (portd.1=1)and(portc.0=0)and(menu=1) then spi_glcd_write_text(" PAUSE ",76,6,1)
                                                  delay_ms (1000)
                                                  while (portd.1=0)and(portc.0=0) wend
                                                     if speed2 < stvel then speed3 = stvel  vel = 1
                                                     else speed3 = speed2  vel = 0
                                                     end if
                                                  end if
          
          if vel=1
             then ct = ct +1
                  if ct = acc2 then speed3 = speed3-10 ct = 0 end if
                  if speed3stvel then speed3 = stvel end if
                  end if
    
          for delay = 0 to speed3
          nop
          next delay
    
          vm = vm - 1
          if dx<>0 then
          if coord > dx then coord = coord - vm2
                             portb.7 = 1
                             mx = mx +1 end if end if
          coord = coord + dx
          
          if dy<>0 then
          if coord1 > dy then coord1 = coord1 - vm2
                              portb.5 = 1
                              my = my + 1 end if end if
          coord1 = coord1 + dy
          
          if dz<>0 then
          if coord2 > dz then coord2 = coord2 - vm2
                              portb.3 = 1
                              mz = mz + 1 end if end if
          coord2 = coord2 + dz
    
          delay_us (2)
    
          portb.3 = 0
          portb.5 = 0
          portb.7 = 0
    
          wend
    
       if dirx = 1 then ax = ax + (mx/stepratio)
                   else ax = ax - (mx/stepratio)
                   end if
    
       if diry = 1 then ay = ay + (my/stepratio)
                   else ay = ay - (my/stepratio)
                   end if
    
       if dirz = 1 then az = az + (mz/stepratio)
                   else az = az - (mz/stepratio)
                   end if
    
    end sub
    if someone have a code to do circular interpolation with G02 and G03 i can integrate into the program

    for reading gcode it's verry simple i read it line after line

    if the 3 first carracters are G00 then rapid move
    if G01 the controled speed move

    here is the routine to read the values

    at the first i read a comlete line into the mmc (the routine is integred in mikrobasic) ans store it in a array of bytes

    Code:
    sub procedure read_gcode
    
    file = 0
    
    divider = 1
    
    while ((data[pointer]<47) or (data[pointer]>58)) and (pointer > 3)
          pointer = pointer - 1
          wend
    
    
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = (data[pointer]-48) * 100
       end if
    
    pointer = pointer - 1
    
    if (data[pointer]=46) and (pointer>3) then divider = 10
                                               pointer = pointer - 1 end if
            
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = file + (data[pointer]-48)*1000
            pointer = pointer - 1
            end if
            
    if (data[pointer]=46) and (pointer > 3) then divider = 100
                                            pointer = pointer - 1 end if
                                            
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = file + (data[pointer]-48)*10000
            pointer = pointer - 1
            end if
    
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = file + (data[pointer]-48)*100000
            pointer = pointer - 1
            end if
    
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = file + (data[pointer]-48)*1000000
            pointer = pointer - 1
            end if
    
    if (data[pointer]>47) and (data[pointer]< 58) and (pointer > 3)
       then file = file + (data[pointer]-48)*10000000
            pointer = pointer - 1
            end if
            
    if (data[pointer]=45) and (pointer > 3)
       then inv2=1
            pointer = pointer - 1
       else inv2=-1
            end if
    
    
    file = file /divider
    
    if (data[pointer]=88) and (pointer > 3) then px = file+opx end if
    
    if (data[pointer]=89) and (pointer > 3) then py = file+opy end if
    
    if (data[pointer]=90) and (pointer > 3) then pz = (file*inv2)+opz end if
    
    if (data[pointer]=70) and (pointer > 3) then setspeed = file/10 end if
    
    if (data[pointer]=83) and (pointer > 3) then setrpm = file/100 end if
    
    if (data[pointer]=84) and (pointer > 3) then tool = file/100 end if
    
    file = 0
    
    end sub




  12. #12
    Registered cwiliam's Avatar
    Join Date
    Jun 2004
    Location
    United States
    Posts
    33
    Downloads
    12
    Uploads
    0

    Default

    seen ths
    http://www.fisertek.it/index_000044.html

    i was hoping to see it finished but the owner of the webpage email me saying he doesn't have time

    hopefully I can make Arnaud2's great cnc controller

    thank you so much for sharing



Page 1 of 6 1234 ... 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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Full cnc controller

Full cnc controller