cancel
Showing results for 
Search instead for 
Did you mean: 

Quadrature Encoder not available in Speed Sensing Mode Selection

userst
Associate II

[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]:

  1. Create custom inverter board and motor.
  2. Create a new project in MC Workbench where the custom board and motor is used.
  3. Make sure "Quadrature Encoder" is "On" in Motor tab.
  4. 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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

View solution in original post

5 REPLIES 5
GMA
ST Employee

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.

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
userst
Associate II

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.

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.

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA
userst
Associate II

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?

Hello @userst,

For ADC point of view, yes, please proceed with current settings...

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA