I am experimenting with stepper motor and StepperDriver4PWM. I configured stepper in MotionControlType::velocity_openloop. I notice noise from stepper when rotating, so i measured current with oscilloscope:
I guess that noise comes from non-sinus form of current.
Why current(green) doesn’t start flowing with start of pwm signal(yellow)?
I measured that current start at cca 7% duty cycle and above.
How can i correct for that?
Do I understand you correctly: the output of SimpleFOC via the PWM driver is <7% duty cycle, the output of the driver stage is no current?
What is your driver architecture, which driver or FETs are you using, if I may ask?
May I ask the time-scale of the above plot? And what frequency do you run the PWM at?
Both of these boards have very slow switching times - I wonder if this can be the issue?
→ e.g. 25kHz x 7% is about 2.8µs - but the turn-on times of a L298 are also measured in µs, and depending on the setup can be even more than this… so basically the transistor just doesn’t have time to properly switch on before it is switched off again…
You can try with a better driver, or if you have set a low voltage_limit compared to the PSU voltage, you might improve things with lower PSU voltage, so the low duty cycles are not used as much.
It’s difficult right now, you have to hunt around. Generally more available are the demo boards from TI or ST for their various motor drivers, but those cost $$ - usually $50-$150, depending on what it can do. Many of them accept 3-PWM or 6-PWM input and can be used with SimpleFOC.
Other than that, keep looking back in the SimpleFOC store, and maybe you can try some of what you see when you search “SimpleFOC” on AliExpress…
We don’t have a minimum PWM threshold, that I’m aware of. I have to think about it, but I think you might be able to achieve this effect by setting the dead-time to the right value, if you’re using 6-PWM. Or you could clone the library source code from GitHub and modify the setPwm function in the driver code (BLDCDriver6PWM.cpp or BLDCDriver3PWM.cpp) to contstrain the value between 0.07 and 1.0 - but I guess you should allow the value 0.0 as well…
Your hardware has to support this by offering current-sensing. If you get a driver with inline current sensing, you can try it right now, for low-side current sensing we plan to have it implemented in the next release.
I tried with B-G431B-ESC1 board. I drive only 1phase in stepper motor for test. I got sinus current from this driver.
I repeated test again, same setup with L298 and IFX007T, phase current was non sinus.
I am happy that i solved this issue. I am still not sure about root cause, probably switching of transistor was to slow.
I am asking myself how IFX007 preform as BLCD driver? Probably very bad…
L298N and BTN8982/IFX007 have very slow rise time and they are unfortunately not very good drivers for the FOC. Not for Stepper or BLDC motors.
We have had many posts now about their performance problems and I’ll make sure to list them in the docs.
We have been very optimistinc about them at first because of their low cost and convenience but unfortunately many people are reaching their limits.
Thanks for reporting back.
I’ve at first developed the stepper code on 2 simplefocshields (using 4 out of 6 phases). They performed very well, bgc I did not test.
I’ve also tested the samd21 based smartstepper integrated driver, it is a bit loud, but it does work well.