Review of a small motor controller schematic.

I’m making a motor controller board for fun, and I’d like to increase the odds that it’ll work the first time by having someone knowledgeable look over it before I send the board off to be fabbed. The place I’m working at this summer has a scope, hot air for soldering, some nice soldering irons, and a nice magnifying glass, so I’ll be able to solder this thing up no problem. I’ve done some basic circuits in my circuits class last semester, but we never got past resistors, capacitors, and op-amps.

The micro-controller is a 3.3 volt LPC2101 ARM7 chip. It will be controlling 1 ~9 volt motor that stalls at 1 amp. If I remember right, the motor driver chip, a sn754410, is rated to 1 amp per channel and has 2 channels per chip, so I’m wiring both sets of control lines and outputs together to increase the output current so that I have a safety factor of 2, rather than 1. I can do that without problems, right?

I’m mostly worried that I’ve got the 3 regulators hooked up right, the crystal hooked up right, that I’ve got the LEDs set up with the correct resistors. It’s easier to work on debugging the rest of the circuit when the basics work. I based all that off of other schematics that I found online, but I’m more of a ME than an EE, so I don’t know if I did it perfectly the first time.

I included the 5 volt regulator to power some of the 5 volt peripherals I plan on connecting, like some nice 5 volt encoders I have. The controller says “5 volt tolerant digital IO” on the data sheet for some of the digital input pins. That means I can connect the 5 volt encoder up to one of the 5 volt tolerant pins without problems, right? Or would it be better to set up a voltage divider to step the voltage down to 3.3?

I plan on daisy chaining a number of these together, hence the two power connectors and two RJ45 connectors. They will then provide a similar role as Jaguars over CAN for FRC. I plan on implementing a bus kind of like I2C or CAN over the RJ45 connector where the bus is pulled high with a pull up resistor, and all the devices pull it down to change the bit low, and read the bit back, floating the line, to set it high. I think I’ve got that part set up well enough that I can deal with it later. It’ll be powered using a 9.6 volt NiCad battery, so my experience says it needs to survive a sustained input of up to 11 volts.

In case anyone is looking for cheap PCB boards that sacrifice turnaround time for price, looks pretty good. The biggest issue is the ~1 month turnaround time, but when you are a hobbyist for which time isn’t an issue, it’s a good way to go.

Thanks for your help!

MotorBoard.pdf (70.5 KB)
MotorBoard.layout.pdf (49.9 KB)

MotorBoard.pdf (70.5 KB)
MotorBoard.layout.pdf (49.9 KB)

First thing to add is the protection diodes across the motor leads as shown in the TI specsheet. These are normally a part of the power FETs in our current controllers so with the L293D they have to be added externally. Insure that the diodes are placed on the board such that large motor currents do not inject noise into the power supplies. Normally this is done with separate return traces just for the diodes and motors tied back to power input. Also keep in mind the maximum current specs of 1 amp when you choose your motors. Also check the requirements for the bypass caps on the LM1117. High output capacitance near the chip might be detrimental. The spec sheet shows a 22mmf. Something larger may cause current foldback when starting.
Let us know how it works.

The motor controller chip does not have current monitoring. It’s ashame to have all that CPU power and nothing for it to measure. You might want to consider the Freescale MC33887. It has current monitoring and some additional protections. How about some reverse polarity protection? A P or N channel FET can provide this with the cost of a little more resistance in the current path. If you do use the chip you chose, put a heat sink on it You can use the CAN buss but, allot of other motor controllers use RS485. You could duplicate the command structure. The problem with motor controllers is that there is a good chance of frying one when proto typing. You could separate the controller parts from the drive. Hope fully one board will survive instead of frying the whole thing . After you get it working the boards could be stacked.

The 33887 is a friend of mine, I agree with G.

I’m having a hard time reviewing it because not all the part numbers are shown. Capacitors are notorious for being a pain in the butt for reviews - their rated capacitance only tells you 20% of what you need to know. Also, more capacitance is more better, especially when you are prototyping.

In the world of current sharing, 1 + 1 hardly ever equals 2. One leg will end up taking slightly more of the load than the other, so 1+1 might equal 1.8 or 1.9. This uses a BJT (Darlington) output, which doesn’t share current as well as FETs do.

Personally, I’d bring them out separately and provide a simple way to common them together - what if you want to drive 2 smaller motors?

You should be sure to include easy ways to attach scope probes - Keystone makes a lot of test points just for this purpose.

Page 22/32 of indicates that you can handle up to 5.5V on an input - a standard margin. You should be fine with 5V inputs - the encoder will be fine. Driving 5V outputs is another issue.

Why not use CAN or I2C? No need to go custom here.

I guess I forgot to explicitly say one design choice. I’m trying to get the most bang out for the buck. I’d like to make ~10+ of these, and if they cost $35 per board in parts…

Sounds like a better chip than what I had chosen. It’s more expensive, but you are probably right that the current sensing is helpful. I should then be able to sense if the motor is hitting something, and do better diagnostics of how it’s working. And it’ll have a pretty good safety factor for the current that my motor will stall at. Your point about CPU power hits home too. I’ll probably implement a PID loop on each controller, along with higher level logic so that the master controller on the bus can do some pretty cool things.

Does anyone know how to solder a 20-hsop package that the MC33887 comes in? It has a large pad underneath it, which makes it harder. Do I put solder on the pad, place the chip on the pad, and then warm it up with the hot air until it melts? The naive way is to just apply lots of heat until everything is hot enough, and then it should be soldered on, though it might not work afterwords…

Interesting idea. Would standard .1" headers stand the 5 amp current of the motor? That will also help me make the board smaller when I add the MC33887. The MC33887 has a larger footprint than the DIP footprint of the other chip.

Part of the problem is that I was under the impression that all capacitors are created equal, so I thought I’d worry about that later. :rolleyes: Thanks for the heads up. I’ll work on figuring that out.

Upgrading to the MC33887 will fix that. Yet another reason to use the better controller.

Thanks! I feel better about reading 5 volt inputs now. I read the spec sheets, and at least for the old motor controller I was looking at, 3.3v registered as high, so “5V” outputs aren’t a problem.

I looked around online for about 2 weeks looking for an inexpensive micro-controller that would support CAN. I couldn’t find any ones that were below $10, if I remember correctly. Any suggestions? $10 x ~10+ adds up a lot faster than $2-3 x ~10+. And I’ll learn a lot implementing the bus :slight_smile:

Good to know. I’ll go back and reread the data sheet carefully.

Thanks for all the feedback Al, Eric, and Gdeaver! Now time to act on it and update the schematic, build a better parts list, and come back to do it again.

In hand soldering this part, if you are using the test board layout for heatsink, you can try adding a small pool of solder to the PCB pad and keep it hot with the iron at the edge of the chip placement. Make sure that the bottom of the chip is clean, you might add a little flux and then set it down on the hot PCB in the right position. Hold the chip in place and remove the iron.

OK, there is a whole lot to master here to get a good functioning controller. I might suggest that you buy one of these. It has every thing that you need to drive a motor except the Micro part.
Get you micro together and running on a carrier bread board or what ever. Then you can start the development work. As you noted surface mount power devices take a bit of effort to deal with the heat. That slug is very important to the performance of the device. Yes it has to be soldered to the board and additionally there should be many via’s to transfer the heat to the bottom PCB layer. Being a ME it might be more beneficial to focus on the drive and control algorithms. Let the EE’s do their job and make the boards.
Focus on the motor and the mechanical system. MOTION CONTROL. Today the micro controller is taking over the world. A ME today can not ignore the EE and control part of systems any more. You have to be able to walk the walk and talk the talk with the other members of a development team. This project is a good study. Note that you have chosen brushed motors. After you run the course on this you might what to focus on brushless motors. You will probably be seeing many of these in industry. There are many brushless development systems available. Though they cost a couple hundred dollars. Don’t forget to take a look at stepper motors also.

I’ve had good luck using solder paste for those sorts of things. If you have a beefy enough iron, you can melt the solder paste from the other side of the board through a via. Since the HSOP only has pins on two sides, it would probably be easier to just extend the middle pad and heat it on that side. If you have a hot air pencil, use that instead.

Capacitors are dirty stinking liars. If they say “1uF”, they mean “It will be 1uF, so long as you don’t do something silly like apply voltage to it or hit it with a frequency.” Take a look at a Y5V capacitor sometime - it dives to ~20% of its nominal capacitance when you bias it with half of its rated voltage.

Also, the effective series resistance can be just as important (or more important) as the effective capacitance.

I got in a small fight with the 33887 with regards to 5V tolerant. Don’t worry, you are fine. The 33887 can handle 3.3V inputs just fine, but it has very small pullups to 5V. The chip I was driving it with couldn’t handle its inputs being pulled above 4Vish, so I had to buffer it.

My suggestion was to use a standard bus protocol, rather than create something like a standard bus protocol.

I think you should contact one of the Luminary people on this forum and ask for 10 samples. I’m positive they’d love to help out a fellow FIRST community member. :smiley:

Using this suggestion, I think I’ve updated the schematic to use the 33887 correctly. If wiring the 3.3 volt I/O lines from the controller doesn’t work, I’ll grab a knife and cut the trace and add a buffer/transistor. I’ll update the layout once the rest of the schematic stops changing.

Thanks for pointing me to the page for the regulator again. It says that a 10µF tantalum capacitor is recommended and that Aluminum electrolytic types of 50µF or greater can also be used. I also took the time to read about the heat dissipation recommendations in the spec sheet this time around, and I’ll be updating my layout accordingly to add some more copper to dissipate heat when I do the layout for the 33887.

MotorBoard2.pdf (76 KB)

MotorBoard2.pdf (76 KB)

The difference in capacitor values stems from Tantalums being very close to labeled value and electrolytics being a little less precise and varying over their life. I like to use the bigger caps if I have room. I also cannot use tants for audio so it makes less different parts to buy for my work. The other thing is tants tend to short when they go bad or lightning happens. On a power supply that can be catastrophic. If you find that regulator oscillates, you may have to add a .01-.1 cap in parallel with the output cap near the regulator.

Actually, this is due to their differing ESR (effective series resistance) and ESL (effective series inductance). Ormore generally, their frequency responses. In general, an electrolytic will have a higher ESR than a tant of the nominal capacitance and tech level.

Different capacitor technologies have different applications. Electrolytics are typically for big, low frequency capacitance. Ceramics are typically for small, high frequency capacitance. Tants are somewhere between the two. However, technology has improved to the point where the three are bleeding into each other. Ceramics are getting to have higher capacitance densities, tants are getting more robust, etc.

A painfully large portion of my day job is to make sure the buggers still work right at frequency. I spent a year in the low-GHz range, where the parasitic elements are really beginning to dominate. An electrolytic registers as an inductor at those frequencies, and is therefore completely ineffective!

It is still important at lower frequencies, such as those found in class-D amplifiers (i.e. motor drivers). At your frequencies, electrolytics are beginning to really feel the effects of their ESR, but they aren’t dead yet. You therefore get to make the price/size trade-off.

As an example, the 24V boost supply uses ceramics, but the 5V buck supply uses electrolytics. ESR is much more important in a boost supply, because of the current surge in each cycle. Bulk capacitance is more important in a buck supply, because the inductor smoothes things out. Even though they are switching at roughly the same frequency, the boost supply’s current wave form has much richer harmonics and therefore needs capacitors capable of handling those higher frequency components.

In short, a capacitor is really defined by its total impedence at the frequency of interest. This is roughly proportional to: C/f + ESR + ESL*f

Knowing C alone only tells 1/4 of the story, though an EE more experienced than I can usually ballpark the rest.

Edit: Al just pointed out to me that you are using a linear, not a switcher. I thought this was for the 33887. If you look at page 8/23 of the regulators datasheet, you will find the following:

Figure 1 shows the basic hookup diagram for fixed-voltage
models. All models require an output capacitor for proper
operation, and for improving high-frequency load
regulation; a 10μF tantalum capacitor is recommended.
Aluminum electrolytic types of 50μF or greater can also be
used. A high-quality capacitor should be used to assure
that the ESR (Effective Series Resistance) is less than

This clearly shows that the discrepency in capacitance is because Tants typically have lower (better) ESR. If you can find a 10uF electroylitic with >.5Ω ESR, go for it.

I think I found all the parts and layed out everything again. I learned that I had the wrong model for the Ethernet connectors when I went and read the manual for the ones I’m looking at. :eek: I talked to my boss for the summer who does electronics, and he suggested the diode to keep the CPU running across quick spikes.

Hopefully the BOM that I made is useful. I can update it if needed to a different format.

Thanks for all the help so far!

MotorBoard3.pdf (79 KB)
bom.txt (2.96 KB)
MotorBoard3.layout.pdf (60.9 KB)
HbridgeExpansion3.layout.pdf (38.5 KB)

MotorBoard3.pdf (79 KB)
bom.txt (2.96 KB)
MotorBoard3.layout.pdf (60.9 KB)
HbridgeExpansion3.layout.pdf (38.5 KB)