<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to CNC Dynamic Path and SMC_SmoothPath</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec6701efe2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec6701efe2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ec6701efe2/</id><updated>2020-02-27T13:48:07.572000Z</updated><subtitle>Recent posts to CNC Dynamic Path and SMC_SmoothPath</subtitle><entry><title>CNC Dynamic Path and SMC_SmoothPath</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ec6701efe2/?limit=25#9848" rel="alternate"/><published>2020-02-27T13:48:07.572000Z</published><updated>2020-02-27T13:48:07.572000Z</updated><author><name>aellis</name><uri>https://forge.codesys.com/u/aellis/</uri></author><id>https://forge.codesys.com480bd11e37e1e52002937cbbac96c2fda31a973d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have an application which requires functionality similar to the CNC Dynamic Path example provided with the SM tutorials. I have modfied the example to work with a gantry cutter and can now cut a shape using straight lines. However I now need to cut a smooth shape between all the points. I was thinking about using the SMC_Smoothpath FB to achieve this, however this only works on points between G code G51 - G50, but I am not using G code but data written into the interpolator. Is there any way around this, or can somebody suggest a better method,&lt;/p&gt;
&lt;p&gt;My current code is below:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
CASE iState OF &lt;br/&gt;
0:&lt;br/&gt;
    //initialize Queue&lt;br/&gt;
    QUEUE_RAW.pbyBuffer := ADR(BUF&lt;span&gt;[0]&lt;/span&gt;);&lt;br/&gt;
    SM3_CNC.SMC_SetQueueCapacity(ADR(QUEUE_RAW), SIZEOF(BUF));&lt;br/&gt;
    iState := iState + 1;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;1:  //fill queue&lt;br/&gt;
    WHILE NOT QUEUE_RAW.bFull DO                    // when the Queue is full, wait until it has been processed by the following FBs&lt;br/&gt;
        n := n + 1;&lt;br/&gt;
        GEO.iSourceLine_No := n;  &lt;br/&gt;
        GEO.piStartPos := GEO.piDestPos;        // copy last destination &lt;br/&gt;
        GEO.iMoveType := LIN;                   // generate linear movement &lt;br/&gt;
        GEO.iObjNo := GEO.iObjNo + 1;           // calculate number &lt;br/&gt;
        GEO.piDestPos.dX := xp&lt;span&gt;[n]&lt;/span&gt;;              // generate position &lt;br/&gt;
        GEO.piDestPos.dY := yp&lt;span&gt;[n]&lt;/span&gt;;&lt;br/&gt;
        SMC_CalcLengthGeo(pg := ADR(GEO));      // calculate length of object with the help of the standard function&lt;br/&gt;
        SMC_AppendObj(poq:=ADR(QUEUE_RAW), pgi:=ADR(GEO));  //append object to queue &lt;br/&gt;
        IF n = SIZEOF(xp)/SIZEOF(xp&lt;span&gt;[1]&lt;/span&gt;) THEN    // all target positions processed&lt;br/&gt;
            QUEUE_RAW.bEndOfList := TRUE;&lt;br/&gt;
            n := 0;&lt;br/&gt;
            iState := 2;&lt;br/&gt;
            EXIT;&lt;br/&gt;
        END_IF&lt;br/&gt;
    END_WHILE&lt;/p&gt;
&lt;p&gt;2:  //generate 3d path for visulaisation&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="nt"&gt;pcf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;bExecute&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;TRUE&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="nt"&gt;udiNumberOfPointsInArray&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;SIZEOF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;pointbuffer&lt;/span&gt;&lt;span class="o"&gt;)/&lt;/span&gt;&lt;span class="nt"&gt;SIZEOF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;pointbuffer&lt;/span&gt;&lt;span class="cp"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="nt"&gt;pBuffer&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;pointbuffer&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="nt"&gt;poqCNCpath&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;QUEUE_RAW&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
        &lt;span class="nt"&gt;dPrecision&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;10&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I assume my path preprocessing would occur between steps 1-2.&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>