TMC2226/TMC2209应用笔记
2020-10-12 13:01:05
简述
从260,262到5160再到2660,对TMC的步进驱动算是非常熟悉了,看到19年的新品TMC2226/TMC2209价格便宜(1/2),电流足够(Ipeak = 2.8A),相对5160而言功能也很足够,还能多一些“新奇”的设计,所以说非用不可了。
一些特点:
- 配置接口使用单线UART
- 内部提供步进脉冲发生器,但是没有速度斜坡功能 = 无用
- 基于较稳定的附带温度补偿的低MOS管导通电阻,提供了免外部采样电阻功能
- 所谓的OTP - Configuration Memory,OTP_PROG 编程用寄存器,保存一些需要断电存储的信息。某些参数的缺省值取决于OTP的设置。
- 无外置mos提供2.8A峰值电流
- StallGuard4而不是StallGuard2
- 可uart配置最高256细分,但是硬件针脚的配置只能8,16,32,64四种
- SPREAD引脚选择斩波方式,并且只有两种斩波,去掉了恒定关断时间斩波
- STDBY24DI 低功耗切换引脚
- 提供额外的VREF参考电压输入,更灵活的电流配置
- 与5160一样的飞轮模式
从哪里开始?
第一章 操作原理 综述部分说明了以下3种操作模式:
传统模式
全部使用硬线作为控制或者交互,VREF用以调节电流
OTP预配置的Step/Dir模式
可以读写的断电保存的数据区大小是3个byte,共24个bit,单次写入操作只能操作一个bit位,并且推荐的写入时间是10ms!写入后,通过读出进行校验。
详细的bit信息参见“OTP_READ只读寄存器”
不过,参数的配置是有局限的,需要全功能的设置,必须使用uart接口。
可以省去mcu一个uart,在PCB出厂时候单独烧写参数。使用1拖n可以提高烧写效率。并不实用,仅仅省一个uart确丢掉了很强的动态配置能力这不值当。不过,uart接口之外多一个额外EEPROM或许是有用的。
使用uart动态配置的Step/Dir模式
全功能
所以说,就选择第三种模式,从做一个3轴步进驱动器开始
UART节点的拓扑
选择第一种即可
UART通信协议
波特率可以在9000-fCLK/16之间选择,内部自动侦测实际波特率。
从机地址0-3
主机地址%11111111
each byte is LSB...MSB, highest byte transmitted first
CRC代码参见手册
寄存器说明
打算公开所有可配置项
静音斩波
SpreadCycle斩波
硬件设计
其他思路
上位机设计一个配置向导以降低配置难度