Unfortunately, it is not as easy as it sounds. There are still a few components we need to add when it comes to properly polarizing the DRV8811 device. Other than the DRV8811 and the motor itself, we need a series of capacitors and resistors which will take the device from a semiconductor device to the ultimate stepper driver! Well, one of them, anyway… The “dreaded” passive components can be seen on the picture below:
Caps needed for the charge pump and the internal regulator are a piece of cake. The datasheet is more than clear than three ceramic caps of 0.22 uF value should go in between (1) CP1 and CP2, (2) VCP and VM and then (3) VGD to GND. The voltage? The CP1/CP2 and VCP/VM caps I would make 50V just to be safe. The VGD cap can be 16V as this is a 10V node.
But how about the components needed to properly configure the RC pins RCA and RCB? These are harder to allocate as now we need to understand what is going on with the current regulation engine! In fact, selecting these components is not a trivial endeavor. Make them too big and your switching frequency is too slow, with a high pitch squaling noise making your life miserable. Make them too small, and the switching losses increase, removing total power dissipation capability from the H Bridge’s power FETs. We need to match these values as close as possible to the optimal set of parameters in order to maximize out output. This task may seem daunting and annoying, but I assure you it is quite simple.
But first we need to understand the circuit block which makes it all possible: The Current Regulation Engine!
DRV8811 Current Regulation Engine
We are dealing with a stepper. In the past, steppers were driven with a particular voltage to obtain a current. Or, a winding series resistor was put in place to limit the current. This resistor was bulky and costly. But today we do not need to worry about any of this. We can use any voltage and forget about power resistors, and still obtain whatever current we desire. And for this to be possible, we must thank our current regulation circuit, also known as current chopper. But how does this work? OK, I promise to go there, but let us make sure you know the basics.
We can regulate current across an inductor because inductors do not accept abrupt changes in current. They will allow the current to charge up or discharge down, but even this takes time, and this time is directly proportional to how inductive the winding is and how big the power supply voltage is. The higher either (or both) of them, the less time it takes for the current magnitude to change as it flows through the winding. And of course, vice versa.
As a result, we can then allow charge and discharge cycles such that at the end we obtain one particular current which is the one we want to drive our stepper. Per example, you could use 40V to drive a 100 mA stepper. This sounds preposterous but by controlling the current, we can ensure the winding sees only about 100 mA. How can we do this?
As you can see in the picture above, if we allow the current to increase/decrease in between two values such as 105 mA and 95 mA, we should obtain an average current of 100 mA. It is possible you are worrying whether 105 mA is too much for this 100 mA stepper motor, but truly it is not an issue at all. As the winding current increases and passes above the 100 mA mark, it also goes below it by a same amount. To the eyes of the motor, a 100 mA is passing through across time. Plus, I do not recommend to drive a 100 mA Abs Max stepper motor with this kind of current. It is always safe to run the motor a little bit cooler than what an Abs Max will give you. But so that you know, on motor land, Abs Max are really not as deadly as in IC land. A motor may take considerably larger currents as long as you manage to keep it cold. But I digress…
What you want to understand is how Current Regulation works. This is piece of cake!
The picture above shows the current regulation engine. It consists of an amplifier, a comparator and some logic.
A SENSE resistor is placed in series with the motor winding. It is then safe to assume whatever current is flowing through the winding is also flowing through the resistor. At the same time we know that a current flowing through a resistor must imply a voltage drop equal to I*R. This is how then we can measure this voltage and learn what current we are dealing with.
The problem is that this voltage is rather small. Why? Because in the first place, the SENSE resistor is made to be on the small side itself. You will see SENSE resistors in anywhere from 100 mOhms to 400 mOhms and similar values. Why so tiny, you ask? Because if it were any larger, the power losses on the resistors would not be appealing. Hence, the smaller the resistor the better (in terms of power loss, at least…).
It is then expected that the voltage across this resistor will be considerably small. Per example, if your current is 2A and the SENSE resistor is a measly 100 mOhms, then the voltage must be equal to 200 mV. 200 mV is not that small, but what if your current is 100 mA? Then the voltage is a measly 10 mA. That is a minute voltage!
This problem is solved by adding an amplifier stage with a known gain which will take the practically insignificant voltage and generate a larger version. We want this larger version as we will supply another voltage (we call the Reference Voltage) which we will compare against the amplified voltage version from the winding current. This comparison is important because it will define whether the H Bridge is enabled, current flows and increases, or the H Bridge is disabled with the current decreasing through an alternate path (you may want to check my post on decay modes).
What we will see then is that as current is increasing but with a respective voltage smaller than our comparison voltage, the H Bridge will le this current flow. As soon as the current reaches the maximum allowed current, as specified by the reference voltage, the H Bridge is disabled. This is how we make the current oscillate in between two values. This current at which we disable the H Bridge is called I TRIP as it is the current magnitude which signals the H Bridge to move into disablement. Each driver chip has its own I TRIP equation and it is very important to know which equation you are dealing with.
In the case of the DRV8811, the ITRIP equation goes as follows:
ITRIP = VREF / (8*RSENSE)
That is, if you VREF = 1V and your sense resistor is 100 mOhms, the H Bridge will allow current to increase until it reaches 1.25A in magnitude.
Sounds simple and easy! We should be done, except that clearly we are not. I have not even explained how the RC values are selected on the DRV8811. To go into these we need to understand why this previous picture is not as simple as we thought. In reality, there are still two problems we need to solve:
When you enable an H Bridge driving an inductive load, spurious noise may be present which will be taken by the current chopper as a current trip event. The problem is that this high current spike is by no means conducing to a real current at the winding, hence torque at the motor shaft. The high current spike is most likely caused by diodes switching or capacitive parasitics at the winding itself. Either way, we need to make sure we do not regulate winding current by looking at this false current spike and the way to do this is by ignoring it. We know this spike does not last forever. A few hundred nano seconds at best. So if we apply some form of delay to make sure we do not act on these spikes, we can then focus on looking at the real current. We call this wait period TIME BLANK or TBLANK because this is the amount of time in which the current regulation engine is ignoring current shortly after the H Bridge is enabled.
The beauty on the DRV8811 is that you can configure this TBLANK. Why do we want to configure this value? Shouldn’t we just fix it at some appropriate value and get it over with? We can certainly do that but by adding this flexibility you can take into consideration your particular motor and tailor the system’s TBLANK to an optimal value. You can make it as small or as large as you want.
On the DRV8811, TBLANK is computed as TBLANK = 1400 *C. On my boards I use a 1000 pf ceramic cap which takes the TBLANK parameter to 1.4 us. This time is more than plenty to ignore spurious pulses at the SENSE resistor. Do note this amount of time will elapse whether the current magnitude is falsely spiking or truthful going above my ITRIP value. This plays a role on your system as your inductance and input voltage may be taking the winding current to ITRIP levels considerably quicker than 1.4 us. If this is the case, then you would need to make TBLANK smaller. If you do not, by the time you see an ITRIP event, the current will be considerably larger than the value you wanted to ITRIP at. It will look something like this:
Remember! Current is ignored while TBLANK, so even if you are above ITRIP when the next cycle starts, the H bridge will charge the inductance during this period.
TBLANK defines what we call the minimum TIME ON. However, it is important to understand that TIME ON is indirectly proportional to motor inductance and input power supply. As I have stated before, the larger either of this, the quicker the current builds up. But the quicker the current builds up, the quicker you reach your ITRIP, hence the shorter the H Bridge remains ON. It is very hard to coordinate TIME ON. Actually, practically nobody worries about this as once you have chosen a motor and a power supply rail, there is very little you can do. You could add resistors in series or inductors, but this practice is quite undesirable as it raises cost and complexity.
On the other hand, selecting a motor based on inductance alone is almost impractical. What you will be looking for is torque and speed. Hence, optimizing for how long the H Bridge is ON, is not very practical. What we can do however, is optimize how long will the H Bridge be OFF. Which takes us to the end of our journey.
Current Chopping PWM
Once you have configured how long will the H Bridge will at least remain ON (TBLANK), we need to configure for how long it will remain OFF once an ITRIP event is registered. Ideally, you would make your TIME OFF to be equal to TIME ON. That wat you get a 50% duty cycle and the average current is right in the middle. However, this is not demanded. You can make your PWM duty cycle whatever you want. Do have in mind that the longer the TIME OFF, the more the current will decay away from ITRIP. This is either a good or a bad thing, and will depend on what you are trying to accomplish. At the end, we must not forget how much the current decays is both a factor of how large the TIME OFF is and the DECAY mode as well! Fast, Slow or Mixed. I tell you, you will need to check that other posting in decay modes!
My biggest worry when selecting TIME OFF is making the PWM frequency too low. Have in mind we are configuring an oscillator here. The DRV8811 does not have an internal PWM generator, but the combination of the logic and the RCx pin, along with the motor, make up for one. So, if the inductance is too large and it takes forever to reach ITRIP, the TIME ON will be quite long. If we then add a lot of time on TIME OFF, we have a total T (T = TIME ON + TIME OFF), which when inverted (F = 1/T) may give us a too low frequency. Is this an issue? If you don’t like hearing your motor squeals, then yes, it is a problem! And in my experience nobody likes this particular noise. Well, it is called noise for a reason…
The equation for TIME OFF on the DRV8811 is TIME OFF = R*C. I use a 47K resistor on my circuits. Assuming TIME ON is identical to TBLANK (which is the quickest our H Bridge could respond), I will have a frequency of 1 / (1.4 us + 47 us) = 20.6 KHz. This frequency is good enough to be unhearable by the great majority of us. Do note, however, that if the motor has enough inductance to make TIME ON larger than a 1.4 us TBLANK (and most bipolar motors will), I will expect to see the frequency to frop below 20 KHz, which may result in a high pitch squealing audible to kids in elementary school. In the event that I learn they are pissed at my existence, I would switch to a smaller resistor. Maybe something in the 30K range. I think anything above 16 KHz is more than fine, but maybe my six month old will complaint in a few years as he is deafened by my stepper based projects…
By selecting the R and the C on the DRV8811 RCx input pins you can fully control the current control engine. This will allow you to “program” a switching frequency. Remember that too high a switching frequency makes switching losses grow and this is not pretty. But decreasing switching losses by reducing the frequency can lead to audible noise, poor motion quality and some increased torque ripple. Hence, it is your responsibility to choose these components carefully. In the event you feel a neurism about to pop as you take on to these two “heinously complex” equations from hell, you may want to consider the typical values of 1000 pf and 47K or maybe even a smaller resistor. But seriously, if you have read so far, I doubt these equations are hard to grab at all!
11 comments for “How to Select the R and C at the RCx Pins on the DRV8811 Bipolar Stepper Driver”