|
HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
|
The snippets below highlight common patterns when working with the driver. They assume you have already followed the setup guide and created your own communication interface.
Choose the motor type and commutation mode. The driver exposes helper functions for these parameters so you rarely need to write raw register values. A typical initialization looks like this:
Adjust the parameters as required for your hardware. For example you may choose FOC_ENCODER when using an incremental encoder or set the number of motor poles to match your BLDC.
Use the ramp generator utilities to command velocity or position moves.
For position control:
All calls return a boolean indicating communication success. You can poll the status or read back the position to monitor progress.
The library can query temperature, current and voltage from the chip.
Refer to inc/TMC9660.hpp for the complete API and additional helper functions. With these building blocks you can integrate the driver into your motion control software and start experimenting right away.