2024-11-25 07:06 AM - last edited on 2024-11-25 07:33 AM by Andrew Neil
[VERSION]: MCSDK v6.3.2
[TOOL]: MC WB (and Board Designer to design the custom inverter board)
[EXPECTED BEHAVIOR]: Quadrature Encoder mode available and selectable in Speed Sensing Mode Selection tab in MC Workbench
[HOW TO REPRODUCE]:
[DETAILS]:
I am trying to use ST Motor Control SDK with a custom inverter board. I have issues selecting Quadrature Encoder mode in Speed Sensing Mode Selection when using my custom inverter board and motor. I have the following config added:
The following is part of motor.json file:
"hasQuadratureEncoder": true,
"quadratureEncoder":
{
"hasIndexPin": true,
"pulsesPerMechanicalRevolution": 4096
}
And in board.json:
"type": "SpeedAndPositionSensing",
"name": "SpeedAndPositionSensing",
"hwVariants":
[
{
"signals":
{
"QENC_A":
[
{
"name": "PB6",
"help": {},
"cost": 0
}
],
"QENC_B":
[
{
"name": "PB8-BOOT0",
"help": {},
"cost": 0
}
],
"QENC_Z":
[
{
"name": "PA0",
"help": {},
"cost": 0
}
]
},
"type": "QuadratureEncoderAbsolute",
"cost": 0
}
]
What did I miss?
I just noticed the following message in the "Project Hw & Info" tab under "Board Connections Messages":
Warnings
CSConnect: ThreeShunt_AmplifiedCurrents DualADCs SharedSignal
CSConnect: ThreeShunt_AmplifiedCurrents DualADCs NoSolution
I would assume this relates to Current Sensing and therefor wouldn't be the reason for the Quadrature Encoder mode not being available.
Attached some screenshots showing config and the drop-down with the option grayed out.
Solved! Go to Solution.
2024-11-26 05:43 AM
Hello @userst,
As previously said, TIM8 is “reserved” for PWM generation (it isn’t mentioned for the moment, and it will be added in documentation). The Encoder IP associated timer should be from TIM2 to TIM5.
Do you have the possibility to change this setting? If no, you can maybe bypass this limitation by modifying the line 58 in MC_SDK_6.3.2\Utilities\PC_Software\STMCWB\assets\ConnectionParameters.json file (TIM[2-5] -> TIM[2-8], but result is not granted...
For the ADC part, warnings "DualADCs SharedSignal, DualADCs NoSolution" are about Dual ADC and you have a Single ADC configuration.
2024-11-26 12:17 AM
Hello @userst,
Could you please check that your ENCA,B signals are associated with a TIMER input (TIM1/8 are reserved for PWM generation)?
And check that CURRENT_AMPL_U/V/W signals are corresponding to ADC input?
Loading used MCU on STM32CubeMX, all pin features are displayed.
2024-11-26 01:58 AM - edited 2024-11-26 04:10 AM
Hi @GMA
My board is based on the STM32G491CET MCU.
The following pins are used for the encoder:
PB6 and PB8 is set up for combined channels encoder mode.
For all six PWMs TIM1 is used.
For ADC and CURRENT_AMPL_U/VW:
I do not see any issues with above pin mapping.
2024-11-26 05:43 AM
Hello @userst,
As previously said, TIM8 is “reserved” for PWM generation (it isn’t mentioned for the moment, and it will be added in documentation). The Encoder IP associated timer should be from TIM2 to TIM5.
Do you have the possibility to change this setting? If no, you can maybe bypass this limitation by modifying the line 58 in MC_SDK_6.3.2\Utilities\PC_Software\STMCWB\assets\ConnectionParameters.json file (TIM[2-5] -> TIM[2-8], but result is not granted...
For the ADC part, warnings "DualADCs SharedSignal, DualADCs NoSolution" are about Dual ADC and you have a Single ADC configuration.
2024-11-27 01:27 AM
Thanks for helping circumventing this undocumented limitation.
Regarding the ADC part, I am not sure what you mean. Is this a blocking issue or can I proceed?
2024-11-27 01:30 AM
Hello @userst,
For ADC point of view, yes, please proceed with current settings...