Changeset 15 for trunk/Arduino


Ignore:
Timestamp:
Aug 14, 2019, 11:03:02 PM (7 years ago)
Author:
markus
Message:

Simulation of T_Boiler and T_Ret

Location:
trunk/Arduino
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Arduino/libraries/OT_Slave/OT_Slave.cpp

    r12 r15  
    2525  dhwEnable(false),
    2626  dhwActive(false),
    27   dhwTemperature(0)
     27  dhwTemperature(0),
     28  tBoiler(28.0),
     29  tRet(28.0)
    2830{
    2931}
    … …  
    7981      action.response.type = OT_MSGTYPE_DATA_INVALID;
    8082      break;
    81     case OT_MSGID_FEED_TEMP:  // 25 (Boiler temperature)  [M:ReadAck|DataInvalid]
    82       action.response.type = OT_MSGTYPE_DATA_INVALID;
     83    case OT_MSGID_FEED_TEMP:  // 25 (Boiler water temperature)  [M:ReadAck|DataInvalid]
     84//    action.response.type = OT_MSGTYPE_DATA_INVALID;
     85      action.response.type = OT_MSGTYPE_READ_ACK;
     86      action.response.f88(GetBoilerTemperature());
     87      break;
     88    case OT_MSGID_RETURN_WATER_TEMP: // 28 (Return water temperature)
     89      action.response.type = OT_MSGTYPE_READ_ACK;
     90      action.response.f88(GetReturnTemperature());
    8391      break;
    8492    case OT_MSGID_DHW_SETPOINT: // 56 (DHW setpoint)
    … …  
    180188}
    181189
     190float   OT_Slave::GetBoilerTemperature ()
     191{
     192        if (chActive || dhwActive) {
     193                // increase
     194                float tTarget = (chTemperature > dhwTemperature) ? chTemperature : dhwTemperature;
     195                if (tBoiler < tTarget) {
     196                        tBoiler += 0.01;
     197                }
     198        } else {
     199                // decrease
     200                if (tBoiler > tRet) {
     201                        tBoiler -= 0.01;
     202                }
     203        }
     204        return tBoiler; // FAKE NEWS !!!
     205}
     206
     207extern volatile long  loops;
     208
     209float   OT_Slave::GetReturnTemperature ()
     210{
     211        float temp = 100.0 * (tRet - 1);
     212        temp += float((loops >> 4) % 100);
     213        return temp / 100.0;
     214}
     215
    182216void  OT_Slave::ListenAfterResponse ()
    183217{
  • trunk/Arduino/libraries/OT_Slave/OT_Slave.h

    r12 r15  
    3030  float         dhwTemperature;
    3131
     32  float         tBoiler;        // max(ch,dhw,ret)
     33  float         tRet;           // Troom (28.0)
     34
    3235public:
    3336                OT_Slave ();
    … …  
    4851  virtual void  DHW_Temperature (float);
    4952
     53  virtual float GetBoilerTemperature ();
     54  virtual float GetReturnTemperature ();
     55
    5056private:
    5157  static void   ListenAfterResponse ();
  • trunk/Arduino/projects/OT_boiler/OT_boiler.ino

    r14 r15  
    3030  Ethernet.begin(mac);
    3131  CONSOLE(println("done"));
    32   // Check for Ethernet hardware present
    33 /*  Not needed anymore
    34   if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    35     CONSOLE(println("Ethernet shield was not found.  Sorry, can't run without hardware. :("));
    36     while (true) {
    37       delay(1); // do nothing, no point running without Ethernet hardware
    38     }
    39   }
    40 */
    4132}
    4233
Note: See TracChangeset for help on using the changeset viewer.