Difference between revisions of "Controller"

From 3D printer from scratch
Jump to: navigation, search
Line 8: Line 8:
  
 
=== Ramp ===
 
=== Ramp ===
  - ramp('8h9a,'36h<acceleration>, '36h<clock count>)
+
  - 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.
 
For the given number of clocks increment the internal acceleration register by the value given in the command.
Line 14: Line 14:
  
 
=== Start ===
 
=== Start ===
  - start('8hb5)
+
  - start(8'hb5)
  
 
Start the engine. All commands in the fifo will be executed.
 
Start the engine. All commands in the fifo will be executed.
  
 
=== Configure Rev ===
 
=== Configure Rev ===
  - configure clocks/rev ('8ha3, '24h<step per revolution>)
+
  - 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.
 
Set number of steps for one revolution. With a 0.9deg stepper and 256 microstepping set it to 1024000.
Line 25: Line 25:
  
 
=== Sync Revcounter ===
 
=== Sync Revcounter ===
  - sync('8h3d)
+
  - sync(8'h3d)
  
 
Run until the next rising edge of the home sensor. If reached, reset the internal position to 0.
 
Run until the next rising edge of the home sensor. If reached, reset the internal position to 0.

Revision as of 21:10, 21 March 2018

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(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

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