TMC5031 DATASHEET (Rev. 1.11 / 2016-APR-28)
62
14 Getting Started
Please refer to the TMC5031 evaluation board to allow a quick start with the device, and in order to
allow interactive tuning of the device setup in your application. Chapter 13 will guide you through the
process of correctly setting up all registers.
14.1 Initialization Examples
Initialization SPI datagram example sequence to enable and initialize driver 1 and ramp generator 1
to move the motor in velocity mode and read access the position register:
SPI send: 0x8000000008; // GCONF=8: Enable PP and INT outputs
SPI send: 0xEC000100C5; // CHOPCONF: TOFF=5, HSTRT=4, HEND=1, TBL=2, CHM=0 (spreadCycle)
SPI send: 0xB000011F05; // IHOLD_IRUN: IHOLD=5, IRUN=31 (max. current), IHOLDDELAY=1
SPI send: 0xA600001388; // AMAX=5000
SPI send: 0xA700004E20; // VMAX=20000
SPI send: 0xA000000001; // RAMPMODE=1 (positive velocity)
// Now motor 1 should start rotating
SPI send: 0x2100000000; // Query X Actual – The next read access delivers X Actual
SPI read;
// Read X Actual
Initialization SPI datagram example sequence to enable and initialize the motion controller and then
move one rotation (51200 microsteps) using the ramp generator.
SPI send: 0xA4000003E8; // A1 = 1 000 First acceleration
SPI send: 0xA50000C350; // V1 = 50 000 Acceleration threshold velocity V1
SPI send: 0xA6000001F4; // AMAX = 500 Acceleration above V1
SPI send: 0xA7000304D0; // VMAX = 200 000
SPI send: 0xA8000002BC; // DMAX = 700 Deceleration above V1
SPI send: 0xAA00000578; // D1 = 1400 Deceleration below V1
SPI send: 0xAB0000000A; // VSTOP = 10 Stop velocity (Near to zero)
SPI send: 0xA000000000; // RAMPMODE = 0 (Target position move)
// Ready to move!
SPI send: 0xADFFFF3800; // XTARGET = -51200 (Move one rotation left (200*256 microsteps))
Hint
Tune the configuration parameters for your motor and application for optimum performance.
www.trinamic.com