By using MC_ProgramSpeedRampMotor1 api trying to change ramp in six step algorithm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-13 10:14 PM
The MC_ProgramSpeedRampMotor1 api is created in six steps to modify the ramp; however, ramp changes cannot be made with this api.It is possible to modify the ramp in FOC by using the MC_ProgramSpeedRampMotor1_F api.
Additionally, two produced APIs are supplied in FOC; however, in the Six Step, just MC_ProgramSpeedRampMotor1 generated.
I am unable to modify the ramp using the MC_ProgramSpeedRampMotor1 api in six step. Could you please assist me? Is there another method to modify the ramp in a six-step algorithm?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-13 10:34 PM
__weak bool MC_StopSpeedRampMotor1(void)
{
return (MCI_StopSpeedRamp(pMCI[M1]));
}
/**
* @brief Stops the execution of the on-going ramp for Motor 1, if any.
*
* If a ramp is currently being executed, it is immediately stopped, the torque or the speed
* of Motor 1 is maintained to its current value.
*/
__weak void MC_StopRampMotor1(void)
{
MCI_StopRamp(pMCI[M1]);
}
/**
* @brief Returns true if the last ramp submited for Motor 1 has completed, false otherwise
*/
__weak bool MC_HasRampCompletedMotor1(void)
{
return (MCI_RampCompleted(pMCI[M1]));
}
I have not used 6 step, but can you use the above functions to verify if the ramp is complete or not and then change the ramp or stop the ramp etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 03:46 AM - edited ‎2023-12-14 03:56 AM
I used MC_HasRampCompletedMotor1 flag to check weather the ramp is completed or not and then i getting the message that rampl is completed but the speed is not reflecting in motor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 04:12 AM
void MC_ProgramSpeedRampMotor1(int16_t hFinalSpeed, uint16_t hDurationms)
The ramp is with respect to the time that is you may want to achieve the speed in 5seconds, 10 seconds etc. To change the speed you have to update the hFinalSpeed, provide different values as arguments to the function MC_ProgramSpeedRampMotor1 for example 100, 200 RPM (verify the units the function MC_ProgramSpeedRampMotor1 expects). Can you show how you are passing parameters to the MC_ProgramSpeedRampMotor1 function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 04:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 06:18 AM
I find mistakes duration is unsigned but you are checking for less than 0
The targetspeed is a signed value but you are passing unsigned value. Please check those coding errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 09:32 PM
I have changed to signed but still the ramp is not reflecting in the motor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 09:37 PM - edited ‎2023-12-14 09:41 PM
You have to learn to debug the code use break points to verify if the expected the actual values are matching. You can also use the Cubemonitor to watch variables during the run time.
You are checking the duration < 0, but that will never be True.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 09:55 PM
Both actual and expected values are matching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-14 09:59 PM
Can you install CubeMonitor and try using it and post the images of the variables?
