Confused by dwIpoTime input for SMC_Interpolator

2024-07-18
2024-07-22
  • trusty-squire - 2024-07-18

    Hi,
    Learning Codesys CNC, and I am confused by the dwIpoTime parameter. I have a basic demo application, using SMC_Interpolator feeding into SMC_TRAFO_Gantry2Tool2, which then sets the position of the x/y SM_Drive_Virtual axis. I also have a C axis which revolves the tool, which is controlled using a simple tangential angle calculation SMC_CalcDirectionFromVector.

    The GCode I'm using has feed/accel set at 500. The axis configuration limits are well above that (2000). What's strange is that, when I run the simulation, the feed speed changes drastically when I update the variable dwIpoTime. The larger the number, the faster it moves.

    What's going on here? The documentation only says "This variable has to be set for each call. It represents the cycle time in ΞΌsec." Why does it change the feed speed I'm seeing the in simulation? What is a good number to use? The example I was looking at set it at 5000.

    Screenshot attached.

     
  • tk096 - 2024-07-22

    Hi,

    dwIpoTime should be set to the cycle time of your motion task. It defines the interpolation interval of the interpolator.

    E.g. in the attached screenshot, the task has a task interval of 4ms. The dwIpoTime input of the interpolator should be set to 4000.

     
    πŸ‘
    1
    • trusty-squire - 2024-07-22

      OK, that makes sense. Because the FB is provided a specific interval period, it would change the target position accordingly based on the time it "thought" elapsed. If it has the wrong interval provided, it updates the target positions every cycle incorrectly so the axes will end up moving faster or slower.

      Thanks!

       

Log in to post a comment.