当前位置:网站首页>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
边栏推荐
- FR练习题目---简单题
- Niuke: intercepting missiles
- dynamic programming
- 基于TI DRV10970驱动直流无刷电机
- Thymeleaf 使用后台自定义工具类处理文本
- 黑马程序员-软件测试-10阶段2-linux和数据库-44-57为什么学习数据库,数据库分类关系型数据库的说明Navicat操作数据的说明,Navicat操作数据库连接说明,Navicat的基本使用,
- [learning notes] stage test 1
- [summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses the coef function to obtain the log odds ratio corresponding to each vari
- Intelligent supply chain collaboration system solution for daily chemical products industry: digital intelligent SCM supply chain, which is the "acceleration" of enterprise transformation
猜你喜欢
Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
想进阿里必须啃透的12道MySQL面试题
【leetcode周赛总结】LeetCode第 81 场双周赛(6.25)
微帧科技荣获全球云计算大会“云鼎奖”!
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
Why do mechanical engineers I know complain about low wages?
实现一个博客系统----使用模板引擎技术
CyCa children's physical etiquette Ningbo training results assessment came to a successful conclusion
How does redis implement multiple zones?
分享 20 个稀奇古怪的 JS 表达式,看看你能答对多少
随机推荐
js亮瞎你眼的日期选择器
Implement a blog system -- using template engine technology
【学习笔记】图的连通性与回路
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)
Time to calculate cron expression based on cronsequencegenerator
Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
安装配置Jenkins
选择排序和冒泡排序
长列表优化虚拟滚动
Solution of commercial supply chain collaboration platform in household appliance industry: lean supply chain system management, boosting enterprise intelligent manufacturing upgrading
Is the securities account given by the head teacher of qiniu school safe? Can I open an account?
Disjoint Set
【NVMe2.0b 14-9】NVMe SR-IOV
【招聘岗位】软件工程师(全栈)- 公共安全方向
Matrix chain multiplication dynamic programming example
webRTC SDP mslabel lable
基于TI DRV10970驱动直流无刷电机
The simplest way to open more functions without certificates
Is it OK to open the securities account on the excavation finance? Is it safe?
【学习笔记】阶段测试1