The closed-loop drive is to feedback the rotation angle of the stepping motor to the control panel, compare the distance that needs to be rotated with the distance of the actual rotation, calculate the error value, and then compensate, so as to prevent the problem of multi-step and lost step. The closed-loop drive can completely overcome the lost step of the open-loop stepping motor, and can also significantly improve the performance of the motor at high speed
Hi,
I tried to implement RTC (LSI) but I am always getting too fast speed. So the result of a second=LL_RTC_TIME_GetSecond(RTC); is always too fast - around 20% which is out of any specs.
I tried:
using existing SystemClock_Config
SystemClock_Config from CubeMX in LL or HAL mode LL version is pretty much the same - just different freq
played around with different freq values (default in firmware: LL_Init1msTick(48000000); LL_SetSystemCoreClock(48000000); )
It does not matter how much I change anything - speed is always the same.
my MX_RTC_Init btw:
void MX_RTC_Init(void)
{
/* USER CODE BEGIN RTC_Init 0 */
/* USER CODE END RTC_Init 0 */
LL_RTC_InitTypeDef RTC_InitStruct = {0};
/* Peripheral clock enable */
LL_RCC_EnableRTC();
/* USER CODE BEGIN RTC_Init 1 */
/* USER CODE END RTC_Init 1 */
/** Initialize RTC and set the Time and Date
*/
RTC_InitStruct.HourFormat = LL_RTC_HOURFORMAT_24HOUR;
RTC_InitStruct.AsynchPrescaler = 127;
RTC_InitStruct.SynchPrescaler = 255;
LL_RTC_Init(RTC, &RTC_InitStruct);
LL_RTC_SetAsynchPrescaler(RTC, 127);
LL_RTC_SetSynchPrescaler(RTC, 255);
/* USER CODE BEGIN RTC_Init 2 */
LL_RTC_DisableWriteProtection(RTC);
LL_RTC_TIME_SetHour(RTC,__LL_RTC_CONVERT_BIN2BCD (18));
LL_RTC_TIME_SetMinute(RTC,__LL_RTC_CONVERT_BIN2BCD(30));
LL_RTC_TIME_SetSecond(RTC,__LL_RTC_CONVERT_BIN2BCD (0));
LL_RTC_EnableWriteProtection(RTC);
/* USER CODE END RTC_Init 2 */
}
Hi, I tried to implement RTC (LSI) but I am always getting too fast speed. So the result of a second=LL_RTC_TIME_GetSecond(RTC); is always too fast - around 20% which is out of any specs. I tried:
It does not matter how much I change anything - speed is always the same.
my MX_RTC_Init btw:
Thank you!