Open Source Rpi + FPGA CNC Controller - Page 1
Forum section: electronics / general

author: kunzem
author_rank: Contributor
timestamp: March 01, 2016, 01:41:15 pm
content: Hey everyone i want to share my latest project with you and probe for interest:The GoalAffordable Linuxcnc based controller for small CNC machines (<150€)Precision Control of stepper motor with upto 256 µSteps with state of the art driversOpen source hard- and softwareDesigned for thermal perfomace and size plus modularityApproachUsing a Rpi2/3 with a realtime capable linux (machinekit has nice images)Linuxcnc or the arm optimized machinekit variantFPGA-Companion for realtime step generation and IO + toysTrinamic 5130A Drivers with 2Amp, 256µSteps and alot of extrasSandwich build with drivers attached to a heatsink, motherboard in the middle and a Rpi + FPGA modules on top, bounded with simple pin headersMotivationBasicly i got 2 here, first is our university lab old CNC-Mill that we found in the basement without any control attached to it. In progress to make it usable again we tried china crap and failed on the quality, so we decided to make our own controller. Our goal was an affordable (you know labs not always got great fund) but still performant controller capable to WORK. The second idea was my own 3D-Printer build where i wasnt able to find a cool controller and the drivers kinda suck imho (i use NEMA23 2amp motors and ballscrews).First StepsSo i ordered some samples of the Trinamic Drivers, pushed out an test pcb design and assembled a crude prototype baseboard. On FPGA side i use a cheap (30€) Spartan3 module from Lithuania and coupled that to a Raspberry Pi2 via SPI at ~20Mbits. Modifying an existing SPI-Driver for Linuxcnc the whole thing was running (including FPGA design + drivers) on one weekend and milling the next day. This setup is still running for 3 months now and proved to work just fine.Current SituationI redesigned the drivers, slimmed them down and kicked some features (like on chip step generation, external clock etc) that is not needed really, so they are now 3x4 cm in size. This drivers i just got from the manufacturer plus an mainboard that holds all the stuff including the pi2 (or 3), the spartan3 and all the io stuff.The setup is to be assembled in the next weeks for further testing.Design stuff1. ULN2803A on the mainboard, yeah i know they are rusty old TTL shit, but they do their job done + they are solid (but still to be replaced later on)2. No isolation yet, thats a thing, the pcb size (10x10cm) dont really allow it, so a multilayer or bigger pcb is needed to get this in (its about 24V rails power stuff isolated to the 5/3.3V logic stuff)3. Rpi3 compatibility to be tested, just ordered one4. Rotary encoder, power mosfetts etc can be added via an extension headerSpecs for the upcomming boardRpi2/3 with linuxcnc for software stuffSpartan3 lifting the realtime and step generation upto 1MHz step frequency tested (100Mhz shouldnt be a problem)Trinamic TMC5130A drivers @2Amp with 256µSteps and fancies like beeing stealthchop, spreadcycle and shaft load measuring.SPI Interface from the FPGA to the drivers for realtime monitoring of their conditionSPI Bindung to the FPGA from the Rpi for 1ms cycle updates4 Axis with 2 endstops each (3x SUB-D9 connectors + one pin header)8 General purpose Inputs (open collector, 24V)8 Relay outputs (need for external protection diode, 500mA total sink)2 Channel Mosfet Fan control1 LM75 Temperature sensor attached to the board2 Extension Header for the FPGA (8 signals each)24 Power rail + 5V logic rail to be supplied from external.Cost estimationDrivers are fully assembled each ~10€ (tmc3130A with 6,7€ is major here, rest is filters, diodes, varistor, passives)Spartan3 module ~30€Rpi ~40€Connectors etc 20€PCB's depends really on qty and source lets say 10€ per 4-axis board.FPGA Jtag programmer is given (otherwise ~50€)estimates to 140€ totalFuture ideasUsing boards like the Arty7 for an ethercat style binding to a COTS-Computer (saving the PI plus adding a perfomance)Waiting for the announced Spartan7 from XilinxRedesign the baord again with proper isolationCasings with Heatsinks etcSo what do you think? i dont want to monetize this and would rather like to see a nice open source project affordable for everyoneLinks:Driverhttp://www.trinamic.com/products/integrated-circuits/integrated-motion-controller-stepper-driver/tmc5130FPGA fromhttp://www.ebay.de/usr/fpga.store?_trksid=p2057872.m2749.l2754seems out of stock atm, but any spartan3 will do itImages:2 Drivers attached to the heatsink (old rev):https://www.dropbox.com/s/cqsds87g765gnx1/2015-11-30%2020.05.25.jpg?dl=0Prototype:https://www.dropbox.com/s/05zyv97uj68y3au/2015-11-30%2020.03.11.jpg?dl=0Mainboard:http://pasteboard.co/1WqaCMOB.png(fpga is lower left, 4 drivers on the back)First outputs:https://www.dropbox.com/s/e678ykuqlrf6to4/2015-12-22%2020.07.14.jpg?dl=0(aluminium milled waveguide antenna parts)Testbed:https://www.dropbox.com/s/wcfmju9mo33mzpp/2015-12-15%2018.44.22.jpg?dl=0Sources:FPGA & Linuxcnc sources:https://github.com/magnifikus/TMC5130FPGA/tree/master/fpga/spartan3_ISELayouts are currently in Target 3000, need to figure something out

author: InterestedTom
author_rank: Regular Contributor
timestamp: April 12, 2018, 01:38:58 pm
content: Interested in how this is going now.

author: CM800
author_rank: Frequent Contributor
timestamp: April 12, 2018, 10:40:17 pm
content: Quote from: InterestedTom on April 12, 2018, 01:38:58 pmI am also called Tom.I am also interested how this is going...

author: NiHaoMike
author_rank: Super Contributor
timestamp: April 13, 2018, 02:12:37 am
content: Spartan 3 is quite dated. Spartan 6 is available for very cheap, not sure exactly how long it will remain supported.https://www.ebay.com/itm/XC6SLX16-Spartan-6-Xilinx-FPGA-Development-Board-w-32Mb-Micro-SDRAM-Memory/222739647376

author: ebastler
author_rank: Super Contributor
timestamp: April 14, 2018, 07:04:21 pm
content: Hi Tom and Tom,If you check the profile of user "kunzem", you will see that he was last active on this forum in July 2017. I'm afraid we can't expect a reply from him any time soon.Edit: The Github repository (last link in the original post) also wasn't updated for more than 2 years. Last updated in December 2015, i.e. there was no further activity after the post here.

author: Bassman59
author_rank: Super Contributor
timestamp: April 30, 2018, 09:17:28 pm
content: Quote from: ebastler on April 14, 2018, 07:04:21 pmAnother open-source project, abandoned by its creator who was unaware of the complexity of the idea before diving in.This sort of stuff is hard, otherwise everyone would be doing it.

author: Bob Sava
author_rank: Regular Contributor
timestamp: May 16, 2018, 04:16:05 pm
content: Maybe author realized that FPGA is not not needed if you have RPihttps://github.com/KevinOConnor/klipper

author: thm_w
author_rank: Super Contributor
timestamp: May 17, 2018, 11:09:04 pm
content: Heres another one:https://hackaday.com/2018/05/15/direct-cnc-control-with-the-raspberry-pi/