Showing results for 
Search instead for 
Did you mean: 

Softmotion Interpolator behaves strange

Softmotion Interpolator behaves strange

Established Member

Hello everyone,

Iam observing troubles with Codesys SoftMotion Interpolator. It interpolates one line again and again. It is stuct on objectNo = 1, and interpolator This takes place when file is interpreted into SMC_OutQueue (using FBs: SMC_ReadNCFile2, SMC_NCInterpreter, SMC_CheckVelocities).

When the same NC code copied into Codesys CNC program (within the PLC project), then the program runs without any trouble.

Tested NC Code:

N5 G00 X20 Y20 Z20
N10 G00 X0 Y0 Z0
N20 G01 X100 F10
N30 G01 Y50
N35 G03 X50 Y100 R50
N40 G01 X0
N50 G01 Y0
N60 G00 Z50
N70 M30

Project attached ctrlX PLC Engineering version 1.20.6, WORKS version 1.20.8


I wasted lots of time investigating, but still have no clue what to check. Has anybody ever faced this issues? I would really appreciate any hint. 



Established Member


in your program is missing the limitations of accelerations

Just insert in the first line N100 G53 F3000 E1000 E-1000

for error handling in the Softmotion CNC please have a look in our example


Established Member

Hello Franz,

thank you very much for answer. Your solution with some dynamic limitations unfortunatelly did not helped. I also call the instance of SMC_ReadNCFile2 with some default values:


Regarding the error handling - can you be more specific?

I found you use instance of FB SMC_CNC_REF - what that FB is used for? The given example does not show the idea as well as documentation. It seems that it somehow constraints some start position with given NC file:


Thank you for explanations!

BR Jan


Established Member

Hello jan

What for error message to you have.

Have you tryed my example

BR Franz

Established Member

Hello Franz,

trouble is that no error comes. The interpolator is repeating one movement endlessly. It moves from start to target position and when target position is reached interpolator's command value jumps back to start postion. This creates a gap which is covered by some gap acceleration deceleration and also velocity, so axes moves back to start pos. Axes catch up interpolator's set positions and moving to target position. When target reached the interpolator setpositions are back to start position which again creates gap. And so on, and so on... endless loop.

As this is caused only by Gcode from file and the GCode from project works fine I assume I have no problem with the program architecture, but there must be some difference between the OutQueue from file and OutQueue from project GCode.

So that is the situation. What to do now? Any ideas?

Thank you!

BR Jan


Established Member

Hello Jan

This looks like a known problem, have you tried the program with my example project?
Probably the input

fbSMC_Interpreter( sentences:= fbSMC_ReadNCfile2.sentences, bExecute:= TRUE, bAbort:= ,     bAppend:= ,



To the error handling.
Each block has its own error output. In my example, I created under the actions "aErrorhandling" for the individual assemblies.

So please have a llok about my example.


Established Member

Hello Franz,

I have found the root cause of this problem. This was happening due to the different variabeles of type SMC_OUTQUEUE I used. I have used one variable (of type SMC_OutQueue) for "fileOperations" and copied the content after succesfull reading to the other instance of type SMC_OutQueue. The effect was overwritting the queue which caused the same row of file was executed again and again. My fault. But also big fault in documentation - there is not mentioned how to connect the FBs together and any row about the data flow or how does it work in general.

The solution is simple just to have only one instance. From the instance of FB SMC_CheckVelocities there comes pointer to SMC_OutQueue which is then only neccessary to copy into FB SMC_Interpolator. So the FB Interpolator works directly with output of FB CheckVelocities.

This is also why the "integrated NC program editor" was working fine. It generates variable of type SMC_OutQueue, which adress you then need to paste inside the FB SMC_Interpolator. When switched Interpolator input to integrated editor program then it run smoothly.

Anyway many thanks for your goodwill to help.

BR Jan