zoukankan      html  css  js  c++  java
  • 加热算法,加热温度控制加热功率,加热功率控制加热速度(PWM)

    uint8_t user_heating_algorithmPID(void)
    {
        uint32_t temp_1;
        uint16_t Adcn;
        nrfx_err_t err_code;
        HEATING_ENABLE();
        nrf_delay_us(1000);//ÑÓʱ1000us=1ms
        err_code = fu_peripheral_saadc_sample_convert(FU_SAADC_CHANNEL_LOADER, (nrf_saadc_value_t*)&Adcn);
        APP_ERROR_CHECK(err_code);
        uMachine_V.heating_V = uGetOutPut_Voltage(Adcn);
        if(uMachine_V.Heating_Temperature < uMachine_V.Heating_SET_Temperature)
        {
            temp_1 = uMachine_V.heating_V*uMachine_V.heating_V/1000;
            if(uMachine_V.Heating_Temperature > Heating_ctr_power)//Heating_ctr_power=(Heating_top_SET_Temperature-(Heating_top_SET_Temperature/5)) 
          {
    if(uMachine_V.Heating_power > Constant_temperature_power) { uMachine_V.Heating_power=uMachine_V.Heating_power-((uMachine_V.Heating_power*(uMachine_V.Heating_Temperature-Heating_ctr_power))/(uMachine_V.Heating_SET_Temperature-Heating_ctr_power)); } else { uMachine_V.Heating_power = Constant_temperature_power; } } if((uMachine_V.heating_V <= 14000)&&(temp_1 < (uMachine_V.Heating_resistance * uMachine_V.Heating_power)))//ÏÞÖƵçѹΪ10V£¬ÍòÒ»µç×è²âÊÔ²¿×¼£¬µçѹ¾Í¿ÉÄÜÉýµÃºÜ¸ß { if(uMachine_V.heating_speed < 70) { uMachine_V.heating_speed++; } } else { uMachine_V.heating_speed--; } HEATING_ENABLE(); if(uMachine_V.heating_EN != 2)uMachine_V.heating_EN = 1; } else { HEATING_DISABLE(); uMachine_V.heating_EN = 0; } fu_pwm_duty_set(uMachine_V.heating_speed, FU_PWM_CH_ATOMIZER); return 0; }
    经验再多也只能看作加法,而经过理论升华的经验,就可以看作乘法!
  • 相关阅读:
    setoptsocket函数
    C++右值引用
    const char* char const* char*const
    select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET
    gitee搭建应用
    C++ 实现基本运算+-*/
    C++学习笔记(一)mutable function
    创造型设计模式-----抽象工厂模式
    openPhase gcc迁移
    SQLPLUS 远程连接数据库
  • 原文地址:https://www.cnblogs.com/TorryLong/p/13067782.html
Copyright © 2011-2022 走看看