Measurement-based Feedforward Tuning:
Alternative Methods Based on a Single Move
If you make a single move at a decent acceleration and
velocity, you will have enough DAC information to calculate the feedforwards.
Collect the DAC output and the Commanded Velocity for your move in MoScope
measure a few points labeled A, B, and C on the figure below for the DAC
output. You will need to know the maximum velocity reached and the acceleration
used. Do not use an S-Curve move, it makes the calculations much more
involved. A simulated feedforward term using the feedforwards calculated
below is plotted on the actual DAC output to show the validity of the
feedforward values. For this example, a move of 200,000 encoder counts
with 50,000 counts / sec2 acceleration and 100,000 counts / sec max velocity
will be used.

In the figure above, I measured:
DACa = 2000
DAC counts
DACb = 4627
DAC counts
DACc = 1800
DAC counts
The motion consisted of:
Max velocity = 50 encoder
counts / sample
Acceleration = 0.0125
encoder counts / sample2
Examples:
Kvff
= (DACb - DACa) / max velocity
= (4627 - 2000) (DAC counts) / 50 (encoder counts / sample)
= 52.54 (DAC Counts / Encoder Counts * samples)
This compares to the 50.07 value for Kvff we got in
the first example.
Kaff = (DACb
- DACb) / (2 * accel)
= (4627 - 1800) (DAC counts) / (2 * 0.25) (encoder counts / sample2)
= 113080 (DAC Counts / Encoder Counts * samples2)
Kfff
= DACa - Kaff * Acceleration
= 2000 (DAC counts) - 113080 (DAC Counts / Encoder Counts * samples2)
* 0.0125
(encoder counts / sample2)
= 586.5 DAC counts
This compares to the 583 value for Kfff for the first
example.
Let's take a look at the motion, before and after feedforward,
using the feedforward values we just calculated.

This is rather conclusive evidence that the position
error can be dramatically reduced through the use of feedforwards. But
notice that there is not a drastic change in the DAC output. This is because
the difference in motion is ~45 encoder counts (peak error with no feedforward)
in a 200,000 count move. In precision motion, this improvement in performance
is important for two reasons:
|
- The following error is drastically reduced.
- The settling time is improved because the following error is
so low when the commanded trajectory is done.
|
To emphasize the fact that the feedforwards we calculated
will work with different moves, we will apply the same feedforwards to
a different move:
20,000 counts
200,000 counts/sec2

Note the reduction in DAC output on acceleration transitions.
This is because there is less ringing in the motor position.
|