当前位置:网站首页>Drive brushless DC motor based on Ti drv10970
Drive brushless DC motor based on Ti drv10970
2022-07-05 14:34:00 【No martial arts, no understanding of the Jianghu】
Preface
I took over a project in the laboratory before , Need to use TI Of DRV10970 Chip to drive brushless DC motor with Hall feedback , The motor has been switched on these days , So write an article to record .
About the drive mode of Brushless DC motor , I don't want to go into details ,CSDN There are a lot of them , I'll just say based on TI Of DRV10970 Chip to drive brushless DC motor .
One 、TI DRV10970
1. Introduce
DRV10970 It is an integrated three-phase BLDC Motor driver , Suitable for household appliances 、 Cooling fans and other general motor controls application . The device has built-in intelligent features , And it has a small shape and simple pin distribution structure , It not only reduces the design complexity 、 The circuit board space is saved , And it also reduces the system cost . The integrated protection function improves the robustness and reliability of the system .
This means that we don't need to process Hall signals , The chip will automatically process the hall signal , We just need to output PWM And setting some pins can drive the brushless DC motor .

2. Pin Introduction
| name | describe |
|---|---|
| CPN | Charge pump switching node,Connect a 0.1-µF X7R capacitor rated for VM between CPN and CPP |
| CPP | Charge pump switching node,Connect a 0.1-µF X7R capacitor rated for VM between CPN and CPP |
| VCP | Charge pump output,Connect a 16-V, 1-µF ceramic capacitor to VM |
| GND | Device ground,Must be connected to board ground |
| VINT | Integrated regulator output,Integrated regulator (typical voltage 5 V) mainly for internal circuits; Provide external power for less than 20 mA. Bypass to GND with a 10-V, 2.2-µF ceramic capacitor |
| VM | Power supply |
| CS | Current limit setting pin |
| DAA | Drive angle adjustment configuration pin,Low: 10° drive angle adjustment,High: 5° drive angle adjustment,Floating: adaptive drive angle adjustment |
| FG | Frequency indication pin,Open drain Electrical Frequency Output pin. One toggle per electrical cycle. Requires an external pull-up of 3.3-kΩ. |
| FR | Motor direction control,Direction Control Input.When low, phase driving sequence is U → V → W ( U phase is leading V phase by 120°).When high, the phase driving sequence is U → W → V. |
| BRKMOD | Brake mode setting,Low: Coasting mode (phases are tri-stated),High: Brake mode (phases are driven low) |
| PWM | Variable duty cycle PWM input for speed control |
| RD | Lock indication pin |
| RETRY | Auto retry timing configure |
| CMTMOD | Commutation mode setting,Low: Sinusoidal operation mode with 0° Hall placement,High: Sinusoidal operation mode with 30° Hall placement,Floating: Trapezoidal operation mode with 30° Hall placement |

We only need to pay special attention to a few of the above pins , Including pulse width modulation (PWM) Input ( Speed command )、FG Output ( Speed feedback )、FR Input ( Forward and reverse control ) as well as RD Output ( Motor lock indication ).
FG and RD yes DRV10970 Feedback to MCU The signal of
CMTMOD Is the setting mode , Generally will CMTMOD Setting low level is sinusoidal mode 0° Place hall element ,
BRKMOD Is the braking mode setting , take BRKMOD The pin is set to low level , Even if BRKMOD The motor set to high level will not brake , Because this pin is used to set the braking mode , Instead of directly braking the motor , Only power off or will PWM Set to 0 Before you can brake .
DAA Is the angle setting of the drive motor , Set it to float , Floating is the adaptive angle to drive the motor
PWM It's the connection MCU Of PWM Output pins ,PWM The frequency of is 15Khz-100Khz.
Two 、 Use steps
1. Program
So it's using DRV10970 when , We need to PWM,FR,BM,CM,DAA Just set it up , I use two chips here to drive two motors
void PWM_Configuration(u16 arr,u16 pre)
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_OCInitTypeDef TIM_OCInitStructure;
// TIM_BDTRInitTypeDef TIM_BDTRInitStructure;
RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC |RCC_AHB1Periph_GPIOD, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM12, ENABLE);
GPIO_PinAFConfig(GPIOB,GPIO_PinSource14,GPIO_AF_TIM12); //PB14 Reuse TIM12
GPIO_PinAFConfig(GPIOB,GPIO_PinSource15,GPIO_AF_TIM12); //PB14 Reuse TIM12
// PWM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15; //
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; // Multiplexing push pull output
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; // Pull up
GPIO_Init(GPIOB,&GPIO_InitStructure); // initialization PB14
//M1
//GPIO DAA In the air M2 PD14--DAA
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_14 ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;// Floating space
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 ; //GPIO_Pin_11
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOB, &GPIO_InitStructure);// initialization GPIOD
//GPIO M1--PD12--CM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_15 ; //M2 PD15--FR
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
//GPIO M2--PA12--CM M2-PA11-BM
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12 ;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal output mode
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;// Push pull output
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;// Pull up
GPIO_Init(GPIOA, &GPIO_InitStructure);// initialization GPIOD
//GPIO //FG and RD all feedback
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9| GPIO_Pin_13; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
//GPIO // M2--PC8--RD M2--FG--PC14
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_14; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//
GPIO_Init(GPIOC, &GPIO_InitStructure);// initialization GPIOD
//GPIO // CMTMOD--PD10
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10|GPIO_Pin_11; // Input
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;// Normal input mode
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;//
GPIO_Init(GPIOD, &GPIO_InitStructure);// initialization GPIOD
TIM_TimeBaseStructure.TIM_Period= arr-1;
TIM_TimeBaseStructure.TIM_Prescaler= pre-1;
TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_ClockDivision=TIM_CKD_DIV1;
TIM_TimeBaseInit(TIM12,&TIM_TimeBaseStructure); //TIM12
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
// TIM_DeInit(TIM12);
TIM_OC1Init(TIM12, &TIM_OCInitStructure);// Initialize peripherals TIM1 OC1--OC4
TIM_OC2Init(TIM12, &TIM_OCInitStructure);
TIM_OC3Init(TIM12, &TIM_OCInitStructure);
TIM_OC4Init(TIM12, &TIM_OCInitStructure);
TIM_OC1PreloadConfig(TIM12, TIM_OCPreload_Enable);// Enable preload register
TIM_OC2PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_OC3PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_OC4PreloadConfig(TIM12, TIM_OCPreload_Enable);
TIM_ARRPreloadConfig(TIM12,ENABLE);
TIM_Cmd(TIM12, ENABLE);
//M1
// PD12--CM
GPIO_ResetBits(GPIOD, GPIO_Pin_10 );//PD10---FR PD11---BM
GPIO_SetBits(GPIOD, GPIO_Pin_12 );// PD12--CM
//M2
GPIO_ResetBits(GPIOA, GPIO_Pin_11 );// PA11--BM
GPIO_SetBits(GPIOA, GPIO_Pin_12 );// PD12--CM
}
3、 ... and . How to judge when the chip is damaged
When VM for 12V When electricity is on , If VINT No, 5V Output , It can be considered that the chip is broken
边栏推荐
- R language ggplot2 visualization: gganimate package is based on Transition_ The time function creates dynamic scatter animation (GIF) and uses shadow_ Mark function adds static scatter diagram as anim
- LeetCode_ 3 (longest substring without repeated characters)
- 矩阵链乘 - 动态规划实例
- 想进阿里必须啃透的12道MySQL面试题
- PHP - fatal error: allowed memory size of 314572800 bytes exhausted
- APR protocol and defense
- R Language ggplot2 Visualization: visualize linegraph, using Legend in Theme function. Paramètre de position emplacement de la légende personnalisée
- Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading
- LeetCode_ 69 (square root of x)
- 日化用品行业智能供应链协同系统解决方案:数智化SCM供应链,为企业转型“加速度”
猜你喜欢

Thymeleaf 使用后台自定义工具类处理文本

周大福践行「百周年承诺」,真诚服务推动绿色环保

Thymeleaf 模板的创建与使用
![[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)](/img/d7/f49bca8da2ce286c18508325985990.png)
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)

Share 20 strange JS expressions and see how many correct answers you can get

PHP - fatal error: allowed memory size of 314572800 bytes exhausted

家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级

leetcode:881. 救生艇
![Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]](/img/c2/a5f5fe17a6bd1f6f9df828ddd224d6.png)
Which Internet companies are worth going to in Shenzhen for software testers [Special Edition for software testers]

Topology可视化绘图引擎
随机推荐
【学习笔记】图的连通性与回路
Redis如何实现多可用区?
Topology visual drawing engine
Catch all asynchronous artifact completable future
Loop invariant
js亮瞎你眼的日期选择器
Introduction, installation, introduction and detailed introduction to postman!
不相交集
【NVMe2.0b 14-9】NVMe SR-IOV
R Language ggplot2 Visualization: visualize linegraph, using Legend in Theme function. Paramètre de position emplacement de la légende personnalisée
Pointer operation - C language
R language ggplot2 visualization: visual line graph, using legend in theme function The position parameter defines the position of the legend
Mysql database installation tutorial under Linux
危机重重下的企业发展,数字化转型到底是不是企业未来救星
申请代码签名证书时如何选择合适的证书品牌?
useMemo,memo,useRef等相关hooks详解
非技术部门,如何参与 DevOps?
Thymeleaf 常用函数
实现一个博客系统----使用模板引擎技术
微帧科技荣获全球云计算大会“云鼎奖”!