Skip to main content
TKara.2
Associate III
February 25, 2024
Question

Speed ramp with Potentiometer

  • February 25, 2024
  • 1 reply
  • 1345 views

"I'm trying to rotate the motor using potentiometer libraries. Do you think there are any other missing parts that I need to determine?"

 

uint16_t potMeasArray[16];

 

potentiometerHandle.LPFilterBandwidthPOW2=4;

potentiometerHandle.PotMeasArray=potMeasArray;

potentiometerHandle.PotRegConvHandle=3;

potentiometerHandle.Valid=true;

 

 

POT_Init(&potentiometerHandle);

 

speedPotentiometerHandle.Pot =potentiometerHandle ;

speedPotentiometerHandle.pMCI = pMCI[M1];

speedPotentiometerHandle.RampSlope = 0.5;

speedPotentiometerHandle.ConversionFactor =88;

speedPotentiometerHandle.SpeedAdjustmentRange = 10;

speedPotentiometerHandle.MinimumSpeed =100;

speedPotentiometerHandle.LastSpeedRefSet = 650;

 

 

 

SPDPOT_Init(&speedPotentiometerHandle);

 
 
 
    This topic has been closed for replies.

    1 reply

    Gael A
    ST Employee
    February 26, 2024

    Hello TKara.2,

    I think you cover all the needed seetings.

    However, your ConversionFactor seems incoherent with your Motor's max speed : ConversionFactor = (65536 / (Max_Speed - Min_Speed)) = 119 (computation done given the motor's max speed in your project and the min Speed you posted)

    Moreover, be aware that the RampSlope is in SPEED_UNIT / s, which means your current acceleration is 0.05 Hz/s, provided that your SPEED_UNIT is U_01HZ (default value).

    Lastly, your SpeedAdjustmentRange seems a bit low too, you would need to be very confident in your potentiometer returned value for this to be reliable.

    The upper remarks are not necessarily pointing mistakes, but are more interrogations considering your values.

    If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.
    TKara.2
    TKara.2Author
    Associate III
    February 26, 2024

    "Thank you for the response, but my engine is running at a constant speed. can u help me ?

     
     
     
     
    Gael A
    ST Employee
    February 27, 2024

    Hello TKara.2,

    I'm not sure on what I'm supposed to help here

    Have you tried generating a project enabling the Potentiometer feature ? Are you facing any issue ?

    If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.Hope this will help,Gaël A.