<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/</id><updated>2025-01-18T22:11:55.760000Z</updated><subtitle>Recent posts to Strange problem with the ‘MC_SetPosition’ function</subtitle><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=25#2adb/86b6/7e9d/0a23/f5f3" rel="alternate"/><published>2025-01-18T22:11:55.760000Z</published><updated>2025-01-18T22:11:55.760000Z</updated><author><name>trusty-squire</name><uri>https://forge.codesys.com/u/trusty-squire/</uri></author><id>https://forge.codesys.com986d926db39489392ef09b4cad69bb3673b00fb3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;Here, it seems to me that we are getting completely off track with the observed problem.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If questions clarifying the details of the installation are problematic, it's best to include those details in the original question then...&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I had already written this elsewhere. The program before being brought into machines was exhaustively tested in SW emulation and the problem did not occur.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Testing the full program in emulation is entirely different from creating a simplified program to isolate the function causing problems in the real world. I would recommend trying it to isolate the issue.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The drive and motor have been working fine for about 10 years. In replacing the machine control system, I opted for CoDeSys where before there was something else. But this is not the subject of the problem&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A simple "yes" is the correct answer to my question here...&lt;/p&gt;
&lt;p&gt;Anyways, you seem to be a very knowledgeable expert, good luck on your problem!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=100#2adb/86b6/7e9d/0a23" rel="alternate"/><published>2025-01-18T20:49:46.961000Z</published><updated>2025-01-18T20:49:46.961000Z</updated><author><name>Gustavo Antonio Banchetti Brucatori</name><uri>https://forge.codesys.com/u/mubeta/</uri></author><id>https://forge.codesys.comd4c9b2559aaad497d3a5291cabfe37531f835d7d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;How are the servo drives controlled? EtherCAT, step/dir pulses, other? &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;CANOpen, 1 Mb/s, bus load 35%, cycle time 2ms.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Another thought is that - if it's step/dir pulse based control - the pulses from the PLC to the drive are getting missed/lost at high frequencies? If that's the case then there would be multiple troubleshooting steps/corrections that could be investigated.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here, it seems to me that we are getting completely off track with the observed problem.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You could try to create a simplified program&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I had already written this elsewhere. The program before being brought into machines was exhaustively tested in SW emulation and the problem did not occur. However, in emulation I was interested in checking other aspects of the process, not this specific one which is for real a correction made necessary after the fact. The part of the program that does this correction with the function mentioned in the topic, came up from its origins, but I didn't know or didn't think it was really useful. A scruple that later turned out to be necessary. However, for now I do not think I will spend any more time on this verification, already lacking any to do my normal.&lt;br/&gt;
I remain amazed, however, that a function intended to correct the axis position with the motor in motion and that it should not interfere with this, in fact instead changes behavior as the motor speed changes. Mah!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When you manually control the motor directly from the servo drive software at the speeds you are calling for, does it move precisely to the target position?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The drive and motor have been working fine for about 10 years. In replacing the machine control system, I opted for CoDeSys where before there was something else. But this is not the subject of the problem. What I need to resolve is the fact that a clutch specially placed at a certain point can slip and, therefore, I have the undeniable need to phase the 'prime mover' to the mechanical position of the machine, detected by a cam for each turn, in order to properly stop at its optimum point. Which for now I have ruled out doing.&lt;br/&gt;
In effetti, se proprio devo dirla tutta, visto che siamo andati brutalmente OT, inizialmente pensavo che questa frizione dovesse entrare in azione solo in casi di estrema necessità, come accade nella maggior parte delle prove. Ma questa, per come è fatta, slitta più facilmente di quanto potessi prevedere e il 'prime mover' servocontrollato e la macchina vanno fuori fase, magari di poco, ma frequentemente, e quando la macchina lavora ad alta velocità (di fatto tutto il tempo), non riesco a regolare correttamente la posizione del 'prime mover' al volo.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=25#2adb/86b6/7e9d" rel="alternate"/><published>2025-01-18T13:40:23.783000Z</published><updated>2025-01-18T13:40:23.783000Z</updated><author><name>trusty-squire</name><uri>https://forge.codesys.com/u/trusty-squire/</uri></author><id>https://forge.codesys.com48fa67742b51482270aec07ffcd5bfb9ccd98900</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;How are the servo drives controlled? EtherCAT, step/dir pulses, other?&lt;/p&gt;
&lt;p&gt;Another thought it - if it's step/dir pulses - the pulses are getting missed/lost at high frequencies? If that's the case then there would be multiple troubleshooting steps/corrections that could be investigated.&lt;/p&gt;
&lt;p&gt;You could try to create a simplified program, with all the same parameters, that only has an MC_SetPosition FB you manually trigger and see if you are still getting the same results?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=100#f083/924b" rel="alternate"/><published>2025-01-12T16:32:39.851000Z</published><updated>2025-01-12T16:32:39.851000Z</updated><author><name>Gustavo Antonio Banchetti Brucatori</name><uri>https://forge.codesys.com/u/mubeta/</uri></author><id>https://forge.codesys.com91bb3cfbde4488ba3af3552a1ed5190b79f9cb7f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Here is the archive of the simulation project: &lt;a href="https://drive.google.com/file/d/1n74Qy-1yLPpI2OK4FaZO5q50y2uTa0Wr/view?usp=drive_link" rel="nofollow"&gt;https://drive.google.com/file/d/1n74Qy-1yLPpI2OK4FaZO5q50y2uTa0Wr/view?usp=drive_link&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=100#2adb/86b6" rel="alternate"/><published>2025-01-10T17:11:02.215000Z</published><updated>2025-01-10T17:11:02.215000Z</updated><author><name>Gustavo Antonio Banchetti Brucatori</name><uri>https://forge.codesys.com/u/mubeta/</uri></author><id>https://forge.codesys.com6170b7ef7c3742f1885696d98ba787b64c4314df</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;No errors in any condition. The function terminate correctly with the 'done' bit.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=100#f083/6285" rel="alternate"/><published>2025-01-10T17:08:17.162000Z</published><updated>2025-01-10T17:08:17.162000Z</updated><author><name>Gustavo Antonio Banchetti Brucatori</name><uri>https://forge.codesys.com/u/mubeta/</uri></author><id>https://forge.codesys.com8b93cd0c072498dd12ed19ef6df49356110f6a79</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi gseidel,&lt;br/&gt;
before moving to HW implementation, I had created the same program in simulation mode with virtual drives and, as far as I remember, everything worked fine simulating process and the few useful inputs. So it does not seem to be a SoftMotion library problem, but rather a problem with dynamics or physical axis adjustments. What escapes me, however, is the fact that this function is supposed to perform a position shift virtually, in fact without interfering with the axis itself, thus independent of its adjustments. MC_SetPosition() is not a homing function, in fact it is clearly intended to be executed on the fly with the axis moving.&lt;br/&gt;
Now I'll see if I can reduce the program, although I don't like it very much. In my life I have learned that problem searches should be done on the part, and not in a more or less similar way.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=25#f083" rel="alternate"/><published>2025-01-10T09:26:53.514000Z</published><updated>2025-01-10T09:26:53.514000Z</updated><author><name>gseidel</name><uri>https://forge.codesys.com/u/gseidel/</uri></author><id>https://forge.codesys.comabfb2c3d2666e8447335c2b399669a01b8973599</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Gustavo,&lt;/p&gt;
&lt;p&gt;can you reduce the problem to a project that reproduces the issue without the real servo drives? (You could set the servo drives to virtual and strip away as much as possible from the application.)&lt;/p&gt;
&lt;p&gt;If you can attach a project, we will have a look.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Georg&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=25#2adb" rel="alternate"/><published>2025-01-09T22:47:41.199000Z</published><updated>2025-01-09T22:47:41.199000Z</updated><author><name>trusty-squire</name><uri>https://forge.codesys.com/u/trusty-squire/</uri></author><id>https://forge.codesys.comf3391143e8dcc33719cb4fe539cc806c05529ac7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Just a stab in the dark, but you might want to check the Dynamic Limits (accel, decel, velocity, jerk) in the Codesys SoftMotion device configuration, as well as checking similar limits on your servo drive?&lt;/p&gt;
&lt;p&gt;Are you seeing any errors, or does the MC_SetPosition FB get marked as complete?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Strange problem with the ‘MC_SetPosition’ function</title><link href="https://forge.codesys.com/forge/talk/Motion/thread/6aa4cad29a/?limit=100#ed63" rel="alternate"/><published>2025-01-09T20:59:50.088000Z</published><updated>2025-01-09T20:59:50.088000Z</updated><author><name>Gustavo Antonio Banchetti Brucatori</name><uri>https://forge.codesys.com/u/mubeta/</uri></author><id>https://forge.codesys.com1ba99f83df45ab1f5dfa49b4d44f7a864e669599</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;CoDeSys 3.5.19.7&lt;br/&gt;
Target Berghof MX6&lt;/p&gt;
&lt;p&gt;In a simple SoftMotion programme with two stepperless modular axes from CMZ, one is simply controlled in speed, but a spot must perform a positioning.&lt;br/&gt;
I use the function MC_SetPosition() both to reference the axis at power-up and also to correct the actual position to a fixed machine reference detected with proximity.&lt;br/&gt;
The function has only one instance and I actually use a booelan variable to control the ‘Execute’ input.&lt;br/&gt;
Well, I cannot correctly change the axis position on the fly if it is running at high speed. The servomotor works in a speed range between 0°/s and 720°/s, (gearbox output with a 1:6 ratio). As long as the servomotor is operating at speeds below about 400 °/s, the function is able to correct the position correctly even when forcing values far apart, but at high speeds, from 400 °/s upwards, the correction no longer takes place. For example, trying to correct the position of 280° into 300° with absolute mode, the axis that is moving at speed actually shifts the position by a few degrees, not the expected 20.&lt;br/&gt;
I don't understand why with the servo drive running slowly the position shift occurs correctly, while increasing in speed it no longer works.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>