First test, only using FPGA logic, the ARM side is sleeping.
My goal is to kill as much energy as possibly < 20kHz that is not the fundamental tone driving the stepper.
Z-turn 7020 ZYNQ board + custom daughter card (White PCB)
NEMA 17 stepper 12V 0.4 A rated. Using ~400kHz switching freq with 8 bit pwm (100MHz FPGA clock) 1:St order delta sigma with 16 bits LFSR dither. 25 kHz sampling rate (creating the ~50kHz alias tone). 50Hz == 1 rev/s . 10ns deadtime. THD = -66dB or 0.05%
(Will push to github later on)
Any suggestions?
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8bd58fb3-f004-49ad-be1b-40bf7c70e3d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is current going through the H-bridge down to ground, and the Voltage from one of the half bridge LP filtered @ 10kHz. As expected.
The current is measured with a 33mOhm resistor and a 20X gain stage made for this purpose.
> Here is the switching powerloss in 2 full H-bridges (One stepper driver). The MOSFET are Audio class D graded and are intended to operate up to 400kHz., At 30V rail they get around 40 deg C without any heatsink.
Amazingly low.
_Mark
First measurement using the ARM CPU to create the waveform @ 400 ksps for both X and Y axis.
The CPU load on core0 is ~55% using double prec. and the sin and cos in math.h.
If needed CPU time for trig functions can be improved with an factor 5 with lookup array.
Effectively, I'm using 8000 microsteps per step @ 1 rev/s, or 400 000 microsteps per step @ 1step/s
Here is a measurement using 29V rail with improved Delta-Sigma to reduce the noise-floor.
Next step is to build the feed-forward filter that increases the voltage at higher speeds to keep the current constant.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ca2fc58e-6a90-428f-9de6-8b9b02f044d1%40googlegroups.com.
wtX += yf*dt;
double amp_3=yf*amp3;if(amp_3>0.12) amp_3=0.12;
double x = sin(wtX) + amp_3*sin(w3tX);double y = cos(wtX) + amp_3*cos(w3tX);
s32 A=amp*x;A+=0x8000;s32 B=amp*y;B+=0x8000;XLlFifo_TxPutWord(&FifoInstanceX, (A<<16) | B);
The inductance of the coils do change, if you have load on the motor the then the stator does not move and the coils have more inductance.
So basically you are charging the stator with a magnetic field and then as it moves the core(Stator) of the inductor moves, and a precharged part of stator moves into it's place over coil and inductance drops. So when there is a load you have to charge the stator with more magnetic field before the stator moves, which shows up as an increased inductance. Also as motor steps the inductance goes from high to low.
The issue with PWM stepper drivers is that this change in loading affects the drive current, as you have seen. So most PWM systems sense the current through the transistor h-bridge (usually on low side) so they turn h-bridge on, then wait some dead band time until ringing stops and then leave H-bridge on until the low side current is reached. Then they will either reverse h-bridge on short both low side FETs, the idea is that the inductor of the motor keeps that constant current flowing in coil until your next cycle. Note the reversing of the h-bridge is often needed to over come the dead band time. That is if the h-bridge is on for say xxns before measuring current and you have low inductance motor and/or high voltage source you can drive too much current into the coil so you have to reverse it back out, yes this causes noise, heat and other issues but it is often done on most stepper drivers.So the ideal low noise drive into stepper motors is an adjustable constant current drive. However this means lots of heat losses in driver. The PWM drive works well but you have noise. If you drive with really high frequency then you run into problem monitoring current and will need to tune your PWM duty cycle to the motor, but then can run into problems as loads change on the motor, which changes the inductance of the motor and hence your tuning. So it works fine most of the time, but not when the load on motor changes.
To do the best PWM drive you need to sense the current in the coil and change PWM based on that. If you for example put a 0.010 resistor as a current sense then you introduce loss and higher resistance to the coil.
Hence I found the best way is to use a hall effect current sensor. With the hall effect sensor you can directly sense the current in the motor and adjust your PWM to give you correct output. Here if your current is low you drive coil positive until current is reached and then drive h-bridge to have both low side FETs on (brake mode) the current will continue to flow through coil due to charge on the motor inductive coil. When the current starts to drop you turn H-bridge back on. When you need to drop current you drive H-bridge in reverse and repeat. The idea is to have the desired constant current in motor coils with as small ripple noise (acoustic) as possible.The acoustic noise is based on the PWM frequency for sure, and how fast you can sample and adjust current, faster means less low frequency ripple and noise. Also ringing when turning FETs on and off can cause acoustic noise. To help here you can use some tricks like putting a resistor in series with gate of high side FET and a diode in parallel with resistor.
Such that your turn on time of the high side FET is slower than the turn off. So now by tweaking the resistor value what happens is the high side FET is slightly on when the low side FET turns on, this causes more current draw and heat in driver but snubbs out the ringing.
With the FPGA you could tweak the PWM timing to do this or better yet run really fast PWM such that you control current into FET gates to do this, basically turning the FETs into programmable snubber circuit. Again the cost is heat to reduce noise.The torque of the motor is based on the maximum current you drive the coil. For example the spec on a stepper might be 1A however this is continuous current spec, so you can drive with higher current as long as average current is lower than 1A. When motor is stalled (not moving) you have to make sure your current is below spec (average current below 1A). When motor is moving you can drive higher currents as long as average is still below spec. For example if you put a sine wave current waveform into motor you can get ~1.414 high peak current than motor spec and still be under the average spec on motor.
The speed of the motor is dependent on how fast you can get the current to rise in the motor. So running a high voltage allows faster current rises and higher speeds, but also for a 1A motor you will need shorter PWM pluses for same current. So for best torque and speed use as high of voltage source for your steppers as possible (ie 24V better than 12V). Note the motor rated voltage is basically the resistance of motor divided by max current, and has nothing really to do with your voltage source for your stepper driver.
For really high speeds you need to do a phase prediction. That is you predict where the next phase angle of the motor stator should be and basically skip steps ahead to drive motor. Hence you are predicting the stator position based on motors speed and driving coils based on where stator will be by the time you power coils not based on where stator is. I have done this with my smart stepper boards which has encoder feedback and can get really high speeds out of a stepper, 20k RPM for example. Now there is very little torque at these speeds but it is fast.
To keep motor heat down what I do on the smart steppers is montior the motor desired position and the actual position. If they match turn off the current, if they don't use PID control on the current to force them to be the same. This way the current into motor is always just enough for the holding torque of the load or moving motor. This minimizes the heating of motor and noise. Note most drivers if set for 1A will put 1A in the motor when there is no load, which causes more noise and heat than needed.Have Fun!Trampas
Thank you for your long text, here is my thoughts.
Den torsdag 16 augusti 2018 kl. 01:20:32 UTC+2 skrev Trampas Stern:I do not understand why it would heat the MOSFETS? If the coil creates a back EMF higher that the rail, then the body diode of the upper MOSFET would start to conduct with heat loss. Otherwise the MOSFET should be in a low resistive state or a high resistive state.I did run my steppers at 3 AMP output at 400kHz switching without any heatsinks on the TO220.
But how can it change from a corner frequency of ~50Hz (R to jwL) up to > 250kHz ?. Or is it so simple that the stepper changes to become an generator, changing the sign of the inductance to a negative value, Z: | R + jwL | -> | R - jwL | ->| R + jwL | , and somewhere in between Z=R ?Do I need a passive LC filter on the MOSFET output to limit the HF currents in my next design? Is it hurting any components? EMI must be a nightmare for long cables.
I do not understand why it would heat the MOSFETS? If the coil creates a back EMF higher that the rail, then the body diode of the upper MOSFET would start to conduct with heat loss. Otherwise the MOSFET should be in a low resistive state or a high resistive state.I did run my steppers at 3 AMP output at 400kHz switching without any heatsinks on the TO220.
I know that a simple solution is to use an DAC + comparator instead of an ADC to measure the current, but that is a cycle by cycle method which will introduce a lot of noise and aliasing in to the control.I also know that you can use the recycling state of the H bridge, but that would make the controller to loose the knowledge about the voltage. But I also have a voltage ADC on my card, to be able to track the voltage over recycling current cycles.A antialias filter before the ADC would solve the problem with HF, when using a PID controller.To do the best PWM drive you need to sense the current in the coil and change PWM based on that. If you for example put a 0.010 resistor as a current sense then you introduce loss and higher resistance to the coil.I do not get that. The output resistance of the PSU, MOSFET and resistor lies in series with the coil resistance. Ideally we would like a superconducting coil to avoid the resistive heating.I argue that it is no difference in torque having a 1.33 ohm coil resistance + 0.01 resistor as having a 1.34 coil resistance and a 0 ohm Hall sensor if the windings are the same. The only difference is a little change in the total resistive heating in the stepper.
Which is best RC snubber or "FET" snubber. I guess the RC snubber is more reliable to changes with longer deadtime.
For really high speeds you need to do a phase prediction. That is you predict where the next phase angle of the motor stator should be and basically skip steps ahead to drive motor. Hence you are predicting the stator position based on motors speed and driving coils based on where stator will be by the time you power coils not based on where stator is. I have done this with my smart stepper boards which has encoder feedback and can get really high speeds out of a stepper, 20k RPM for example. Now there is very little torque at these speeds but it is fast.Do you mean that you feed one cycle with a 100% duty cycle, and then skip some cycles, instead of modulating each cycle !?
To keep motor heat down what I do on the smart steppers is montior the motor desired position and the actual position. If they match turn off the current, if they don't use PID control on the current to force them to be the same. This way the current into motor is always just enough for the holding torque of the load or moving motor. This minimizes the heating of motor and noise. Note most drivers if set for 1A will put 1A in the motor when there is no load, which causes more noise and heat than needed.Have Fun!TrampasWhy not just use mapped voltage control, since I then get an automatic boost of current during load. It should be the most quiet way !?
Power in watts is volts * amps. 24V * 10mA =240mW of power. The issues with the 1us blanking time is that if you increase the voltage the power increases to the square, that is if you did the same math for 48V power supply you would have 20mA of current and the power would be 48V*20mA=0.96W.
Now if we assume your 2.4mH 1A motor is a 3V stepper (3/1 = 3 ohm resistance) then we have a maximum input power of 3V * 1A=3W so the 1us blanking time at 24V is .24/3*100=8% of the total power into the motor. At 48V it is 32%.
As are as the motor noise it is true that steppers can create more noise due to the number of steps. However even a brushless DC motor operates on the same principles as the stepper motor, but with less steps per rotations. So they may produce noise too but at a lower harmonic due to less steps.
However the stepping motor noise is more due to how the motor driven, that is taking full steps at maximum current on steppers is like hitting the stepper with a hammer to move it, and creates noise and ringing.
The problem with ringing noise is it is dependent on the impedance of the coil, which changes with loads. Hence to remove ringing and make a quite stepper motor driver you need lots of feed back. For example read up on the trinamic stepper driver chips and see how they operate.
At high velocity, the motor resonance must be kept low, in order to maintain torque as high as possible. Microstep waveforms play a reduced role, as the waveform cannot be maintained in this velocity range anymore (see Figure 2), getting worse with each increase in velocity. Fullstepping sometimes brings a few percent increased motor torque.
The classic constant off-time chopper uses a fixed-time fast decay following each on phase. While the duration of the on phase is determined by the chopper comparator, the fast decay time needs to be fast enough for the driver to follow the falling slope of the sine wave, but it should not be so long that it causes excess motor current ripple and power dissipation. This can be tuned using an oscilloscope or evaluating motor smoothness at different velocities. A good starting value is a fast decay time setting similar to the slow decay time setting.
Off time. This setting controls the duration of the slow decay time and limits the maximum chopper frequency. For most applications an off time within the range of 5μs to 20μs will fit....
Yes I agree with most things.
> Some stepper controllers do a fast decay after an "on time" specifically after you turn off the FETs you will get a reverse EMF voltage spike. The body diodes in FETs will clamp some of this but can not handle the reverse EMF power on larger motors, so the controller will turn the FETs to the fast decay mode to absorb the reverse EMF back into caps.
Don’t understand that one. If you go directly to Slow Decay after On Time, you will have a nice short circuit. No body diodes involved, except perhaps for a few nanoseconds of the break-before-make to avoid cross-current in the switching H bridge. But you also have this when going directly to Fast Decay only this time you have it in both bridges. Or am I missing something?
> Also I can skip the fast decay when driving low currents where the reverse EMF will be low, but use it on higher current on times where I will get significant EMF.
Again I’m not convinced. Trinamic recommend the opposite. Quoting Application Note 001 (V1.02 / 2015-FEB-18) p. 7:
> 2. Try switching the motor to fullstepping, if your driver supports it. Make sure, that the driver coils see a fixed current. Therefore it is important to switch to fullstep at or near the fullstep positions (TMC26x based drivers) – compare Figure 5. Set vhighfs (for TMC5XXX drivers).
> 3. As fullstepping does not require high precision chopper operation, you can try to switch to slow decay only chopper – compare Figure 6, e.g. by setting vhighchm (for TMC5XXX drivers).
I also agree about the needed match between supply voltage, driver and stepper. For instance when I started, I didn’t know (unfortunately) that for fast motion current is not important, voltage is! Current is for torque, voltage is for speed.
I would opt for lower current drivers now but with 48V or 60V support, to get the stubborn current into the steppers in time.
_Mark
Also I don't think switching in the low µs order can create noise (assuming "noise" is of the audio type i.e. perceivable by humans, i.e. subject of this thread). Even bats "only" hear up to 90kHz.
Also I don't think switching in the low µs order can create noise (assuming "noise" is of the audio type i.e. perceivable by humans, i.e. subject of this thread). Even bats "only" hear up to 90kHz.I do not consider the frequencies above the switching frequency, I considering the frequencies that are created below the switching frequency.
On Tuesday, August 21, 2018 at 2:19:20 PM UTC+2, Mikael Bohman wrote:Also I don't think switching in the low µs order can create noise (assuming "noise" is of the audio type i.e. perceivable by humans, i.e. subject of this thread). Even bats "only" hear up to 90kHz.I do not consider the frequencies above the switching frequency, I considering the frequencies that are created below the switching frequency.Ah I see. So it is more about the clock resolution than about the FET switching frequency. You could also add a hysteresis to the Delta-Sigma Modulation and as long as you remain > 40kHz and add the same random element you'd get no audible noise, right?
This modulator have changed all audible tones to noise, but it is still a problematic high level of energy > 1kHz.
Same but with 400kHz base.
With a more advanced design you can start to shape the noise and push most of it above 20kHz. A small part will always be present < 20kHz, but you can often do it good enough.
Again I’m not convinced. Trinamic recommend the opposite. Quoting Application Note 001 (V1.02 / 2015-FEB-18) p. 7:
Note here they may be doing the fast decay to reverse out the power stored in inductor during blanking time. Also different chips allow different configurations that is hybrid, fast decay or slow decay modes such that you can pick for your application and noise tolerance. It all really depends on what you need from your motors.
I also agree about the needed match between supply voltage, driver and stepper. For instance when I started, I didn’t know (unfortunately) that for fast motion current is not important, voltage is! Current is for torque, voltage is for speed.
I would opt for lower current drivers now but with 48V or 60V support, to get the stubborn current into the steppers in time.
Yea I agree, going from 12V to 24V made big difference in speed. Also going from a smoothie to direct drive via a smart stepper made a huge increase in speed. That is by telling the smart stepper the desired end location it could move at full steps and then micro steps when close to end location. This created very smooth and much fast movement. However it accelerated too fast and could leave parts behind (need to add motion planner with acceleration control). Using phase prediction the smart steppers would move faster, but I never got the algorithm tweaked correctly to work under all loads so I have disabled phase prediction.
Trampas