Changing the Scaling of a softmotion drive in Codesys

2016-01-25
2019-02-08
  • Bobbypointe - 2016-01-25

    Hi,
    I would like to be able to change all the scaling parameter of my softmotion drive in my Codesys project (in running mode, and not only config one).
    not only the inc/motor turns object, but also the gear ratio.
    I have an application where the same motor could be used on different station with different scaling.

    I looked into the axis structure parameter and I only found the MSC_Changegearinratio block.
    Does someone know how to do this?

    Thanks by advance

    IMG: 2016

     
  • eschwellinger

    eschwellinger - 2016-01-25

    Hi,
    use SMC_ChangeGearingRatio
    and after that a SMC3_ReinitDrive...

    BR
    Edwin

    IMG: Ratio.jpg

     
  • Bobbypointe - 2016-01-25

    Hi thanks for the answer, but I already tried and it changed only a few parts of the config.
    Nominator is a dword and denominator a int!
    I need more.
    As you can see on the image of my first post, I would like it I change the values in the red square!
    Does someone know how to perform this?

     
  • eschwellinger

    eschwellinger - 2016-01-26

    Example:

    Axis.iRatioTechUnitsNum := Direction (+/-1) * motor turns * gear output turns (all left side) * units in application (all right side)
    Axis.iRatioTechUnitsDenom := increments * motor turns * gear output turns (all left side)

    Note: These two values are mathematically reduced, e.g. if iRatoTechUnitsNum=10000 and dwRatioTechUnitsDenom = 200000, it will be…
    iRationTechUnitsNum=1 and dwRatiTechUnitsDenom=20

    BR
    Edwin

    IMG: Ratio.jpg

     
  • drsumruay - 2019-02-07

    Hi,
    Edwin
    Could you show me the result of Read Actual Axis.iRatioTechUnitsNum and Axis.dwRatioTechUnitsDenom on my project?
    Because I try to calculate with the same as your method but the result doesn't correct.

    IMG: Untitled.png

    IMG: Untitled.png

     
  • eschwellinger

    eschwellinger - 2019-02-08

    iRatioTechUnitsNum := -1 * 1 * 2 * 360 = 720
    dwRatioTechUnitsDenom := 262144 * 243 * 1 = 63700992

    iRatioTechUnitsNum = 5
    dwRatioTechUnitsDenom = 442368

    BR
    Edwin

     

Log in to post a comment.