This course outline is for the student to take the mundane learning from the books about transistor class of operations, and RC networks, impedance matching, and capacitive coupling, to a robust hands on, logic thinking purposefully design of system and subsystems at the component level, to achieve results that are only read about in the books, where they learn hands on about the pitfall in designing stages and coupling them together, and how to work around those pitfalls by using the book knowledge of how components work together to actually putting them together to get desired results.
As the saying goes, "necessity is the mother of all inventions",
So it is in this, when you find it necessary to come up with a network to eliminate distorting a signal feeding into it, you grab a hold of that book page about impedance matching and finally low impedance and high impedance stuff you read about starts to make sense, OH now I see what they mean about making the input impedance higher than the signal source output impedance, it clicks in now.
So this is what they mean about how an emitter follower is used for impedance matching a high impedance to a low impedance output. It makes sense now. When you are faced with design challenges hands on, thats when all those things you read about starts to ring a bell.
You always wondered "why you need to learn about these transistor amp. class of operations, big deal," yeh, well when your faced with a design challenge of what works best for this application at this stage of design, youll be thankfull you learned about those diff. class of operations. Youll appreciate how you learned about analog and switching designs for transistors.
And those boring RC networks you read about, again when you need a specific timing signal to make something work properly, youll appreciate learning what a RC netwoprk is good for.
This course is to spark interest in the mundane book learning, of circuit design, by giving an oppurtunity for the student to get right down, past those little black boxes and to get into the component level itself, and to really appreciate the book learning at a hands on level.
While others are using arduinos, and micro controlers to build a servo driver, you can impress your professor, by showing how you can design a servo motor driver at the transistor level.
By the time you finish this course, you should be able to know exactly how to design each stage of this driver, using design formulas, and logic thinking, you should also be able to predict what your signals should look like on a oscilloscope, at each stage of the design, and why the signals look the way they do, and for what purpose they are designed to do.
Then if you want to get creative, for extra credit, you can logically design an input circuit that uses two push button switchs to make the servo turn left and right, as long as the switchs are active. (That requires aquiring a knowledge of capacitor timing circuits) You can also design light detector circuits to add on to this, the possibiities are up to how well you can first understand this basic system of circuits.
Lets begin:
An oscilloscope is definately needed.
You can purchase for under $100 those PC scopes, any kind of a DSO will do, analog scope will work to, it just will be more challenging to watch the waveforms at the low frequencies required.
First purchase a small servo motor, and usually it will show the driver specifications to make the motor work properly. The motor I have specs out as,(PWM period 20mS. with 1-2mS. duty cycle) (4-6 volts).
Ok what does that mean, the motor is looking for a pulse between 1-2mS, every 20mS, in order for it to run, the 20mS is equal to (50Hz, as you take the inverse of 20mS).
So in order to get this kind of a waveform we need to design a PWM circuit.
Those stage terms are my own, lables.
So here is what were designing, we start out by designing a pulse generator, to satisfy the motor specs as far as the period and pulse width needed to drive the motor circuit.
The pulse generator is designed to have a 2mS pulse every 20mS. since the maximum pulse width is given in the specs to be around 2mS. The exact values are not going to be attained due to component variations without any tweaking, however if we get our values close enough the motor circuit will still work fine enough, for our purposes.
NOTE:
I am designing this as I go along, so I can verify this will be a working circuit when this course is finished.
-----------------------------------------------------------------------------------------------------------------
Lets start with a pulse generator:
Schematic shown below,
Here are the design formulas for designing a pulse generator:
I need a pulse generator to produce a 2mS pulse every 20mS.
T=period of cycle. (20mS)
t2= +pulse =(2mS)
t1= negative pulse = (T - t2)= (20mS - 2mS)= 18mS
The output pulse transistor is Q2.
When Q1 is at cutoff, then its collector goes high, thransistor Q2 switchs on and the output is a negative pulse.
Q1 is turned off during the charging up of the cap. C2 through R3.
The design formulas for determining the base resistor values is as such:
first choose a value for the capacitors, I chose 1uF, you can choose any value you want within reason of the frequency required.
Now use this formula to solve for a resistor value:
R=(t / (0.69 * C))
In the example shown:
R3 = (t1 / (0.69 * C2)) therefor R3 = ( 18mS / (0.69 * 1uF)) ~= 26086 ohms, choose 27K ohms.
R4 = (t2 / (0.69 * C1)) which is R4 =(2mS / (0.69 * 1uF)) ~= 2898 choose 2.7K ohms.
R1 = (R3 / 10) = 2.7K ohms
R2 = R2 =(R4 / 5)= 560 ohms
The diode arrangement is used to square up the output waveform. R2's values are the parallel combination of (R4 / 10) .
always choose the closest resistor values available.
Now this should run at a Vcc value from 4 - 12 volts DC.
build this and using an oscilloscope, check to see how close you have a positive pulse of around 2mS wide, every 20mS.
You should be close enough to make it work, if not, than always tweak values to get your optimum desired performance.
Again you may have to tweak the values to get an appropriate signal output.
Here I interject, study the schematic, and use hands on approach to experiment, with this circuit building block, until you are able to use the design formulas given above to design any type of pulse generator, with any kind of period and pulse width.
Once you are satisfied with that, then it's time to move on to the next stage.
Alright the next stage is going to be an RC network, it's actually a low pass filter, however it is used to modify the pulse wave into a ramp wave, so as to produce a sort of a wedge signal.
the design goes as follows:
we need to make this stage with an input impedance high enough to have very little affect on the pulse generator stage that feeds into it. so lets investigate the pulse generator output impedance for a moment.
we have two 560 ohm resistors in parrallel which is around 280 ohms. A good rule of thumb is to make the impedance that a source is working into to be around 10 times or more larger than the impedance of the signal source itself.
so 10 times 280 ohms would be 2.8K ohms. I'll choose a 3K ohm resistor. (closest standard value)
This will be the input impedance (Zin) looking into the next network were going to design.
So this next stage is an RC filter, (waveshaping network, ramp wave, integrator). it looks like this:
R6 and C3 form the RC lowpass filter, that is designed to work as an integrator, to produce a ramp wave.
We already established the Zin should use a 3K ohm resistor, so lets put that in as R5.
Now we need to use logic thinking, as an engineer you will need to make choices on component values and such based on what your trying to achieve, this case we need to think of what kind of a ramp wave are we looking for, if we just throw any value capacitor in there, we will produce a ramp wave, but is it the ramp wave we require, isn't a ramp wave a ramp wave, sure, but what do you want this ramp wave to do. WE cannot just make a ramp wave network, and expect it to work for us, without a little planning ahead of time.
Lets determine what the ramp wave should do, this ramp wave is going to be used to turn on a switching circuit, we are going to use a analog signal (ramp wave) to produce a digital signal.
At this time you probably don't know what this ramp wave is going to do, but after you build this circuit, you should be able to know exactly what the ramp wave is used for.
So I am going to go through some basic details of what we want the ramp wave to look like.
1. we want it as large of voltage output as possible without distortion, (within reason)
2. we want the charge up time of the capacitor to be longer than the pulse driving it, so as to make sure we don't have clipping of the ramp wave on its positive peak. (the sharper the peak is the better control of driving the motor more accurately and precisely.)
Here is the first formula needed to determine the capacitor value. (C3).
TC = (R*C) means Time Constant:, this is the amount of time the capacitor will charge up to a voltage of around 63% of applied voltage. Engineers have established that it takes around 5 TC's to have a capacitor charge up to around 99% of applied voltage.
Now lets think carefully of what we want to do, we have a pulse of 2mS, coming into this network, we want the capacitor to charge up to a maximum voltage within that time frame, so since it is determined that (TC * 5) = full charge, then we will now substitute our requirements for a 2mS pulse which is (TC*5 = 2mS) which means in 2mS the cap. will get fully charged.
What was all of that about, it's this way, when the 2mS pulse comes into this network, that amount of pulse time, will fully charge up the capacitor. to a maximum voltage, according to the formula (5 * TC = cap. full charge)
So if five Time Constants fully charges the capacitor, then what value of capacitor do we need to achieve this.
We find that value by the equation (pw=5*TC) where pw is the pulse width which is the amount of time to charge the cap. to full charge, and TC is time constant, which is equal to (R*C).
so therefor (TC = pw / 5) so plugging in our values, (TC = 2mS / 5) which becomes (TC = 400uS)
So now we have determined one Time Constant is equal to 400uS. and now we use another equation to solve for the capacitor value, needed to give this result.
(TC = R*C) so now plugging in our values again, we have (400uS = 3K ohms * C) rearranging we have (C = 400uS / 3k ohms) = 133nF.
now these are theoretical values, we may need to tweak the capacitor value as needed as we view the waveform on the oscilloscope.
lets see what the scope shows.
As can be seen the top of the waveform has a little clipping this is because I used pw value in the equation to be equal with pulse coming in. Thats Ok because by using the values we used gets us in the ballpark, now is a good time to do some cap. value tweaking.
I'll make the cap. larger from 133nF to 200nF and see how the waveform looks.
lets take a look:
much better, no clipping and were still holding about 6v. p-p.
I'll stay with those values.
that finishes this building block.
So here we show our pulse generatore output, and the RC network output on the scope.
We now have a 2mS pulse with a 20mS period, feeding into a RC network producing a ramp pulse with a pointy top and a base width of around 4mS which will be plenty good to drive the next stage.
This next building block is a Digital circuit, it takes a analog signal, in this case a ramp sawtooth wave, and converts it into a digital high low signal, either a one or a zero on its output. by the time we get this building block built, we will be able to have a PWM output however it will still need some conditioning to be usefull to drive a micro circuit in a servo motor.
Here is the next stage of design:
Analog to digital circuit.
we will now design a schmitt trigger circuit, however since I am not going to go into all the detailed equations given in my course design books from (NRI) course. , I'll use a short version of my own equations to get reasonable results, which is good enough for this application.
The design is not my own, just the formulas used to find the resistor values.
Here are the equations I came up with to build this circuit.
refer to circuit below.
1.) VCC is chosen value.
2.) Vth = (Vcc / 2) (threshold, trigger voltage)
3.) R7 is chosen value.
vbe = 0.7v. and vce = 0.3v. (respectively base emitter voltage and collector emitter saturation voltage)
4.) VR8 = (Vth - vbe)
5.) R8 = {(VR8 * R7) / (VCC - (VR8 +vce)}
6.) R9 = (10 * R8)
7.) IR9 = (Vth / R9)
8.) R10 = (0.1v / IR9)
9.) R11 = {(VCC - 0.1v-Vth) / IR9}
so lets now plug in our values to see what resistor values will work for this.
VCC = 8v. (This will allow this circuit to work with a 9 volt battery.)
Vth = 4v.
R7 =470 ohms
R8 = {(3.3v * 470) / (8v - (3.3v +0.3v)} ~=352 ohms, I chose 240 ohm resistor..
R9 = (10* R8) = 2.4K ohms.
IR9 = (4 / 2.4K ohms) ~= 1.7mA.
R10 = (0.1v / 1.7mA) = ~=60 ohms. I chose 62 ohm resistor.
R11 = {(8v-0.1v-4v) / 1.7mA} = ~=2294 ohms I chose a 2.2K ohm resistor.
The trim resisdtors in series with the manual input pot. is inserted for later tweaking of the circuit for proper input performance.
Ok so now that we have this building block done, lets hook up the preceeding stage to it and see if we get any PWM signal out.
When I made this connection as shown above, I ran into a major problem:
Hmm what happened. Well this is one of the problems an electronics engineer will need to deal with on a continuous basis. When designing circuits, you need to keep on thinking about impedance matching, that has several meanings depending on the application.
In rf work it means matching exact values of Zin to Zout. however in analog and digital low frequency work it mainly works out as making sure the input impedance your working into is always higher then the signal source working into it.
The signal source in this case is the RC integrator stage, it has an output impedance (Zout) of around 3K ohms. (resistor R5)
The input impedance (Zin) of the analog to digital convertor block (ADC) has an input impedance that varies from (0v. to around (the parallel combination of 11K pot value and the 240 ohm emitter resistor in the be junction of Q3.))
In other words we need some sort of a buffer between these two stages, between the RC network and the ADC stage.
There are several options, using mosfet is one of them, however trying to keep this at a bipolar transistor level only, lets use a emitter follower (CC) building block.
A rule of thumb for matching impedances at low frequencies, is to make the input impedance of the stage the signal source is feeding into to be 10 times or higher than the output impedance of the signal source, thats feeding it.
looking back we see the 3K ohm resitor (R5) as the Zout of the RC stage, so lets make Zin of the (CC) stage to be around 30K or more.
So if we use two 62K ohm resitors to form a voltage divider across the base of the transistor (CC) than the parallel combination gives around 30K ohms.
Assuming a dc beta of 100 for a transistor (2n3904) for calculating purposes, then we can use a resitor in its emitter of around 300 ohms to make the input look like a 30K ohm resistor, or somewhere in that range.
Now if we use an emitter resitor of a value 1/10th of the pull up resitor (R13) (62K), that would be a value of (6.2K ohms).
So we are keeping our Z matching consistent somewhat, where the emitter resistor is ten times less than the pull up resistor, and the parallel combo. of the volt. divider is around ten times larger than the 3K ohm resistor of the RC network, we should have good signal flow with little distortion.
lets build this (CC) buffer building block to see how this works out.
Ok we have our waveform back in working order, its peak voltage is around 6-7v. with nice sharp point on top.
Now lets see how we do on the (ADC) building block.
When I hook it up, the (ADC) goes full positive voltage, so there is no variable pulse width, yet. In other words it is overdriving the next stage.
OK so now we use some logic thinking, since my (ADC) is designed to trigger at 4v, and my triangle wave peaks at around 6-7v., then I need to make the pk value of this wave much less than 4v. in order to not overdrive the (ADC) stage.
That's where you use attenuation networks. A simple voltage divider is used to divide the output voltage of the RC network down to a value much lesser than 4v.
Lets choose the triangle wave pk. volt will be attenuated down to around 2volts, or so.
Lets insert this attenuator between the (RC) stage and the (CC) stage.
These values are chosen like this, I make R15 to be 30K ohms so it is ten times larger than R5 than I empirically insert a ground resistor and watch my waveform, when it is peaking around 2v. than that is the resistor combination I use to do the attenuation with.
In my case I found that a 30K ohm resitor to ground gave me close to 2v. pk. on the triangle wave. C4 is inserted to block any dc bias of the (CC) stage from interfering with the (RC) stage, it is known as a coupling capacitor, it couples the ac (triangle wave) to the next stage while blocking dc voltages.
So this is what the attenuation network looks like between the 2 stages.
The atten. are comprised of (R15 and R16):
Now lets see where, were at on the waveforms.
First we need to tweak those trim pots. I was talking about earlier.
NOTE:
Also not shown you may need to use larger value trim pots. I had to change mine to larger values, I just put those values shown on the circuit schematic as a ballpark figure. If you don't have larger trim pots. than add series resistors to the trim pots.
Continuing now,
here is how it is done.
Hook a scope probe to the collector lead of transistor Q4 like this.
Watching the squarewave form this case in red, turn your manual 10K pot all the way till the square wave reads zero on the bottom line, thats going to put the input to full negative voltage, now begin to tweak the low side pot. until the square wave appears, continue to turn it until you have about 500uS of pulse width, as shown above.
I put a second probe on the triangle wave output for demonstration purposes only, you don't need to look at the triangle wave for this procedure, just use the square wave only.
once you have around 500uS width on the square wave, turn the manual input pot. all the way till you have maximum positive voltage, your square wave should now show a straight line at the top of the scope screen.
from there begin tweaking the high side trim pot. until you have a squarewave at around 2.3mS in width. as shown below.
Now that the manual input is fully tuned in, we have our first sign of a PWM output.
Making sure you have both scope probes on DC input,
Hook your other scope probe to the input of the (ADC) like this:
and watch how when you traverse the manual pot. from left to right how the triangle wave acts as a wedge and rises through the bottom of the PWM wave causing the PWM wave to change width of pulse as the triangle wave goes higher into it.
Study this phenomonem, until you can figure out what is making this work this way.
Now we can't stop here, because this will not drive a servo motor just yet, if you observe the PWM wave is above ground by a value of around 3-4v. This is due to the makeup of the circuit, that at idle voltage we are above ground by a value of emiter voltage plus Q4 sat. voltage.
The servo motor will not recognize the PWM wave at this voltage level above ground.
So one last step is needed in order to drive a servo motor with this circuit.
We need to incorporate a voltage level shifting stage.
This is very simple to do, we use an NPN transitor and bias its emitter at around (VCC /2), using two 10K ohm resistors.
Then we couple the output of this (ADC) stage to it through a current limiting resistor of 10K ohms. This stage is used as a voltage detector to detect when the voltage from the (ADC) stage goes above (VCC/2), then it switchs on and produces a ground signal to its output.
This is what this stage looks like:
you should see your PWM working in reverse where the ground is shown as the top of the scope screen and the PWM wave drops down from the top like this.
Now we have the PWM wave referenced to a ground position, however that ground position is the positive rail, the servo needs a negative ground, so all we do now is invert the entire signal, by using a PNP transistor inverter stage.
Just use all 10K ohm resistors for current limiting into the base, and for the collector output.
like this:
Now the PWM output is reference to negative ground through the pull down resistor R21.
Here is the PWM waveform now.
Now lets hook this up to the servo motor, and see if we need to do any tweaking of component values. The motor runs fine, a little touchy due to rough potentiometers, the better precision the pot. the better controle of the servo motor.
Also the last stage is a PNP common emitter amp, so it has a lot of gain, to reduce sensitivity of the manual control pot, you could add a 5.1K resistor in its emitter lead, so as to reduce the gain. This should make the manual control less touchy as your turning the knob.
This is a homemade all transistor servo motor driver.
Here is the entire schematic:
This circuit was tested, and it works from around 4v. to up to 12v, the lower the voltage the more sensitive the motor.
It was designed to work with a 9v. battery, and that works real good using a 9v. battery.
I'm running the motor itself off of a seperate power supply of around 5v.
Just make sure you connect the negative terminals of both suplies together, so as to have a common signal ground, otherwise the motor circuitry won't recognize this driver circuit if both negative term. are not connected to each other.
I wrote this course up as if I was building the circuit for the first time, to show how you come into pitfalls, as you build one stage after another, and how to work around those pitfalls so as to have a working circuit at the end.
Main pitfalls are matching impedances from one stage to another, so as to keep the signal source s happy throughout. That way you have minimal distortion on the signals being produced and transfered through out the system.
I feel if you study each section each building block until you understand its function, you should be able to sit down and design from scratch your own version of a transitor level servo motor driver.
Your professor will probably be intrigued if you can explain what each waveform should be, through out each stage, and what design work you did to produce those waveforms, while everyone else is programming arduinos, (micro controlers) to make commercial servo motors work, you can get right down into the actual system itself, and show how the driver works at the very working level, of the circuitry involved.
Have an oscilloscope hooked up as part of the demonstration, touch the probe to each transistor in the pulse generator stage, and explain in detail why this pulse is generated, and the purpose for using it. Then explain in detail, how this pulse will be fed into another stage.
Surely you learned about RC networks, but now you have an oppurtunity to design those RC networks with purpose, in a precise manner, matching impedances, explain why you need to use the value of resitor in the RC network, so as to not load down the stage preceding it, show you understand impedance matching in systems like this. Then explain in detail the logic process of how you determined the TC, of the RC integrator network.
You learned how to design RC integrators, and diffrentiators, in your class, but now you can show your professor, why you chose a integrator of the two.
Then as you move your scope probe to the output of the RC network, explain how this waveform is produced by the charging of the cap. show how if you change cap. values how you can improve the waveform, or bring distortion on it.
Using your scope show how you tweaked the cap. value for optimal performance.
Now couple this stage directly to the ADC stage bypassing the (CC) stage, and show how the waveform gets severly distorted, then explain why the use of a (CC) stage, you learned about these amps. now you have an oppurtunity to purposefully design one for use in the system, its all handson experience of what you learned throughout your year in school, from the books.
Now insert back into the system the (CC) stage, and now bypass the (attenuator network), probe the ADC output and show how the waveform is positive railed. (being overdriven) and explain in detail the need for voltage attenuators.
Also explain in detail the use and need for capacitor coupling between certain stages, so as to block dc and pass ac signal, surely you learned that through the school year , but now you can apply it purposefully, to show how important it was to learn about it from the books.
insert the atten. and probe the ADC output and show how it is above ground, and explain what the cause of it is, and how you need this signal to be at ground level.
Then show how you insert a voltage detecting circuit to act as a switching circuit to get a ground signal at the output, probe the output of this stage and show how the PWM signal is reversed ground at the positive rail.
Now you learned how to use PNP transistors, exolain in detail why the use of a PNP inverter is used, then show the PWM signal working properly at the output as it is now negative ground refrenced.
If youi can thoroughly explain these things in your project this should be a very successful project to show your professor how much you learned about electronic circuit design and how to use that knowledge to produce a working system down at the component level.
Youll have a thoro understanding of the very waveforms driving these motors, while others are working with computer commands, your working with electronic waveforms, while there results are the understanding of micro controler commands, your results are the understanding of tweaking component values to get the waveform working conditions.
Youll have more understanding of the micro controller functions to drive a servo motor at the electronic component level.
Its like knowing how to drive a car, and also knowing how the car works, at the mechanical level.
Learning at this level prepares you for IC design as well, this gives you a taste of designing microcontroler functions at the component level.
Also it is a lot of fun knowing how to design commercial type circuits at the transistor level, instead of just programming those little black boxes.
Above all enjoy this course get all the understanding of this as you can, and design your own version of a servo driver, from the transistor level.
Have fun and God Bless.
As the saying goes, "necessity is the mother of all inventions",
So it is in this, when you find it necessary to come up with a network to eliminate distorting a signal feeding into it, you grab a hold of that book page about impedance matching and finally low impedance and high impedance stuff you read about starts to make sense, OH now I see what they mean about making the input impedance higher than the signal source output impedance, it clicks in now.
So this is what they mean about how an emitter follower is used for impedance matching a high impedance to a low impedance output. It makes sense now. When you are faced with design challenges hands on, thats when all those things you read about starts to ring a bell.
You always wondered "why you need to learn about these transistor amp. class of operations, big deal," yeh, well when your faced with a design challenge of what works best for this application at this stage of design, youll be thankfull you learned about those diff. class of operations. Youll appreciate how you learned about analog and switching designs for transistors.
And those boring RC networks you read about, again when you need a specific timing signal to make something work properly, youll appreciate learning what a RC netwoprk is good for.
This course is to spark interest in the mundane book learning, of circuit design, by giving an oppurtunity for the student to get right down, past those little black boxes and to get into the component level itself, and to really appreciate the book learning at a hands on level.
While others are using arduinos, and micro controlers to build a servo driver, you can impress your professor, by showing how you can design a servo motor driver at the transistor level.
By the time you finish this course, you should be able to know exactly how to design each stage of this driver, using design formulas, and logic thinking, you should also be able to predict what your signals should look like on a oscilloscope, at each stage of the design, and why the signals look the way they do, and for what purpose they are designed to do.
Then if you want to get creative, for extra credit, you can logically design an input circuit that uses two push button switchs to make the servo turn left and right, as long as the switchs are active. (That requires aquiring a knowledge of capacitor timing circuits) You can also design light detector circuits to add on to this, the possibiities are up to how well you can first understand this basic system of circuits.
Lets begin:
An oscilloscope is definately needed.
You can purchase for under $100 those PC scopes, any kind of a DSO will do, analog scope will work to, it just will be more challenging to watch the waveforms at the low frequencies required.
First purchase a small servo motor, and usually it will show the driver specifications to make the motor work properly. The motor I have specs out as,(PWM period 20mS. with 1-2mS. duty cycle) (4-6 volts).
Ok what does that mean, the motor is looking for a pulse between 1-2mS, every 20mS, in order for it to run, the 20mS is equal to (50Hz, as you take the inverse of 20mS).
So in order to get this kind of a waveform we need to design a PWM circuit.
Those stage terms are my own, lables.
So here is what were designing, we start out by designing a pulse generator, to satisfy the motor specs as far as the period and pulse width needed to drive the motor circuit.
The pulse generator is designed to have a 2mS pulse every 20mS. since the maximum pulse width is given in the specs to be around 2mS. The exact values are not going to be attained due to component variations without any tweaking, however if we get our values close enough the motor circuit will still work fine enough, for our purposes.
NOTE:
I am designing this as I go along, so I can verify this will be a working circuit when this course is finished.
-----------------------------------------------------------------------------------------------------------------
Lets start with a pulse generator:
Schematic shown below,
Here are the design formulas for designing a pulse generator:
I need a pulse generator to produce a 2mS pulse every 20mS.
T=period of cycle. (20mS)
t2= +pulse =(2mS)
t1= negative pulse = (T - t2)= (20mS - 2mS)= 18mS
The output pulse transistor is Q2.
When Q1 is at cutoff, then its collector goes high, thransistor Q2 switchs on and the output is a negative pulse.
Q1 is turned off during the charging up of the cap. C2 through R3.
The design formulas for determining the base resistor values is as such:
first choose a value for the capacitors, I chose 1uF, you can choose any value you want within reason of the frequency required.
Now use this formula to solve for a resistor value:
R=(t / (0.69 * C))
In the example shown:
R3 = (t1 / (0.69 * C2)) therefor R3 = ( 18mS / (0.69 * 1uF)) ~= 26086 ohms, choose 27K ohms.
R4 = (t2 / (0.69 * C1)) which is R4 =(2mS / (0.69 * 1uF)) ~= 2898 choose 2.7K ohms.
R1 = (R3 / 10) = 2.7K ohms
R2 = R2 =(R4 / 5)= 560 ohms
The diode arrangement is used to square up the output waveform. R2's values are the parallel combination of (R4 / 10) .
always choose the closest resistor values available.
Now this should run at a Vcc value from 4 - 12 volts DC.
build this and using an oscilloscope, check to see how close you have a positive pulse of around 2mS wide, every 20mS.
You should be close enough to make it work, if not, than always tweak values to get your optimum desired performance.
Again you may have to tweak the values to get an appropriate signal output.
Here I interject, study the schematic, and use hands on approach to experiment, with this circuit building block, until you are able to use the design formulas given above to design any type of pulse generator, with any kind of period and pulse width.
Once you are satisfied with that, then it's time to move on to the next stage.
Alright the next stage is going to be an RC network, it's actually a low pass filter, however it is used to modify the pulse wave into a ramp wave, so as to produce a sort of a wedge signal.
the design goes as follows:
we need to make this stage with an input impedance high enough to have very little affect on the pulse generator stage that feeds into it. so lets investigate the pulse generator output impedance for a moment.
we have two 560 ohm resistors in parrallel which is around 280 ohms. A good rule of thumb is to make the impedance that a source is working into to be around 10 times or more larger than the impedance of the signal source itself.
so 10 times 280 ohms would be 2.8K ohms. I'll choose a 3K ohm resistor. (closest standard value)
This will be the input impedance (Zin) looking into the next network were going to design.
So this next stage is an RC filter, (waveshaping network, ramp wave, integrator). it looks like this:
R6 and C3 form the RC lowpass filter, that is designed to work as an integrator, to produce a ramp wave.
We already established the Zin should use a 3K ohm resistor, so lets put that in as R5.
Now we need to use logic thinking, as an engineer you will need to make choices on component values and such based on what your trying to achieve, this case we need to think of what kind of a ramp wave are we looking for, if we just throw any value capacitor in there, we will produce a ramp wave, but is it the ramp wave we require, isn't a ramp wave a ramp wave, sure, but what do you want this ramp wave to do. WE cannot just make a ramp wave network, and expect it to work for us, without a little planning ahead of time.
Lets determine what the ramp wave should do, this ramp wave is going to be used to turn on a switching circuit, we are going to use a analog signal (ramp wave) to produce a digital signal.
At this time you probably don't know what this ramp wave is going to do, but after you build this circuit, you should be able to know exactly what the ramp wave is used for.
So I am going to go through some basic details of what we want the ramp wave to look like.
1. we want it as large of voltage output as possible without distortion, (within reason)
2. we want the charge up time of the capacitor to be longer than the pulse driving it, so as to make sure we don't have clipping of the ramp wave on its positive peak. (the sharper the peak is the better control of driving the motor more accurately and precisely.)
Here is the first formula needed to determine the capacitor value. (C3).
TC = (R*C) means Time Constant:, this is the amount of time the capacitor will charge up to a voltage of around 63% of applied voltage. Engineers have established that it takes around 5 TC's to have a capacitor charge up to around 99% of applied voltage.
Now lets think carefully of what we want to do, we have a pulse of 2mS, coming into this network, we want the capacitor to charge up to a maximum voltage within that time frame, so since it is determined that (TC * 5) = full charge, then we will now substitute our requirements for a 2mS pulse which is (TC*5 = 2mS) which means in 2mS the cap. will get fully charged.
What was all of that about, it's this way, when the 2mS pulse comes into this network, that amount of pulse time, will fully charge up the capacitor. to a maximum voltage, according to the formula (5 * TC = cap. full charge)
So if five Time Constants fully charges the capacitor, then what value of capacitor do we need to achieve this.
We find that value by the equation (pw=5*TC) where pw is the pulse width which is the amount of time to charge the cap. to full charge, and TC is time constant, which is equal to (R*C).
so therefor (TC = pw / 5) so plugging in our values, (TC = 2mS / 5) which becomes (TC = 400uS)
So now we have determined one Time Constant is equal to 400uS. and now we use another equation to solve for the capacitor value, needed to give this result.
(TC = R*C) so now plugging in our values again, we have (400uS = 3K ohms * C) rearranging we have (C = 400uS / 3k ohms) = 133nF.
now these are theoretical values, we may need to tweak the capacitor value as needed as we view the waveform on the oscilloscope.
lets see what the scope shows.
As can be seen the top of the waveform has a little clipping this is because I used pw value in the equation to be equal with pulse coming in. Thats Ok because by using the values we used gets us in the ballpark, now is a good time to do some cap. value tweaking.
I'll make the cap. larger from 133nF to 200nF and see how the waveform looks.
lets take a look:
much better, no clipping and were still holding about 6v. p-p.
I'll stay with those values.
that finishes this building block.
So here we show our pulse generatore output, and the RC network output on the scope.
We now have a 2mS pulse with a 20mS period, feeding into a RC network producing a ramp pulse with a pointy top and a base width of around 4mS which will be plenty good to drive the next stage.
This next building block is a Digital circuit, it takes a analog signal, in this case a ramp sawtooth wave, and converts it into a digital high low signal, either a one or a zero on its output. by the time we get this building block built, we will be able to have a PWM output however it will still need some conditioning to be usefull to drive a micro circuit in a servo motor.
Here is the next stage of design:
Analog to digital circuit.
we will now design a schmitt trigger circuit, however since I am not going to go into all the detailed equations given in my course design books from (NRI) course. , I'll use a short version of my own equations to get reasonable results, which is good enough for this application.
The design is not my own, just the formulas used to find the resistor values.
Here are the equations I came up with to build this circuit.
refer to circuit below.
1.) VCC is chosen value.
2.) Vth = (Vcc / 2) (threshold, trigger voltage)
3.) R7 is chosen value.
vbe = 0.7v. and vce = 0.3v. (respectively base emitter voltage and collector emitter saturation voltage)
4.) VR8 = (Vth - vbe)
5.) R8 = {(VR8 * R7) / (VCC - (VR8 +vce)}
6.) R9 = (10 * R8)
7.) IR9 = (Vth / R9)
8.) R10 = (0.1v / IR9)
9.) R11 = {(VCC - 0.1v-Vth) / IR9}
so lets now plug in our values to see what resistor values will work for this.
VCC = 8v. (This will allow this circuit to work with a 9 volt battery.)
Vth = 4v.
R7 =470 ohms
R8 = {(3.3v * 470) / (8v - (3.3v +0.3v)} ~=352 ohms, I chose 240 ohm resistor..
R9 = (10* R8) = 2.4K ohms.
IR9 = (4 / 2.4K ohms) ~= 1.7mA.
R10 = (0.1v / 1.7mA) = ~=60 ohms. I chose 62 ohm resistor.
R11 = {(8v-0.1v-4v) / 1.7mA} = ~=2294 ohms I chose a 2.2K ohm resistor.
The trim resisdtors in series with the manual input pot. is inserted for later tweaking of the circuit for proper input performance.
Ok so now that we have this building block done, lets hook up the preceeding stage to it and see if we get any PWM signal out.
When I made this connection as shown above, I ran into a major problem:
Hmm what happened. Well this is one of the problems an electronics engineer will need to deal with on a continuous basis. When designing circuits, you need to keep on thinking about impedance matching, that has several meanings depending on the application.
In rf work it means matching exact values of Zin to Zout. however in analog and digital low frequency work it mainly works out as making sure the input impedance your working into is always higher then the signal source working into it.
The signal source in this case is the RC integrator stage, it has an output impedance (Zout) of around 3K ohms. (resistor R5)
The input impedance (Zin) of the analog to digital convertor block (ADC) has an input impedance that varies from (0v. to around (the parallel combination of 11K pot value and the 240 ohm emitter resistor in the be junction of Q3.))
In other words we need some sort of a buffer between these two stages, between the RC network and the ADC stage.
There are several options, using mosfet is one of them, however trying to keep this at a bipolar transistor level only, lets use a emitter follower (CC) building block.
A rule of thumb for matching impedances at low frequencies, is to make the input impedance of the stage the signal source is feeding into to be 10 times or higher than the output impedance of the signal source, thats feeding it.
looking back we see the 3K ohm resitor (R5) as the Zout of the RC stage, so lets make Zin of the (CC) stage to be around 30K or more.
So if we use two 62K ohm resitors to form a voltage divider across the base of the transistor (CC) than the parallel combination gives around 30K ohms.
Assuming a dc beta of 100 for a transistor (2n3904) for calculating purposes, then we can use a resitor in its emitter of around 300 ohms to make the input look like a 30K ohm resistor, or somewhere in that range.
Now if we use an emitter resitor of a value 1/10th of the pull up resitor (R13) (62K), that would be a value of (6.2K ohms).
So we are keeping our Z matching consistent somewhat, where the emitter resistor is ten times less than the pull up resistor, and the parallel combo. of the volt. divider is around ten times larger than the 3K ohm resistor of the RC network, we should have good signal flow with little distortion.
lets build this (CC) buffer building block to see how this works out.
Ok we have our waveform back in working order, its peak voltage is around 6-7v. with nice sharp point on top.
Now lets see how we do on the (ADC) building block.
When I hook it up, the (ADC) goes full positive voltage, so there is no variable pulse width, yet. In other words it is overdriving the next stage.
OK so now we use some logic thinking, since my (ADC) is designed to trigger at 4v, and my triangle wave peaks at around 6-7v., then I need to make the pk value of this wave much less than 4v. in order to not overdrive the (ADC) stage.
That's where you use attenuation networks. A simple voltage divider is used to divide the output voltage of the RC network down to a value much lesser than 4v.
Lets choose the triangle wave pk. volt will be attenuated down to around 2volts, or so.
Lets insert this attenuator between the (RC) stage and the (CC) stage.
These values are chosen like this, I make R15 to be 30K ohms so it is ten times larger than R5 than I empirically insert a ground resistor and watch my waveform, when it is peaking around 2v. than that is the resistor combination I use to do the attenuation with.
In my case I found that a 30K ohm resitor to ground gave me close to 2v. pk. on the triangle wave. C4 is inserted to block any dc bias of the (CC) stage from interfering with the (RC) stage, it is known as a coupling capacitor, it couples the ac (triangle wave) to the next stage while blocking dc voltages.
So this is what the attenuation network looks like between the 2 stages.
The atten. are comprised of (R15 and R16):
Now lets see where, were at on the waveforms.
First we need to tweak those trim pots. I was talking about earlier.
NOTE:
Also not shown you may need to use larger value trim pots. I had to change mine to larger values, I just put those values shown on the circuit schematic as a ballpark figure. If you don't have larger trim pots. than add series resistors to the trim pots.
Continuing now,
here is how it is done.
Hook a scope probe to the collector lead of transistor Q4 like this.
Watching the squarewave form this case in red, turn your manual 10K pot all the way till the square wave reads zero on the bottom line, thats going to put the input to full negative voltage, now begin to tweak the low side pot. until the square wave appears, continue to turn it until you have about 500uS of pulse width, as shown above.
I put a second probe on the triangle wave output for demonstration purposes only, you don't need to look at the triangle wave for this procedure, just use the square wave only.
once you have around 500uS width on the square wave, turn the manual input pot. all the way till you have maximum positive voltage, your square wave should now show a straight line at the top of the scope screen.
from there begin tweaking the high side trim pot. until you have a squarewave at around 2.3mS in width. as shown below.
Now that the manual input is fully tuned in, we have our first sign of a PWM output.
Making sure you have both scope probes on DC input,
Hook your other scope probe to the input of the (ADC) like this:
and watch how when you traverse the manual pot. from left to right how the triangle wave acts as a wedge and rises through the bottom of the PWM wave causing the PWM wave to change width of pulse as the triangle wave goes higher into it.
Study this phenomonem, until you can figure out what is making this work this way.
Now we can't stop here, because this will not drive a servo motor just yet, if you observe the PWM wave is above ground by a value of around 3-4v. This is due to the makeup of the circuit, that at idle voltage we are above ground by a value of emiter voltage plus Q4 sat. voltage.
The servo motor will not recognize the PWM wave at this voltage level above ground.
So one last step is needed in order to drive a servo motor with this circuit.
We need to incorporate a voltage level shifting stage.
This is very simple to do, we use an NPN transitor and bias its emitter at around (VCC /2), using two 10K ohm resistors.
Then we couple the output of this (ADC) stage to it through a current limiting resistor of 10K ohms. This stage is used as a voltage detector to detect when the voltage from the (ADC) stage goes above (VCC/2), then it switchs on and produces a ground signal to its output.
This is what this stage looks like:
you should see your PWM working in reverse where the ground is shown as the top of the scope screen and the PWM wave drops down from the top like this.
Now we have the PWM wave referenced to a ground position, however that ground position is the positive rail, the servo needs a negative ground, so all we do now is invert the entire signal, by using a PNP transistor inverter stage.
Just use all 10K ohm resistors for current limiting into the base, and for the collector output.
like this:
Now the PWM output is reference to negative ground through the pull down resistor R21.
Here is the PWM waveform now.
Now lets hook this up to the servo motor, and see if we need to do any tweaking of component values. The motor runs fine, a little touchy due to rough potentiometers, the better precision the pot. the better controle of the servo motor.
Also the last stage is a PNP common emitter amp, so it has a lot of gain, to reduce sensitivity of the manual control pot, you could add a 5.1K resistor in its emitter lead, so as to reduce the gain. This should make the manual control less touchy as your turning the knob.
This is a homemade all transistor servo motor driver.
Here is the entire schematic:
This circuit was tested, and it works from around 4v. to up to 12v, the lower the voltage the more sensitive the motor.
It was designed to work with a 9v. battery, and that works real good using a 9v. battery.
I'm running the motor itself off of a seperate power supply of around 5v.
Just make sure you connect the negative terminals of both suplies together, so as to have a common signal ground, otherwise the motor circuitry won't recognize this driver circuit if both negative term. are not connected to each other.
I wrote this course up as if I was building the circuit for the first time, to show how you come into pitfalls, as you build one stage after another, and how to work around those pitfalls so as to have a working circuit at the end.
Main pitfalls are matching impedances from one stage to another, so as to keep the signal source s happy throughout. That way you have minimal distortion on the signals being produced and transfered through out the system.
I feel if you study each section each building block until you understand its function, you should be able to sit down and design from scratch your own version of a transitor level servo motor driver.
Your professor will probably be intrigued if you can explain what each waveform should be, through out each stage, and what design work you did to produce those waveforms, while everyone else is programming arduinos, (micro controlers) to make commercial servo motors work, you can get right down into the actual system itself, and show how the driver works at the very working level, of the circuitry involved.
Have an oscilloscope hooked up as part of the demonstration, touch the probe to each transistor in the pulse generator stage, and explain in detail why this pulse is generated, and the purpose for using it. Then explain in detail, how this pulse will be fed into another stage.
Surely you learned about RC networks, but now you have an oppurtunity to design those RC networks with purpose, in a precise manner, matching impedances, explain why you need to use the value of resitor in the RC network, so as to not load down the stage preceding it, show you understand impedance matching in systems like this. Then explain in detail the logic process of how you determined the TC, of the RC integrator network.
You learned how to design RC integrators, and diffrentiators, in your class, but now you can show your professor, why you chose a integrator of the two.
Then as you move your scope probe to the output of the RC network, explain how this waveform is produced by the charging of the cap. show how if you change cap. values how you can improve the waveform, or bring distortion on it.
Using your scope show how you tweaked the cap. value for optimal performance.
Now couple this stage directly to the ADC stage bypassing the (CC) stage, and show how the waveform gets severly distorted, then explain why the use of a (CC) stage, you learned about these amps. now you have an oppurtunity to purposefully design one for use in the system, its all handson experience of what you learned throughout your year in school, from the books.
Now insert back into the system the (CC) stage, and now bypass the (attenuator network), probe the ADC output and show how the waveform is positive railed. (being overdriven) and explain in detail the need for voltage attenuators.
Also explain in detail the use and need for capacitor coupling between certain stages, so as to block dc and pass ac signal, surely you learned that through the school year , but now you can apply it purposefully, to show how important it was to learn about it from the books.
insert the atten. and probe the ADC output and show how it is above ground, and explain what the cause of it is, and how you need this signal to be at ground level.
Then show how you insert a voltage detecting circuit to act as a switching circuit to get a ground signal at the output, probe the output of this stage and show how the PWM signal is reversed ground at the positive rail.
Now you learned how to use PNP transistors, exolain in detail why the use of a PNP inverter is used, then show the PWM signal working properly at the output as it is now negative ground refrenced.
If youi can thoroughly explain these things in your project this should be a very successful project to show your professor how much you learned about electronic circuit design and how to use that knowledge to produce a working system down at the component level.
Youll have a thoro understanding of the very waveforms driving these motors, while others are working with computer commands, your working with electronic waveforms, while there results are the understanding of micro controler commands, your results are the understanding of tweaking component values to get the waveform working conditions.
Youll have more understanding of the micro controller functions to drive a servo motor at the electronic component level.
Its like knowing how to drive a car, and also knowing how the car works, at the mechanical level.
Learning at this level prepares you for IC design as well, this gives you a taste of designing microcontroler functions at the component level.
Also it is a lot of fun knowing how to design commercial type circuits at the transistor level, instead of just programming those little black boxes.
Above all enjoy this course get all the understanding of this as you can, and design your own version of a servo driver, from the transistor level.
Have fun and God Bless.