2021-12-15 10:35 PM
(Environment)
MC_SDK 5.Y.3 + STM32CubeMX 6.3.0 with HAL + IAR EWARM 8.5
(Hardware)
custom board based on F446RE + custom power board + Low Voltage BLDC motor with Encoder
(Control Mode)
Speed Control
(What I found)
==========================================================================
/* dual drive check */
ADCInjFlags = ADCx_1->SR & (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS);
if ( ADCInjFlags == LL_ADC_FLAG_JSTRT )
{
/* ADC conversion is on going on the second motor */
do
{
/* wait for end of conversion */
ADCInjFlags = ADCx_1->SR & (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS);
}
while ( ADCInjFlags != (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS) );
}
else if ( ADCInjFlags == 0 )
{
/* ADC conversion on the second motor is not yet started */
while ( ( TIMx->CNT ) < ( pHandle->pParams_str->Tw ) )
{
/* wait for a maximum delay */
}
ADCInjFlags = ADCx_1->SR & (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS);
if ( ADCInjFlags == LL_ADC_FLAG_JSTRT )
{
/* ADC conversion is on going on the second motor */
do
{
/* wait for end of conversion */
ADCInjFlags = ADCx_1->SR & (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS);
}
while ( ADCInjFlags != (LL_ADC_FLAG_JSTRT|LL_ADC_FLAG_JEOS) );
}
}
else
{
/* ADC conversion on the second motor is done */
}
==========================================================================
(Question)
Solved! Go to Solution.
2022-01-19 07:01 AM
Hello,
You are fully right. This part of the code covers single and dual motors as well.
The Dual Drive part is useless for single motor but doesn't prevent single drive to work.
Yes you can remove the above code.
Best regards.
Gilbert
2021-12-29 12:44 AM
I added the corresponding code lines in the question details. Someone can answer this please?
2022-01-17 04:36 PM
Could ST test this case and guide how to handle the code?
2022-01-19 07:01 AM
Hello,
You are fully right. This part of the code covers single and dual motors as well.
The Dual Drive part is useless for single motor but doesn't prevent single drive to work.
Yes you can remove the above code.
Best regards.
Gilbert
2022-01-19 03:54 PM
Thank you for your confirmation !
Regards.
THA