<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Implement Retard Transfer Function</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b84bd3a096/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b84bd3a096/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b84bd3a096/</id><updated>2020-10-23T13:13:40.740000Z</updated><subtitle>Recent posts to Implement Retard Transfer Function</subtitle><entry><title>Implement Retard Transfer Function</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b84bd3a096/?limit=100#16fd" rel="alternate"/><published>2020-10-23T13:13:40.740000Z</published><updated>2020-10-23T13:13:40.740000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com0736c7bb69305ff2555cc0781081f1526b7e42dd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What about this :&lt;br/&gt;
This will introduce some filtering on your value.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;rActualPower&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rActualPower&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;rPidOutputPower&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You may also do this, but it will surely oscillate and tends not to reflect any real system:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;aRrBuffer&lt;/span&gt; : &lt;span class="nv"&gt;ARRAY&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;..&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="nv"&gt;OF&lt;/span&gt; &lt;span class="nv"&gt;REAL&lt;/span&gt;&lt;span class="c1"&gt;; &lt;/span&gt;
&lt;span class="o"&gt;---&lt;/span&gt;
&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Cycle index value&lt;/span&gt;
&lt;span class="nv"&gt;index&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;If&lt;/span&gt; &lt;span class="nv"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="k"&gt;Then&lt;/span&gt;
    &lt;span class="nv"&gt;index&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;End_If&lt;/span&gt;
&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Recover stored value&lt;/span&gt;
&lt;span class="nv"&gt;rPidInputPower&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;aRrBuffer&lt;/span&gt;[&lt;span class="nv"&gt;index&lt;/span&gt;]&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Place new command in buffer&lt;/span&gt;
&lt;span class="nv"&gt;aRrBuffer&lt;/span&gt;[&lt;span class="nv"&gt;index&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;rPidOutputPower&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Both examples need to be called in a cyclical task, where if we want 5s filtering/delay and 100 records, then the cyclical call time should be 5s/100samples so every 50ms.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Implement Retard Transfer Function</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b84bd3a096/?limit=25#7b19" rel="alternate"/><published>2020-10-22T11:53:28.587000Z</published><updated>2020-10-22T11:53:28.587000Z</updated><author><name>fjcano</name><uri>https://forge.codesys.com/u/fjcano/</uri></author><id>https://forge.codesys.com4c561da11f5dc0cb821bdb2cd6eaa06c6dce98df</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, I´m trying to simulate the control of a heating system. Then end of the control is a PID of the error between a power reference I generated internally for the heating system and the actual power consumption of the heating system. To test this control I want to implement a retard transfer function that simulates the power consumption. The idea is that the power consumption of the heating system will be the output of the PID with a retard of, for example, 5 second. The thing is that I don´t know how to implement this in CODESYS or if it is possible. Any ideas? &lt;br/&gt;
Any help will be appreciated.  &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>