View Full Version : LMD18201
Generalx5
14-07-2007, 21:45
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
Generalx5
15-07-2007, 02:25
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.
Generalx5
15-07-2007, 16:57
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?
Generalx5
15-07-2007, 17:17
: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
Generalx5
16-07-2007, 02:31
http://www.centralsemi.com/pdf/cclm0035-5750.pdf
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.
Al Skierkiewicz
16-07-2007, 13:34
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.
Generalx5
18-07-2007, 00:25
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:
Al Skierkiewicz
18-07-2007, 07:38
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.
DonRotolo
18-07-2007, 17:46
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:
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 (http://www.bobblick.com/techref/projects/sv2pwm/sv2pwm.html) for one example, or get an NE544N or some other servo amplifier.
Don
Generalx5
19-07-2007, 02:07
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.
Al Skierkiewicz
19-07-2007, 08:02
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.
Generalx5
19-07-2007, 18:56
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.
Generalx5
21-07-2007, 02:17
Yeap, but I still dont understand why an RC servo would work with our Robot Controllers. If RC Servos use RC PWM, then our classic PWM shouldnt be able to drive those servos. Whats up?
Another thing im not sure of is, under the electrical characteristics in the data sheet, when it states: Logic High Input Current ---------- 10micro amps(max) under the limts columb.
Does this figure represent the maximum allowed current to be fed on that pin? or the maximum amount of current that specific pin will draw wil be no greater than 10 microamps?
When you go to EE school, you actually spend at least one whole semester studying signals.
For this exercise we need to nail down 2 concepts. The first is the concept of periodic waveform, it's period, waveform, etc. And the average or RMS value over that period.
RC Servos and Motors, and our FRC/VEX equipment all use the RC PWM scheme of control. It doesn't work on RMS values. Remember the period can be 20 ms but only about 2ms of that signal has our useful control information.
Standard PWM is essentially RMS value. If you have had calculus you will cover a concept called integration that calculates the area under the curve. You could actually perform an RC lowpass function on it and create a dc voltage that corresponds to the duty cycle. The RC lowpass is actually implements an integral and performs this RMS average.
You can see a sample of the circuit and the waveforms here : http://controls.ame.nd.edu/microcontroller/main/node41.html
Modern logic and analog chips are usually implemented with CMOS gates (sometime JFET gates, rarely bipolar junctions) and have a very high input impedance which is what you are talking about here. The spec sheet is telling you the maximum current the pin will draw. What that means here is that you don't need a diesel engine to drive this gate. It can greatly simplify the nature of the signal source needed to drive this input.
You are not going to have any trouble driving this pin. You do need a way to translate the RC PWM to standard PWM.
I suspect this goofy RC PWM waveform had something to do with hobby RC systems decades ago and how they multiplexed multiple control channels onto a single RF carrier for broadcast.
You probably have 2 ways to solve the problem. The first would be some sort of creative analog circuit. The second would be to take a small processor with a fast interrupt to sample the pin and synthetically create a standard PWM output. Either of these is a very educational project if you have never done it before.
Here is a useful bit if information: I think I referenced the paul.hills website before, but here is a specific reference translating the RC PWM.
http://homepages.which.net/~paul.hills/Circuits/RxDecoder/RxDecoder.html
I'm back and editing this post I did previously.
Above the Paul Hills link shows several ways to decode an RC PWM signal. One method gives you an analog output, the other a digital word.
Ok, so lets say you do the analog output thing. Now you need to create the standard PWM. So you need a voltage controlled PWM generator.
Back to Paul Hills at this link: http://homepages.which.net/~paul.hills/Circuits/PwmGenerators/PwmGenerators.html
Between these two pages, you have a RC PWM to voltage decoder and a voltage to standard PWM encoder.
If you nail these two pages then you will be 'the man'. There is quite a bit of material there. If you could get an inexpensive scope and a breadboard and a pile of parts you would be on the way.
Ed
Al Skierkiewicz
23-07-2007, 00:01
General,
What is critical to the discussion is the actual signals we are discussing. In standard RC PWM the pulses vary from 1msec to 2msec but do not repeat for up to 30 msec (repetition rate) That makes the RC PWM about 50 Hz rep rate. On the website you and I have been referencing, the PWM signal for the LMD is required to be at least 1kHz rep rate and have no pause between signals. That is why the interface is reguired. Although PWM signals can be decoded by filtering as Ed has pointed out, most of these devices use a clock circuit and compare the incoming pusle against the clock to obtain the best accuracy. The comparison will start at the beginning of the pulse and count clock cycles until the pulse ends. A 10kHz clock would then transistion 10 cycles for a 1 msec pulse and 15 cycles for 1.5msec pulse width. The clock comparator is actually much higher in frequency but you get the idea.
The max currents you refer to is the actual maximum current that can be drawn by the input when the input signal is 12 volts peak to peak. It is a measurement that indicates how many devices can be connected across the same logic output. If for instance the logic feeding the LMD is only capable of sourcing 20 micoramps then that device can only feed two LMD devices reliably.
The RC and Edu controllers both output RC PWM standards and that is why they talk directly to servos. Your reference page does hint at the repsonse of a servo to incoming PWM. The waveforms you refer to are the limits of the RC PWM. A 1.5msec pulse is interpreted by the servo as zero, a 1 msec as full reverse and a 2 msec is full forward.
DonRotolo
23-07-2007, 20:05
Yeap, but I still dont understand why an RC servo would work with our Robot Controllers. If RC Servos use RC PWM, then our classic PWM shouldnt be able to drive those servos. Whats up?
Because the Robot Controller doesn't output classical PWM (i.e., a square wave) - it puts out R/C PWM, or a 1-2 mSec pulse at a 40 Hz rate.
Don
Generalx5
24-07-2007, 03:54
Thats a real pain in the butt...the PWM sigal types. Anyone know a simple decoder I can easilly make on a PCB board? Eds link has something thats too complicated. I just need a basic RC PWM to Standard PWM converter, a small pakage would be nice. What does the Victors use in their PWM to MOSFET control? How do they get the RC PWM to pulsed MOSFETS? I get the whole H bridge thing, but I don't get how they cut the 20 -30ms off times of the PWM signal from the motors. I believe the motors are controlled in a way like the Standard PWM signals?
Better yet, is there a code for the RC that converts RC PWM to Standard PWM, by limiting the off times.....etc.
Al Skierkiewicz
24-07-2007, 07:45
General,
(what is your name really?) The Victor handles a conversion internally, taking the RC PWM signal and decoding direction and magnitude and then further conditioning to make a PWM output at 150Hz. To add more to the equation, IFI has added to the conversion a scaling function such that the 127 step encoded RC PWM (255 less the dead band and less the direction) and makes 93 steps of output PWM in each direction. There is some info on the IFI site if you look for it. Check the documents and forum questions.
So I know your next question, 'why so many different signals?'. Well this is a complex answer. A lot has to do with price and available technology when the system was first developed, and backward compatability. Pre 2000, FIRST robots were still using hobby motor controllers (Tekins, sp?). So the logical next step was to develop a controller that would talk to those devices. They were underdesigned for the motors and stress we need from a robot controller so IFI developed the Victor 883. Those controllers output a PWM signal at 2kHz as I remember. The high switching frequency was fine for most operation but just didn't give optimal low speed control for the motors that are supplied in our KOP. The output also caused problems at near full speed conditions as well. So the 884 was developed which lowered the output switching frequency and made other improvements. Thanks to IFI for their dedication to responding to a very limited market.
As I pointed out earlier, there is a product on the website you and I both have quoted that will make the conversion. It is $66 but that sounds cheap for what it does.
Back in the Creataceous Era when I was a young person I always wanted to design everything myself so I could avoid spending all the money that I didn't have.
It took me a long time to get it through my head that I can buy stuff cheaper and easier and I can design/build it. I would love to design and build a car engine from a block of metal, but I can buy one cheaper and easier.
But now (when I'm not working my day job as a designer) I still spend a lot of time designing and building (or rather helping students do that) robots and stuff.
What you will find is that it is really useful to learn about the things one the links I gave above. Any of that material that you can absorb will come back and help you later, somewhere, somehow, if you are interested enough.
In practice, especially at larger volumes, circuits are developed like the ones in the links above, using parts from supply houses, and then the circuit is condensed into a single ic at a fab house for commercial use.
I wish you had access to an O'scope, a signal generator, a breadboard, a small motor, and some parts. You could have a blast on a benchtop working out all these exercises and really wrap your head around these issues. And have a lot of fun even though you may or may not really complete a motor controller. Being able to 'see' your signals and workout prototypes on a breadboard will tremendously help you gain knowledge and skills.
( Back "in the day" I once built a computer terminal (pre-PC) and a modem. The modem had an acoustic coupler made from a John Deere tractor radiator hose and was encased in a wooden box made from leftover beehive parts. )
If you designed a PWM system from scratch if may look very different from what it does today. But, the signal formats were set years ago to accommodate issues of that day that are probably no longer in existence. So we are stuck with backward compatibility issues.
Modern phone systems have a similar problem. Central Office telephone systems have to be compatible with signaling systems that go back 100 years. This gives phone engineers similar grief.
I hope everyone reading this thread gains an appreciation for how much value are in the Victor speed controllers. There really is a lot more to it than it appears.
If all that answers were really simple, then we wouldn't need the engineers would we?
Ed
sciguy125
24-07-2007, 11:00
Anyone know a simple decoder I can easilly make on a PCB board? Eds link has something thats too complicated. I just need a basic RC PWM to Standard PWM converter, a small pakage would be nice.
I was playing with this about a year and a half ago. I made a speed controller based on an L298 and 12F683 (one of the 8 pin PICs). The PIC is essentially being used as an RC PWM to traditional PWM converter (two outputs to control an H-bridge). It works, but it has some software bugs. (the only one I can recall off the top of my head is that if it loses the input signal, it defaults to full speed forward)
The basics of what it does:
1. When you get the rising edge of the pulse, start a timer.
2. Stop the timer on the falling edge.
3. Do some checks to make sure that it's a valid signal.
4. If it's 1.5ms, set outputs to 0. If it's >1.5ms, calculate the appropriate duty cycle and set outputs for forward. If <1.5ms, calculate appropriate duty cycle and set outputs for reverse.
5. Wait for next pulse.
I've attached the code for it. I have to warn you though, the bugs aren't documented and the comments aren't the clearest or most complete. Depending on what you're trying to do, you may or may not want to fix the bugs. Actually, you know what? I would advise that you don't actually use it. Instead, you could use it as a reference if you decide that you want to make your own converter. It's been so long that I don't even remember what all the code does. If you're just looking for a toy though, you should be able to just load the code into an appropriate PIC and plug it all in.
Someone, Von Neumann I think, said that "hardware and software are equivalent"
I like the processor approach for this low quantity type project.
You should fire off a second timer/counter to measure elapsed time. It can periodically increment a timer variable.
Every time you get a pulse in you clear the timer. If say 50ms goes by without a start pulse, then you will know that because the timer variable is increasing. Then you can take your synthetic pwm output to zero, neutral.
So all together here you have 2 timers, to make things safe.
Ed
Generalx5
11-08-2007, 04:23
I found one!
http://www.bobblick.com/techref/projects/sv2pwm/sv2pwm.html
Bob has a really nice Decoder, I've built two so far with only one working. after a few hours it died too. I suspect that it was due to a horrable soldering job.... Making a new one with SMT caps tomorrow, and I've also changed my double sided board to a 95% single sided board design to reduce faluty soldering jobs. I've also stopped using the LMD18201 as BOB'S design works directly with an H Bridge. LMD18201's costs about 15 dollars:yikes:
I'll report back with some results in a couple of days.
It's good to see that you are making progress. From the posting time it looks like you are burning the midnight oil. Gittin er done. congrats !
Ed
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.