TMC457_1 TRINAMIC [TRINAMIC Motion Control GmbH & Co. KG.], TMC457_1 Datasheet - Page 27

no-image

TMC457_1

Manufacturer Part Number
TMC457_1
Description
S-profile motion controller with PID feedback control and high resolution micro stepping sequencer for stepper motors and piezo motors
Manufacturer
TRINAMIC [TRINAMIC Motion Control GmbH & Co. KG.]
Datasheet
TMC457 DATASHEET (V. 1.16 / 2009-Nov-25)
7 Examples
Following, some examples are given how to program the TMC457 to do a desired task. The examples
are given as sequences of SPI datagram as 40 bit hexadecimal number with an additional comment.
So, for this example the datagram is $89 12 34 56 78. That datagram sets the register x_target to the
hexadecimal value $12345678.
7.1 How to Get a Motor Running
7.2 Set Incremental Encoder Interface Parameters
For this example, we assume to have an incremental encoder with a resolution of 16384 steps per
revolution. For the quadrature signals A and B this means that they toggle 8192 tomes per revolution
with a phase shift of quarter period.
A stepper motor is assumed to have 200 full steps per revolution and is driven with a micro step
revolution of 256 micro steps per full step. So, for this example, the stepper motor has 200 * 256 =
51200 micro steps per revolution.
The axis of the incremental encoder is assumed to be directly connected to the axis of the stepper
motor with a gear. With this, a number of 16384 positions of the incremental encoder are equal to
51200 micro steps of the stepper motor.
Copyright © 2009 TRINAMIC Motion Control GmbH & Co. KG
$89 12 34 56 78
// initialize the sine wave look-up table once (either for stepper motor or for piezo motor).
for (x=0; x<8192; x++)
{
}
This results in a sequence of datagramms for initializing the sine wave look-up table as:
$FF $00 $00 $07 $FF
$FF $00 $01 $08 $01
$FF $00 $02 $08 $02
.
.
.
$FF $1F $FD $07 $FA
$FF $1F $FE $07 $FC
$FF $1F $FF $07 $FD
// now the motion //
$80 xx xx xx xx
$83 xx xx xx xx
$88 00 00 00 00
$8F xx xx xx xx
$89 00 BC 61 4E
y = abs( 8191 * sin(2.0 * 3.141592652 * x / 8192) );
datagram = ( 0x7F << 32 ) | ( x << 16 ) | ( y );
// set x_target := $12 34 56 78
// mode := %00 = ramp_mode positioning mode with linear ramps
// v_max := $xx xx xx xx
// bow_max := 0 = linear ramp
// a_max_d_max := $xx xx xx xx
// x_target := 12345678; => move to target position x_target
// ram[
// ram[
// ram[
// ram[8189] := 0x07FA;
// ram[8190] := 0x07FC;
// ram[8191] := 0x07FD;
0] := 0x07ff;
1] := 0x0801;
2] := 0x0702;
// compose datagram
// stepper motor
27

Related parts for TMC457_1