10
Chapter 3: DSPpro Controller Design
3.1.1 Program Storage
DSPpro controllers offer 1 Mbyte of DRAM and 1 Mbyte of non-volatile flash memory to store
multiple motion control programs for execution as needed.
3.2 Firmware Execution
After the firmware is loaded, the DSP constantly executes the following series:
Read All Encoders
Calculate Next
Trajectory Point
Check for
Event Triggers
Perform Event
Action
Calculate and
Set DAC Output
Next Axis?
DSP Timer Interrupt
Exit From Interrupt
Read Analog
and Parallel Input
Figure 3-2. Main Loop
3.2.1 Read All Encoders
Immediately after the DSP’s timer interrupt (time interval is determined by the sample rate), the
DSP reads all eight encoder inputs and stores them into memory for future use. Then the DSP
runs a series of events for each axis before the next timer interrupt.
3.2.2 Read Analog and Parallel Input
If an axis is configured to read an analog input, the DSP writes a control word to the A/D, waits
for the conversion, reads the 12-bit digital value, and stores its value in memory. If an axis is
configured to read the parallel input, the DSP reads the 32 user I/O bits and stores its value in
memory.
3.2.3 Calculate Next Trajectory Point
The DSP calculates an axis’ command position trajectory. It maintains a command jerk,
command acceleration, command velocity, and command position:
Tn = Tn-1 + FS
Tn is the time at sample n
An = An-1 + FS * J
J is the jerk
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com