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; }
    经验再多也只能看作加法,而经过理论升华的经验,就可以看作乘法!
  • 相关阅读:
    Dbcp2抛出org.apache.commons.dbcp2.LifetimeExceededException
    DbUtils使用时抛出Cannot get a connection
    Spring注解【非单例】
    Exception in thread java.lang.IllegalThreadStateException
    eclipse选中变量,相同变量高亮。
    git push 403
    java虚拟机能并发的启动多少个线程
    产品的随想
    【转载】学习新东西的唯一方法
    Mysql错误问题记录
  • 原文地址:https://www.cnblogs.com/TorryLong/p/13067782.html
Copyright © 2011-2022 走看看