About two months ago I ordered an L6470 AutoDrive V13 board from SparkFun to use with a machine tool rotary table. I have gotten the board to work with an Arduino Mega and a 34 vdc power supply.
However the position count from ADboard.getParam (ABS_POS) has problems:
-
Even with the board set to full stepping, ADboard.configStepMode(STEP_FS),
ABS_POS increments by about 128 microsteps instead of full steps.
-
The count appears to be modulo 2**16 unsigned instead of 2**21 two’s complement.
For example (the decimal numbers are 2**16 unsigned):
When ABS_POS is incremented from 0x007FFF (32,767), ABS_POS is set to 0x3F8000 (32,768).
When ABS_POS is incremented from 0x3FFFFF (65,535), ABS_POS is set to 0x000000.
When ABS_POS is decremented from 0x000000, ABS_POS is set to 0x3FFFFF (65,535)
When ABS_POS is decremented from 0x3F8000 (32,768), ABS_POS is set to 0x007FFF (32,767).
ADboard.getPos() interprets the count as 2**21 two’s complement.
When the count reaches 0x007FFF (32,767), it rolls over to 0xFFFF8000 (-32,768)..
Following are portions of a monitor log file of readings once a second.
get_pos is the value return by long getPos(); first HEX then DEC.
ABS_POS is the value returned by unsigned long getParam(ABS_POS), first HEX the DEC
&0x00FFFF is the ABS_POS value masked by &0x00FFFF, first HEX then DEC.
10:2:22 Run FWD 1.00 steps/sec for 20 secs
get_pos: 7EB9 32441 ABS_POS: 7EB9 &0x00FFFF 7EB9 32441
get_pos: 7F3B 32571 ABS_POS: 7F3B &0x00FFFF 7F3B 32571
get_pos: 7FBE 32702 ABS_POS: 7FBE &0x00FFFF 7FBE 32702
get_pos: FFFF8040 -32704 ABS_POS: 3F8040 &0x00FFFF 8040 32832
get_pos: FFFF80C2 -32574 ABS_POS: 3F80C2 &0x00FFFF 80C2 32962
get_pos: FFFF8144 -32444 ABS_POS: 3F8144 &0x00FFFF 8144 33092
get_pos: FFFFFE87 -377 ABS_POS: 3FFE87 &0x00FFFF FE87 65159
get_pos: FFFFFF09 -247 ABS_POS: 3FFF09 &0x00FFFF FF09 65289
get_pos: FFFFFF8B -117 ABS_POS: 3FFF8B &0x00FFFF FF8B 65419
get_pos: D 13 ABS_POS: D &0x00FFFF D 13
get_pos: 8F 143 ABS_POS: 8F &0x00FFFF 8F 143
get_pos: 112 274 ABS_POS: 112 &0x00FFFF 112 274
10:17:54 Run REV 1.00 steps/sec for 20 secs
get_pos: 174 372 ABS_POS: 174 &0x00FFFF 174 372
get_pos: F1 241 ABS_POS: F1 &0x00FFFF F1 241
get_pos: 6F 111 ABS_POS: 6F &0x00FFFF 6F 111
get_pos: FFFFFFED -19 ABS_POS: 3FFFED &0x00FFFF FFED 65517
get_pos: FFFFFF6B -149 ABS_POS: 3FFF6B &0x00FFFF FF6B 65387
get_pos: FFFFFEE9 -279 ABS_POS: 3FFEE9 &0x00FFFF FEE9 65257
get_pos: FFFF8144 -32444 ABS_POS: 3F8144 &0x00FFFF 8144 33092
get_pos: FFFF80C1 -32575 ABS_POS: 3F80C1 &0x00FFFF 80C1 32961
get_pos: FFFF803F -32705 ABS_POS: 3F803F &0x00FFFF 803F 32831
get_pos: 7FBD 32701 ABS_POS: 7FBD &0x00FFFF 7FBD 32701
get_pos: 7F3B 32571 ABS_POS: 7F3A &0x00FFFF 7F3A 32570
get_pos: 7EB8 32440 ABS_POS: 7EB8 &0x00FFFF 7EB8 32440