FPGA cnc control

36 views
Skip to first unread message

Rik Starmans

unread,
Apr 8, 2021, 8:33:24 AM4/8/21
to beagleg-dev
Hey all,

I am working on controlling motors with a FPGA. I discussed this with Zeller and Leonardo. You can see my working setup here .
The video is not the greatest but it shows where I am at. Code for the FPGA core can be found in my repo FPGAG.
I tried to make the code as readable as possible and separate it into logical units. You can also virtually test the core using test virtual.
The code is written in python and gets converted to verilog/vhdl using nmigen. Yosys/Nextpnr translate the code to the ICE FPGA chip.
As such it is quite a paradigm shift from most embedded projects around micro-controllers, C++ and assembly.
My board can be found online, I also found someone, sensile; who developed a board with a newer FPGA chip and a microcontroller see photo and his repo here .

The software consists out of the following elements;
   * SPI command interface
 
(receives command and words, copied from Luna)       
   *  Transactionalized FIFO
(buffers instruction in sram, copied from luna)
    * SPI parser (basically an extension of SPI command interface, with specifics for my  
                           project)

   *  Dispatcher; picks up commands from the FIFO buffer and dispatches instructions to
                            actual hardware

    *
Polynomial integrator: creates pulse train for stepper motors; basically you send the 
                       coefficients for the polynomial and the number of ticks in a segment.

I did not implement Bezier curves as there are no hardware multipliers on the ice chip I use. Bezier might have an advantage as you send over real positions and as such it might be easier to correct for errors.  The advantage of polynomial is that there is more direct link with speed and acceleration.

My current focus is on getting a laser scanner working with this framework. For this specific application there is no need to have a GCode parser.

I hope at least you find some inspiration or better direction for steps to take next from my code.


Best,

Rik

Reply all
Reply to author
Forward
0 new messages