LMD18201

Here is the datasheet on this H-Bridge controller.

http://www.national.com/ds/LM/LMD18201.pdf

According the the logic truth table and the test circuit diagram. Does “sink” mean that it is connected to +v and “source” mean that it is connected to Ground?

Look at figure 8. That is basically the way you hook it up.

source, sink notation - Source is where the current comes from, like the source of a river. Sink is where the “used up” current goes after it passed through the load.

But an H-Bridge can swap source and sink around, hence the notation in figures 7 and 8 as out1 and out2.

If you were playing with a battery with a light bulb across it, in EE network theory if you were to say the current is +3 amps, the current flow is from plus to negative. If you were to say it is -3 amps, the current flow is from negative to plus.

Back in the days of Benjamin Franklin when they were coming up with the ideas about current flow, it was theorized that current went from plus to minus (anode to cathod). He had a 50/50 guess, and guessed wrong.

Physically, the electron flow really goes from negative to positive. Backwards from the way a network theorist represents it.

But all that is getting a little off topic but I though it would be neat to have the history lesson.

Just view it as a network theorist. Source provides current, sink sends it away, and an H-Bridge can swap source and sink around. See figure 7, 8.

Ed

Thanks, that helped alot =D

Now, according to the datasheet, pin 8(signal ground) is connected to ground? If I were to use the Robot controller as my PWM generator. the Signal Ground pin needs to be grounded to the MCU?

I wonder if the outputs(source & sink) pulses… or is it continous current flow.

Pins 7 and 8 you should ground. If you had a long cable run from controller to the motor then you could use the current sense but you should be able to safely ignore that for now. Just ground 7 and 8.

Yes I think that the outputs will be pulsing. They will pulse alternating between the configuration needed and open circuit.

But here is where it gets wierd. ‘Classical’ PWM in the rest of the EE world generally means a signal with some duty cycle, between 0 and 100%.

RC PWM is a little different. It is a 2ms period wave that has an on time of 1 to 2 ms. 1.5ms is neutral or centered and correlates to digital PWM value of 127 in an Robot Controller.

I googled around and found this. You may find it interesting.

http://homepages.which.net/~paul.hills/Circuits/SpeedAndDir/SpeedAndDir.html

http://homepages.which.net/~paul.hills/

I need to put this on a scope sometime and play with it. Playing with signals really helps reinforce these concepts. Offhand it looks like that there may need to be a translation between RC PWM and what you need. I may get a chance to do that this week. We have had 2 robots out for weeks on display and teaching and are just getting them back.

BTW, A Victor has circuits added to greatly beef up the current handling capability.

This is a great exercise for students to go through. It really gives you an appreciation for why commercial items cost what they do.

Ed

When connecting the motor controler to a the micro outputs it can be a good idea to put some 10k resistors in line to protect against several failure modes. You’ll have to set up the hardware regesters on the robot controler to generate a duty cycle PWM output.

10k to shut off the motor controller?

:ahh: I just noticed something…

If I had the Direction Pin(3) hooked up the the PWM signal, and have the PWM Pin(5) hooked onto logic high, this way I use only PWM for direction and magnitude control. according to the Logic chart, I would be switching from (Source 1, Sink 2) to (Sink1 , Source 2) back and forth. Isn’t that bad for the motor controller? I would be switching high currents at high frequencies…:yikes:

The 10k resistors between the micro and the controller is not a problem. The input impedance of the controller is very high, therefore the nominal current through the resistor is negligible, therefore the nominal voltage drop across the resistor is negligible.

Any spikes/transients are essentially isolated by the 10k resistor. The is very much desired in order to protect the micro.

High frequencies and high currents are basically relative matters.

As for the switching waveforms I think (I’ll investigate more) that is essentially correct.

Ed

Above is the link to the datasheet of a CLD (Current limiting diode)

Does the REGULATOR(1) DYNAMIC KNEE LIMITING TEMPERATURE
CURRENT represent the output current? what about the input current? or ddoes that matter? Is there no restriction on the Input current? The data sheet doesnt say much about it.

OK,
Reading the datasheet, there are two ways to control this device depending on the input PWM signal. If the PWM is direction encoded where a 50% duty cycle represents zero speed then you tie the speed PWM pin to logic high and use the direction PWM for your input. (see the applications section of the data sheet.) The Source 1 & 2 and Sink 1 & 2 refer to the output pairs. Note in the block diagram that the left output pair is labeled Out 1 and the right is labeled Out 2. Now if you look at the truth table, the “Active Output Drivers” refer to which FET in which output is conducting. “Source 1” referes to the upper transistor in the left side of the block diagram and “Sink 2” refers to the lower transistor in the right side of the block. “Source” generally means a connection to the positive power while “sink” refers to a connection to ground. Again in the applications section, the manufacturer refers to Pin 7 and “ground/sense” so that a user may insert a 0.1 ohm resistor at this pin and measure a voltage that is ground referenced and proportional to the current flowing through this resistor. In addition to normal speed control, this device also allows braking but in addition to turning on both “sink” transistors ( a normal way to brake), it allows a state where both “source” transistors can be turned on instead. This would allow some applications that may not be motor control. Since a motor is connected across the two outputs, the motor will turn in one direction when sink 1 and source 2 are turned on. It will reverse direction when the sink 2 and source 1 are turned on and it will brake when either the two source or two sink transistors are turned on. You need to look closely at the PWM data in this sheet to determine whether it meets your ability to generate a readable encoded PWM signal. Please note that even small motors have a very large start current. A motor that is not moving is by definition in stall and will draw stall current when starting. Even the little Johnson motors can draw 20-30 amps when starting, albeit for a very short time.

cool, So far I’ve designed everything onto the ExpressPCB program. Now comes the issue with current regulation on the LMD18201. I looked into Current Limiting Diodes for current regulation of about 13mA for the LMD18201, but the data sheets on the CLDs don’t say what the limit input current is. That worries me because I don’t know if thats even relevant. Are there other ways to supply low currents? I can’t exceed 15mA because that could cause damage to the Chip. :confused:

???
The chip is rated for an output of 3 amps continuous and 6 amps peak. You should only have to fuse/breaker this for 6 amps to protect the circuitry.

There is another chip that is popular for small brushed DC motors, the TI SN754410. Here is an app note that may help.http://kronosrobotics.com/an101/DAN101.shtml
And
http://kronosrobotics.com/an101/AAN101.shtml
The big mother of integrated motor controlers is the ST MIcro VNH2SP30-E. Here is the data sheet.
http://www.st.com/stonline/products/literature/ds/10832/vnh2sp30.pdf
This company sells some motor controller board products.
http://www.pololu.com/products/elec.html#motocon
Might help.

Nope, no problem at all.

At high frequencies (over a few hundred Hz - the 18201 is rated up to a few tens of kHz) the motor sees this as an average voltage, thus effecting motor speed control.

In other words, if you have full forward 75% of the time, and full reverse 25% of the time, the motor is seeing (75 - 25 =) 50% forward. No harm to the motor or the chip.

However, converting R/C PWM to the EE’s PWM (which this chip needs), is easy but needs to be done. See Here for one example, or get an NE544N or some other servo amplifier.

Don

No way! You mean the PWM signals from our robot controllers cant work directly with the LMD18201 chip? The spec sheet on page 6 right under the Logic Truth Table states the types of PWM signals. I am thinking that our robot controller is the Simple, locked anti-Phase PWM type. As apposed to the Sign/magnitude PWM type. :eek:

it says that I can attache the PWM pin to logic High, and put in my PWM signal into the Direction pin. this way I only need a single PWM signal to indicate direction and magnitude.

Yes Way !!!

That is basically what I was talking about in my post about classical PWM versus RC PWM.

RC PWM is its own wierd beast so you have to convert it. Annoying eh ?

Ed

Thats why a microcontroller is needed. It can time the incoming hobby type PWM pulse and set up the hardware Fixed requency variable duty PWM. The micro also can monitor the status and current draw. Also, the micro could get it’s commands by a SPI, I2c or async serial port. Take it one step further and add a PID control to the speed controller. The micro could also red sensors for velocity ( encoder or gear tooth sensor), a POT or non-contact absolute position sensor. To design an inteligent motor controler gets a little complicated.

General,
As I wrote above you need to examine the specifications for the devices you are using to insure compatability. You might want to check out these sites where there are kits for a PWM convertor and motor controller using the chip we are discussing.
http://www.superdroidrobots.com/shop/item.asp?itemid=603
http://www.superdroidrobots.com/shop/item.asp?itemid=583
I have not done business with this site but came across it when doing research for this thread.

I tested the PWM outputs on the robot controler… I have the MINI RC with me, with 8 PWM outs each programmed from 0 - 255. Then I brought out my RC servos, 3 wires and plugged it into the Mini RC PWM outs. They responded accordingly, setting the servo arms at various locations. Since servos use RC PWMs to determine positions, wouldnt the PWM on the robot controller work as well?

On the data sheet, it says that a 50% duty cycle is zero or neutral, that would be 1.5ms pulse. I do believe our Robot controllers work within the 1 - 2ms pulse width correct?

This page contains a nice picture showing the RC PWM and the regular PWM (right side of method 3), could someone tell me which PWM type is in our robot controllers? The blue one or the red one?

http://www.superdroidrobots.com/product_info/RC.htm

Get a pencil and paper and draw these waveforms:

Standard PWM waveforms, for simplicities sake, set the period to 1 ms
a) a 50% duty cycle square wave - this is the ‘neutral’ position, it is called square because it looks square
b) 90% on/ 10% off wave,
c) 10% on/ 90% off wave,

RC PWM waveforms.
If I remember right, the pulses can come as infrequently as 20 ms.
The width of the pulse varies between 1 to 2 ms, 1.5 ms being neutral.

So if you draw a nominal neutral RC PWM wave form, it could (but doesn’t have to look exactly like this) look like a repeating waveform that is 1.5 ms on, 18.5 ms off. ( I may have my on/off logic sense inverted here so just flip it over)

That is WAY different than the neutral 50% square wave in (a) above.

Ed

PS - I just went and looked at the links for the waveform. If you read the paragraph above the waveforms it talks about the 20 ms. THe graph doesn’t have the interpulse interval marked out. THe graph is a little misleading because it looks square’ish, but I can assure you that it isn’t. Ask around and see if you can find someone with an oscilloscope and see if you can get them to help you ‘see’ these signals. Seeing is believing.

famous saying in engineering is “all you gotta do is…” then you run into reality.