New option: voltagedrop for sensing ohmic sensing
This commit is contained in:
@@ -101,7 +101,7 @@
|
|||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>DT1601</Name>
|
<Name>DT1601</Name>
|
||||||
<BitSize>208</BitSize>
|
<BitSize>240</BitSize>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<SubIdx>0</SubIdx>
|
<SubIdx>0</SubIdx>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
@@ -172,10 +172,20 @@
|
|||||||
<Access>ro</Access>
|
<Access>ro</Access>
|
||||||
</Flags>
|
</Flags>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<SubIdx>7</SubIdx>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Type>UDINT</Type>
|
||||||
|
<BitSize>32</BitSize>
|
||||||
|
<BitOffs>208</BitOffs>
|
||||||
|
<Flags>
|
||||||
|
<Access>ro</Access>
|
||||||
|
</Flags>
|
||||||
|
</SubItem>
|
||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>DT1602</Name>
|
<Name>DT1602</Name>
|
||||||
<BitSize>208</BitSize>
|
<BitSize>240</BitSize>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<SubIdx>0</SubIdx>
|
<SubIdx>0</SubIdx>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
@@ -246,6 +256,16 @@
|
|||||||
<Access>ro</Access>
|
<Access>ro</Access>
|
||||||
</Flags>
|
</Flags>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<SubIdx>7</SubIdx>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Type>UDINT</Type>
|
||||||
|
<BitSize>32</BitSize>
|
||||||
|
<BitOffs>208</BitOffs>
|
||||||
|
<Flags>
|
||||||
|
<Access>ro</Access>
|
||||||
|
</Flags>
|
||||||
|
</SubItem>
|
||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>DT1A00</Name>
|
<Name>DT1A00</Name>
|
||||||
@@ -723,7 +743,7 @@
|
|||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>DT7001</Name>
|
<Name>DT7001</Name>
|
||||||
<BitSize>184</BitSize>
|
<BitSize>216</BitSize>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<SubIdx>0</SubIdx>
|
<SubIdx>0</SubIdx>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
@@ -800,10 +820,21 @@
|
|||||||
<PdoMapping>R</PdoMapping>
|
<PdoMapping>R</PdoMapping>
|
||||||
</Flags>
|
</Flags>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<SubIdx>7</SubIdx>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Type>REAL</Type>
|
||||||
|
<BitSize>32</BitSize>
|
||||||
|
<BitOffs>184</BitOffs>
|
||||||
|
<Flags>
|
||||||
|
<Access WriteRestrictions="PreOP">ro</Access>
|
||||||
|
<PdoMapping>R</PdoMapping>
|
||||||
|
</Flags>
|
||||||
|
</SubItem>
|
||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>DT7002</Name>
|
<Name>DT7002</Name>
|
||||||
<BitSize>184</BitSize>
|
<BitSize>216</BitSize>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<SubIdx>0</SubIdx>
|
<SubIdx>0</SubIdx>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
@@ -880,6 +911,17 @@
|
|||||||
<PdoMapping>R</PdoMapping>
|
<PdoMapping>R</PdoMapping>
|
||||||
</Flags>
|
</Flags>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<SubIdx>7</SubIdx>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Type>REAL</Type>
|
||||||
|
<BitSize>32</BitSize>
|
||||||
|
<BitOffs>184</BitOffs>
|
||||||
|
<Flags>
|
||||||
|
<Access WriteRestrictions="PreOP">ro</Access>
|
||||||
|
<PdoMapping>R</PdoMapping>
|
||||||
|
</Flags>
|
||||||
|
</SubItem>
|
||||||
</DataType>
|
</DataType>
|
||||||
<DataType>
|
<DataType>
|
||||||
<Name>UDINT</Name>
|
<Name>UDINT</Name>
|
||||||
@@ -1027,12 +1069,12 @@
|
|||||||
<Index>#x1601</Index>
|
<Index>#x1601</Index>
|
||||||
<Name>In_Unit1</Name>
|
<Name>In_Unit1</Name>
|
||||||
<Type>DT1601</Type>
|
<Type>DT1601</Type>
|
||||||
<BitSize>208</BitSize>
|
<BitSize>240</BitSize>
|
||||||
<Info>
|
<Info>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
<Info>
|
<Info>
|
||||||
<DefaultValue>6</DefaultValue>
|
<DefaultValue>7</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
@@ -1071,6 +1113,12 @@
|
|||||||
<DefaultValue>#x70010620</DefaultValue>
|
<DefaultValue>#x70010620</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Info>
|
||||||
|
<DefaultValue>#x70010720</DefaultValue>
|
||||||
|
</Info>
|
||||||
|
</SubItem>
|
||||||
</Info>
|
</Info>
|
||||||
<Flags>
|
<Flags>
|
||||||
</Flags>
|
</Flags>
|
||||||
@@ -1079,12 +1127,12 @@
|
|||||||
<Index>#x1602</Index>
|
<Index>#x1602</Index>
|
||||||
<Name>In_Unit2</Name>
|
<Name>In_Unit2</Name>
|
||||||
<Type>DT1602</Type>
|
<Type>DT1602</Type>
|
||||||
<BitSize>208</BitSize>
|
<BitSize>240</BitSize>
|
||||||
<Info>
|
<Info>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
<Info>
|
<Info>
|
||||||
<DefaultValue>6</DefaultValue>
|
<DefaultValue>7</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
@@ -1123,6 +1171,12 @@
|
|||||||
<DefaultValue>#x70020620</DefaultValue>
|
<DefaultValue>#x70020620</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Info>
|
||||||
|
<DefaultValue>#x70020720</DefaultValue>
|
||||||
|
</Info>
|
||||||
|
</SubItem>
|
||||||
</Info>
|
</Info>
|
||||||
<Flags>
|
<Flags>
|
||||||
</Flags>
|
</Flags>
|
||||||
@@ -1539,12 +1593,12 @@
|
|||||||
<Index>#x7001</Index>
|
<Index>#x7001</Index>
|
||||||
<Name>In_Unit1</Name>
|
<Name>In_Unit1</Name>
|
||||||
<Type>DT7001</Type>
|
<Type>DT7001</Type>
|
||||||
<BitSize>184</BitSize>
|
<BitSize>216</BitSize>
|
||||||
<Info>
|
<Info>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
<Info>
|
<Info>
|
||||||
<DefaultValue>6</DefaultValue>
|
<DefaultValue>7</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
@@ -1583,6 +1637,12 @@
|
|||||||
<DefaultValue>0</DefaultValue>
|
<DefaultValue>0</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Info>
|
||||||
|
<DefaultValue>0</DefaultValue>
|
||||||
|
</Info>
|
||||||
|
</SubItem>
|
||||||
</Info>
|
</Info>
|
||||||
<Flags>
|
<Flags>
|
||||||
</Flags>
|
</Flags>
|
||||||
@@ -1591,12 +1651,12 @@
|
|||||||
<Index>#x7002</Index>
|
<Index>#x7002</Index>
|
||||||
<Name>In_Unit2</Name>
|
<Name>In_Unit2</Name>
|
||||||
<Type>DT7002</Type>
|
<Type>DT7002</Type>
|
||||||
<BitSize>184</BitSize>
|
<BitSize>216</BitSize>
|
||||||
<Info>
|
<Info>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
<Name>Max SubIndex</Name>
|
<Name>Max SubIndex</Name>
|
||||||
<Info>
|
<Info>
|
||||||
<DefaultValue>6</DefaultValue>
|
<DefaultValue>7</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
<SubItem>
|
<SubItem>
|
||||||
@@ -1635,6 +1695,12 @@
|
|||||||
<DefaultValue>0</DefaultValue>
|
<DefaultValue>0</DefaultValue>
|
||||||
</Info>
|
</Info>
|
||||||
</SubItem>
|
</SubItem>
|
||||||
|
<SubItem>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<Info>
|
||||||
|
<DefaultValue>0</DefaultValue>
|
||||||
|
</Info>
|
||||||
|
</SubItem>
|
||||||
</Info>
|
</Info>
|
||||||
<Flags>
|
<Flags>
|
||||||
</Flags>
|
</Flags>
|
||||||
@@ -1705,6 +1771,13 @@
|
|||||||
<Name>OhmicSensingVoltageLimit</Name>
|
<Name>OhmicSensingVoltageLimit</Name>
|
||||||
<DataType>REAL</DataType>
|
<DataType>REAL</DataType>
|
||||||
</Entry>
|
</Entry>
|
||||||
|
<Entry>
|
||||||
|
<Index>#x7001</Index>
|
||||||
|
<SubIndex>#x7</SubIndex>
|
||||||
|
<BitLen>32</BitLen>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<DataType>REAL</DataType>
|
||||||
|
</Entry>
|
||||||
</RxPdo>
|
</RxPdo>
|
||||||
<RxPdo Fixed="true" Mandatory="true" Sm="2">
|
<RxPdo Fixed="true" Mandatory="true" Sm="2">
|
||||||
<Index>#x1602</Index>
|
<Index>#x1602</Index>
|
||||||
@@ -1751,6 +1824,13 @@
|
|||||||
<Name>OhmicSensingVoltageLimit</Name>
|
<Name>OhmicSensingVoltageLimit</Name>
|
||||||
<DataType>REAL</DataType>
|
<DataType>REAL</DataType>
|
||||||
</Entry>
|
</Entry>
|
||||||
|
<Entry>
|
||||||
|
<Index>#x7002</Index>
|
||||||
|
<SubIndex>#x7</SubIndex>
|
||||||
|
<BitLen>32</BitLen>
|
||||||
|
<Name>OhmicSensingVoltageDrop</Name>
|
||||||
|
<DataType>REAL</DataType>
|
||||||
|
</Entry>
|
||||||
</RxPdo>
|
</RxPdo>
|
||||||
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
<TxPdo Fixed="true" Mandatory="true" Sm="3">
|
||||||
<Index>#x1A00</Index>
|
<Index>#x1A00</Index>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#define SM3_smc 0x20
|
#define SM3_smc 0x20
|
||||||
#define SM3_act 1
|
#define SM3_act 1
|
||||||
|
|
||||||
#define MAX_MAPPINGS_SM2 13
|
#define MAX_MAPPINGS_SM2 15
|
||||||
#define MAX_MAPPINGS_SM3 11
|
#define MAX_MAPPINGS_SM3 11
|
||||||
|
|
||||||
#define MAX_RXPDO_SIZE 512
|
#define MAX_RXPDO_SIZE 512
|
||||||
|
|||||||
@@ -294,6 +294,13 @@
|
|||||||
"value": "0",
|
"value": "0",
|
||||||
"access": "RO",
|
"access": "RO",
|
||||||
"data": "&Obj.In_Unit1.OhmicSensingVoltageLimit"
|
"data": "&Obj.In_Unit1.OhmicSensingVoltageLimit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "OhmicSensingVoltageDrop",
|
||||||
|
"dtype": "REAL32",
|
||||||
|
"value": "0",
|
||||||
|
"access": "RO",
|
||||||
|
"data": "&Obj.In_Unit1.OhmicSensingVoltageDrop"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"pdo_mappings": [
|
"pdo_mappings": [
|
||||||
@@ -349,6 +356,13 @@
|
|||||||
"value": "0",
|
"value": "0",
|
||||||
"access": "RO",
|
"access": "RO",
|
||||||
"data": "&Obj.In_Unit2.OhmicSensingVoltageLimit"
|
"data": "&Obj.In_Unit2.OhmicSensingVoltageLimit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "OhmicSensingVoltageDrop",
|
||||||
|
"dtype": "REAL32",
|
||||||
|
"value": "0",
|
||||||
|
"access": "RO",
|
||||||
|
"data": "&Obj.In_Unit2.OhmicSensingVoltageDrop"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"pdo_mappings": [
|
"pdo_mappings": [
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ static const char acName1601_03[] = "LowPassFilterThresholdVoltage";
|
|||||||
static const char acName1601_04[] = "EnableOhmicSensing";
|
static const char acName1601_04[] = "EnableOhmicSensing";
|
||||||
static const char acName1601_05[] = "OhmicSensingSetupTime";
|
static const char acName1601_05[] = "OhmicSensingSetupTime";
|
||||||
static const char acName1601_06[] = "OhmicSensingVoltageLimit";
|
static const char acName1601_06[] = "OhmicSensingVoltageLimit";
|
||||||
|
static const char acName1601_07[] = "OhmicSensingVoltageDrop";
|
||||||
static const char acName1602[] = "In_Unit2";
|
static const char acName1602[] = "In_Unit2";
|
||||||
static const char acName1602_00[] = "Max SubIndex";
|
static const char acName1602_00[] = "Max SubIndex";
|
||||||
static const char acName1602_01[] = "VoltageScale";
|
static const char acName1602_01[] = "VoltageScale";
|
||||||
@@ -32,6 +33,7 @@ static const char acName1602_03[] = "LowPassFilterThresholdVoltage";
|
|||||||
static const char acName1602_04[] = "EnableOhmicSensing";
|
static const char acName1602_04[] = "EnableOhmicSensing";
|
||||||
static const char acName1602_05[] = "OhmicSensingSetupTime";
|
static const char acName1602_05[] = "OhmicSensingSetupTime";
|
||||||
static const char acName1602_06[] = "OhmicSensingVoltageLimit";
|
static const char acName1602_06[] = "OhmicSensingVoltageLimit";
|
||||||
|
static const char acName1602_07[] = "OhmicSensingVoltageDrop";
|
||||||
static const char acName1A00[] = "Input12";
|
static const char acName1A00[] = "Input12";
|
||||||
static const char acName1A00_00[] = "Max SubIndex";
|
static const char acName1A00_00[] = "Max SubIndex";
|
||||||
static const char acName1A00_01[] = "Input12";
|
static const char acName1A00_01[] = "Input12";
|
||||||
@@ -99,6 +101,7 @@ static const char acName7001_03[] = "LowPassFilterThresholdVoltage";
|
|||||||
static const char acName7001_04[] = "EnableOhmicSensing";
|
static const char acName7001_04[] = "EnableOhmicSensing";
|
||||||
static const char acName7001_05[] = "OhmicSensingSetupTime";
|
static const char acName7001_05[] = "OhmicSensingSetupTime";
|
||||||
static const char acName7001_06[] = "OhmicSensingVoltageLimit";
|
static const char acName7001_06[] = "OhmicSensingVoltageLimit";
|
||||||
|
static const char acName7001_07[] = "OhmicSensingVoltageDrop";
|
||||||
static const char acName7002[] = "In_Unit2";
|
static const char acName7002[] = "In_Unit2";
|
||||||
static const char acName7002_00[] = "Max SubIndex";
|
static const char acName7002_00[] = "Max SubIndex";
|
||||||
static const char acName7002_01[] = "VoltageScale";
|
static const char acName7002_01[] = "VoltageScale";
|
||||||
@@ -107,6 +110,7 @@ static const char acName7002_03[] = "LowPassFilterThresholdVoltage";
|
|||||||
static const char acName7002_04[] = "EnableOhmicSensing";
|
static const char acName7002_04[] = "EnableOhmicSensing";
|
||||||
static const char acName7002_05[] = "OhmicSensingSetupTime";
|
static const char acName7002_05[] = "OhmicSensingSetupTime";
|
||||||
static const char acName7002_06[] = "OhmicSensingVoltageLimit";
|
static const char acName7002_06[] = "OhmicSensingVoltageLimit";
|
||||||
|
static const char acName7002_07[] = "OhmicSensingVoltageDrop";
|
||||||
|
|
||||||
const _objd SDO1000[] =
|
const _objd SDO1000[] =
|
||||||
{
|
{
|
||||||
@@ -139,23 +143,25 @@ const _objd SDO1600[] =
|
|||||||
};
|
};
|
||||||
const _objd SDO1601[] =
|
const _objd SDO1601[] =
|
||||||
{
|
{
|
||||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1601_00, 6, NULL},
|
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1601_00, 7, NULL},
|
||||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_01, 0x70010120, NULL},
|
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_01, 0x70010120, NULL},
|
||||||
{0x02, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_02, 0x70010220, NULL},
|
{0x02, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_02, 0x70010220, NULL},
|
||||||
{0x03, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_03, 0x70010320, NULL},
|
{0x03, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_03, 0x70010320, NULL},
|
||||||
{0x04, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_04, 0x70010408, NULL},
|
{0x04, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_04, 0x70010408, NULL},
|
||||||
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_05, 0x70010520, NULL},
|
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_05, 0x70010520, NULL},
|
||||||
{0x06, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_06, 0x70010620, NULL},
|
{0x06, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_06, 0x70010620, NULL},
|
||||||
|
{0x07, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1601_07, 0x70010720, NULL},
|
||||||
};
|
};
|
||||||
const _objd SDO1602[] =
|
const _objd SDO1602[] =
|
||||||
{
|
{
|
||||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1602_00, 6, NULL},
|
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName1602_00, 7, NULL},
|
||||||
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_01, 0x70020120, NULL},
|
{0x01, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_01, 0x70020120, NULL},
|
||||||
{0x02, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_02, 0x70020220, NULL},
|
{0x02, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_02, 0x70020220, NULL},
|
||||||
{0x03, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_03, 0x70020320, NULL},
|
{0x03, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_03, 0x70020320, NULL},
|
||||||
{0x04, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_04, 0x70020408, NULL},
|
{0x04, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_04, 0x70020408, NULL},
|
||||||
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_05, 0x70020520, NULL},
|
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_05, 0x70020520, NULL},
|
||||||
{0x06, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_06, 0x70020620, NULL},
|
{0x06, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_06, 0x70020620, NULL},
|
||||||
|
{0x07, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName1602_07, 0x70020720, NULL},
|
||||||
};
|
};
|
||||||
const _objd SDO1A00[] =
|
const _objd SDO1A00[] =
|
||||||
{
|
{
|
||||||
@@ -244,23 +250,25 @@ const _objd SDO7000[] =
|
|||||||
};
|
};
|
||||||
const _objd SDO7001[] =
|
const _objd SDO7001[] =
|
||||||
{
|
{
|
||||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7001_00, 6, NULL},
|
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7001_00, 7, NULL},
|
||||||
{0x01, DTYPE_REAL32, 32, ATYPE_RO, acName7001_01, 0x00000000, &Obj.In_Unit1.VoltageScale},
|
{0x01, DTYPE_REAL32, 32, ATYPE_RO, acName7001_01, 0x00000000, &Obj.In_Unit1.VoltageScale},
|
||||||
{0x02, DTYPE_REAL32, 32, ATYPE_RO, acName7001_02, 0x00000000, &Obj.In_Unit1.VoltageOffset},
|
{0x02, DTYPE_REAL32, 32, ATYPE_RO, acName7001_02, 0x00000000, &Obj.In_Unit1.VoltageOffset},
|
||||||
{0x03, DTYPE_REAL32, 32, ATYPE_RO, acName7001_03, 0x00000000, &Obj.In_Unit1.LowPassFilterThresholdVoltage},
|
{0x03, DTYPE_REAL32, 32, ATYPE_RO, acName7001_03, 0x00000000, &Obj.In_Unit1.LowPassFilterThresholdVoltage},
|
||||||
{0x04, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7001_04, 0, &Obj.In_Unit1.EnableOhmicSensing},
|
{0x04, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7001_04, 0, &Obj.In_Unit1.EnableOhmicSensing},
|
||||||
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName7001_05, 0, &Obj.In_Unit1.OhmicSensingSetupTime},
|
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName7001_05, 0, &Obj.In_Unit1.OhmicSensingSetupTime},
|
||||||
{0x06, DTYPE_REAL32, 32, ATYPE_RO, acName7001_06, 0x00000000, &Obj.In_Unit1.OhmicSensingVoltageLimit},
|
{0x06, DTYPE_REAL32, 32, ATYPE_RO, acName7001_06, 0x00000000, &Obj.In_Unit1.OhmicSensingVoltageLimit},
|
||||||
|
{0x07, DTYPE_REAL32, 32, ATYPE_RO, acName7001_07, 0x00000000, &Obj.In_Unit1.OhmicSensingVoltageDrop},
|
||||||
};
|
};
|
||||||
const _objd SDO7002[] =
|
const _objd SDO7002[] =
|
||||||
{
|
{
|
||||||
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7002_00, 6, NULL},
|
{0x00, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7002_00, 7, NULL},
|
||||||
{0x01, DTYPE_REAL32, 32, ATYPE_RO, acName7002_01, 0x00000000, &Obj.In_Unit2.VoltageScale},
|
{0x01, DTYPE_REAL32, 32, ATYPE_RO, acName7002_01, 0x00000000, &Obj.In_Unit2.VoltageScale},
|
||||||
{0x02, DTYPE_REAL32, 32, ATYPE_RO, acName7002_02, 0x00000000, &Obj.In_Unit2.VoltageOffset},
|
{0x02, DTYPE_REAL32, 32, ATYPE_RO, acName7002_02, 0x00000000, &Obj.In_Unit2.VoltageOffset},
|
||||||
{0x03, DTYPE_REAL32, 32, ATYPE_RO, acName7002_03, 0x00000000, &Obj.In_Unit2.LowPassFilterThresholdVoltage},
|
{0x03, DTYPE_REAL32, 32, ATYPE_RO, acName7002_03, 0x00000000, &Obj.In_Unit2.LowPassFilterThresholdVoltage},
|
||||||
{0x04, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7002_04, 0, &Obj.In_Unit2.EnableOhmicSensing},
|
{0x04, DTYPE_UNSIGNED8, 8, ATYPE_RO, acName7002_04, 0, &Obj.In_Unit2.EnableOhmicSensing},
|
||||||
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName7002_05, 0, &Obj.In_Unit2.OhmicSensingSetupTime},
|
{0x05, DTYPE_UNSIGNED32, 32, ATYPE_RO, acName7002_05, 0, &Obj.In_Unit2.OhmicSensingSetupTime},
|
||||||
{0x06, DTYPE_REAL32, 32, ATYPE_RO, acName7002_06, 0x00000000, &Obj.In_Unit2.OhmicSensingVoltageLimit},
|
{0x06, DTYPE_REAL32, 32, ATYPE_RO, acName7002_06, 0x00000000, &Obj.In_Unit2.OhmicSensingVoltageLimit},
|
||||||
|
{0x07, DTYPE_REAL32, 32, ATYPE_RO, acName7002_07, 0x00000000, &Obj.In_Unit2.OhmicSensingVoltageDrop},
|
||||||
};
|
};
|
||||||
|
|
||||||
const _objectlist SDOobjects[] =
|
const _objectlist SDOobjects[] =
|
||||||
@@ -271,8 +279,8 @@ const _objectlist SDOobjects[] =
|
|||||||
{0x100A, OTYPE_VAR, 0, 0, acName100A, SDO100A},
|
{0x100A, OTYPE_VAR, 0, 0, acName100A, SDO100A},
|
||||||
{0x1018, OTYPE_RECORD, 4, 0, acName1018, SDO1018},
|
{0x1018, OTYPE_RECORD, 4, 0, acName1018, SDO1018},
|
||||||
{0x1600, OTYPE_RECORD, 1, 0, acName1600, SDO1600},
|
{0x1600, OTYPE_RECORD, 1, 0, acName1600, SDO1600},
|
||||||
{0x1601, OTYPE_RECORD, 6, 0, acName1601, SDO1601},
|
{0x1601, OTYPE_RECORD, 7, 0, acName1601, SDO1601},
|
||||||
{0x1602, OTYPE_RECORD, 6, 0, acName1602, SDO1602},
|
{0x1602, OTYPE_RECORD, 7, 0, acName1602, SDO1602},
|
||||||
{0x1A00, OTYPE_RECORD, 1, 0, acName1A00, SDO1A00},
|
{0x1A00, OTYPE_RECORD, 1, 0, acName1A00, SDO1A00},
|
||||||
{0x1A01, OTYPE_RECORD, 5, 0, acName1A01, SDO1A01},
|
{0x1A01, OTYPE_RECORD, 5, 0, acName1A01, SDO1A01},
|
||||||
{0x1A02, OTYPE_RECORD, 5, 0, acName1A02, SDO1A02},
|
{0x1A02, OTYPE_RECORD, 5, 0, acName1A02, SDO1A02},
|
||||||
@@ -285,7 +293,7 @@ const _objectlist SDOobjects[] =
|
|||||||
{0x6001, OTYPE_RECORD, 5, 0, acName6001, SDO6001},
|
{0x6001, OTYPE_RECORD, 5, 0, acName6001, SDO6001},
|
||||||
{0x6002, OTYPE_RECORD, 5, 0, acName6002, SDO6002},
|
{0x6002, OTYPE_RECORD, 5, 0, acName6002, SDO6002},
|
||||||
{0x7000, OTYPE_VAR, 0, 0, acName7000, SDO7000},
|
{0x7000, OTYPE_VAR, 0, 0, acName7000, SDO7000},
|
||||||
{0x7001, OTYPE_RECORD, 6, 0, acName7001, SDO7001},
|
{0x7001, OTYPE_RECORD, 7, 0, acName7001, SDO7001},
|
||||||
{0x7002, OTYPE_RECORD, 6, 0, acName7002, SDO7002},
|
{0x7002, OTYPE_RECORD, 7, 0, acName7002, SDO7002},
|
||||||
{0xffff, 0xff, 0xff, 0xff, NULL, NULL}
|
{0xffff, 0xff, 0xff, 0xff, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ typedef struct
|
|||||||
uint8_t EnableOhmicSensing;
|
uint8_t EnableOhmicSensing;
|
||||||
uint32_t OhmicSensingSetupTime;
|
uint32_t OhmicSensingSetupTime;
|
||||||
float OhmicSensingVoltageLimit;
|
float OhmicSensingVoltageLimit;
|
||||||
|
float OhmicSensingVoltageDrop;
|
||||||
} In_Unit1;
|
} In_Unit1;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@@ -51,6 +52,7 @@ typedef struct
|
|||||||
uint8_t EnableOhmicSensing;
|
uint8_t EnableOhmicSensing;
|
||||||
uint32_t OhmicSensingSetupTime;
|
uint32_t OhmicSensingSetupTime;
|
||||||
float OhmicSensingVoltageLimit;
|
float OhmicSensingVoltageLimit;
|
||||||
|
float OhmicSensingVoltageDrop;
|
||||||
} In_Unit2;
|
} In_Unit2;
|
||||||
|
|
||||||
/* Parameters */
|
/* Parameters */
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ void ads1014_reset(ADS1014 *ads) {
|
|||||||
class OhmicSensing {
|
class OhmicSensing {
|
||||||
public:
|
public:
|
||||||
void handle(uint8_t voltageState, float inVoltage, float limitVoltage,
|
void handle(uint8_t voltageState, float inVoltage, float limitVoltage,
|
||||||
uint32_t setupTime, uint8_t enabled, uint8_t &sensed);
|
float voltageDropLimit, uint32_t setupTime, uint8_t enabled,
|
||||||
|
uint8_t &sensed);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum OhmicStates { OHMIC_IDLE, OHMIC_SETUP, OHMIC_PROBE };
|
enum OhmicStates { OHMIC_IDLE, OHMIC_SETUP, OHMIC_PROBE };
|
||||||
@@ -128,11 +129,13 @@ void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation
|
|||||||
|
|
||||||
Ohm1.handle(
|
Ohm1.handle(
|
||||||
stat_1, Obj.Out_Unit1.CalculatedVoltage,
|
stat_1, Obj.Out_Unit1.CalculatedVoltage,
|
||||||
Obj.In_Unit1.OhmicSensingVoltageLimit, Obj.In_Unit1.OhmicSensingSetupTime,
|
Obj.In_Unit1.OhmicSensingVoltageLimit,
|
||||||
|
Obj.In_Unit1.OhmicSensingVoltageDrop, Obj.In_Unit1.OhmicSensingSetupTime,
|
||||||
Obj.In_Unit1.EnableOhmicSensing, Obj.Out_Unit1.OhmicSensingSensed);
|
Obj.In_Unit1.EnableOhmicSensing, Obj.Out_Unit1.OhmicSensingSensed);
|
||||||
Ohm2.handle(
|
Ohm2.handle(
|
||||||
stat_2, Obj.Out_Unit2.CalculatedVoltage,
|
stat_2, Obj.Out_Unit2.CalculatedVoltage,
|
||||||
Obj.In_Unit2.OhmicSensingVoltageLimit, Obj.In_Unit2.OhmicSensingSetupTime,
|
Obj.In_Unit2.OhmicSensingVoltageLimit,
|
||||||
|
Obj.In_Unit2.OhmicSensingVoltageDrop, Obj.In_Unit2.OhmicSensingSetupTime,
|
||||||
Obj.In_Unit2.EnableOhmicSensing, Obj.Out_Unit2.OhmicSensingSensed);
|
Obj.In_Unit2.EnableOhmicSensing, Obj.Out_Unit2.OhmicSensingSensed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,8 +430,9 @@ void lowpassFilter(float &oldLowPassGain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OhmicSensing::handle(uint8_t voltageState, float inVoltage,
|
void OhmicSensing::handle(uint8_t voltageState, float inVoltage,
|
||||||
float limitVoltage, uint32_t setupTime,
|
float limitVoltage, float voltageDropLimit,
|
||||||
uint8_t enabled, uint8_t &sensed) {
|
uint32_t setupTime, uint8_t enabled,
|
||||||
|
uint8_t &sensed) {
|
||||||
sensed = 0;
|
sensed = 0;
|
||||||
if (enabled && voltageState == 0) {
|
if (enabled && voltageState == 0) {
|
||||||
if (ohmicState == OHMIC_IDLE && inVoltage > limitVoltage) {
|
if (ohmicState == OHMIC_IDLE && inVoltage > limitVoltage) {
|
||||||
@@ -446,8 +450,11 @@ void OhmicSensing::handle(uint8_t voltageState, float inVoltage,
|
|||||||
voltages.push(inVoltage);
|
voltages.push(inVoltage);
|
||||||
#define N_VOLTAGES 3
|
#define N_VOLTAGES 3
|
||||||
while (voltages.size() > N_VOLTAGES) voltages.pop(); // Only N_VOLTAGES
|
while (voltages.size() > N_VOLTAGES) voltages.pop(); // Only N_VOLTAGES
|
||||||
if (inVoltage <= limitVoltage || oldVoltage - inVoltage >= 1.0 ||
|
if (inVoltage <= limitVoltage || // Below threshold
|
||||||
voltages.front() - voltages.back() > 2.0) {
|
(abs(voltageDropLimit) > 1e-3 && // Immediate drop
|
||||||
|
oldVoltage - inVoltage >= voltageDropLimit) ||
|
||||||
|
(abs(voltageDropLimit) > 1e-3 && // Drop over 3 cycles
|
||||||
|
voltages.front() - voltages.back() > voltageDropLimit)) {
|
||||||
sensed = 1;
|
sensed = 1;
|
||||||
}
|
}
|
||||||
oldVoltage = inVoltage;
|
oldVoltage = inVoltage;
|
||||||
|
|||||||
Reference in New Issue
Block a user