Showing posts with label DC motor suppression. Show all posts
Showing posts with label DC motor suppression. Show all posts

Sunday 30 November 2008

Suppression

Some time ago I blogged that the GM3 gearmotor generates a lot of RFI, which was interfering with TV reception in our house and corrupting I2C comms on HydraRaptor. I designed a simple suppressor that fixed the problem, details here.





Recently Zach Smith designed a nice little PCB version of it and produced a kit. He gave me a sample to test. Here it is installed on a GM3: -



To test it I wired a GM3 with no suppressor to a bench power supply with a pair of jumper cables about 30cm long. I viewed the noise on both motor terminals with a scope grounded at the PSU. This is what it looks like in the time domain.



It is massively noisy producing about 50V pk-pk. And here is the spectrum in the frequency domain: -



Although this is the 12V version of the motor it looks similar to the 6V version I tested before.

I repeated the same test with the suppressor fitted, measuring the voltage at the terminals of the suppressor.



The noise is vastly reduced, now only about 700mV pk-pk.



The spectrum is reduced drastically as well: -



Compared to my Vero board version, tested under the same conditions, it seems to work a bit better, but that could be down to variations between motors.

So the kit version works well and also gives convenient screw terminals or 0.1" header robustly anchored to the motor.

Saturday 13 October 2007

GM3 motor suppressor

I have also been asked for more details on my motor suppression circuit that I first blogged in dc-to-daylight, so here goes :-



The Solarbotics GM3 generates large amounts of RF noise from 20MHz up to at least the TV band, which is 470- 850MHz in the UK. I know this because I can see the 20 MHz on my scope and it was also affecting our TV reception.

This is the circuit I used :-



The 1nF capacitors were axial ceramics and the 10nF was a radial ceramic, mainly because that is what I had to hand. I don't know the spec of the ferrite beads because I salvaged them from an old disc drive. Here is what they look like though :-



They should be a low Q type rated for at least 1A. The current rating is not so much about how much current they can carry but about the point where the magnetic field saturates the ferrite and the inductance disappears.

We want them to have a high impedance from 20 MHz to 800 MHz. I don't have much knowledge in this area but think this is quite a big ask for a ferrite and that I fell lucky with these. To get more impedance at the low frequency end it is normal to increase the number of turns to increase the inductance which is proportional to their square. The problem with that is that it increases the capacitance, reducing the attenuation at the high frequency end.

These beads are a good compromise: they have nearly a whole turn compared to a straight through bead which is half a turn, hence four times the inductance, but the wires maintain 0.1" separation so minimizing the capacitance.

The first two 1nF capacitors are soldered to the motor case. This is easier than you might imagine because steel is such a poor conductor of heat compared to copper, although it has to be said I am using a 50W temperature controller soldering iron. I cleaned the area first with a PCB cleaning block.



This is the rest of the circuit before it was soldered on top of the two capacitor leads. Spot my mistake!



Ignore the back emf diode, it is specific to my controller and should really be part of it. I used twin screened cable with the braid grounded at the controller end and left unconnected at the filter end.

Tuesday 18 September 2007

DC to daylight

Well my machine is not going to pass any EMC regulations, my wife is complaining it is interfering with the digital TV downstairs! The amount of noise coming from the little GM3 gear motor is astonishing. This is the motor switching waveform on the top trace and the other lead of the motor which is at 12V on the bottom trace. The vertical scale is 20V and the timebase 0.4mS.



In this instance the motor is being powered for about 300 uS every 1.3 mS when its negative lead is driven to ground. When the motor is switched off the voltage shoots up above 12V due to the back emf. It gets capped at 48V by the over voltage protection of the BTS134 low side switch that I am using to drive it. It then has a damped oscillation at about 6KHz before settling down to 12V for the remainder of the off period. This will be due to the inductance of the motor windings resonating with the 100nF capacitor I put across the motor terminals. Although it looks violent it is actually the smaller burst of noise on the right which is causing all the problems.

Here is a close up of a similar burst of noise with a timebase of 10uS.



This is around 20MHz and you can see it gets onto the 12V rail. It is caused by the sparks at the motor brushes. Sparks emit RF energy from DC to daylight as I was once told by an EMC expert. My guess is that 20MHz is the resonant frequency of the motor windings with their own stray capacitance when they are momentarily disconnected from my suppression capacitor by the commutator.

One nasty aspect of this sort of noise is that it tends to get less as the motor brushes wear in and then get worse again as they start to wear out. I remember a project where a small motor was mounted close to a PIC. The PIC would frequently crash when the device was first run, but it would soon become impossible to recreate the problem until a new motor was fitted. I read that it is a good idea to "break in" DC motors by running them without any load at a low voltage for a few hours to allow the brushes to become a good fit to the commutator. Too late for mine though!

This is what the noise that gets onto the I²C lines looks like :-



A tough challenge then to make I²C reliable in this environment!

I began by stopping the comms from locking up so that I could add a retry scheme. To do that I had to put timeouts in all the points where I was waiting for the master controller to do something. When it times out I have to reset the controller and do one manual clock pulse to free up the slave before delaying 100uS and then re-enabling the controller. That stopped the comms locking up but did nothing to preserve data integrity. E.g., while I was sending motor commands and reading the temperature the heater came on of its own accord, not good!

The next thing I did was add an 8 bit CRC checksum to the end of each message so that I can detect when a message has been corrupted. 8 bits should be sufficient because the messages are only a few bytes long, i.e. less than 28 bits, and the bursts of noise are only a few bits long, i.e. less than 8. I used a table driven method so the software overhead is just a 256 byte table, one XOR and a table lookup.

I also added a sequence flag to the top bit of the command byte. This alternates when a new command is sent but does not on a retry. This enables the slave to ignore retried commands resent by the master because the previous reply from the slave has been corrupted.

The result seems to be robust even with the massive amount of noise present but I don't like to paper over hardware problems with software. To make systems like this completely reliable I aim to get no retries in normal operation and only rely on the protocol to handle exceptional events. The root cause is the noise from the motor so I decided to have a go at tackling that.

I took a closer look at the noise on the motor leads without any suppression :-



It looks pretty random and different on each wire which is to be expected because the two brushes spark independently. Here is a spectrum analysis :-



It peaks at 23 MHz but must in fact go all the way up to over 600 MHz to affect the television. There is also a lot of noise on the can. My first attempts to suppress it were to put a 100nF disc ceramic across the terminals and earth the can. That did not work well at all. I found that a more modern 1nF capacitor across the terminals worked better and leaving the can floating was better than grounding it because that just put noise on the ground rail. The old and new capacitors are shown below :-



It is no surprise the me that the smaller one works better at higher frequencies because it is so much physically smaller its inductance will be less. It is also much kinder to the MOSFET driving it!

Doing a bit of research I found that it is common practice to connect a capacitor from each terminal to the can, so I added two more 1nF caps forming a triangle. That worked well as it got the retries on the I2C bus down to zero, and also stopped the TV interference. I could have stopped there but there was still plenty of noise visible on the scope. I added two small ferrite bead inductors that I salvaged from a very old disc drive, one in series with each lead, and put a small 10nF ceramic across the cable. That made a fantastic filter leaving no noise visible on the scope.




I also decided to add a back emf clamping diode rather than rely on the over voltage protection of the MOSFET. 48V across a 5V motor is a bit much after all and is high enough to give an electric shock.

Here is the resulting filter mounted on Vero board and fitted to the motor :-



The 1nF cap across the motor is hidden by it and the other two are underneath :-



And here is the new switching waveform with pretty much all overshoot, ringing and noise eliminated :-



If only all EMC problems were that easy!