2024-10-24 10:06 AM
I'm trying out the board designer feature and ran into an issue where after succesfully making a board in Board Designer based on a custom STM32G431 motor controller board, MCWB gives this error about the current sensing not being found:
The Board Designer doesn't show any errors:
I have a current sensing feature added with 3 shunt resistor readings from a DRV8323 chip:
Can anyone give me some advice on what to try next to get this to work? This is such a cool tool I'd love to get working.
Solved! Go to Solution.
2024-10-30 04:21 AM
Hello shane mattner,
The reason why you cannot select the Encoder speed selection is because your board description lacks the "QuadratureEncoderRelative" feature. In fact, even if you will only use the absolute feature, the relative one is mandatory to allow proper generation. This is a limitation of the tool, we apologise for the inconvenience.
Concerning the reason why the WorkBench does not allow you to go further, it is because you have invalid gain values for G2. It seems the auto-calculation did not give a satisfactory result and ended up with an error. This is the same for your PI gains in Drive Settings. You can check the User Manual (Via WorkBench, you can find it by clicking on About -> Documentations -> Documentation -> in the newly open browser window, click on User Manual) to have more info on how G1 and G2 gains are calculated.
Please make sure that all constant values in your board are correct before simply overwriting the gain values by hand via WorkBench.
2024-10-24 10:48 AM
Here is the board json file:
{
"type": "inverter",
"contentVersion": "1.0",
"clockFrequency": 170,
"name": "st_obake_0_4",
"PN": "1",
"longDescription": "",
"algorithmCompatibility": [
"FOC"
],
"shortDescription": "",
"mcu": "STM32G431CBTx",
"clockSource": "internal_osc",
"motorDrives": [
{
"name": "M1",
"minRatedVoltage": 10,
"maxRatedVoltage": 25,
"maxRatedCurrent": 40,
"features": [
{
"type": "CurrentSensing",
"name": "CurrentSensing",
"tRise": 10,
"hwVariants": [
{
"signals": {
"CURRENT_AMPL_U": [
{
"name": "PB0",
"help": {},
"cost": 0
}
],
"CURRENT_AMPL_V": [
{
"name": "PB1",
"help": {},
"cost": 0
}
],
"CURRENT_AMPL_W": [
{
"name": "PB2",
"help": {},
"cost": 0
}
]
},
"type": "ThreeShunt_AmplifiedCurrents",
"cost": 0,
"shuntResistor": 0.007,
"amplifyingNetworkImax": 48,
"amplifyingNetworkVm": 20,
"amplifyingNetworkPrating": 1000,
"opAmpGain": 5,
"offsetNetworkAttenuation": 0,
"polarizationOffset": 0
}
]
},
{
"type": "SpeedAndPositionSensing",
"name": "SpeedAndPositionSensing",
"hwVariants": [
{
"signals": {
"QENC_A": [
{
"name": "PA0",
"help": {},
"cost": 0
}
],
"QENC_B": [
{
"name": "PB3",
"help": {},
"cost": 0
}
],
"QENC_Z": [
{
"name": "PA15",
"help": {},
"cost": 0
}
]
},
"type": "QuadratureEncoderAbsolute",
"cost": 0
}
]
},
{
"type": "PhaseVoltageGeneration",
"name": "PhaseVoltageGeneration",
"driverName": "drv8323",
"driverPN": "1",
"tNoise": 10,
"minDeadTime": 10,
"maxSwitchingFreq": 60,
"hwVariants": [
{
"signals": {
"PWM_CHU_H": [
{
"name": "PA8",
"help": {},
"cost": 0
}
],
"PWM_CHV_H": [
{
"name": "PA9",
"help": {},
"cost": 0
}
],
"PWM_CHW_H": [
{
"name": "PA10",
"help": {},
"cost": 0
}
],
"PWM_CHU_L": [
{
"name": "PC13",
"help": {},
"cost": 0
}
],
"PWM_CHV_L": [
{
"name": "PA12",
"help": {},
"cost": 0
}
],
"PWM_CHW_L": [
{
"name": "PB15",
"help": {},
"cost": 0
}
]
},
"type": "DrivingHighAndLowSides",
"cost": 0,
"deadTime": 10,
"highSideSwitchesDrivingPolarity": "Active high",
"lowSideSwitchesDrivingPolarity": "Active high"
}
]
}
]
}
],
"descVersion": 4
}
2024-10-25 02:35 AM
Hello shane mattner,
The PINs you chose for your current sensing are not compatible with any of our current sampling method.
For 3-Shunts sensing, we have different sampling methods :
- Single ADC sampling, if you want to do that, your 3 pins need to have access to the same ADC
- Dual ADC sampling shared phase, your pins need to have access to 2 different ADC, and one of the pins need to have access to both of them. This is for any ST Observer FOC algorithm (Sensorless + PLL or Cordic, or sensored)
- Dual ADC sampling for HSO only, two pins to one ADC, and the third pin to a second ADC
- Triple ADC sampling, (only available on HSO algorithm) each one of your pins need to have access to a different ADC.
Now, taking a look at your setup, you can see that PB0 goes to ADC1_IN15 only, PB1 to ADC1_IN12 only, and PB2 to ADC2_IN12 only, so only third configuration above fits. However, it only fits the HSO algorithm, which requires Phase Voltage Sensing on top of Current Sensing, so you would not be able to create a project like that. If you want to create an inverter for the HSO algorithm, you will need to add the Phase Voltage Sensing feature. If you want to create an STO project, then you will have to modify your Current Sensing pins in a way that fits the first two configurations listed above.
We are currently working on the Board Designer for it to tell you beforehand whether your chosen pin setting will in fact end up with a valid board for the WorkBench tool, but this is still work in progress, we apologise for the inconvenience, and thank you for the feedback !
2024-10-29 06:04 PM
Thank you @Gael A for the thoughtful response. I spun up a new board with all current sensing on a single channel (ADC1). However, now I'm running into other issues:
Could this be related to my current ADC setup not being correct? This blocks me from saving new configs.
I've copy/pasted my Board Designer file and attached the MCWB project file. Could you possibly point me towards a dev kit using the STM32G431 with 3 external current sensor inputs and encoder input?
{
"type": "inverter",
"contentVersion": "1.0",
"clockFrequency": 170,
"name": "st_obake_0_4",
"PN": "1",
"longDescription": "st obake replacement",
"algorithmCompatibility": [
"FOC"
],
"shortDescription": "",
"mcu": "STM32G431CBTx",
"clockSource": "internal_osc",
"motorDrives": [
{
"name": "M1",
"minRatedVoltage": 10,
"maxRatedVoltage": 25,
"maxRatedCurrent": 40,
"features": [
{
"type": "CurrentSensing",
"name": "CurrentSensing",
"tRise": 100,
"hwVariants": [
{
"signals": {
"CURRENT_AMPL_U": [
{
"name": "PA3",
"help": {},
"cost": 0
}
],
"CURRENT_AMPL_V": [
{
"name": "PB14",
"help": {},
"cost": 0
}
],
"CURRENT_AMPL_W": [
{
"name": "PB12",
"help": {},
"cost": 0
}
]
},
"type": "ThreeShunt_AmplifiedCurrents",
"shuntResistor": 0.007,
"amplifyingNetworkImax": 48,
"amplifyingNetworkVm": 3.3,
"amplifyingNetworkPrating": 3,
"opAmpGain": 5,
"offsetNetworkAttenuation": 0,
"polarizationOffset": 0,
"help": {
"en": ""
},
"cost": 0
}
]
},
{
"type": "SpeedAndPositionSensing",
"name": "SpeedAndPositionSensing",
"hwVariants": [
{
"signals": {
"QENC_A": [
{
"name": "PA0",
"help": {},
"cost": 0
}
],
"QENC_B": [
{
"name": "PB3",
"help": {},
"cost": 0
}
],
"QENC_Z": [
{
"name": "PA15",
"help": {},
"cost": 0
}
]
},
"type": "QuadratureEncoderAbsolute",
"cost": 0
}
]
},
{
"type": "PhaseVoltageGeneration",
"name": "PhaseVoltageGeneration",
"driverName": "drv8323",
"driverPN": "1",
"tNoise": 10,
"minDeadTime": 10,
"maxSwitchingFreq": 60,
"hwVariants": [
{
"signals": {
"PWM_CHU_H": [
{
"name": "PA8",
"help": {},
"cost": 0
}
],
"PWM_CHV_H": [
{
"name": "PA9",
"help": {},
"cost": 0
}
],
"PWM_CHW_H": [
{
"name": "PA10",
"help": {},
"cost": 0
}
],
"PWM_CHU_L": [
{
"name": "PC13",
"help": {},
"cost": 0
}
],
"PWM_CHV_L": [
{
"name": "PA12",
"help": {},
"cost": 0
}
],
"PWM_CHW_L": [
{
"name": "PB15",
"help": {},
"cost": 0
}
]
},
"type": "DrivingHighAndLowSides",
"cost": 0,
"deadTime": 10,
"highSideSwitchesDrivingPolarity": "Active high",
"lowSideSwitchesDrivingPolarity": "Active high"
}
]
},
{
"type": "PhaseVoltageSensing",
"name": "PhaseVoltageSensing",
"hwVariants": [
{
"signals": {
"VOLTAGE_DIV_FILT_U": [
{
"name": "PA7",
"help": {},
"cost": 0
}
],
"VOLTAGE_DIV_FILT_V": [
{
"name": "PB2",
"help": {},
"cost": 0
}
],
"VOLTAGE_DIV_FILT_W": [
{
"name": "PB0",
"help": {},
"cost": 0
}
]
},
"type": "ThreePhaseVoltageDividersFiltered",
"cost": 0,
"cutoffPulse": 1000,
"voltageDividerValue": 3.119
}
]
}
],
"maxRatedPower": 1000,
"resistorOffset": 0
}
],
"descVersion": 4,
"features": [
{
"type": "Button",
"name": "Button",
"hwVariants": [
{
"signals": {
"BUTTON_TRIGGER": [
{
"name": "PB13",
"help": {},
"cost": 0
}
]
},
"type": "PushButton",
"cost": 0,
"buttonTriggerEdge": "Falling Edge",
"buttonGpioConfig": "Pull up"
}
]
}
]
}
2024-10-30 04:21 AM
Hello shane mattner,
The reason why you cannot select the Encoder speed selection is because your board description lacks the "QuadratureEncoderRelative" feature. In fact, even if you will only use the absolute feature, the relative one is mandatory to allow proper generation. This is a limitation of the tool, we apologise for the inconvenience.
Concerning the reason why the WorkBench does not allow you to go further, it is because you have invalid gain values for G2. It seems the auto-calculation did not give a satisfactory result and ended up with an error. This is the same for your PI gains in Drive Settings. You can check the User Manual (Via WorkBench, you can find it by clicking on About -> Documentations -> Documentation -> in the newly open browser window, click on User Manual) to have more info on how G1 and G2 gains are calculated.
Please make sure that all constant values in your board are correct before simply overwriting the gain values by hand via WorkBench.
2024-10-30 08:31 AM
Thank you for the support @Gael A . Hopefully ST will make these tools a little easier to use in the future. Perhaps a video walk-through of using the Board Designer (along with how to address any common mistakes) with a custom board would be helpful to the community.