![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Open Source Controller Boards Discussion for Open Source CNC type Controller Boards and other related items. (for personal use only) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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 |
|
#5
| |||
| |||
| 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 |
| Sponsored Links |
|
#11
| |||
| |||
| 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 speed3 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
| ||||
| ||||
| 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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help!- FULL CNC or DRO | Gunther45 | Benchtop Machines | 4 | 06-08-2008 09:28 AM |
| full 5th | timf | EdgeCam | 0 | 04-28-2008 07:05 AM |
| 6cm Full Bullnose | DennisCNC | Glass, Plastic and Stone | 1 | 09-05-2007 09:10 PM |
| who sells full kit | ataxy | Benchtop Machines | 4 | 06-19-2007 11:45 AM |
| memory full | ad1z | Haas Mills | 5 | 11-16-2006 12:59 PM |