2021-04-20 05:36 AM
Hi All,
I would really appreciate your input to this problem.
I am presently trying to implement the waveform "(a) PWM-ON" shown in figure below
It is for a 6step control algorithm, the STSW-SPIN32F0251 to be exact.
Here is the snapshot of the code that I have implemented for each step
This is the result that I am getting on the output timers that generates output PWM signals.
-->The yellow and green waveforms are the hall sensor input signals. All the three hall sensors signals have been XORed internally in my MCU into a single channel TI1.
-->The blue waveform is the gate signal to the high side of the first leg.
-->The pink waveform is the gate signal to the low side of the second leg.
A zoom in: Also here is an interesting picture showing the current waveform in pink color. The current decays to 0 between each step due to this delay problem
Now the problem that I would love you to help me with is this:
So how can I fix this delay?
I kinda think it could be a setting problem on the PWM timer - advanced timer 1. Maybe there is a setting to ensure the signals repeat and not get cleared until the next step.?
Thank you
2021-04-28 01:58 AM
@Javier Muñoz The delay still exists though after I did that.
About outputting the corresponding commutation steps through the DAC. I might be inexperienced but I don't have a way to do that since the board - EVSPIN32F0251S1 - does not have an actual DAC. It only came with an external PWM DAC to transform the current reference - which is a PWM signal - into a DC value by passing it through a low-pass filter for a Peak current control.
2021-04-28 02:05 AM
@BoboyeOkeya whatever suits you, but yes to be able to vsualize your commutation steps along with your pwm gate driving signals will improve your debugging
2021-04-28 02:17 AM
@Javier Muñoz I kinda plotted the steps on software but you are right, it does not have the step like shape, however it does slopes down from 6 to 1 and vice versa, but sometimes it doesnt reach 6 or 1.
2021-04-28 02:23 AM
Depends of how fast are your steps going....
The SWV debugger will try to fish your variables from memory "at runtime"
But if your commutation steps are going much faster you will get undersampled signals like thisone you showed me in green.
what about slowing down (speeding down) the motor?
2021-04-28 03:14 AM
ohhhh yes thats true, its the signal acquisition. At slow speeds it tries to get the step form but it still doesnt.
During the process of the debuggings ive done earlier though, I was comparing the hall sensor signals to the PWM gate signals.
Here is my rookie deduction from the image I attached below in figure 1:
Figure 1
Hallsensor signals: yellow and green waveform
PWM Gate signals: pink and purple.
Figure 2: shows an example of how the hall sensor capture timers is interlinked with them PWM timer
Please help me, lol, i just want to be able to graduate.
2021-04-29 05:41 AM
@BoboyeOkeya sorry but i cant help you further without actually doing the work for you.
Maybe ask for help to your techers/classmates or use an already existing implementation of bldc motor control to check against yours.
good luck
2021-05-03 04:14 AM
@Javier Muñoz thank you for all the help so far. I am actually using an already existing motor control solution software from STM itself - their six step motor control library called STSW-SPIN32F0251
I still have not been able to solve it from help from teachers or classmates