I’m having trouble with my current measurements on a setup using a Nucleo F439ZI board paired with a DRV8301 driver board.

12 次查看(过去 30 天)
Hi there!
If it’s not too much trouble, I actually have two different questions I’d love to ask.
1, Question
I’m building a field-oriented control (FOC) algorithm in Simulink. My closed-loop system is set up, but I’m having trouble with the motor’s startup routine. To “catch” the back-EMF and establish initial current, I switch into an open-loop mode:
output of the NUCLEO board: six sinusoidal waveforms with a dead-time compensation algorithm.
I’m testing on a DRV8301 evaluation board (half-bridge drivers, FETs), and when I run the BLDC motor in open-loop, the phase currents look noisy and distorted even after I apply basic filtering.
Current
Filtered Current
The resulting waveforms don’t resemble clean sine currents, so I’m not sure whether they’re acceptable or if something’s completely off. Do you think these current shapes are reasonable for an open-loop startup? And are there other filtering techniques beyond simple low-pass or Kalman filters that I could use to clean up the measurements?
2, Question
I’m using MATLAB Simulink Coder together with STM32 CubeMX, and I’m not sure if the sampling time specified in the Simulink ADC block needs to match the ADC frequency configured in CubeMX. Could you clarify it please?
Simulink_ADC_Block
Simulink_ADC_BlockSTM32CubeMX_ADC_Parameter_Settings

采纳的回答

Adit Kirtani
Adit Kirtani 2025-7-22
Hi Virag,
Here is an example which allows you to generate an open loop model for your target hardware:
You may use this to compare your current feedback with your current model.
You can also compare the peripheral configurations in the STM32CubeMX ioc files. Instead of using the ADC in a trigger and read configuration, we use the ADC in read only mode. In the IOC, we set the ADC to be triggered by the timer controlling PWM. This allows for the ADC to sense currents at a point when we know current is flowing through the inverter (PWM is high).
Perhaps this may be why the readings are quite noisy. I hope this helps.
Regards,
Adit Kirtani.

更多回答(1 个)

Sameer
Sameer 2025-7-9
Yes, distorted current waveforms are expected during open-loop startup, especially when running in six-step or sinusoidal commutation without current feedback.
  • PWM and dead-time effects introduce high-frequency noise and distortion, especially near zero crossings.
  • Raw current measurements often include switching spikes from the inverter and are not clean sinusoids.
  • Low-pass filtering (like with a Butterworth filter) helps, but even then, the result won’t be perfect — some flattening or ripple is normal.
From your images, the filtered waveform looks fine — fairly stable with reasonable amplitude and small ripple. That’s expected in open-loop where the current isn’t actively controlled. In startup, you're likely just applying a fixed torque (Iq), so the current stays nearly constant.A few things to check:
  • Current sensor filtering: Make sure the RC filter on the shunt amp output is not too aggressive (e.g., 100 Ω / 1 nF is commonly stable for DRV83xx). Over-filtering can cause ringing; under-filtering lets noise through.
  • PCB layout: Poor grounding or layout can add extra noise. Follow the driver IC's layout guidelines.
Unless your filtered current is wildly distorted or the system becomes unstable, what you’re seeing is normal and acceptable during open-loop startup.
Hope this helps!
  1 个评论
Virag
Virag 2025-7-15
I am really grateful for your answer. But how does the process work when you switch from open-loop to closed-loop control? I don’t have any sensors inside the motor, so I must use the open-loop method to start it, then switch to closed-loop control, right? However, during the open-loop phase the sinusoidal signal isn’t clear or well-shaped.
This happens during the first few milliseconds (or even less), when the ADC is trying to sample the open-loop feedback signal while the system is already switching to closed-loop control.
However, in closed-loop mode, it still reads that “gibberish” sinusoidal signal. I hope I’ve explained my thoughts clearly enough.
Thank you for your answer again!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Communications Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by