. .
  1. #1
    Hello!
    I'd like to present first ever CNC machine controller implementation on pure Python(even without dependencies or any C modules) for ARM based Linux boards. Hardware access layer(HAL) allows to implement support for almost any ARM SoC/CPU with suitable DMA module, but currently it is implemented for Raspberry Pi only. It already works on Raspberry Pi 2 and 3.

    Typically, CNC machine controllers are implemented with C or C++ programming language and running on OSless or very real time operation systems. For example, Linux by default is not real time operation system and running LinuxCNC on it require to add special real time features to kernel. I believe that is very old approaches for building such controllers and it's high time to use modern ARM processors for CNC and use very high level programming languages like Python to provide easy development, flexibility and migration between hardware.

    I managed to do this! First ever CNC controller implemented on pure Python on Raspberry Pi 2 running Linux, it's better to see, than read:


    How it works? It uses DMA(Direct Memory Access) on chip hardware module, which just copy allocated in RAM buffer of GPIO states to actual GPIO registers. And this copying process is clocked by system clock and works completely independently from CPU cores. So, I was needed just to generated pulses sequence for axis stepper motors in memory and DMA precisely sends it. As for access to processor registers, it's implemented with /dev/mem system device. That can be implemented with different languages, but Python is very simple language which provides better development experiences. Of course, Python performance is not good, but on the other hand, modern ARMv7 processor performance is more than enough to run it.

    And the most pleasant part, I open sourced this project!
    Project is here - https://github.com/Nikolay-Kha/PyCNC
    There is a wiring diagram and running instructions in git repo.
    It's just a begging of this project, currently, it supports just simple things - spindle control, linear interpolation and some basic gcode commands. I have plans in near feature to add round interpolation, 4th axis, temperature sensors, heaters support and implement fully functional 3D printer CNC controller.

    Thank you for reading, hope it was interesting for you.

  2. The Following User Says Thank You to Nikolay-Kha For This Useful Post:


  3. #2
    Hello!
    Great news! PyCNC has full 3D printer implementation. Version 1.0.0 is released.

    Also I made a hardware with RerRap Prusa i3, RAMPSv1.4 board and Raspberry Pi3. Circuit diagram and photos in repo's README.md file - https://github.com/Nikolay-Kha/PyCNC.

    First 3D model was printed on this video -


    Overall PyCNC supports:
    - 4 axis - X, Y, Z, E;
    - Linear interpolation;
    - Circular(in XY, ZX, YZ planes) interpolation;
    - Minimum end stops and homing procedure;
    - Extruder and bed heaters;
    - Spindle for engraving.
    Last edited by Lee Roberts; 15-07-2017 at 04:44 PM. Reason: formatting

  4. #3
    Interesting and good work. I also posted a link to this thread here; http://www.cambam.co.uk/forum/index....54310#msg54310

    This thread might interest you; http://www.cambam.co.uk/forum/index....51798#msg51798 (GRBL v1.1 Machine Control and GCODE sender Plugin)

    What about this ? https://2013.spaceappschallenge.org/...-raspberry-pi/
    would it then run Marlin Firmware ?
    Last edited by EddyCurrent; 15-07-2017 at 02:23 PM.
    Spelling mistakes are not intentional, I only seem to see them some time after I've posted

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Raspberry Pi CNC Hat V2.58 gorup buy..anyone interested ?
    By Fivetide in forum Motor Drivers & Controllers
    Replies: 1
    Last Post: 31-12-2016, 01:07 PM
  2. cnc print a raspberry
    By george uk in forum General Discussion
    Replies: 7
    Last Post: 13-06-2014, 01:13 PM
  3. Raspberry Pi
    By irving2008 in forum General Electronics
    Replies: 50
    Last Post: 06-10-2012, 09:26 AM
  4. Raspberry Pi as a PC + Mach3 .. very possible
    By Fivetide in forum General Electronics
    Replies: 2
    Last Post: 05-09-2012, 11:18 PM
  5. New CNC Controller for Milling Machine
    By antsals in forum Electronic Project Building
    Replies: 26
    Last Post: 08-04-2012, 06:09 PM

Bookmarks

Posting Permissions

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