fpga4fun.com - where FPGAs are fun.
Home
Welcome
Information


FPGA projects
Music box
Pong game
R/C servos
Text LCD module
Quadrature decoder
PWM and one-bit DAC
Debouncer
LED displays
Crossing clock domains
External contributions

FPGA interface projects
RS-232
JTAG
I2C
EPP
SPI
CNC steppers

FPGA advanced projects
Graphic LCD panel
Digital oscilloscope
10BASE-T interface
PCI interface
Spoc CPU core

Hands-on
A simple oscilloscope


FPGA introduction
What are FPGAs?
How FPGAs work
FPGA pins
Clocks and global lines
Download cables
Configuration
Learn more

FPGA software
Design software
Pin assignment
Design-entry/HDL
Simulation/HDL
Synthesis and P&R

FPGA electronic
SMD technology
Crystals and oscillators

HDL info
HDL tutorials
Verilog tips
VHDL tips

Quick-start guides
ISE
Quartus

Site
News
FPGA links
HDL tutorials
Forum


FPGA motion controller

FPGA design

Here's the FPGA motion controller block diagram (three axes shown):

The USB-2 data gets buffered in a FIFO and then goes to a demultiplexor. Since the data is "packetized", the demultiplexor is necessary to distribute the acceleration data to each integrator's axis. After the integrators, pulse generators make sure the Step/Dir pulses have the proper timing.

Here's the integrator's heart.

generate
for(i=0; i<nbaxes; i=i+1)
begin:motion
    always @(posedge clk) axes_S[i] <= axes_S[i] + axes_A[i];
    always @(posedge clk) axes_P[i] <= axes_P[i] + axes_S[i];
end
endgenerate

The complete Verilog code weights about 200 lines and is available from KNJN.com.



>>> NEXT: Motion formulas >>>



This page was last updated on January 31 2008.