<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/</id><updated>2020-02-27T14:22:22.657000Z</updated><subtitle>Recent posts to Problem on generate SINE wave in GEN</subtitle><entry><title>Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/?limit=25#00e6" rel="alternate"/><published>2020-02-27T14:22:22.657000Z</published><updated>2020-02-27T14:22:22.657000Z</updated><author><name>Francis-JJ</name><uri>https://forge.codesys.com/u/francis-jj/</uri></author><id>https://forge.codesys.com6d5038375af438a85d618efc9ea15c2b665fb11d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Josep M. Rams hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Francis.&lt;br/&gt;
In principle the software would has ask the task about his cycletime and about the cyclenumber =&amp;gt; time_i=cycletime x ncycles.&lt;br/&gt;
I recomend to you to read oscat basic documentation is more clear.( Has this block)&lt;br/&gt;
For your tests see too the drive cycle time and if the drive could interpolate his consign. If not the drive see an stair not a sinus curve&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Dear Josep,&lt;/p&gt;
&lt;p&gt;Clear, many thanks.&lt;br/&gt;
BTW, for this problem I already had the solution, And I tried to use the FB from OSCAT, and it also can works fine.&lt;br/&gt;
I just curious why official FB from 3S had this kind of issue.  &lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Francis&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/?limit=25#470f" rel="alternate"/><published>2020-02-27T14:22:22.252000Z</published><updated>2020-02-27T14:22:22.252000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com7caafc18f49cfebcb9b06fe27f4f1d2ed22f0b6f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Francis.&lt;/p&gt;
&lt;p&gt;In principle the software would has ask the task about his cycletime and about the cyclenumber =&amp;gt; time_i=cycletime x ncycles.&lt;/p&gt;
&lt;p&gt;I recomend to you to read oscat basic documentation is more clear.( Has this block)&lt;/p&gt;
&lt;p&gt;For your tests see too the drive cycle time and if the drive could interpolate his consign. If not the drive see an stair not a sinus curve&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/?limit=25#4900" rel="alternate"/><published>2020-02-27T14:22:21.041000Z</published><updated>2020-02-27T14:22:21.041000Z</updated><author><name>Francis-JJ</name><uri>https://forge.codesys.com/u/francis-jj/</uri></author><id>https://forge.codesys.com4445039fe1f98a8c8a5a3c8b1db904e9662660cf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Josep M. Rams hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
It seems that if you use bade=true sin is calculated with the time in execution time. With base false uses the beguin cycle time( ncycles x cycletime).&lt;br/&gt;
For me is better the second one. The output is updated syncronous with cycle.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Dear Josep,&lt;/p&gt;
&lt;p&gt;Thanks for your quick reply, I used the t#500ms in this application. I try to make cycle time faster, and make it to 1ms, and it's looks better.&lt;br/&gt;
So this was cause by the time gap between the Task cycle time and parameter named 'Period'?&lt;/p&gt;
&lt;p&gt;Besides, I have a question when 'Base' was set to 'False', for example, my cycle time is 8ms, and I want it to generate the sine wave 1Hz frequency, so how I should calculate this 'Cycle'?&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Fancis&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/?limit=25#3a64" rel="alternate"/><published>2020-02-27T14:22:20.626000Z</published><updated>2020-02-27T14:22:20.626000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.comd63f74147ae6fd07d19eeee69111d6dc5c0b0de7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It seems that if you use bade=true sin is calculated with the time in execution time. With base false uses the beguin cycle time( ncycles x cycletime).&lt;/p&gt;
&lt;p&gt;For me is better the second one. The output is updated syncronous with cycle.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Problem on generate SINE wave in GEN</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/0e4881ac29/?limit=25#3993" rel="alternate"/><published>2020-02-27T14:22:20.168000Z</published><updated>2020-02-27T14:22:20.168000Z</updated><author><name>Francis-JJ</name><uri>https://forge.codesys.com/u/francis-jj/</uri></author><id>https://forge.codesys.coma7264fac762db40dbbbcb9dadcc7277f881340e8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear 3S colleague:&lt;/p&gt;
&lt;p&gt;I have inquiry which related to function block named 'GEN' in 'Util.library'.&lt;/p&gt;
&lt;p&gt;I try to called the function block like as below,&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;fb_Gen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="k"&gt;MODE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;sinus&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;BASE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;TRUE&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;PERIOD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tFreq&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;CYCLES&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;AMPLITUDE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="k"&gt;RESET&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="k"&gt;OUT&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After that I found the trace file was not so smooth, and every cycle are the same, please check the file I attached named '1.jpg'.&lt;br/&gt;
Since I used this sine wave as master position, and I used an realo axis to follow this master, every cycle I can see the jerk and hear the noise.&lt;br/&gt;
So I try to modify the parameter 'Base' to false, and it seems better, and I try to directly call the function 'sin' also can works well. the drives also can works fine without any noise.&lt;/p&gt;
&lt;p&gt;Could you help explain why this jerk will happened? Since I can't find more detailed information in help documentation. So your explaination will be very helpful to solved this issue and let me know more about this library.&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;br/&gt;
Hope you can have a nice day!&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Francis&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: 1.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2269"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>