From 3D printer from scratch
Jump to: navigation, search

Currently an Artix-7 FPGA is used as the controller. It has a serial interface with a command width of 80 bytes.

The first byte gives the command. The command has a variable width, with a maximum length of 80 bits. Most commands just get enqueued into an internal FIFO with 64 entries. The bits are clocked in right to left, so the lowest bit of the command comes last.

The internal clock frequency is 20MHz.



- ramp(8'h9a,36'<acceleration>, 36'<clock count>)

For the given number of clocks increment the internal acceleration register by the value given in the command. Acceleration can also be negative.


- start(8'hb5)

Start the engine. All commands in the fifo will be executed.

Configure Rev

- configure clocks/rev (8'ha3, 24'<step per revolution>)

Set number of steps for one revolution. With a 0.9deg stepper and 256 microstepping set it to 1024000. If the internal position counter reaches this value, it is reset to zero and a pulse on the REV pin is generated.

Sync Revcounter

- sync(8'h3d)

Run until the next rising edge of the home sensor. If reached, reset the internal position to 0.