Author Topic: Open Source Rpi + FPGA CNC Controller  (Read 5859 times)

0 Members and 1 Guest are viewing this topic.

Offline kunzem

  • Contributor
  • Posts: 10
  • Country: de
Open Source Rpi + FPGA CNC Controller
« on: March 02, 2016, 12:41:15 am »
Hey everyone i want to share my latest project with you and probe for interest:

The Goal
  • Affordable Linuxcnc based controller for small CNC machines (<150€)
  • Precision Control of stepper motor with upto 256 µSteps with state of the art drivers
  • Open source hard- and software
  • Designed for thermal perfomace and size plus modularity


Approach
  • Using a Rpi2/3 with a realtime capable linux (machinekit has nice images)
  • Linuxcnc or the arm optimized machinekit variant
  • FPGA-Companion for realtime step generation and IO + toys
  • Trinamic 5130A Drivers with 2Amp, 256µSteps and alot of extras
  • Sandwich build with drivers attached to a heatsink, motherboard in the middle and a Rpi + FPGA modules on top, bounded with simple pin headers


Motivation
Basicly 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 Steps
So 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 Situation
I 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 stuff
1. 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 one ;)
4. Rotary encoder, power mosfetts etc can be added via an extension header

Specs for the upcomming board
Rpi2/3 with linuxcnc for software stuff
Spartan3 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 condition
SPI Bindung to the FPGA from the Rpi for 1ms cycle updates

4 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 control
1 LM75 Temperature sensor attached to the board
2 Extension Header for the FPGA (8 signals each)

24 Power rail + 5V logic rail to be supplied from external.

Cost estimation
Drivers 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€ total :)


Future ideas
Using 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 Xilinx ;)
Redesign the baord again with proper isolation
Casings with Heatsinks etc


So what do you think? i dont want to monetize this and would rather like to see a nice open source project affordable for everyone



Links:
Driver http://www.trinamic.com/products/integrated-circuits/integrated-motion-controller-stepper-driver/tmc5130
FPGA from http://www.ebay.de/usr/fpga.store?_trksid=p2057872.m2749.l2754   seems out of stock atm, but any spartan3 will do it ;)




Images:
2 Drivers attached to the heatsink (old rev): https://www.dropbox.com/s/cqsds87g765gnx1/2015-11-30%2020.05.25.jpg?dl=0
Prototype: https://www.dropbox.com/s/05zyv97uj68y3au/2015-11-30%2020.03.11.jpg?dl=0
Mainboard: 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=0

Sources:
FPGA & Linuxcnc sources: https://github.com/magnifikus/TMC5130FPGA/tree/master/fpga/spartan3_ISE
Layouts are currently in Target 3000, need to figure something out :)







« Last Edit: March 02, 2016, 12:59:37 am by kunzem »
 
The following users thanked this post: thm_w

Offline InterestedTom

  • Regular Contributor
  • *
  • Posts: 51
  • Country: england
Re: Open Source Rpi + FPGA CNC Controller
« Reply #1 on: April 12, 2018, 11:38:58 pm »
Interested in how this is going now.
 

Offline CM800

  • Frequent Contributor
  • **
  • Posts: 836
  • Country: 00
Re: Open Source Rpi + FPGA CNC Controller
« Reply #2 on: April 13, 2018, 08:40:17 am »
Interested in how this is going now.

I am also called Tom.

I am also interested how this is going...
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 4272
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Open Source Rpi + FPGA CNC Controller
« Reply #3 on: April 13, 2018, 12:12:37 pm »
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
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 1818
  • Country: de
Re: Open Source Rpi + FPGA CNC Controller
« Reply #4 on: April 15, 2018, 05:04:21 am »
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.
« Last Edit: April 15, 2018, 05:09:03 am by ebastler »
 

Offline Bassman59

  • Frequent Contributor
  • **
  • Posts: 845
  • Country: us
  • Yes, I do this for a living
Re: Open Source Rpi + FPGA CNC Controller
« Reply #5 on: May 01, 2018, 07:17:28 am »
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.

Another 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.
 

Offline Bob Sava

  • Regular Contributor
  • *
  • Posts: 84
  • Country: us
Re: Open Source Rpi + FPGA CNC Controller
« Reply #6 on: May 17, 2018, 02:16:05 am »
 :'(

Maybe author realized that FPGA is not not needed if you have RPi https://github.com/KevinOConnor/klipper
 

Offline thm_w

  • Frequent Contributor
  • **
  • Posts: 693
  • Country: ca
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf