Controller

From 3D printer from scratch
Revision as of 21:05, 21 March 2018 by Sensille (talk | contribs)
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 internal clock frequency is 20MHz.

Commands:

Ramp

- ramp('8h9a,'36h<acceleration>, '36h<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

- start('8hb5)

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

Configure Rev

- configure clocks/rev ('8ha3, '24h<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('8h3d)

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