2023-04-23 12:44 AM - edited 2023-11-20 07:23 AM
I want to understand the current sensing that is done in B-G431B-ESC1 kit.
I do not understand the purpose of IN_VOPAMP3 connected to ADC2
The opamp3 can be connected to ADC1 and ADC2 as shown in the figure? The software configuration of opamp3
hopamp3.Init.InternalOutput = ENABLE;
whereas for opamp1 and 2 is
hopamp1.Init.InternalOutput = DISABLE;
and the code for ADC2 is
sConfigInjected.InjectedChannel = ADC_CHANNEL_3;
sConfigInjected.InjectedRank = ADC_INJECTED_RANK_1;
sConfigInjected.InjectedChannel = ADC_CHANNEL_VOPAMP3_ADC2;
sConfigInjected.InjectedRank = ADC_INJECTED_RANK_2;
Please advise on the above configuration.
Solved! Go to Solution.
2023-04-23 12:39 PM
Hello @Community member,
The purpose of using IN_VPOPAMP3 is to allow the sampling of the two phases simultaneously by the two ADCs.
We sample 2 phases among 3. Thanks to IN_VPOPAMP3 the phase W can be sampled by both ADC1 and ADC2.
phases U,V are sampled by ADC1(IN3),ADC2(IN3)
phases UW are sampled by ADC1(IN3),ADC2(IN_VPOPAMP3)
phases VW are sampled by ADC2(IN3),ADC1(IN12)
The OPAMP3 InternalOutput is managed dynamically by the FW. For the initialization by cubeMX we have to enable it in order to be able to configure the sampling delay of the ADC2 channel (IN_VPOPAMP3) .
I hope it is clear now.
Regards
Cedric
2023-04-23 12:39 PM
Hello @Community member,
The purpose of using IN_VPOPAMP3 is to allow the sampling of the two phases simultaneously by the two ADCs.
We sample 2 phases among 3. Thanks to IN_VPOPAMP3 the phase W can be sampled by both ADC1 and ADC2.
phases U,V are sampled by ADC1(IN3),ADC2(IN3)
phases UW are sampled by ADC1(IN3),ADC2(IN_VPOPAMP3)
phases VW are sampled by ADC2(IN3),ADC1(IN12)
The OPAMP3 InternalOutput is managed dynamically by the FW. For the initialization by cubeMX we have to enable it in order to be able to configure the sampling delay of the ADC2 channel (IN_VPOPAMP3) .
I hope it is clear now.
Regards
Cedric
2023-04-25
11:41 PM
- last edited on
2023-12-06
04:55 AM
by
Laurids_PETERSE
I am in huge issue now i am using the STM32G431RBT6 series and in CubeMX i never see the
Opamp3 channels enabled, how do i proceed, do i need to make software modifications in the b-g431b-esc1 software provided or i can use as it is? Please help.
2023-04-26 01:38 AM
Sorry it is enabled now after OPAMP3 setting.
2023-04-26 02:44 AM
Exactly, the channel is enabled only if the internal connection between OPAMP and ADC is enabled.
Be aware that this connection is exclusive, if the OPAMP is internally connected, then it is disconnected from the pin. In our software, we change this connection dynamically at PWM rate.
Cedric
2023-05-01 02:40 PM
Hi SRedd.5. Sorry to be asking the same question in several places, but I am very frustrated by not having any loadable source code or firmware for this board. You refer to "the b-g431b-esc1 software provided" but I had no software provided and cannot find the download for it. There is an early example project but it will not load into V6 software. In fact, it will not load into the compiler it came with either (V5.8 I think) and says it needs 5.9x. Guess which is the only compiler not available for download? :)
Please, if anybody has the original working FOC project for this board which is compilable I would love to know where to get it. Many thanks.
2023-05-02 01:52 AM
Hello @Optician ,
The firmware for this board is generated by the Motor control Workbench tool.
Did you download the workbench SDK 6.1.1 and configure a project targeting the b-g431b-esc1 ?
Could you explain your issue ? I did not find any other post you wrote about this issue.
Best Regards
Cedric
2023-05-02 02:57 AM
Yes, I tried that first but got many compilation errors, I tried the example in v5.8 I believe?. It won't generate code in v5.8, just fails at the end saying I need v5.90. If I try the code in V6.1 it complains it's for an earlier version. I choose Migrate but it fails. Looked for an example in v6.1.1 but it seems to have been removed. I previously commented to an old thread with the title "Where can I find downloadable firmware files for b-g431b-esc1?" on Apr 23rd this year. My basic question there was asking why there isn't working source code and binary supplied with the card or downloadable. Staff replying to that thread and others obviously have a working project, can this not be shared?. I always find it a great start to have a known working project which you can study, understand, and alter.
2023-05-02 04:14 AM
Hello,
My basic question there was asking why there isn't working source code and binary supplied with the card or downloadable.
Because motor is part of the system, and project has to be generated for your motor.
Staff replying to that thread and others obviously have a working project, can this not be shared?
It will not be a working project able to spin your own motor.
The question is why does it fail only for you ?
If you have the 6.1.1, then please start a new FOC project and select the b-g431b-esc1 board.
If you want to enable the control of the motor speed with an external PWM duty cycle, then enable it in the "Stage Configuration" window, you have a field "Electronic Speed Control"
Let me know what are the generation issues you are facing.
Regards
Cedric
2023-05-03 09:46 AM
Thanks Cedric. Ok, I have profiled my motor and saved it. Nice is see it sinning!. I think it was successful, but I couldn't convince it that I don't have a secondary Hall effect sensor.
I load Up MC Workbench v6.1.1. I choose New Project, select FOC and Inverter. Choose my above mentioned motor and the B-G431B-ESC 1 board.
I went through all the setting tabs on the left, basically looking over each one but not changing anything except enabling PWM control on PA15 TIM2_CH1. Saved work so far. I click on Generate Project and wait. Many clean entries flow by in the log on screen, but eventually it starts warning in orange and then shouting in red that it can't get internet access because the Updater is already in action. I noticed yesterday that MX said updating at 36% and thought nothing of it. I closed WB and opened MX. There it is - updating and at 36% and it is still the same now, several hours later, and was there all day yesterday. This is stopping me proceeding just at a time when I thought I was starting to know what I'm doing!. Is there a way to kill the update and start again?. If not I think I will have to vape every sign of MC and Cube and reinstall.
If/when I get sorted, I would very much appreciate it if you could point me at a document and reference that will talk me over where I go next after generating the project in MC WB. I believe I open the generated project in CubeMX and Generate Source, and then open that project in CubeIDE. That is where I came unstuck before, so I am quite willing to believe it's my lack of knowledge of the development flow. A few tips would be most appreciated Cedric. Many thanks for your help.