@lobomau mach doch mal ein Thread auf "PID-Adapter: Anwendungs-Ideen und -Möglichkeiten" oder so ähnlich.
@lobomau sagte in Test neuer Adapter pid (pid-Regler) V0.0.x:
Bisher habe ich immer die Ampere-Zahl geregelt. Wenn ich es richtig sehe nutzt du den unteren DP, der aus Watt die Ampere macht, richtig?
ich kenne den Datenpunkt so nicht, ich nutze MQTT und verwende da amp.set und versorge den state mit ganzen (Ampere-) Zahlen. Die Stromstärke berechne ich aus der vom Regler ermittelten Leistung in kW und runde auf ganze Zahlen ab. Den Code vom Blockly findest du unten - einfach in Blockly importieren und versuchen nachzuvollziehen
Warum regle ich die Leistung und nicht die Stromstärke? Weil die Leistung von 1.4 bis 11 kW geht, bei ca. 4 kW aber der Sprung von 16 zurück auf 6 A kommt, während dann mit 3 und nicht mehr mit 1 Phase geladen wird. Wenn du mit max. 3.7 kW laden möchtest (=1-phasig) kannst du auch die Stromstärke von 6 - 16 A regeln.
@lobomau sagte in Test neuer Adapter pid (pid-Regler) V0.0.x:
Und wenn ich es richtig verstehe muss ich da irgendwie in der selben Einheit bleiben... also alles in kW?
Istwert und Sollwert müssen die gleiche Einheit haben, sonst lässt sich ja die Regelabweichung nicht vernünftig berechnen. Der Reglerausgang muss dann zum Stellglied passen, kann 0-100 (%) sein, kann 0-11 (kW) sein, 0-10 (V), 6-16 (A), -1400 - 1400 (U/min) sein usw. (wird ja durch min und max definiert).
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="comment" id="6Fzyi%iFMuz;[gx6U^ur" x="-162" y="-462">
<field name="COMMENT">Objekte für Lademodi</field>
<next>
<block type="create" id="g=}k]T}C`/O@fN^KkL8,">
<field name="NAME">Wallbox.Laden_mit_3_Phasen</field>
<value name="VALUE">
<block type="logic_boolean" id="Q#$fU7:LQ*wXH$Wmo?^;">
<field name="BOOL">FALSE</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="()hhu.BXzd@3B9LR{M5L">
<field name="TEXT">{"type":"boolean"}</field>
</block>
</value>
<next>
<block type="create" id="V2UMyXKwCwkVRQ7Q|H7p">
<field name="NAME">Wallbox.Ladestrom</field>
<value name="VALUE">
<block type="math_number" id=")zxu/!0vjiL|6`/wTm?z">
<field name="NUM">6</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="IBU`2L$!ri*P0acDm[hq">
<field name="TEXT">{"type":"number","unit":"A","min":6,"max":17}</field>
</block>
</value>
<next>
<block type="create" id="3ZF*2X8UqK5D2Yrg.=Ja">
<field name="NAME">Wallbox.Ladestrom_temp</field>
<value name="VALUE">
<block type="math_number" id="Os.Q{xlLrT9ukcU2.he:">
<field name="NUM">6</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="h|$`wDEX7VK:.vb#?+9~">
<field name="TEXT">{"type":"number","unit":"A","min":6,"max":17}</field>
</block>
</value>
<next>
<block type="comment" id="9(;?A=^Gm:J{1/0kx?D*">
<field name="COMMENT">Ladefreigabe nur bei Anforderung >1.4kW</field>
<next>
<block type="on" id="LI/DnJ,bhNV[GPDQd5x2" disabled="true">
<field name="OID">javascript.0.Wallbox.Ladeleistung</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id="]g-4ksVUc,L:R`,Sam{]">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="LR(_Lypo4Eh;q?jxiyWG">
<field name="OP">LT</field>
<value name="A">
<block type="on_source" id="5ICK=yd_RoC2xZ=2nuCd">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="z2XHw[s8?rAAc45}wfIg">
<field name="NUM">1.4</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="M%HTxJcO2Ix:=1Lvth^w">
<field name="COMMENT">Flatterschutz</field>
<next>
<block type="control" id="7)CJi@2G~T@ov|Nw^8Bk">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">mqtt.0.go-eCharger.frc.set</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="u3r[TM0$.O8x/1i[y_L#">
<field name="NUM">1</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="control" id="}uF^S[.4}bpeEf|E.^/~">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">mqtt.0.go-eCharger.frc.set</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="4n~49KOkX/ZZAR)1wrfD">
<field name="NUM">0</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
<next>
<block type="comment" id="*(ykd$e~x?uw_M6bq9=5">
<field name="COMMENT">Freigabe Regler nur bei aktiver Ladung</field>
<next>
<block type="on" id="(J,T/^Dj!W64nts%+Q~f">
<field name="OID">javascript.0.PV.Netzleistung</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="control" id="L+s}}3JbkdP9ird(}dD?">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">pid.0.C-Wallbox_Ladeleistung.in.act</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="on_source" id="BW+GhDj$_HcO%0A5`Uig">
<field name="ATTR">state.val</field>
</block>
</value>
<next>
<block type="comment" id="lT_D;o/aq/KP3g[/6[=X">
<field name="COMMENT">"- 0.5" = Grundlast</field>
<next>
<block type="control" id="ui]E)FYnxhAtqjDiio_)">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">pid.0.C-Wallbox_Ladeleistung.para.max</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_constrain" id="~1f,$OZYDw3ka]UGHbrB">
<value name="VALUE">
<shadow type="math_number" id="^`IA.,ld+d0I)(kPy`9N">
<field name="NUM">50</field>
</shadow>
<block type="math_arithmetic" id="rd@D|6a,_es.dd@R7Q.z">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="5Tfd4pORy!tC@3lXPp+*">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="P=JTpM]BWMnggQ^0$;2o">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="jV=45_4GcvdMfevaias|">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="asCeq)lqPS^](|ZJ=~er">
<field name="ATTR">val</field>
<field name="OID">pid.0.C-Wallbox_Ladeleistung.in.set</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="yQ?:r`qozcbv_*^/!;MJ">
<field name="NUM">0.5</field>
</shadow>
<block type="get_value" id="cpWV!jBFH`w(r?EjIGi%">
<field name="ATTR">val</field>
<field name="OID">lg-ess-home.0.user.essinfo.home.statistics.pcs_pv_total_power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id=")BI(2-KYpw={iuPJ2=!e">
<field name="NUM">0.5</field>
</shadow>
</value>
</block>
</value>
<value name="LOW">
<shadow type="math_number" id="Pz3azW*5Kd,gx3~tI8wM">
<field name="NUM">1.4</field>
</shadow>
</value>
<value name="HIGH">
<shadow type="math_number" id="?*r`h-cHu$XdQx+lY.*=">
<field name="NUM">11.4</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="R$%zd0jUahW`PPIGw_lZ">
<field name="COMMENT">PID-Adapter hat y (Ladeleistung) verändert</field>
<next>
<block type="comment" id="*|YXiB6@e=%~gJ-enB-{">
<field name="COMMENT">Berechnung von Strom und Anzahl Phasen</field>
<next>
<block type="on" id="Lv1XVslI[XE21]$gixhv">
<field name="OID">pid.0.C-Wallbox_Ladeleistung.out.y</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id="-94`Y!nA+O~2fKFScjGq">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="knkQ5MNMDQSuAO%~TzWI">
<field name="OP">GTE</field>
<value name="A">
<block type="on_source" id="];-|1rg~FCQeqrFcFT0!">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="Ds%kkB$E0UIh6#9snq+c">
<field name="NUM">4.3</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="/0}^g)!y4{][e:rG8)V5">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.Wallbox.Laden_mit_3_Phasen</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=".}pj*s316R_g{2~urmom">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="2P=}qq.`fQQ04OAb_Q7(">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.Wallbox.Ladestrom_temp</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="]Fs)6Y24R=Id7@(Wc%Uv">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="}6c;IG09uA}ji#f*}/u0">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="./*ky,qeu2Jly-#o:.NA">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="P}tikR,7o8zbZTw,kyiW">
<field name="NUM">400</field>
</shadow>
<block type="on_source" id="I^XZ^2Ny^jPI`*2O;c_X">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="HFR$IT_BfO1Fr=+W9n0y">
<field name="NUM">1000</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="=D~E~Voyz4-[!}*TtHg%">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="J5E4vPyUoz28Mv!Yxe=%">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="{kwtU*UGl5T1w_*XAMm}">
<field name="NUM">400</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="k=H55W)(6ME~]s52b6^y">
<field name="NUM">1</field>
</shadow>
<block type="math_single" id="/|J#~[u|cI)$^~3|vQA3">
<field name="OP">ROOT</field>
<value name="NUM">
<shadow type="math_number" id="]LN=L2`Z+4=uzwd}DKK*">
<field name="NUM">3</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="lhSTc~J%TR]tQnvBRk3J">
<field name="OP">LTE</field>
<value name="A">
<block type="on_source" id="NuPp_$3eTiKW[F8EcSZr">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="WZeW!mvt_8|Ji)a]O,R?">
<field name="NUM">4.1</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="update" id=".8`KTV|:H]f67+4KkwFY">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.Wallbox.Laden_mit_3_Phasen</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="7tpYqM!BDOjQrWoD@)m~">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="update" id="v-z)wQ!i}E3KPIoqnf;Q">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.Wallbox.Ladestrom_temp</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="#P7..Vx8z^mk`w0/op7$">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="fEQ,#vO5*8c)z%KwM{a3">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="q=M1`]}3*XB,Y77`ZNw(">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="PCER@)4yE#7cF/]heqO]">
<field name="NUM">400</field>
</shadow>
<block type="on_source" id="H%kxy#Tea`Lbcuk^*jm%">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="_I;!W[$Rn+m/O+m(GZn`">
<field name="NUM">1000</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="b(U)LH@-Y#=Lxzy*G#5V">
<field name="NUM">230</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</statement>
<next>
<block type="comment" id="#xW+.d|2.Vtia9K#2I9A">
<field name="COMMENT">Phasenumschaltung an Wallbox senden, Regler pausieren</field>
<next>
<block type="on" id="/q{y(D=]qK]yr0KwDQ*Q">
<field name="OID">javascript.0.Wallbox.Laden_mit_3_Phasen</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="control" id="j}5$_.R^ys2qr?]3?DFP">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">pid.0.C-Wallbox_Ladeleistung.in.hold</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="]1sVAD$]{P-;J2/=)GLt">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="controls_if" id="sCKj4U,.=qqK^sT[j9-R">
<mutation else="1"></mutation>
<value name="IF0">
<block type="on_source" id="JoZpjKCyF%VUV,gq~8*~">
<field name="ATTR">state.val</field>
</block>
</value>
<statement name="DO0">
<block type="control" id="#idta+mDk7An|9R9FSxE">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">mqtt.0.go-eCharger.psm.set</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">5</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="math_number" id="[KoA|W-q-~_IK-~]bT~Y">
<field name="NUM">2</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="control" id="^xyJKc0U/ntD/akG2fdi">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">mqtt.0.go-eCharger.psm.set</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">5</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="math_number" id="1T`;KG`5.v+,cGi7U-gZ">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</statement>
<next>
<block type="on" id="D=Z$+roFM-SNg72/,9b`">
<field name="OID">mqtt.0.go-eCharger.modelStatus</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id="~D;_*(4y7:7F95q|YE*v">
<value name="IF0">
<block type="logic_compare" id="ofUANLJu18F7)zOxwnKK">
<field name="OP">NEQ</field>
<value name="A">
<block type="on_source" id="1qySnM7=m`b@4K]I^A8F">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="math_number" id="X{om?Wpv,SD#?)Awr$72">
<field name="NUM">23</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="9o3x0+NZi9FOv$%Jn],I">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">pid.0.C-Wallbox_Ladeleistung.in.hold</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">5</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="logic_boolean" id="]rfM^IuodA02kP75,*w0">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
<next>
<block type="comment" id="4CFmsu+d62e8[O_1TJJ$">
<field name="COMMENT">Ladestrom in ganzen Ampere verzögert an Wallbox senden (Flatterschutz)</field>
<next>
<block type="on" id="}ee8Ww@51lY/sJH48da=">
<field name="OID">javascript.0.Wallbox.Ladestrom_temp</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="update" id="zshQaj)(D+w_TKTgRD:`">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.Wallbox.Ladestrom</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_constrain" id="wFmf`{^upWMB2OJdAb|G">
<value name="VALUE">
<shadow type="math_number" id="OolIglBQ1NPR+!O4eGrf">
<field name="NUM">50</field>
</shadow>
<block type="math_round" id="$m0s.BG/!^X?k^Afni8@">
<field name="OP">ROUNDDOWN</field>
<value name="NUM">
<shadow type="math_number" id="`7oxcQI80-L-5|v6l{ZE">
<field name="NUM">3.1</field>
</shadow>
<block type="on_source" id="%v#Z0Z$`8}+tD/BK.cC|">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<value name="LOW">
<shadow type="math_number" id="*e`aXaysjQdx*v%uiLb9">
<field name="NUM">6</field>
</shadow>
</value>
<value name="HIGH">
<shadow type="math_number" id="YaWi@k@syv0)}OtI#DEe">
<field name="NUM">16</field>
</shadow>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="on" id="5fjJvXZz9=9xHMmXqipC">
<field name="OID">javascript.0.Wallbox.Ladestrom</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="control" id="s$Nt!/B/Vr%PS,`~~{Dt">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation>
<field name="OID">mqtt.0.go-eCharger.amp.set</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">5</field>
<field name="UNIT">sec</field>
<field name="CLEAR_RUNNING">TRUE</field>
<value name="VALUE">
<block type="on_source" id="G}rg6b4k{eWdw-W7?WZp">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>