TB6600 stepper driver problems - Page 1
Forum section: electronics / projects

author: Emil
author_rank: Regular Contributor
timestamp: December 07, 2015, 01:23:05 pm
content: I'm making a stepper driver using the TB6600 driver chip.When testing it with a small stepper it appared to work perfectly on the first try, but when doing some more testing I discovered two problems:1. The stepper draws less current than I was expecting. Since the the chip limits the peak current, while the multimeter probably measures something close to the RMS current I was expecting the measured current to be ~.7 times the set curent. The current I measure is .45 to .5 times the set current, even when full stepping slowly or holding position. Not sure if this is a real problem or a bad assumption on my part.2. If I limit the (measured) current to less than ~.7A everything appares to work correctly. It doesn't matter if I limit it using the Vref voltage or activating the current reduction. If the current is higher than this the motor loses steps, stalls or doesn't move at all. It doesn't just do this at high speed or high load but even when the unloaded motor is stepping very slowly.Any ideas what might be causing this or suggestions for what I should be checking?I have tried two power supplies 12V (14A max) and 36V (10A max) with the same result. Voltage in to the driver board does not drop under load.I have tried two different TB6600 chips, same result.The sense resistors are thick film resistors, so I don't think inductance should be a problem.I didn't have a low ESR 47uF cap, so i used a low ESR 330uF 63V cap instead (EKYB630ELL331MJ25S).A couple probably unrelated questions which I have not found clear answers to:-The OSC frequency can be set from 20kHz to 60kHz, with the datasheet specifying 40kHz as typical. What would be the expected effects of using a frequency closer to 20 or 60kHz?-The block diagram does not show any internal back-EMF diodes nor does the typical circuit diagram show any external back-EMF diodes. Does this chip require external back-EMF diodes?Datasheet:http://www.mouser.com/ds/2/408/TB6600HG_datasheet_en_20140109-771376.pdf

author: H.O
author_rank: Frequent Contributor
timestamp: December 07, 2015, 02:06:40 pm
content: Hi,Where are you putting your multimeter when you're measuring the current? In series with the supply or in series with the actual motor winding?If it's in series with the supply then you have to realise that the drive pretty much acts as a step down converter. The power drawn from the supply will be equal (a bit higher due to losses of course) to the power being put into the motor but since the voltage at the supply is higher than the avergage voltage that the motor sees the average current drawn from the supply is lower than the average current in the motor winding. If you decrease the power supply voltage while the motor is running at a certain speed I think you'll see the current drawn from the supply will increase.Increasing the chopper frequency decreases the current ripple and makes for a smoother average current but it increases the switching losses. High power supply voltage with low inductance motor windings makes the current increase/decrease faster which can warrant a higher chopping frequency. Decreasing the chopper frequency has the opposite effect. With that said "most" drivers I've come across use around 20kHz.EDIT: What value are you using for the sense resistors?

author: Emil
author_rank: Regular Contributor
timestamp: December 07, 2015, 02:19:45 pm
content: Quote from: H.O on December 07, 2015, 02:06:40 pmThank you for your reply.In series with the supply, I will try to connect the multimeter in series with one of the motor phases.QuoteI use two 330mOhm resistors in parallel, so 165mOhm.

author: H.O
author_rank: Frequent Contributor
timestamp: December 07, 2015, 02:33:50 pm
content: QuoteIt probably won't give you an accurate reading due the waveforms involved but give it a try. Otherwise, use a scope and look at the voltage across the sense resistors.QuoteWell, as before, you can't really get an accurate reading of the actual motor current by measuring the power supply current so that 0.7A figure doesn't tell you much.QuoteOK, so then you need a voltage at VRef of ~0.5V/A of motor current. With the voltage divider values in your schematic you're should have a voltage at VRef of around 1V therefor asking for a peak current of around 2A. Does that match up with your expectations?

author: Emil
author_rank: Regular Contributor
timestamp: December 07, 2015, 03:16:58 pm
content: Quote from: H.O on December 07, 2015, 02:33:50 pmI will make some measurements tonight so that I can answer your other two questions, hopefully I can get some good readings with the scope across the sense resistors. But I think it is significant that the motor loses steps/stalls/fails to run as the current is increased even if the measurement of the current when this starts to happen is innacurate.

author: H.O
author_rank: Frequent Contributor
timestamp: December 07, 2015, 03:45:22 pm
content: QuoteI was thinking that you may bemassivelyoverdriving the motor windings into saturation or something which could cause it to not work reliably. You generally don't want the voltage at the VRef pin to be much higher than [motor rated current] x 3 x [sense resistance].

author: Emil
author_rank: Regular Contributor
timestamp: December 07, 2015, 08:27:21 pm
content: H.O,I see that the schematic I uploaded doesn't have the correct values for the voltage divider resistors: R12=4.7K and R10=3.3K.This should give Vref=1.94V, measured Vref=1.91V.Calculated peak current: (1.91V/3)/0.165ohm=3.85AMeasured +/- 600mV peak with the oscilloscope across the sense resistors: 0.6V/0.165ohm=3.64A, quite close to the calculated value.(A multimeter in series with one of the motor's phases measured from 1.1A to 3.1A. The multimeter was all over the place while the scope gave consistent readings, so I wouldn't trust it much.)The motor (23HS45-3008D) is an 8 wire type rated at 4.24A with the two windings in parallel.I also measured with current reduction enabled. I got 210mV across the sense resistors on the scop, corresponding to a current of 1.27A.When running the motor at full current it was very erratic, moving a bit then stalling then reversing direction several times. With current reduction enabled I ran smootly in one direction apparently without missing any steps. All measurements while fullsteping at ~100Hz. Chopper frequency 35.7kHz.I think question 1 is solved, the current is as expected, I was just measuring it incorrectly.

author: H.O
author_rank: Frequent Contributor
timestamp: December 08, 2015, 06:08:22 am
content: Yes, those numbers makes sense and I think your circuit is working as expected.At full current it MAY just be that the motor is resonating/ringing too much to be able to keep "in sync".Have you tried to going to 1/2-step or 1/4-step and/or ramping the step frequency up past 100Hz, perhaps your right in the resonating zone at frequency.

author: Emil
author_rank: Regular Contributor
timestamp: December 08, 2015, 10:43:02 am
content: Quote from: H.O on December 08, 2015, 06:08:22 amAt first I thought this was a mid band stability issue, but it seems completely independent of stepping frequency. Maybe there can be other resonance issues? I will read up on stepper resonance/ringing.I have tried 1/2, 1/4, 1/8, 1/16-step and higher/lower steping frequencies. Normally I start it at the highest speed I can without stalling it and then ramp up, but I kept the speed constant while measuring current to remove one variable.I think the next step is to try a different stepper. I have some 3A steppers(Edit: 2.12A, 3A is unipolar rating)on my CNC mill, I will try connecting one stepper to the TB6600 driver and see how it performs. (After changing the current to 2.12A.)

author: Emil
author_rank: Regular Contributor
timestamp: December 09, 2015, 08:45:40 am
content: I tested the driver yesterday with two other steppers:One was a 1.68A NEMA17, which worked perfectly up to 2800rpm.Then I tried it on a 2.12A NEMA23 motor (23HS30-3006D) which is mounted on the X-axis of my Taig CNC mill. It ran perfectly at 600rpm. I have not tried running it faster yet, but it will be interesting to compare the performance to what I get with the driver I normally use on the mill.So it appares the driver is actually working, just not with the 23HS45-3008D motor. Maybe I will try a flywheel, might help if it is a resonance problem.Thank you very much H.O for helping me with this.

author: H.O
author_rank: Frequent Contributor
timestamp: December 09, 2015, 10:06:43 am
content: GreatAnother possibillity is of course electrical noise - which of course increases with increased current. I see on your PCB layout that your step-signal runs right next to the sense for the bridges. Perhaps noise is getting into the step and/or direction line or, since you're returning both power and logic signals thru the same ground plane, it might be noise on the logic ground. I don't THINK it is but it might be worth investigating.

author: Emil
author_rank: Regular Contributor
timestamp: December 14, 2015, 10:27:45 am
content: Quote from: H.O on December 09, 2015, 10:06:43 amI'm redesigning the board to get more seperation between the signal lines and the sense resisitors / stepper output.I noticed something interesting:I get a voltage spike on the Vref pin with the same frequency as the chopper frequency. At the same time as the spike, the voltage on ouput 1A goes low and there is a delay before 1B goes high. At the time scale I was using both appared to happen at the same time, but I will do some more measurements tonight to see if the spike happens before or after 1A goes low.The spike (if I remember correctly) is -2V/+4V relative to the set Vreg voltage of 1.05V with enabled and the spike's amplitude increases when turning off current reduction or increasing Vref.The Vref voltage comes from a voltage divider, dividing the output of a 3.3V linear regulator. I don't see how that could make the spikes, so I think it must come from the TB6600's Vref pin.I have tried adding a ceramic cap from Vref to gnd, but it actually increases the amplitude of the spike. Maybe a zener or a MOV would work, but I would much rather find and eliminate the cause of the spike than trying to supress it.

author: wraper
author_rank: Unknown
timestamp: December 14, 2015, 10:55:01 am
content: Didn't read the whole topic but you should get correct current waveform by trying different combinations on current decay mode inputs, it's very important.page 6http://www.glyn.com/data/glyn/media/doc/TB6560AHQ-E_en_090324.pdfSorry have read the chip model incorrectly

author: H.O
author_rank: Frequent Contributor
timestamp: December 14, 2015, 11:02:29 am
content: In a circuit like this there are (relatively) high currents being switched fast. This generates noise and the high currents circulating in your ground plane can make "ground" jump "all over the place".It's possible that the spike you see on the scope isn't actually there and is just a side-effect of HOW you're probing that node. The fact that a cap (which isn't a bad idea anyway) doesn'tseemto help at all makes me suspicious...If you're not already doing so, get rid of the ground lead of your probe and attach the little high freqency springy thingy to the probe. Now probe the Vref node again, prefferably with the probe ground attachement right on the logic level ground pin of the driver chip or, if that's not possible, as close to it as possible.While redesigning the PCB you may want to try keeping the power ground and low level ground separate and attach them together at a single point only (the power inout terminal for example).

author: Emil
author_rank: Regular Contributor
timestamp: December 15, 2015, 09:56:29 am
content: Quote from: H.O on December 14, 2015, 11:02:29 amYou where right. The probe is just picking up noise.Looking at the board I realised I could easily split the ground by making a few small cuts in the ground plane, cut a few traces and put in 2 jumper wires. I noticed the connections from the TB6600 gnd pins to the gnd plane where not as solid as they should have been because I had used spokes rather than solid connection when filling the gnd plane, so fixed that.The result was interesting. When holding position at 1.3A I can't hear the motor until my ear is 10cm from the motor and it's still very quiet at 3.9A.But still not running right at high current, randomly making a few steps while holding position. Since it never changes direction or step mode while holding position I think the problem is only with the CLK line.So I added a cap between the CLK pin and sgnd, much better. Still some problems, but that really reduced it. I tried cutting the CLK trace at both ends and replacing it with a wire, on the assumption that the trace going right next to the sense resistors was the problem: no change or possibly a little worse. Maybe a wire is even better at picking up noise than a trace(?) I will try shielding it so I can be sure if this is really the cause of the problem before geting a new board, to keep the number of 3 week turnaround cycles to a minimum.

author: H.O
author_rank: Frequent Contributor
timestamp: December 15, 2015, 11:24:49 am
content: Is the MCUdrivingthe CLK pin to both levels or is it possible that it's open source/drain, onlydrivinghigh OR low and left floating in the other "state"?The microcontroler driving the TB6660, is it a 3.3V or 5V device? If it's a 3.3V device it reduces the logic level margins since the TB6660 uses 5V logic levels?More ideas on the layout:Swap positions on J2 and C4 to get C4 close to U2. I think this will also help with the separation of the two grounds.Try and see if you can get C2 and C3 closer to their respective pins, possible in between the two rows of pins of the IC (but that would suck from a service perspective) or behind the back row of pins,right nextto the pins or at the bottom, or..... and use thinker traces. Their "low side" should be returned to PGND (if you split the grounds)You could move the sense resistors to the bottom which will "move" the resistors away from logic level stuff and avoid the added indctance of the vias but will give you a double sided load but I don't think this will go to mass production?Get C1 closer to pin 24 if possible and if you do split the ground C1 should be connected to SGND.You're making progress, keep it up!

author: Emil
author_rank: Regular Contributor
timestamp: December 15, 2015, 01:22:52 pm
content: Quote from: H.O on December 15, 2015, 11:24:49 amIt's a 3.3V device (STM32F030K6T6). The I/O pins are push-pull capable and configured as push-pull in my firmware. I have not actually measured to verify that they are functioning as push-pull.The TB6600 requires 2.0V for logic high and 0.8V for logic low so it's compatible with 3.3V logic. I don't think a 5V MCU would do anything to prevent false logic high(?), but should help preventing false logic low?

author: H.O
author_rank: Frequent Contributor
timestamp: December 15, 2015, 05:41:02 pm
content: Nah, you're probably right - if we're looking at the CLK line only when the circuit is "idle" (ie not stepping) but other signals may idle logic high which could make them more sensitive. I don't know or if it would affect the operation, I'm just thinking out loud. Either way I'd try to probe the signals both when the circuit works and when it doesn't and compare.

author: Emil
author_rank: Regular Contributor
timestamp: December 15, 2015, 08:55:40 pm
content: I was thinking about logic levels and made a change in the firmware. I'v been holding CLK low between steps, then pulling high, short delay and low again to step. I changed to keping it high between steps, then pulling low, short delay and high again for each step. Makes a huge difference, I have not observed any problems after making the change.Edit: Removed the cap from the CLK pin, still works.

author: Emil
author_rank: Regular Contributor
timestamp: December 21, 2015, 06:55:06 pm
content: I have designed a new board which I think will be much better than the previous one.I have seperated signal and power ground and moved all the decoupling caps right up to the pins. I have also added two 10uF ceramic caps at each Vcc pin. I have moved the current sense resistors away from the signal traces and widened all the signal traces.