Quadrature Encoder not available in Speed Sensing Mode Selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-25 7:06 AM - last edited on 2024-11-25 7: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]:
- Create custom inverter board and motor.
- Create a new project in MC Workbench where the custom board and motor is used.
- Make sure "Quadrature Encoder" is "On" in Motor tab.
- Open "Speed Sensing Selection" tab and "Quadrature Encoder" mode is now grayed out and not selectable.
[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.
- Labels:
-
MC Workbench
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-26 5: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.
Best regards.
GMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Best regards.
GMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-26 1:58 AM - edited 2024-11-26 4:10 AM
Hi @GMA
My board is based on the STM32G491CET MCU.
The following pins are used for the encoder:
- Enc A -> PB6 (TIM8_CH1)
- Enc B -> PB8 (TIM8_CH2)
- Enc Z -> PA0 (GPIO_Input)
PB6 and PB8 is set up for combined channels encoder mode.
For all six PWMs TIM1 is used.
- PWM High 1: PA8 (TIM1_CH1)
- PWM High 2: PA9 (TIM1_CH2)
- PWM High 3: PA10 (TIM1_CH3)
- PWM Low 1: PC13 (TIM1_CH1N)
- PWM Low 2: PB0 (TIM1_CH2N)
- PWM Low 3: PF0 (TIM1_CH3N)
For ADC and CURRENT_AMPL_U/VW:
- Current sense 1: PA1 (ADC2_IN2)
- Current sense 2: PA7 (ADC2_IN4)
- Current sense 3: PB2 (ADC2_IN12)
I do not see any issues with above pin mapping.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-26 5: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.
Best regards.
GMA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-27 1: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-11-27 1:30 AM
Hello @userst,
For ADC point of view, yes, please proceed with current settings...
Best regards.
GMA
