Galil Motion Control note 3311a Page 1
DMC-1000
DMC-1500
DMC-1300
Application Note 3311a: Representation of Numbers
Specifying Numbers:
Numbers are stored as 6 bytes of information. The six bytes are represented as 4 bytes of
integer and 2 bytes of fraction. Thus, the integral part of the number can have values
between +/- (2
31
-1) or +/- 2147483647.
Avoid Calculation Errors:
The fractional part of the number is represented with a resolution of 2 bytes or 1 part in
2
16
or 1 part in 65536. The fractional resolution can cause unexpected calculation
errors if this is not well understood.
Example #1:
let X = .001
let Y = 819200
The Galil goes through the following calculations:
X = 66/65536
Y = 819200
X*Y
=
54067200/65536
=
825
The actual value of the product of X and Y is 819.2
Example #2:
let X = (286*.001*6350)-25250
The true value of X is -23433.9
The Galil calculates the value of X as -23421.0419
A more accurate calculation will occur if the calculation is re-arranged in the following
manner:
X = ((286*635)-2525000)/100
The Galil calculates the value of X as -23433.9