/* USER CODE BEGIN Header */
/****************************************************************************************
	* 
	* @author  文七电源
	* @淘宝店铺链接：https://shop598739109.taobao.com
	* @file           : CtlLoop.c
  * @brief          : 环路功能函数
  * @version V1.0
  * @date    01-03-2021
  * @LegalDeclaration ：本文档内容难免存在Bug，仅限于交流学习，禁止用于任何的商业用途
	* @Copyright   著作权文七电源所有
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */
	
/* USER CODE END Header */
#include "CtlLoop.h"


/****************环路变量定义**********************/
int32_t   VErr0=0;//电压误差Q12
int32_t		u0=0;//电压环输出量

/*
** ===================================================================
**     Funtion Name :  void BUCKVLoopCtlPI(void)
**     Description :   位置式PI，电压环路环路计算
**     Parameters  :无
**     Returns     :无
** ===================================================================
*/
#define BUCK_VKP    	50//电压环PI环路P值 Q12，调试数据
#define BUCK_VKI     	5//电压环PI环路I值  Q12，调试数据
#define BUCK_MIN_INTE      327680//最小占空Q24 2%最小占空比，积分量，积分量由Q12扩大到了Q24















