STM32F103模糊pid.zip

  • m6_790609
    了解作者
  • 3.3MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-23 07:50
    上传日期
在很多应用中,同样的pid参数满足不了复杂应用的控制,所以就引入了模糊pid算法,本实例就实现了模糊pid的算法,可以自整定pid的参数
STM32F103PID - 温控测试 程序增量式.zip
  • STM32F103PID - 温控测试 程序增量式
  • HARDWARE
  • inc
  • dc_pid.h
    839B
  • tim3.h
    186B
  • fuzzyPID.h
    198B
  • max6675.h
    142B
  • pwm.h
    559B
  • src
  • 增量式
  • dc_pid.c
    1.1KB
  • fuzzyPID.c
    3.8KB
  • max6675.c
    2.8KB
  • tim3.c
    1.7KB
  • pwm.c
    4.3KB
  • FW
  • CORE
  • core_cm3.h
    83.7KB
  • startup_stm32f10x_hd.s
    15.1KB
  • core_cm3.c
    16.9KB
  • startup_stm32f10x_md.s
    12.5KB
  • SYSTEM
  • sys
  • sys.c
    872B
  • sys.h
    2.7KB
  • delay
  • delay.c
    7.7KB
  • delay.h
    1.9KB
  • usart
  • usart.c
    4.3KB
  • usart.h
    1.3KB
  • OBJ
  • main.d
    2KB
  • usart.crf
    344.6KB
  • stm32f10x_gpio.o
    395.6KB
  • stm32f10x_tim.crf
    360.7KB
  • misc.o
    376.2KB
  • fuzzypid.__i
    581B
  • max6675.o
    379.4KB
  • stm32f10x_rcc.__i
    608B
  • stm32f10x_rcc.o
    415.8KB
  • main.o
    390KB
  • stm32f10x_it.d
    1.8KB
  • stm32f10x_it.o
    380.9KB
  • USART.axf
    352.1KB
  • usart.__i
    569B
  • stm32f10x_it.__i
    581B
  • stm32f10x_spi.crf
    343KB
  • dc_pid.d
    131B
  • stm32f10x_spi.o
    402.2KB
  • delay.__i
    569B
  • misc.__i
    572B
  • main.crf
    356KB
  • stm32f10x_spi.d
    1.9KB
  • stm32f10x_rcc.d
    1.9KB
  • stm32f10x_gpio.d
    1.9KB
  • stm32f10x_usart.d
    1.9KB
  • dc_pid.__i
    573B
  • USART.htm
    75.4KB
  • max6675.d
    1.8KB
  • stm32f10x_tim.o
    494.7KB
  • pwm.crf
    340KB
  • core_cm3.o
    11.2KB
  • USART.lnp
    646B
  • stm32f10x_usart.__i
    616B
  • sys.__i
    559B
  • tim3.o
    374.6KB
  • tim3.crf
    339.3KB
  • delay.crf
    340.1KB
  • USART.hex
    35.8KB
  • dc_pid.o
    11.2KB
  • stm32f10x_spi.__i
    608B
  • pwm.__i
    561B
  • tim3.__i
    565B
  • startup_stm32f10x_md.o
    5.9KB
  • USART_Target 1.dep
    34.4KB
  • usart.o
    381.1KB
  • max6675.__i
    577B
  • usart.d
    1.7KB
  • main.__i
    549B
  • stm32f10x_tim.d
    1.9KB
  • fuzzypid.d
    202B
  • core_cm3.d
    104B
  • USART.build_log.htm
    2KB
  • stm32f10x_gpio.crf
    342.5KB
  • delay.d
    1.6KB
  • stm32f10x_usart.crf
    344.6KB
  • dc_pid.crf
    2KB
  • system_stm32f10x.d
    1.8KB
  • max6675.crf
    344.6KB
  • core_cm3.__i
    573B
  • delay.o
    376.9KB
  • system_stm32f10x.crf
    340.2KB
  • USART.sct
    479B
  • sys.o
    376.6KB
  • stm32f10x_rcc.crf
    346KB
  • pwm.d
    1.5KB
  • fuzzypid.crf
    11.1KB
  • system_stm32f10x.__i
    597B
  • pwm.o
    380.6KB
内容介绍
/** ****************************************************************************** * @file stm32f10x_tim.c * @author MCD Application Team * @version V3.5.0 * @date 11-March-2011 * @brief This file provides all the TIM firmware functions. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f10x_tim.h" #include "stm32f10x_rcc.h" /** @addtogroup STM32F10x_StdPeriph_Driver * @{ */ /** @defgroup TIM * @brief TIM driver modules * @{ */ /** @defgroup TIM_Private_TypesDefinitions * @{ */ /** * @} */ /** @defgroup TIM_Private_Defines * @{ */ /* ---------------------- TIM registers bit mask ------------------------ */ #define SMCR_ETR_Mask ((uint16_t)0x00FF) #define CCMR_Offset ((uint16_t)0x0018) #define CCER_CCE_Set ((uint16_t)0x0001) #define CCER_CCNE_Set ((uint16_t)0x0004) /** * @} */ /** @defgroup TIM_Private_Macros * @{ */ /** * @} */ /** @defgroup TIM_Private_Variables * @{ */ /** * @} */ /** @defgroup TIM_Private_FunctionPrototypes * @{ */ static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); /** * @} */ /** @defgroup TIM_Private_Macros * @{ */ /** * @} */ /** @defgroup TIM_Private_Variables * @{ */ /** * @} */ /** @defgroup TIM_Private_FunctionPrototypes * @{ */ /** * @} */ /** @defgroup TIM_Private_Functions * @{ */ /** * @brief Deinitializes the TIMx peripheral registers to their default reset values. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @retval None */ void TIM_DeInit(TIM_TypeDef* TIMx) { /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); if (TIMx == TIM1) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); } else if (TIMx == TIM2) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); } else if (TIMx == TIM3) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); } else if (TIMx == TIM4) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); } else if (TIMx == TIM5) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); } else if (TIMx == TIM6) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); } else if (TIMx == TIM7) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); } else if (TIMx == TIM8) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); } else if (TIMx == TIM9) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); } else if (TIMx == TIM10) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); } else if (TIMx == TIM11) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); } else if (TIMx == TIM12) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); } else if (TIMx == TIM13) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); } else if (TIMx == TIM14) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); } else if (TIMx == TIM15) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, DISABLE); } else if (TIMx == TIM16) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, DISABLE); } else { if (TIMx == TIM17) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, DISABLE); } } } /** * @brief Initializes the TIMx Time Base Unit peripheral according to * the specified parameters in the TIM_TimeBaseInitStruct. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @param TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef * structure that contains the configuration information for the * specified TIM peripheral. * @retval None */ void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { uint16_t tmpcr1 = 0; /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); tmpcr1 = TIMx->CR1; if((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM2) || (TIMx == TIM3)|| (TIMx == TIM4) || (TIMx == TIM5)) { /* Select the Counter Mode */ tmpcr1 &= (uint16_t)(~((uint16_t)(TIM_CR1_DIR | TIM_CR1_CMS))); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; } if((TIMx != TIM6) && (TIMx != TIM7)) { /* Set the clock division */ tmpcr1 &= (uint16_t)(~((uint16_t)TIM_CR1_CKD)); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; } TIMx->CR1 = tmpcr1; /* Set the Autoreload value */ TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; /* Set the Prescaler value */ TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; if ((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM15)|| (TIMx == TIM16) || (TIMx == TIM17)) { /* Set the Repetition Counter value */ TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; } /* Generate an update event to reload the Prescaler and the Repetition counter values immediately */ TIMx->EGR = TIM_PSCReloadMode_Immediate; } /** * @brief Initializes the TIMx Channel1 according to the specified * parameters in the TIM_OCInitStruct. * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. * @param TIM_OCInitStru
评论
    相关推荐
    • PID算法STM32实现
      PID算法STM32实现,包括纯C实现和PID参数的调节方法和图示等
    • STM32_PID算法源码
      基于STM32F103R8的PID算法例程,完整工程源码,PWM输出控制信号,ADC输入反馈信号,形成闭环控制。
    • 基于STM32的PID算法
      该资源为经典工业控制PID算法STM32源码及思想,详细的解释了PID算法思想及实现,非常适合新手学习,资源整理不易,同学务必珍惜。
    • STM32 PID算法
      PID算法
    • C语言MD5算法STM32单片机亲测可用
      lwip协议栈源码提取 链接:https://pan.baidu.com/s/1Lcwap2cC0fNd7FhY44JhPQ 提取码:w74p
    • STM32 FFT算法实现
      在原子哥的开发板上实现的FFT算法和UCOS。全部资料均来自网络,谢谢原子哥,谢谢网络上无私的朋友
    • stm32加密算法.rar
      STM32加密算法库,包含常见的加密算法,AES、ARC4、ECC、HASH、RAND、RSA、TDES_DES等加密算法
    • stm32 风洞 pid算法程序
      stm32 风洞控制程序 PID
    • stm32 定时器中断算法
      stm32 定时器中断算法,s曲线七段法,可以根据自己应用实例进行更改
    • 基于stm32的血压算法
      基于stm32的血压算法,精度还可以,需要的话可以直接移植使用,方便大家。