<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to BUG2: CoDeSys Axis-modulo tracking error</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/c4b019c165/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Motion/thread/c4b019c165/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Motion/thread/c4b019c165/</id><updated>2020-02-27T18:33:28.417000Z</updated><subtitle>Recent posts to BUG2: CoDeSys Axis-modulo tracking error</subtitle><entry><title>BUG2: CoDeSys Axis-modulo tracking error</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/c4b019c165/?limit=25#8119" rel="alternate"/><published>2020-02-27T18:33:28.417000Z</published><updated>2020-02-27T18:33:28.417000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comae3914a757d5cbe3ae18e37f987b8e8a41ca9d19</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Nicolai_Hanssing&lt;/p&gt;
&lt;p&gt;3S Software has acknowledged, reproduced and solved the bug described above. The residual issue is solved by Hilmar Panzer in SM_DriveBasic.lib ver. 1.9.4.1 wich has yet to be released.&lt;/p&gt;
&lt;p&gt;To make sure your not affected by the bug, just confirm that your modulo-value in drive increments are a whole noumber. This can be read out from the AXIS_REF.iRestNumerator == 0.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Nicolai Hanssing, M.Sc.&lt;/p&gt;
&lt;p&gt;Delta Elektronik A/S&lt;/p&gt;
&lt;p&gt;Denmark&lt;span&gt;[/b]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>BUG2: CoDeSys Axis-modulo tracking error</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/c4b019c165/?limit=25#c467" rel="alternate"/><published>2020-02-27T18:33:25.273000Z</published><updated>2020-02-27T18:33:25.273000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com560f145e336f14ce76a3d3322cffc6d0b3654746</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Nicolai_Hanssing&lt;/p&gt;
&lt;p&gt;Setting up an axis with positionmodulo, where the physical resolution pr turn is not a integer in drive-increments causes the position to drift when multiple turns are performed on the axis.&lt;/p&gt;
&lt;p&gt;Motor: 4096 inc/rev&lt;/p&gt;
&lt;p&gt;Gearing 640:28&lt;/p&gt;
&lt;p&gt;TechUnits: 360 dgr modulo  =&amp;gt;&lt;/p&gt;
&lt;p&gt;.iRatioTechUnitsNum = 63&lt;/p&gt;
&lt;p&gt;.dwRatioTechUnitsDEnom = 16384&lt;/p&gt;
&lt;p&gt;.fPositionPeriod = 360&lt;/p&gt;
&lt;p&gt;.dwOneTurn = 93623 (Wich is not precise)&lt;/p&gt;
&lt;p&gt;.iRestNumerator = -9&lt;/p&gt;
&lt;p&gt;It is clear that after 63 full turns you will have a integer-no of incrments:&lt;/p&gt;
&lt;p&gt;No increments = 360&lt;em&gt;63 / (63/16384) = 360&lt;/em&gt;16384 = 5898240&lt;/p&gt;
&lt;p&gt;And the AXIS_REF.iTurn also reaches this number (63) before roll-over, but the &lt;/p&gt;
&lt;p&gt;position in AXIS_REF.fActPosition still does not track correctly.&lt;/p&gt;
&lt;p&gt;Axis started in:&lt;/p&gt;
&lt;p&gt;.dwActPosition = 0 inc&lt;/p&gt;
&lt;p&gt;.fActPosition = 0 dgr&lt;/p&gt;
&lt;p&gt;After running for some time:&lt;/p&gt;
&lt;p&gt;.dwActPosition = 834859476 (Raw 32bit position from drive)&lt;/p&gt;
&lt;p&gt;.fActPosition = 89.151 dgr (Not correct - I think)&lt;/p&gt;
&lt;p&gt;If I perform modulo calculations on that I get: 94.049 dgr as ActPos as correct&lt;/p&gt;
&lt;p&gt;position.&lt;/p&gt;
&lt;p&gt;But if I calculate by using .dwOneTurn I get: 89.15dgr as ActPos!&lt;/p&gt;
&lt;p&gt;Clearly CoDeSys is not tracking the modulo residuals correctly .....&lt;/p&gt;
&lt;p&gt;When the roll-over occurs the variable .iPosOffSetForResiduals get updated every modulo turn, the resudual value shifts by dwOneTurn. &lt;/p&gt;
&lt;p&gt;But when .iTurn rolls over .iPosOffSetForResiduals does not get corrected by&lt;/p&gt;
&lt;p&gt;'iRestNumerator' as it should since:&lt;/p&gt;
&lt;p&gt;iRatioTechUnitsNum * dwOneTurn = 5898249 = fPositionPeriod*dwRatioTechUnitsDEnom - iRestNumerator&lt;/p&gt;
&lt;p&gt;Am I completely of the bat here?&lt;/p&gt;
&lt;p&gt;Or is this a bug in CoDeSys Softmotion?&lt;/p&gt;
&lt;p&gt;Nicolai&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>