Mechatronics MAE 211
Popular in Course
Popular in Mechanical Engineering
This 74 page Class Notes was uploaded by Ardith Gutmann on Saturday September 12, 2015. The Class Notes belongs to MAE 211 at West Virginia University taught by Staff in Fall. Since its upload, it has received 16 views. For similar materials see /class/202653/mae-211-west-virginia-university in Mechanical Engineering at West Virginia University.
Reviews for Mechatronics
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 09/12/15
MAE 211 Mechatronics Fall 2002 Introduction quotA blend of mechanics and electronics mechatronics has come to mean the synergistic use of precision engineering control theory computer science and sensor and actuator technology to design improved products and processes ME Magazine May 1997 Examples Home Appliances Controls for microwave dishwasher washerdryer oven HVAC music and video systems home security systems are all digital electronics now rather than mechanical These are not just changes in hardware but additions of functionality reduction in cost increase in reliability Automobiles A typical car has 510 microprocessors not counting those in the stereo system Consider the innovations and improvements in automotive performance efficiency safety and reliability in the last 20 years What advances will we see in the next 20 years Aircraft Similar advances in aircraft systems are on the way but have been slowed by extremely conservative regulation and approval processes Navigation and avionics passenger entertainment are most visible areas Industry Incredible strides in automation efficiency improvement pollution prevention business management Paperless factories microrun production lightsout manufacturing Medicine MRI CAT digital X rays laser surgery robotic surgery artificial organs drug delivery systems Gl pill camera all of these are examples of mechatronic devises Ramifications for Mechanical and Aerospace Engineers 0 We are entering the age of ubiquitous intelligencesmart cards smart houses smart highways smart cars All of it is based on embedded microprocessors miniature sensors microactuators We have electric motors smaller than the period at the end of this sentence You will be using designing and building computers or objects built around computers for the rest of your life Or not You could be a plumber o All engineers must understand the rudiments of how computers work and have a basic level of skill in programming them This course is not intended to turn you into EE39s CpE39s or OS students This course will help make sure you hire them instead of them hiring you Chapter 1 Mechanical Concepts G ears A gee nah 1s a meehahTeaT assemmy e11h1eyae11hg geavs 1ha1 uahsms when m changesthe Tate m eheeheh e1me11eh Geav 1ee1h mus1 he ma1ehee1h shape bemve 1hey Wm pmpeny ma1e m mesh The 1mpm1ah1 shape aemys ave push and pvessuve ahg e Vuu Wm Team abum pvessuve ahgTe h a 1a1ey cuuvse hm gee p11eh 1s a shhpTe eeheep1 m are tee Gear Push modulus 1 1 push dwmetermeasuredmmches mm 1h 51 MM geavs ave specmed by meeums 1hs1eae e1 pnch hm 1he eeheep11s1he same a numbev e11ee1h dmded by p11ehe1ame1ey F113qu 1 1 The MD geavs p1e1mee have have eweyem gee p11ehes and Wm ehweusTy he1ma1e pmpeny FTGURE12 Pitch Diameter Luuk a1hew geavs ma1e They eeh1ma1e W11h1us11he11ps enhe 1ee1h tuuchmg su 1he1ee1h Wha1 1s usem 1s Wham 1he eeh1ae1 bemeen twu geavs uncuvsisee gu1251 1 and 12 The push mayhem eehhes ah Wagmavy eheTe1ha1eu1s1hmugh1he1ee1h The eheTes 1hus eehhee 1m Mu pmpeny ma1ee geavs ave 1ahgeh11e eaeh mhev Fm twu pmpeny ma1ee geavthe sha cemevsWTH he spvead hamhe sum enhe p11eh eTame1eys apan Example 11 Suppose I am building a gear train using 24pitch gears I want to use a 21 tooth gear to drive a 72tooth gear How far apart will the shafts centers be Solution To nd the distance apart add half of the pitch diameter of both gears Gear Pitch of teeth Pitch Diameter 24 pitch 21 teeth x inches x 875 inches 24 pitch 72 teeth y inches y 3 00 inches x y 2 194 inches apart Gear Ratio In calculating gear ratios there will always be an input and an output The input is the side that is supplying the power and the output is the side that is being driven The gear ratio is usually given the symbol N and can be expressed in a number of ways The calculation is the same however Gear Ratio N teeth on 1nput gear 12 teeth on output gear So a 12 tooth gear driving a 36tooth gear would have a gear ratio of N 1236 or N 1236 or N 13 or N 13 or N 333 If the numbers of teeth do not turn out to be an integer division decimal fractions can be used for example 1273 was once a common gear ratio for the differential of an automobile Example 12 Suppose I am building a gear train I want to use a 21 tooth gear to drive a 72 tooth gear What is the gear ratio Solution Gear Ratio N 21 teeth72 teeth 292 Direction of Rotation Notice that when two spur gears mate the output gear turns in the opposite direction from the input gear In designing a gear train you must keep track of the direction of rotation of each gear Multiple Gears We have talked about a gear train but up until now have only considered the use of two gears which makes a pretty short train Obviously multiple gears can be set up to drive each other For spur gears there are two ways in which gears can be connected 0 lnline connection 0 Stacked connection Example 13 shows four gears connected in an inline fashion We can analyze this gear train by taking the gears in pairs Gear A is the input and for the first pair we can find the gear ratio very simply N1 teeth A teeth B 1020 Now gear B will turn more slowly than gear A according to equation 12 obma 1020 gt 0 12 ma where 03x is the rotational speed of gear X Now consider gear C Gear C is driven by gear B so we can establish the same input l output relationship between gears B and C as we did for A and B Nbc 2010 we 0 2010 In the same way we can find a gear ratio for the C D combination Ncld 1030 Dd we 1030 The gear speeds provide the clue as to how we combine the ratios to get one overall gear ratio for the gear raIn I d wcNcd bUt we wbNbc and Nb mamab Combining these identities we see that I d waNcdNbcNab So the gear ratios in this chain just multiply together What is interesting though is to see what happens when gears are combined in this inlinequot fashion Look at the product of the ratIos NalbNbiaNcld Nald 1mptmqg iql3010130 ears B and C have no effect on the gear ratio Gears in the center of an inline arrangement like this are called idler gears They generally have one of two functions 0 Change the direction of rotation see figure 15 0 Provide physical space to avoid mechanical interference Example 13 Assume that Gear A is the input and Gear D is the output What is the gear ratio from AD What is the direction of rotation of D with respect to that of A B 20 teeth Solution Gear Ratio N 10 teeth 20 teeth 20 teeth 10 teeth 10 teeth 30 teeth Gear Ratio N Gear D will turn the opposite direction of gear A D A 30teeth 10 teeth m Gear IsleRev 2nd Gear Synchronizer Reverse Gear Countergear Reverse Idler Gear FIGURE 15 An idler gear is used in this transmission for the reverse gear Stacked Gears Example 14 shows a second way in which gear trains can be constructed namely with two gears stacked on the same shaft Gear A drives gear B just as before creating Naquot 1020 0 ma 1020 But gear B does not mesh with gear G Since they are on the same shaft they rotate at the same speed 03c OJb gt Nblc 1 Gear C then meshes with gear D driving it in the normal way New 1030 Dd we 1030 Now the entire train Nald 102011030 100600 wd ma 100600 The stacked arrangement allows us to multiply two gear ratios together to achieve a greater speed reduction than could have been done with a single gear pair or with an inline arrangement Example 14 Now Gear B and Gear C are on the same shaft Assume that Gear A is the input and Gear D is the output What is the gear ratio from AD What is the direction of rotation of D with respect to that of A D 30 teeth Solution Gear Ratio N 10 teeth 20 teeth 1 10 teeth 30 teeth Gear Ratio N 16 Gear D will turn the same direction of gear A Example 15 Gear A is turning at 3450 rpm What is the speed of Gear G What is the direction of rotation of G with respect to that of A A D 10 teeth 10 teeth Solution GearRatio N 1010 2010 1020 1030 13 B 20 teeth Output Speed lnput Speed N Output Speed 3450 13 Output Speed 1 150 rpm Gear G will turn the same direction as gear A Force Newton s second law states if the resultant force acting on a particle is not zero the particle will have an acceleration proportional to the magnitude of the resultant force which can be stated as F m a 13 Where F is the resultant force acting on the particle measured by pounds or Newtons m is the mass of the particle measured by slugs or kilograms and a is the acceleration of the particle measured by feet per seconds squared or meters per second squared A particular case of importance is that of the attraction of the earth on a particle located on its surface The acceleration due to earth s gravity is 322 ftls2 or 981 mlsz In the following example pay particular attention to units Example 16 l have an lbeam that weighs 193 lbs What is its mass Solution F ma 193 lbs m 322 fts2 m 599 lbs sZft 5 99 slugs Speed and Torque The rotational force or torque generated at the center of a gear is equal to the product of the gear s radius and the force applied at its circumference When gears are meshed their respective radii determine the translation of torque from the driving gear to the driven one TFR 14 Where T is torque measured in foot pounds or Newton meters F is force measured in pounds or newtons and R is the radius of the gear measured in feet or meters The input and output shaft speeds and torques are related to the gear ratios W gear rati0N 15 1nput speed t t t w 1 gear rati0N 16 input torque Example 1 7 What torque is being applied to the nut I59 lbw st inclm Solution T F R T 159 lbs 8 inches 106 lbs Example 18 Gear A is turning at 1750 rpm and has a torque or 75 ft lbs What is the speed and torque at gear D A D 10 teeth 30 teeth B 20 teeth Solution Gear Ratio N 10 teeth20 teeth 10 teeth30 teeth Gear Ratio N 16 Output Speed lnput Speed N Output Torque lnput Torque 1 N Output Speed 1750 rpm 116 Output Torque 75 ft lbs 6 Output Speed 292 rpm Output Torque 450 b Gear Types Probably the simplest kind of gear train to understand is made of spur gears Spur gears are at disks with teeth cut into their edges so the teeth are radial to the disk see gures 11 and 12 Bevel gears work the same way as spur gears but allow the direction of motion to be changed usually by 90 degrees The gear teeth are cut into the face of the gear on a 45 degree bevel as shown in gure 13 One disadvantage of bevel gears is that one or both of the gears must usually be cantilevered on the shaft and they produce signi cant side thrust on the shaft and bearings Bevel gears are generally not to be used for very heavy loads if they can be avoided For some applications they are the best solution however Automobile differentials are an obvious example the drive shaft runs from the engine to rear axle which must turn at a 90degree angle to the drive shaft Automobile differentials contain very robust bevel gears to make this transition Worm 9 ar 0 her means of changing direction and effecting speed reduction see gure 14 They also require careful alignment but are very rugged and can be used to achieve high gear ratios in a single stage Precision sets may even machine the worm to wrap around the s ur and machine a hollow center in the spur to match the curve of the worm A unique feature of the worm drives is that they can not be back driven Worm gears are cut at such a shallow angle that it is generally impossible for the load to drive the motor backward When meshed with a spur gear worm gears create an n to 1 reduction where n is the number ofteeth on the spur gear FIGURE 13 bevel gears FIGURE 14 worm gear mechanism Example 19 What is the gear ratio between the motor and gear D Worm D Gear 30 teeth B 20 teeth Solution Gear Ratio N 1 tooth 10 teeth 10 teeth 20 teeth 10 teeth 30 teeth Gear Ratio N 160 Differentials are most commonly used in automobiles see gures 16 and 17 A differential allows two wheels on the same axle to travel at different speeds If there is equal force on both tires the tires will travel at the same speed If there is an unbalanced force between the wheels then one eeI can slip while the other one is being driven This is very useful in going around corners where the outside wheel must travel faster than the inside I 0 e disadvantage is that on a slippery road the differential allows one tire to spin while the other does nothing 39 I FIGURE 16 Lego s version of a differential mm DEM sum 10mm was MM F MON A SH KT NNION pmst LOClt NUS 2mm ow mMpN stew DRNE our mnuENML cum D FfEEENHAl EJEE BEAR NGK GHD ammo Lin AXLE HwIN y ursmwmwe I REARAXLE mmmm H w mm a mum Linear Motion Conversion of Rotary to Linear Motion onversion of rotary motion to linear motion and vice versa is an important and common Jnction in mechanical design his is because motors of one ty e or another are the most common forms of work generators and they inherently provide rotary motion The purpose of this unit is to examine a num er 0 stan ard mec anisms for translating rotational motion to linear motion Some of them can also work in the opposite direction and some ou wil recognize many devices 39om your everyday experience which use these mechanisms Rack and pinion The rack and pinion is one of the most common mechanisms for converting rotary to linear motion The pinion gear is nothing more than a spur gear like you have seen in the previous unit The rack is a kind of unrolled gear with the gear teeth cut into a straight rod Figure 18 is a photo of a rack and pinion The McMaster Carr catalog httpmlwmcmaster com has examples of rack and pinion sets in a varietyo sizes an materials 39 ular gears the rack and the pinion teeth must mesh correctly and thus the concept of gear pitch extends to the rack irectly Recall that the units of pitch are teeth per inch However this is misleading because the pitch of a round gear is measured in teeth per inch of pitch diameter Thus a rack that mates with a 12pitch pinion gear will not have 12 cen er of rotation of the pinion is xe In space then the rack must be ree to translate as the pinion turns This is the arrangement in a rack and pinion steering system in automo ile e pinion is attached to the steering wheel shalt an e rac is driven left or ri ht as the driver turns the wheel and causes the 39ont wheels of the car to tum leit or right accordingly Another example ofthis type ofmechanism is the quill of a drill press versely the rack can be held stationary and the motor or mechanism driving the pinion can be mounte on a moving plat orm The worktable of many drill presses can be adjusted up and down using this kind of arrangement Some construction scaffolds and certain elevators also we on this arrangement Check out the following link to see some examples htt lmMMalimakamericascom The most common example is one that is an extension of this concept lfyou think ofa wheel as a pinion with very small teeth and a road or railroad track as the rack then it is easy to see that all of our common forms of land conveyance work on the same principle FIGURE 18 rack and pinion It is often necessary to relate the rotational and linear motions mathematically This is not dif cult As the pinion rotates one revolution the relative motion between the pinion and the rack must correspond to the circumference of the pinion since there is no slip between pinion and rack S 77 17 Where 8 is the linear displacement of either the rack or of the pinion along the xed rack Dp is the pitch diameter of the pinion and Q is the angular displacement of the pinion measured in number of revolutions radians21E Example 19 The sketch below shows a Lego motor set up to drive the carriage for a model X V plotterrecorder All gears are modulus 1 If the motor turns 10 turns how far does the carriage move Solution The two spur gears have 20 teeth each Since the worm gives a gear ratio of 1 39N where N is the number of teeth of the spur the spur gear turns 9 12010 revolutions revolution The distance moved will be S 71D p9 millimeters To D recall that modulus teethD in millimeters and these gears are modulus 1 so D20mm ThenS 314mm Rack and pinion systems are very rugged dependable systems Rack and pinions can be made any length byjust butting rack sections endtoend They are relatively simple but some at expensive ue o he precision machining that must be done on the parts Check McMaster Carr for an idea of the costs for different sizes and types of materials httplwwwmcmastercom Go to the Power Transmissionquot section of the catalog and look at the gears pages at the top of the page is a pull down menu which will include rack and pinions Belts or Cables and Pulleys Chains and Sprockets Belt or cable and pulley systems are very common and familiar to all of us Conveyor belts escalators elevators garage door openers and hundreds of other devices use these anisms Belt systems have the advantage of being relatively cheap versatile and reliable The are also much more forgiving of pinion misali nment roblems than many other types of drives Belt drives can operate with the rotary element providing the power or being riven he relationship between rotational and linear displacement is the same for belts as for rack and pinion systems namely S 7er6 18 where Dp is now the diameter of the pulley There are many different types of belts at V cog round etc The exact pulley measurement used will depend on the type of belt but the principle is the same You will study them again in more detail in later ME courses Example 110 Gear A is turning at 120 rpm counterclockwise and has a modulus of 2 Gear B is on the same shaft as a drum with a diameter of 75mm A 12 kilogram mass is attached to a cable that wraps around the drum How many revolutions of gear B will it take to lower the weight 100 meters How long will it take What is the torque being applied by the weight to the shaft of gear A Gear A Gear B 80 teeth 120 teeth 12 kg Solution ear A Gear B Modulus teeth pitch diameter Modulus teeth pitch diameter 2 80 teeth pitch diameter 2 120 teeth pitch diameter pitch diameter 40 mm pitch diameter 60 mm Gear Ratio Speed of Gear B N 80 teeth 120 teeth Speed of gear A gear ratio N 23 120rpm 23 80rpm Time Calculation Weight of Mass S 7rD e F ma 100m7r75mme F12lltg981ms2 e 424 revolutions F 118 Newtons 424 revolutions 80 rpm 53 minutes Torque on shaft B from drum T F R T 118 Newtons 37 5mm T 443 Newton meters Torque on shaft A output torque input torque 1 gear ratio 443 Newton meters input torque 3 2 input torque 2 95 Newton meters Lead Screws We generally think of a screw as a clamping or fastening device but they also find wide use as rotary to linear motion converters The principle of operation is simple as the screw turns the nut is not allowed to rotate and so it must slide along the screw and push or pull whatever it is attached to along with it In the lab we will use plain threaded rod and weld nuts for lead screws but for industrial or precision purposes specially designed screws and nuts are available ACME threads are square looking and can support heavier loads without stripping than conventional screw threads They require special nuts obviously and are available through the McMaster Carr catalogue Figure 19 shows a lowfriction plastic used in the lead nut This type of system is lower cost and lower friction but lower capacity than an allsteel system 14 u 1 1huse 1h F1gu1211E These have 1uuhueu gvuuves 1h wh1eh baH heavings e11eu1s1e1h1uuuh a 1s111y eump11es1eu hu1 Eaii scvews have uuuu 1usu hshu11hu espsh1111y shu vevy iDWiHEiiun h111 he suh1ee1eu Wheh1u1s1eu s1h1uh speeds 1he scvew 1ehus 1u bEIW hke a1ump1upe shu wh1p shuu1 1he 1u1s11uhs1 shs Excesswe Vibvaiiun shu s11ess uh heavings 1esu11 The scvew suppuvis 1u11he camage u1 1he muvmg e1emeh1 Figure 1 9 left Plasue lead uu1 msen t 1 1 1V Figural 10 above Ball screw and uu1 Machine Screw Basics scvews shu hu11s useu 1u1 1ss1eh1hu 1h1hus ingeihev Smews s1e u he1s11y e1sss1heu s1e1u he useu1u1shu aisu seeu1u1hu1u1he1ype hesu1he scvew mpie 1h 1he hs1uws1e s1s1e s1 Luwe s yuu Wiii 11hu wuuu scvews shee1me ai se s mseh1he scvews hexrhead cap scvews camage buiis shu hume1uus nihevvanams A11u11hese eume 1h a We 1shue u1 51225 uneh 1h sevevai u111e1eh1 ms1e11s1s sieei mass s1s1h1ess 5122M z1he eus1eu s1ee shamzeu sieei e1e e1e Evuwse ihvuugh 1he MeMss1e1 h1 11 vcum 1uu1lt e u 11a 1 wwwmcmasie Can es1s1u uhue1 1ss1eh1hu shu ses11hu A 1es1 1e1e1ehee 1u1 11 1 u1 mu1e yuu 2v wsh1eu 1u W abu 1 1 ehs1uhs shu s1shus1us1u11h1esueu1ss1ehe1s1s Ma h1he1y s Handbuuk 1huus111s1 Pvess 1 New Vuvk N 1 N 1 831171155 1 We Wiii he mus11 1e1es1eu h 1he uehe1 iciass u1 vews 11eu s1zes u1se1ewshu11s Man he scvews s1e spee11eu1h1e1ms u11he11u1sme1e1shu1he humhe1u11h1esus p21 1heh aisu es11eu p11eh Fm exampie 3 Mn scvew has a hum1hs1u1sme1e1u1m1heh shu2u1h1esus p21 1heh Sms11e1 scvews W11h a u e am u1u1lt 1 s a 5 A u1sme1e11h1hehes 11yuu hee k 11 up u1 uu whs1mus1peup1e uu shu u1u1he scvew up hen 1e 3 gm ihveads yuu heeu1u1uu u1111h11shu see 11111uu1lts11 Lead Screw Pitch and Travel A11u11h1s has been 1esu1hu up 1u 1he iupm u11esu scvew p11ehes shu huw1u knuW huw1s11he1esu hu1 Wiii muve 1u1 eseh 1u1h u11he1esu scvew The es1eu1s11uhs s1e pve y easyiihveaded 1uu has Singie eh11y1h1esus11e uhe spwai 1he 1ehu1h u11he1uu Theveluve 1u1uu11Aezu 1esu scvews 1he 1esu hu1 Wiii ivavei uhe 1heh 1u1 eseh 2u1u1hs u11he1h1esueu 1uu u yuu purchase a NEW Teau screw err baH serewr yuu eah check The speerheaTruhs m trave are u have Tuuhu err sa vaged yuu need m examme rT eareTuuy Same screws use mump eremry er The Thre as TrusTeuuhTThe umperuT uaueysp hahu assume The same reTaTruhshrp hm hm WrTh rhuTTrpTe ehTry Threads There ar e rhur a aTeT hesTeTT T UH Whmhrsuhm T rprTehTha Therqu appear Trurh easuaT upseruaTruh Tuse er has rhuTTr T ehTrres exarhrhe The ehuuTThes re he see h uhe pTaee where The Threads Stan aT The End u su Euum Them Suppuse yuur screw has 2 ehTrres Theh euery erTher peak err uauey peTuhgs Tu The same Thread see hgure T M Tu TrahsTaTe reuuTuTruhs m The screw Tu hhear travek measure The Trurh The peak uruauey uTuhe screwmread m The hexT peak uruauey m The same 3 deTa Thread FrgureT TT Tap Lead screw erh uhe Entry puTTum Lead screw WTh WEI ehTrres Crank and Slider Ohe uHhe mus1 urhrhuh mechahrsmsvur TrahsTurmrhg hhearTu ruTary muTruh ururee haTT r 1 arr eumpressurs aha reTrrgeraTruh eumpressurs Engmes aha eumpressurs whreh use prsTuherahkshaTT meehahrsrhs are aHed reerprueaTrhg Engmes m msTrhgursh Them Trurh TurprhesurreTehgrhes errTrurh uhe uTThe manynunrpmuntypesuicumpressurs The crank aha shder rs ah EXEEHEM meehahrsrh Terr geheraTrhg repeTrTrue mmmn puT has a humpe erT seueraT TeeT There rs a huhhhear reTaTruhshrp peTweeh The ruTaTruh ahgTe aha The hhear msp acement gheh by s r SW17 wnh s bemg The hhear mspTaeerhehT aha a7 The crank ahgTe Arr exTehsruh u The shder crank rs The cam and Tuuuwer mechahrsm A cam rs ah eeeehTrr eTerhehT muumed uh a ruTaTrhg shaTT 1 TT mm TT pushes uh a run err ruHer uaTues rh a reerprueaTrhg rhTerhaT eumpusTruh Engme MaTherhaTreaT ahaTysrs erT cams rs quotEms Trrurah aha Wm pe nvered rh uhe uTyuur maehrhe aesrgh euurses TaTer rh The eurrreuTurh mum 12 Amumume Hanksth mm andcamsha wivawa Exmmedww 39 Bearings Bearings are simply places where two parts that are in motion relative to each other come together Bearings can accommodate both rotating and sliding motion or even a combination of the two Some types of bearings are designed to prevent motion in a particular direction while allowing motion in another Bearings come in a variety of designs shapes and sizes but their primary functions are generally 0 To allow one part to move relative to another while controlling the motion in at least one axis To reduce friction and wear as much as possible on moving parts To reduce bending stresses on shafts To provide a replaceable sacrificial part in a large or expensive mechanism A plain bearing is where a shaft simply slides through a hole and is free to either rotate or slide The shaft is constrained from translation in two axes perpendicular to the axis of the bearing see figure 112 It is free to translate along the axis of the bearing or to rotate about the axis of the bearing A shaft supported by a single plain bearing is also partially free to rotate about either of the two axes perpendicular to the bearing axis due to the necessary tolerances between the shaft and the bearing Thrust bearings allow rotation of the shaft but prevent the translation of the shaft along the axis of the shaftbearing see figure 113 Consider the hinges of a door Hinges are constructed to act as a thrust bearing preventing the door from sliding along the hinge pin and resting on the floor Thrust bearings are found on all motor shafts swiveling chair seats lazy susan mechanisms and thousands of other places Just as for rotary motion linear motion requires bearings to constrain the movement of the components to the proper direction Numerous options exist For precision motion hardened steel rods or rails are often used in conjunction with either plain or linear ball bearings Plain bearings are generally made of a smooth low friction plastic such as nylon Teflon rulon or others The McMaster Carr catalog lists many options Look again in power transmission and find Linear Bearings Plain bearings are used when the loading is low and the speeds of travel are low to moderate For high loads ie heavy stuff and rapid linear motion ball bearings are available in a number of configurations ranging from round shafts to keyed flat or rectangular slides One of the biggest suppliers of linear bearings and guides is Thomson Industries httpWWW ir home htm lf extreme accuracy is not required there are many simpler and cheaper solutions to constraining linear motion From plastic guides on extruded aluminum beams to small casters riding in metal channel myriad solutions can be found to guide linear motion Examine everyday objects around you to see how linear motion is controlled Look at drawer guides garage door track sliding van doors whatever you can find that moves linearly and see how it works A company called 8020 produces a line of products they call The Industrial Erector Set htt www8020net Steel SemiPrecisiun Ball Bearings A n 52335 Plain ngl P044 M4 Sleeve Flanged Steel Ball Thrust Bearings up T I 511quot T 11qu IWOB AT qu 5 va 1mm n RnllevAssemblv D k m 1 gurEW 13 Cummun Eea ngs uund at thwwwmcmastercom Homework 1 Gear A is a 12 pitch 28tooth gear It needs to be meshed with Gear B whose shaft is 30in from shaft B How many teeth should Gear B have 2 A 40tooth gear and a 16 tooth gear are both 12 pitch and need to be meshed How far apart should the shafts be 3 If a 108tooth gear and a 36tooth gear are meshed together with a shaft distance of 225in what is the pitch ofthe gears 4 A8 teeth B40teeth C24teeth and D40teeth The pitch diameter of gear A is 8mm Gears B and C are on the same shaft If block E is 05kg what is the output torque TD If the instantaneous velocity of block E is 075ms what is the speed of Gear D in rpm39s 5 lfthe output torque MC must be 3M3 how many teeth should Gears B and C have Gear A has 26teeth A 6 Set up a gear train whose gear ratio is 215 You may choose from the following inventory of gears one 8 tooth gear one 16 tooth gear one 24 tooth gear one 40tooth gear and one 48 tooth gear You do not have to use all ofthe gears 20 0 the motor m the dwagram be owtums a1 3000 RPM nd me hnear speed of me camage bemg drwen by me new drwe manta carnage Chapter 2 Electricity 22 Basic Electricity Theory Electricity is the flow of electrons along a conducting material Electricity is used to produce heat light electromechanical motion and to represent and manipulate information There are very few mechanical systems that are free of some type of electric or electronic control Voltage Volts Voltage is defined as the total work measured in Joules per unit charge associated with the motion of charge between two points 1 volt 1 jouIecouloumb In more intuitive terms Volts V are a measure of electrical potential or driving force Using the fluid flow analogy voltage is like water pressure Current Amperes mps are a measure of electric current It is literally the number of electrons moving past a fixed point per unit time 1 amp 1 coulombsecond Because an ampere is a great deal of current electronic circuits are commonly expressed in milliamperes Using the fluid flow analogy current is the number of molecules of water flowing past a fixed point per unit time Here is a glossary of other common terms that you will encounter Direct current or DC is the flow of electrons in one direction only Examples of DC power are automobile batteries flashlight batteries and the power supplies that you will be using in our laboratory Alternating current or AC is electron flow that reverses direction at regular intervals For example electricity from a standard wall outlet oscillates in a sinusoidal pattern with a frequency of 60 Hertz cycles per second Conductors are materials that permit the relative free flow of electrons Examples of conductors include copper silver gold aluminum and other metals Insulators are materials that do not allow the flow of electrons Examples of insulators are rubber glass ceramic wood paper plastic and air Semiconductors are materials or combinations of materials that can act as an electrical conductor under certain conditions but it is an insulator under other conditions Examples of semiconductor materials include germanium gallium arsenide and specially treated silicon We will explain semiconductors in greater detail in chapter 3 A circuit is a closed path for electron flow consisting of a source of electrons and one or more components A complete circuit also called a closed circuit is required for electricity to flow A complete circuit is achieved if all of the elements in the circuit are connected by conductors in such a way that an electron can leave its source and flow through a continuous path back to the source The source is usually a battery or a power supply at least in the case of DC systems A coulomb koo Ic39m is a unit of electrical charge One electron has 160219 103919 Coulombs Therefore 1 Coulomb of charge is approximately equal to the charge of 624 101B electrons A switch is a convenient device for allowing a circuit to be either open or closed Open and Closed CircuitsFigure 21 illustrates the concepts of open and closed circuits as one would experience them in a flashlight When the switch is closed the circuit is complete and electrons will flow from the source through all of the elements in the circuit and back to the source When the switch is open no current can flow and the bulb does not 23 hum Nme that n 5012 mum mm emmvuns and nuuusHhe memmnsmemsewesmat cause me mm m hum c 3 39nc e and camp s e Icui 5 Ashan clrcu s a specwa mm my mum mm mm uenevau be avumed Summse WE curmemed we pusmve and mam evmmas m a banevy m we supmywnh a wwe m same umev gum cunduduv m cunem Wm be vevy mam heatmu up the wwE and m bananas EventuaHy EnhEHhE wwe uHhe baneneswm mew upemnume mvcun Atuse s unduc mg malena mm W men and upen m mvcun mu much cunem mm mm n H5 pumuse s m mm the umev cumpunems m the wow hum vecewvg mu much cunem Anndewsmejunmmn mm mmqu execmcax cumpunems Grnund sa bash vevevence mm m me mmmHu curmecHu and mam veamngs Name Sea name 21 In an examine m a schema and name 2 2 In a m m cummun symums 39J Fu5e mmm mg m mum MW Mm mm MW A fr n M a W WWW J m mum 22 m2 Vasmun Reswstuvs ave 5am m be m pavew w au came heads and 3 mm aHs ave cunnememugemev See uuvez mvexaminesulsenesandpavaHeHesmms W name 2 3 a h a sehes CHEM the EUHEM 5 the same a evevy pmm h the chcuu Luuk at ame 25 Each YES S DY has the same numbev c1 execnchs muvmg quotWaugh M Them 5 he mhev paw mattheycantake amps R1 F12 R3 name 2 5 Cuhehmcw m a sehes EHEUN Resista ce The YES S uV s ah execucmc ccmpchem that pamaHy ubstvuc s the aw c1 2 2dvuns A bypvuduct c1 W5 pmcess 5 ma they mea e heat R esmance s measuved h Ohms nm The ves stance m a ccmpchem ch emen s a mhchch c1 Ms cumpusmun ahe Ms 5 22 R eswswny s measuved h uhmrcemwmemvs Fm a gheh ma ehah the ebc nca ves stance c1 ah emem made hem that matena s gweh by Rp LIA 21 Wham p s the ma ena ves swny uhmrcm L s the ength m the chem cm ahe A s the vussrsemmnd avea m cm2 We Wm he usmg a vew emeyem kmds c1 ves stuvs m uuv abuvamvy hesmes med va ue yeshsmys We Wm a su he usmg pu enuume evs ahe phmc ves smvs A putammmetev 5 a veswsmvwhuse 1255137152 cah vavywnh a knub semh Ah Exammg Ma putammme ev 5 a the vu ume knub ch emey s eveus A phmc YES S DY 5 a 125mm whcse va ue changes Wuh the amuum c1 ham n yecehes th um phcm ves stuvs ah mmease m ham causes the YES S anEE c decvease R eswsmvs Wuh hen va ues have these va ues ehcceee ch 012quot hcmes as sthh m ame 2 A Resistor Color Chart Sham code F7gure24 K 777 H Han Equivalent Resistance Any se es andor paraHe7 combmanon of remstors can be reduced to a 5mg e equwa7ent remstance Rem Re 50er the combmanon by a 57ng e res7stor Wm vame Rem u 7 separatew Fmdmg the equwa7ent resmtance Few of remstors m se es 7s a s7mp7e ask you met add the vames ofthe remstors see examp e 2 7 Exampe 2 7 Camare the ram resStance of the 57mm Shown 0eow R7 75 7000 R2 75 7000 am R3 75 2000 R1 R2 R3 SOuIO R9 R7 R2 R3 R9 7000 7000 2000 4000 Tu m 102 eqmmem ves1s1ance u ves1s1uvs m pavaHek use me 100ng uymma demunshamd 1n exammg 2 2 1 1 1 1 22 Req R1 R2 R3 Exam 1e 2 2 Calculate mg 1015 resszance 0 09 01mm shown below P1 15 1000 P2 15 1000 and P315 2000 R1 Sounon 10 101 1P2 1P3 10 11000 11000 12000 025 Re A00 1s genevaHy easmnu Man my me uu sme and Wuvk yuuvway 171 See exammg 2 3 EXampe 2 3 Calculate mg 1015 resszance 0 09 01mm shown below P1 15 1000 P2 15 1000 P315 2000 P415 3000 and 0515 2000 R1 Sounon F05 compuze mg eqmvaem resrsfancv oMe senes 795151075 PA and 05 04 05 3000 2000 5000 045 Now Compute 09 parallel resszance 10 01 102 103 10045 10 1000 11000 12000 15000 027 01 37 0A0 Basic Electricity Calculations Ohm s Law rh s law states that there is a linear relationship between voltage across a resistor and the current that flows in it and current based on the resistance or the circuit You must become comfortable With each Varlallol i orthe roiiOWihg formula V VR I R 23 R I Where v is voltage i is current and R is resistance Wheh solving problems there is generally several Ways to apply ohm s law to get the same result see examples 2 4 2 5 and 2 EXampe 2 A Cacuale the currerilalR7 R7 ts 2000 12 Volts R1 Soulori 39 I VR 72 voIs200IZ 60 WINamps EXampe 2 5 Cacuale the currerilalR7 R7 ts 7000 R2 ts 7000 arid R3 ts 2000 12V R1 R2 R3 Soulori t1 krioW lhalRw of the circuit ts 4000 That39s 700 700200 S 39 I Yo 0 you can use ohm s aW VR 72 wits4000 30 mittiamps Exampe 2 s Cacuate the current at each or the resistors R7 is 7000 R2 is 7000 R3 is 2000 aha RA is 3000 12V R1 R2 R3 R4 Soulori First fwd the equivaerilresslarice of R2 arid R4 7Rw R2 7R4 7 00 7300 Rea Z Volage across R2 75127001275Z200Z 72 ols 2 A VoIs Volage across R4 Volage across R2 2 A ols riew appy ohms aW to R2 and RA Ohms aW atRZ VR 2 A vots 7000 24 mittiamps Ohms aW atRA I VR 2 A wits3000 a mittiamps ritew atRi atRS at R2 at RA 24 mittiamps a mamps 32 mittiamps Aternate Soutron To hno at P7 and R3 ynu couto atso have fuund the equtvaent resrstance ufthe entre ctrcutt Rev R7 11R2 1R4 R3 100 11100 1300 200 3752 Then appted ohm39s taw to the entrre ctrcutt VR 12V37512 32 mrhamos So the current at W N R t mm m Kirchoft s Voltage Law KVL Ktrchoff s votta e taw states that the sum of 5H source vottages must be equat to the sum of 5H toad vottages sot at the net vottage t5 0 A source vottage means a battery r other power source The toad vottages are vottage changes across each of the reststor5 r other components m the ctrcutt Look at examptes 2 7 and 28 bastcaHy go around the o o Examote 2 7 Look at the schematrc t t Vuu knnw other uotage tosses as fulnws R2 5 uots 12 v A B R2 R1 Soutron 12 uots e 5 uots 0 R1 7 uots Examote 2 a Look at the schematrc what ts the uotage change mm mm A to mm 57 Wu knnw other uotage tosses as fuluws R7 3 uots R2 5 uotts R4 2 75 uotts and R5 5 uotts R1 R2 R3 R4 SUMNER 9 VUtsr 3 WM 75 WM 43 2 75 VUts 9 WM 75 VUIs 0 P3 7 25 VUIs w Examote 29 Look at the schematrc what ts the uotage change at R37 Vuu knnw other uotage tosses are as fuluws R7 5 uots R2 5 uotts R4 2 75 uotts R5 5 uotts R7 3 uotts R8 1 25 uots and R9 4 5 uotts R1 R2 R3 R4 Soutron Frrstyou nt wtt th ttage change atR5 97R59r45772573750 R5 4 25 Vots dropped Now you can apply KVL to the too loop to nd the votage change at R3 97425975757R372 750 R3 7 Vots dropped Kircho s Current Law KCL horr s curreht aw states that the sum or aH currents ehtermg a home must eouat the sum or aH currents teavmg the home Look at houre 2 5 r3 must eouat 2n mA because the 3 5 30 mA thureZ 5 Voltage Divider Rule A vottage mvtder rs just a c m rhatroh or two or more serres resrstors across a vottaoe source Cohsroer the rohowrho crrcurt houre 2 7 R R1 lt lt gt Froure 2 7 Vottaoe omoer crrcurt H Stands 0 reason that VP WtH be 855 than V5 but more than Zero provtded R2 gt El Vp Shoutd he a fuhmmh of R1 R2 From ohm s aW We knowthat 24 From Ktmhoff s tawwe know that V5R1R2 25 Then VsR1R2 25 Whch can he Suhstttuted thto equatmh 2 E to get VpR2R1R2V5 27 t See exempts 2 turorah exampe Example 2 10 Camare he vntage acmss R1 1R11s 10022 R21s 10022 and R31s 20022 12V R1 R2 R3 Suuzmn Fur 201s grubem yuu can use he vntage may rule V0Iage acmss R1 100221100221002220022 12 V0ts Vntage acmss R1 3 V0ts Any arm can be thought of as avonage deer just ook at n as a se es mun bumnd me equwa1enues1stance of any paraHe componenta rst See examp ea 211 and 212 Example 2 11 Camare mg vntage acmss each arm resrsmrs 1R11s 10022 R21s 10022 R31s 20022 and R41s 30022 12V Suuzmn Rrsz 1mm sawsem resrsrance 01 R2 and R4 Wig 1R2 4 1R4 1100 41300 3 7522 NW mg v0Iage mmarrue can be used V0Iage acmss R1 10022110022752220022 12 V0ts 0 age acmss R1 3 2 V0ts V0Iage acmss R2 7522110022475224200220 12 VnIs Vntage acmss R2 2 4 V0ts V0Iage acmss R3 20022110022752220022 12 V0ts Vntage crnss R3 5 4 V0ts V0Iage acmss R4 Vntage acmss R2 because vntage 1s cummm m paral9 Vntage acmss R4 2 4 V0ts Example 212 Camare mg vuzage acmss mg cnmbmed resrsmrs 1R4 0 R5 1n mun shuwn Deluw 1R11s 10022 R21s 10022 R31s 20022 R41s 30022 R51s 20022 and R515 15022 R3 Suuzmn Rrsz campuze he scumelem resrsrance 01mg paral9 resrsmrs 1R2 and R3 1Rav 1R2 4 1R3 a 55 722 NW use he vntage may rule VoIage across PAampP5 magnum 41001255 7g30m20m4 5m VoIage across was 12 Vozs 35 Vozs Power Wans ov rs a measure or power Power rs Wuvk durre per urrn me n carr be represented bythe VuHqug ve auunshwp PowerVoltagfcurrent 2 a mm the execmc cumpany s om rs based my me number or wans used per mum Luuk at warn esZ 13 andz 14 Example 2 13 Suppose have a BMW pom bubm my desk lamp A sandard wail oure produces 110 voIs How much currem does I use7 Souzrorr PoweFVoIage cwrem 50 Watts 110 voIs ms Example 2 14 Fwd zrre power used by Mrs crcurz m rs 1000 P2 rs mm P3 s 2000 PA rs 30m Sounon Frrsz lmd zrre currem rrorn the panery 9 3750 WP 1 12V375Q 32m Now power voIage currem Power 12w USZA 384 Watts Chapter 2 Homework Set 1 Determxm the magma betweenA andE m the fn nwmg gnes 1a 77 m 2 A 39 39 1 1b 77 m A 20 B 1 7 so A 300 200 E le 30 A 7D 90 B 2 Use Ohm 5 Law to solve these 2a Current m cmum W 2b Volmge atpomLB 5 Volts 2 a 3 Determine the voltage of the battery in the following 3a I 1 amp 3b 1 amp 3c 35 4 Determine the current at the given points for each of the following 4a A B 36 Chapter 3 Electrical Components 37 ElectriCIty and Magnetism in the 18205 it was found that an electric current could be produced in a circuit by h e m 39ng a m ne m that a changing magnetic eld creates an electric field Later it was found that the reverse was also true that a changing electric eld creates a magnetic eld Have you ever made one ofthese electromagnets with a battery piece ofwire and a nail or screwdriver Try it at home it worksasee figure 3 Use small gage wire and many turns around the nail so you don39t short circuit the battery Paper Clips Figure 31 simpl The coil and iron core setup is the basis of many electrical devises that we use today such as speakers microphones inductors relays motors generators and transformers Here is a glossary listing of several electrical components A speaker has a large diaphragm attached to the light weight coil The coil is free to move so that changes in voltage in the coil cause it to vibrate which causes the diaphragm to vibrate which produces the sound waves Magnet cross semion Voice Coil Figure 32 Parts ofa common speaker One type of microphone has a small diaphragm attached to the coil it works exactly opposite a speaker Sound waves cause the diaphragm to vibrate which causes the iron core to vibra e These vibrations can e read as voltage changes in the coil other microphones work on changing composition or resistance A motor converts electricity into rotary mechanical motion For a good description of how the mom 39 39 39 M A genemor converts rotary mechanical motion into electricity it is very nearly opposite of how a motor works All automobiles have a kind of generator called an alternator An inductor is a coil of wire and may have an air core or a metallic core The electromagnets speaker coils and many other devises are inductors Inductors present a low resistance to direct current but a high resistance to changes in current The voltage across an inductor is given by VLLdidt 31 where i is the current through the device t is time and L is the inductance Inductance is determined by the core type and the number of turns of wire For high frequency or rapidly changing signals didt is very large and the inductor blocks these signals For DC didt is zero and the voltage drop is due only to the resistance of the wire used in the coil A good description of inductors can also be found at httpwwwhowstuffworkscominductorhtm A transformer is a devise that couples two AC circuits magnetically rather than through any direct conductive connection and permits a transformation of the voltage and current between one circuit and the other circuit Note Transformers do not work for DC It consists of an iron core and two coils around it One coil the primary is connected to a power source and the second coil called the secondary becomes the power source for the circuit Stepup transformers stepup increase voltage at the expense of decreasing current Stepdown transformers decrease voltage and increase current These are determined by the ratio of the number of turnswraps if the secondary by the number of turns in the primary turns in secondary n2 Turns Ratio N 32 turns 1n pr1maryn1 such that V2 voltage in the secondary N V1 voltage in the primary 33 and I1 current in the primary N l2 current in the secondary 34 Example 31 Suppose I have a 120 volt power supply and a transformer with 300 turns in the primary and 100 in the secondary What is the output voltage What is the current in the secondary if the primary has 5 amps Solution N100300333 l1Nl2 5 amps 333 l2 V2 120 volts 333 40 volts l2 15 amps A relay is an electromechanical switch It uses an electromagnet to close a mechanical switch Figure 34 is an example of a double pole double throw relay The throw is the number of switches the relay has The pole is the number of contact points for each throw The relay allows small voltage and current to control the switching of a much larger amount of power An example of a use for a relay is the ignition of your car The small wires in your steering column trip a relaythat is connected to the huge battery cables A capacitor is an electrical component that consists of two parallel plates that have a very small gap between them It can be used as a filter because it blocks DC but allows AC to pass It can also be used to temporarily store or build up electrical current A solenoid valves take electrical signals as inputs and control the flow of fluids as outputs They are most commonly used to control the flow of high pressure hydraulic oil or compressed air but can also be used for other liquids or gases such as water fuel oil steam refrigerant natural gas etc 39 Stepper Motors Stepper motors are a special kind of motor designed to move in discrete steps This can perhaps best be understood by looking at how they are designed While there are many variations you wi get the general idea by studying a simple type of stepper called the permanent magnet stepper onsi er the diagram below figure 311 The stepper rotor is the movin part attached to the shaft It is a permanent magnet with North N and South 8 poles The of be turned on and off Recall that like magnetic poles ie NN and 88 repel each other while opposite poles NS attract The magnetic polarity of the stator magnets can be controlled by controlling the current direction throug e coils us assume t a our stepper is set up so hat when we turn a coil on it generates a magnetic N pole closest to the ro or Then if we turn on coil A and leave all of the others off it is clear that the rotor will try to line itself up with its 8 pole aligned with coil A as shown in Figure 310 Left If we leave coil A on the rotor will come to rest in alignment with coil A allu In fact iWill 39g r this position The amount on 39 39 39 hnMimI farmn coll A coll A S COHD COllB COHD COllB N coll C coll C Figure 310 Left now 5 A Right now g If we then turn off coil A and turn on coil B the rotor will turn 1 rotation to the right and align with coil as s own in Figure ig ontinuing to rota e the magnetic eld around the circle will cause the rotor to align next with coil C then coil D etc Ea h locations is a stable osition That is as long as one of the coils is energized the rotor will Stepper Resolution The motor just described has only four stable positions when operated in the full step easy to e vision a need to have more 39on than this and ste rs available with many more than four steps per revolution The ones you will be using in your lab have 100 steps per revolution for example Many of the variations on the design of the er ve been created with a 39 proving the resolution and tor ues eed characteristics of the motors The invention of solid state electronic stepper controllers has made i possi le to generate literally thousands of steps per revolution from relatively simple stepper motors he met 0 or oing this is called ha 5 epping an can e one usin your motors Look again at Figure 1 and imagine that we control the coils in the following wa 1 Energize coilAanu waiilul memmul quot 39 39 39g 39 39 A 2 Without turning off coil A energize coil B Assuming that the two coils generate equally owerful magnetic elds the rotor will come to rest halfway between coils A and B It has moved exactly 1 2 s ep ow urn off coil A leaving only coil B energized and the rotor will move on to align itself I B wit coi 40 Microstepping Tne sarne tdea can be extended by tne use of etectrontc current controts Suppose tnstead of naytng eouat currents ttowtng tn cott A and cott By tnat tne current tn cott A were owtce as targe as tne current tn cott B Nowtne rotor woutd corne to rest a ttttte rnore tnan VA of tne way between A and B tan 10 5 26 5 degrees By controtttng tne retattye strengtns of tne currents between two adtacen COHS tne rotor can be rnade to move tn even srnatter tncrernents tnan tne natt steps descrtoed above UnipolarBipolarWindings n rnotors you wttt use are untootar Tnat rneans tnat you onty naye access to one end of eacn wtndtng tndtytduatty SChemaItcaHy tne rnotor wtndtngs took We thure 3 M s motors but nobody woutd ootner wttn tnat tn a untootar motor tne postttye suopty yottage ts an eacn of tne wtndtngs ts tnen connected to a drtyer tranststor wntcn acts as an Orvoff swttcn Btpotar rnotors are ayattaote wntcn oroytde access to ootn ends of eacn wtndtng tndtytduatty Tnese rnotors attow retattyety strnpte Hrbrtdge controtters to swttcn tne dtrectton of tne current tnrougn tne thdtngs aHon even rnore ttextotttty tn tne controt of tne rnotor 1 tne current tn cott c and caused tt to be a Soutn oote Dependtng on tne georn rnotor and tne state of rnagnettc saturatton of tne rotor tron addtttonat torque rntgnt be dertyed from tne rnotor tn tnts way Winding Geometries Untpotar rnotors sucn as yours accornottsn nt n resotuttons oy tncorporattng rnutttote es for re snows syrnoottcatty now tnts Works 9 3 M Left eacn wtndtng thu Eumman Lead can Lead thure 3 M t W t ttt t t tttttu ett Conceptuat dtagrarn of rnutttote potes for eacn wtndtng Mtddte Stator cotts sornettrnes are stacked atong tne rnotor axts Btgnt Motor wtrtng dtagrarn Semiconductors Semiconductors are materials or combinations of materials that can act as an unuel 39 quot 39 unuel unlel LUlluiiUll Examples of semiconductor materials include germanium gallium arsenide and specially treated silicon ome semiconductors contain combinations of ntype39 and39 ptype39 materials These materials are produced by chemically treating or dopin 39them Doping consists of adding a precise amount of impurities to the crystalline structure of the s miconductor When used in combination these m ter39 39 des and transistors In your EE courses you will learn whythey work For now it is important to understand their uses A diode is a semiconductor device that allows current to ow in one direction only from the anode to the cathode see gure 33 It has one section of ntype material and one section of ptype material The primary application of the diode is to convert alternating current into direct current urrpnt blov L I Anode Cathode gt limit can flow in this duectim39i Figure 33 Current ow at diode Unlike the resistor the relationship between current and voltage for the diode is nonlinear Ohm39s Law does not apply to diodes Figure 34 shows the IV plot for a typical diode As forward39 voltage is applied no current ows until the conduction voltage V is reached For silicon diodes VB is typically about 07V but can be In excess of 10V 0 specialty diodes and LEDs Germanium diodes have a lower VD typically04V or less Ej 1 current VPW I I I I I nlnlmls All lllIA VV 1Mge VC about 7 Volts Figure 34 IV plol ror typical diode Once VB is reached the diode becomes an almost perfect conductor and the forwar current I rises dramatically until the current capacity of the device lmax is reached f me Is exceeded the diode will be destroyed For this reason it is critical to have a currentlimiting element like a resistor in series with a diod h value of the resistor is determined by selecting the desired I and using the Kirchoff and Ohm s Law equations see example 32 Example 32 According to the manufacturefs specs the LED has a V of 10V when I 20mA Imax30mA Choose Rto make I20mA R LED 50V 1 Q Solution From Kircho j s VP VLED 0 5V IR 10V R 4V20mA 2000 Exercise Find the minimum value of R to keep the LED from being destroyed Return to gure 34 and look what happens if we reverse the voltage on the diode The current is blocked until VFW is reached and then the diode will be destroyed PIV stands for Peak Inverse Voltage Diodes can have a PIV ranging from tens of volts to thousands of volts T main speci cations are critical when purchasing a diode PIV and lmax For recti ers the circuit must be analyzed to determine the maximum current the diode must carry an the maximum reverse voltage to which the device will be subjected if any Specify the diode to exceed th e maxima For LEDs PIV is generally not a consideration and the rest ofthe circuit is designed to meet the LED s requirements for forward current A light emitting diode LED is a diode that emits light when a current passes through it A transistor is an analog three terminal semiconductor component that has two basic functions ampli cation and switching The NPN transistor is probably the most common transistor and gets its name from the types of material that it is made from it has two n regions collector and emitter separated by a pregion base A PNP transistor is opposite with two P regions sandwiching the N region 39J Collecto l l quot 39 r iEmitterl T l Collecto Figure 35 NPN IransIstor Figure 36 PNPTransi tor Botht oes ortrahsrstors oroyrde ampllflcatlon 0f the curreht abolred to the base The amount orarholrrrcatroh rs calledgarh ahd rs O el l gryeh the symbol 13 BCIIE 35 Where 1c collectorcurreht and 1B base curreht Tyorcal13 rahges from 50 to 1000 orrhore lh your EE cla se wrll learh to desrgh srrhole trahsrstor arholrrrer crrcurts lh thrs class we are most rhterested rh usrhg the trahsrstor as a swrtch drgrtal deyrces cah oroyrde only a few rhrllrarhos WA or drrye currentirlot h h to ruh a motor or a solehord yalye A srrhole trahsrstor cah oroyrde the curreht ampllflcatlon heeded to effect the cohtrol Cohsrder the srtuatroh rh rrgure 3 7 We heed to cohtrol a solehord yalye usrhg the 150 mA 0f collector curreht l9 rs a common wo orse trahsrstor costrhg about a 07 rh ouahtrtres of 100 rt has a 13 ofmore than 100 and comes rh a varletyof oac ages Solenoid Valve Needs a 12v 150mA boutlzv m to operate A A A A A 2N2222 Logic imx1 mA VVVVV 6100 Gate me 5v Flgure 3 7 Loglc gate scherhatrc We can connect the translstol as SHOWN ll l gure 3 7 To nd R remember that 13100 ClE IE 150A1000015A 36 The yoltage yBE rs rust a drode drop or about 0 7y actually a lrttle lower but use 0 7 So to turn the trahsrstor Ol l v5 must be about 0 0 7y where 0y rs the yoltage at the erhrtter The yoltage drop across R rhusttheh b V 4 5 07V 38V 37 R must be chosehto grye yR 3 8y wheh lB 0015 A1 so RV38V0015A253OQ 38 Sll lce 2400 0 rs a stahdard yalue choose R 24000 For swrtchrhg abolrcatrohs the yalue of R rs hot crrtrcal rt must be large ehough to lrrhrt lB so the trahsrstor rs hot destroyed but small ehough to allow adequate drrye curreht torthe load h optical sensor obtrcal ehcoder rs a swrtch that rs actryated by the presence of any obrect rh rts target area The o trcal sehsor rs basrcally a corhbrhatroh 0f ah LED and a ohototrahsrstor The L D sehds out a beam of lrght and the ohototrahsrstorwrll allow curreht to ow through rt lf rt senses thrs lrght The lrght takes the brace rth base curreh normal trahsrstor They are O el l used for bosrtroh cohtrol 0f rhechahrcal deyrses The 44 2 m major advantage of opttoaT sehsors over rheohahtoaT swtohes ts that they have ho movmg pa s ttrhe o There are two bastctypes of opttoaT sehsors through pass and re ecttve The through pearh sehsors h ure 3 7 are Urshaped and Wm swtoh wheh ah opteot goes betweent e 5 Oh when tts Stgna t5 re ected off an object back at ttse f Care must be tak TV when mounttng the re ecttve Sensor because an t 00 t far away or Beam blocked sensorto close sensorto far Beam can pass d39stance Fxgure 3 8 re ectwe Fxgure 3 7 through beam rs that We have hot tatked about here but sure some sort of ehvtrohrhehtaT for a computer to rea Examptes h the aboratory pressure sehsors Th re are mam otttereht types of sehso u yencounterthem H V ahotheroTass AH s ththg and report the resuTs as ah eTeothoaT ourreh hoTuoe the LM34 terhperature sehsorthat We Wm use oxygen sehsors and Marty others 3 g 3 o m Digital Electronics Dr rtat eteetromes rnvotves two thtngs srgnat proceSSmg and rmmaturrzatron Mrnraturrzatron rs takm many or the components that We prevrousty drseussed and rrttrng 3 u 3 3 1 e 2 e o 3 a E 2 g A g g a 2 E 1 I e NAND Not AND thus rt gtves an output or 1 mr every eombrnatron em and B exce both true The operatron or togre gates can be compac y deserrbed usmg a truth tabte or togre tame togre gates ror mgure 3 9 A E A O 0 0 B 0 B 1 1 AND Gate NAND Gate A I3 OUTPUT A El OUTPUT 0 0 0 a o B o o 1 1 OR Gale 1 NOR Gate 1 A y El OUTPUT 5 Exclusive OR thure 3 9 Logo gates with truth tables Chapter 4 Computer Operation 47 Handy Board Operation Tne Handy Euam ts a hanuhe d batterprWered mmmcummHer buard meat ter persenat anu euueattenat rebette prtuects aaseu en tne Metereta EEHCM mmmprucessur tne Handy Euard mcmdes 32K er batterybacked statte RAM eutputs ter teur DC meters ts r a vaner er sensers and a 1M enaraeter LCD screen Tne Handy Euard runs expenments EasmaHy yuu wnte a c pmgram en the desktup umpu r an men duwnmad ttte tne handy buard We wm frequermy be usmg newenarts te descnbe umputer prugrams Fur a uetaueu uesenptten er rnamng newenarts anu Wrmng c prugrams eensutt tne prerequtstte Engmeerwg 1U matertaL huwever tne ququg sectmns umam a nne renew Tne tew utrterenees between me cw trern Engmeenng U2 and tne trteraenve c C that We use wm atse be mseusseu Flowchart Review A newenart ts a magrarn useu te descrth the steps at a prugram 1 ts useu te strnpnty a mmcmt prub em mamng tt easter te wnte a prugram thure at snews tne eernrnen srnnets used and nas descnpuuns based en nanuyueare prugrammmg Frgures 2 4 3 andAA snew east newenart aarnptes Block Type Example oste Shape ShmEndegnm SumEnd Input me me Campmaonn SetSetpman kmbxeadmg om an Setpmm Wm Campnmans IfSetpmmgt127 at gure at Fhmchan sweets Ou me for an ake statement Oudme for an I statement No 52mm 1 nguveAZ Genenc uwchanexamp es printrquotnnquotx nguveA omhnevmatmxu p IC Programming The difference between C and IC are the compilers that are used When using IC a nice list of compilers are automatically included For detailed descriptions of C programming consult the Help menu of IC the Handy Board manual or your Engineering 102 material Here are a couple basic examples 41 and 42 Example 41 Count to 5 on the LCD screen with one second between each number using a for loop Solution void main int X forx1 xlt5x printf dn x sleep10 Example 4 2 Count to 5 on the LCD screen with one second between each number using a While loop Solution void main int X1 whilexlt5 printf dn x sleep10 x 50 Microprocessor Architecture rnpdters haye corne through a major eyotdtron m perrorrnance and pnce oyer the hey Work haye not changed stgnmcan y srnce t eg o CD ROM er drtve etc and yanods rnpdtodtput v0 deyrses such as a omto orthe e deyrces are connected to two Data BUS Frgdre 4 4 Generar personar computer archrtecture The bus rs nothm more than a set or wrres connected to each or the penpherar deyrces and to the CPU see ngdre 4 7 ach wrre corresponds to one tort or rnrorrnatron and ogtc 1 or 0 orts are represented by the yortage eve on the wrre For e an y oard a yortage or esS than abou 1 yort represents a ogrc or me and a yortage greater than 3 5 yorts represents a ogtc 0 or rarse yortage eyes and ogtc assrgnrnents yary rorn systern sy te Newer especraHy portaores are bemg created to run on oweryotages s o er and prorongrng battery hre Many wow power processors n the 3 yort range and newer modes are emergmg thh The data bus as well as the parallel ports use parallel data flow Parallel data flow is sending several bits of information usually 8 to and from the CPU or other device at the same time These 8 bits are called a byte and 4 bits are sometimes called a nibble It is important to be able to represent a byte with one number instead of a series of eight numbers so you need to learn hexadecimal notation One hex number can stand for 4 binary bits creating a convenient and compact notation Serial data transfer occurs through the computer s serial ports Serial ports have only one wire and send only one bit of information at a time The advantage of serial communication is that it only requires on data wire but the disadvantage is that it takes considerably longer to send and receive information The data rate of a serial transmission line is measured in bits per second since the data is transmitted on bit at a time The unit of 1 bitsecond is called a baud Most PC users should recognize this because modem speeds are measures this way ie 56k modem There is a number of ways to detect and correct errors in data transfer Basically it involves sending extra information along with the required information The more extra information you send the better the error detection and correction will be However it is a tradeoff because the more extra information that is sent the longer the data transfer will take The most common error detection involves sending a parity bit Seven bits of the byte are information and the last bit is for error detection It works like this add the ones of the first 7 bits if this number is odd the parity bit becomes a one Other wise the parity bit becomes a zero 52 BinaryDecimallHexadecimal Converting decimal and binary Method 1 To understand converting from binary to decimal and back you first need to understand the decimal system It is 2472 miles from Morgantown WV to San Diego CA The 2472 miles is the same as saying 2103 4102 710 210 miles Any time you use a number system other than base ten you need to put a subscript after it showing the number system that you used For example 10110101 binary would look like this 101101012 The binary system is based on fewers of two Therefore the binary number 101101012 is equal to 12 026 12 12 023 122 02 12 or 181 base ten To convert from decimal to binary you do the following 1 Divide the number by 2 and write the remainder off to the side 2 Divide the new number by 2 and write the remainder off to the side 3 Repeat step 2 until the number is 0 Your answer is the remainders read from bottom to top This may sound confusing but example 43 Should clear up any confusion Example 4 3 Convert 69 to binary Solution 69 2 34 with a remainder of 1 34 2 17 with a remainder of 0 17 2 8 with a remainder of 1 8 2 4 with a remainder of 0 4 2 2 with a remainder of 0 2 2 1 with a remainder of 0 1 2 0 with a remainder of 1 Now read the remainders from bottom to top 10001012 Converting decimal and binary Method 2 There is a second method that also works you can choose either one You make a small chart start at the left and see which numbers your number is divisible by See example 44 69 is not divisible by 128 so write a 0 below 128 69 is divisible by 64 and you have a remainder of 5 so write a 1 below 64 5 is not divisible by 32 16 or 8 so write a 0 below them 5 is divisible by 4 with a remainder of 1 so write a 1 below 4 1 is not divisible by 2 so write a 0 below 2 and 1 is divisible by 1 so write a 1 below the one Example 44 Convert 69 to binary Solution 27 25 25 2 23 22 21 2quot 128 64 32 16 8 4 2 1 0 0 0 1 0 1 10001012 Converting Hexadecimal and decimal Hexadecimal is base 16 When you run out of numbers start using letters You can count in base 16 as follows 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 So A10 B11 C12 D13 E14 F15 Converting from base 16 to base 10 is just like converting from base 2 to base 10 see example 45 Note that 1016 1 1 61 0 16 16 53 Exampe A 5 Sounon 14 153 A 15 2 151 110 15 58410 Cunvemng 1mm base 1n m base 15 1s vevy smay m eunvemng 1mm base 1n m baseZ asshuWn m examp1e45 Exampe A 5 Conxen 1528 I0 Hex Sounon Memod1 wrm a remamderoHZ wrm a remamdero 5 5 5 WM a remainder 0 5 New read zne remainders ham bonom Io mp 55c Memon 153 15 151 15 4095 255 15 1 5 5 12 12 c n so again 55ch Converting Hexadecimal and Binary Exampe A 7 Conven1011101022o Hex Sounon Fnsz conxen bmar Io decimalquot 1 2 2 1 25 1 2 1 2 m 2 17 an 7 EB Tnen mnven decrmaIo Hexi 18515 11 wrm a remamderoW 1115 0 WM a remamdero So zne answer 15 5AM Theve 1s a mek by eunvemng 1mm bmavym Hex Tne 135 um mans e1 We bmavy numbev beemne1be1as1 men e1 me Hex numben and me nex1 em e1 We bmavy beenmesthe nex1 me 171 Hex 11 5mm s eempbeaxem bm examp e A 8 Wm e1ea1 m up Exampe A 8 Convert 1U111U101I0 Hex Sounon Look at Me hrs low moms and Me second law moms separazey 21 0 21 1 29 1 21 0 21 1 239 0 26 so zne answer 15 5A Tu eenxen 1mm Hex m away 11 1s swmp es m eenxen 1mm Hex e demma and then 1mm demma e bmavy 54 Binary Decimal and Hex Homework 1 Convert the following binary numbers base 2 to decimal base 10 a 01101011 b 101110 c 11111 2 Convert the following binary number base 2 to hex notation base 16 a 11010101 b 10011010 c 11111110 3 Convert the following decimal numbers base 10 to binary base 2 a 64 b 226 c 24 4 Convert the following decimal number base 10 to hex notation base 16 a 1804 b 13 c 17 5 Convert the following hexadecimal notations base 16 to decimal numbersbase 10 a A7 b B2 c 65 6 Convert the following hexadecimal notations base 16 to binary numbersbase 2 a 18 b 45 c AC 55 7712 7rsegment H dxsplay 15 a eneep and popnzet way m dxepzey numbersa ezoexce emets ovens ete 7712 dxsplay consists of 7 LED 1 LCD oats and samenmes a bxt oen accardmg m the nnnneenng scheme as shown What hexadecxmal number would have to rastaztu 871m oarauet dtgttat output port Btt numbers correspond to dtsotay segment messno n Foren Zeo e u u o m zero ottne dtsotay St 7 ottne port ts connected to tne dectmat pomt etc 7 Woe a flowchart far a computer program that counts to ten thn a 2 second delay between eeen number Mmg rtn nnnnnousenotd commode 9vvnte a owchart descnotng tne tnner Workmgs of a pop macmne mdudmgreturmngme correct cnange Chapter 5 IO and Control Programming 57 Digital InputOutput IO Digital or discrete control systems are all around us Lights fire alarms elevator doors elevator motors heating system fans and dozens of other devices operate on a basic onoff mode Lots of industrial systems are also primarily binary either the part is present or not the Estop button is pushed or not the conveyor is on or not We use a variety of sensors to determine whether or not the part is there or the worker s hands are out of the way etc In the final analysis though all of them are nothing more than a switch What causes the switch to actuate may be mechanical force or heat or the presence of a ferrous material or reflected light or a variety of other things But in the end what happens is an electrical switch either closes or opens Digital output consists of a series of binary switches that can be used singularly as a simple on or off or combined to output more complex data like numbers or letters All digital conversations between sensors processors and the controlled device consist of the transfer of onoff or highlow signals Digital input is a highlow or onoff signal received by a device For example your car is equipped with an alarm that sounds if you leave your keys in the ignition while the car is not running and the door is open The digital conversation goes something like this When the car is turned off the processor asks the sensor in the ignition if the keys are still there If the answer digital input is yes then the processor asks the sensor in the door if the door is open If the input from the door sensor is true meaning a binary 1 or yes the door is open then the processor sends a signal digital output to the alarm which will turn on the bell The bell will continue to ding until you remove the keys from the ignition or shut the door hopefully not locking yourself out of the car Figures 51 and 52 illustrate this process Tum Bell ON Keys in ignition Tum Bell OFF Figure 51 Flowchart of feedback system for warning bell in a car door sensor Figure 52 Logic Diagram and ignition sensor truth table for warning bell system 339 In order for the processor to turn off the bell it has to continually recheck the input from each sensor Therefore the program that runs on the control computer will take the form of a loop In C this would be a while loop because it will execute as long as the computer is in the automatic mode 58 Control Program Logic Flow The TeheemehTel peTpese e The mTeTeeehTTelleT Ts Te eehTTel semeThThg eehT sThee Evalylhlrlg The mTeTeeehTTelleT eees Ts The TeselT el 3 pluglam TT Ts eleeT TheT The eeTeel eehTTel heppehs we The slgeTTThms TheT make up The pTegTem AT TheTT BUYE all eehTTel pTegTems sheTe seme elemehTs ulslluclule hTeh we lel ExammE Loops and Loops the while loop The weTe lump lel he esee Th Twe eTTTeTehT Ways wheh we lalk eeeeT eehTTel pTegTems ohe Way Ts Th The pTegTemmThg sense lalklng eeeeT a TepeTTTwe eyele el 3 cumpulelpluglam usuallyseluplulcunllulsasawhlle leep whne test condltlon statement statement r enene seeeenenm 7 Wheh The pTegTem eemes Te ThTs SEE lun TT TTTsT gees Te see Tl The TesT eeheTTTeh Ts TTee ll NEIL TT lel execule slalemenll sTeTemehlz she sTeTemehTa The elesee eele eTeeheT Tells The pTegTem TheT The leep Ts EIVEY she TT gees back Te The Tep she eheehs The Te eeheTTTeh egeTh ll The eeheTTTeh Ts s1llHlu2T T gees back ThTeegh The leep ll The eeheTTTeh Ts else The pTegTem sklps ENE The leep she gees eTTeele Te alemenm she eehTThees eh r h T ll Temp eeT eT eeTemeTTe eehTTel she sheT eewh eT ehTeT a manual eehTTel meee lh The ease eT The Hehey E ald The sTep eeTTeh pTewees a eselel ThpeT Te alluw ThTs eeTTeh Any eTheT ThpeT le Wulk huwevel The use eT The sTep eeTTeh Ts TllesTTeTee TeweTes The ehe eTThTs seeTTeh Loops and Loops open loop vs closed loop cont ro lh cummlslalgun we else lalk eeeeT epeh leep she elesee leep eehTTel FTgeTe 5 3 Ts a ehemeTTeT Te eh leep eehTTel sysTem lh epeh leep eehTTel The eehTTelleT Teees The seTpeThT she e leeleTes a eehTTel Tg al TheT she ld gwe eeTT u T Nu m eseT TThe eeTeel eeTpeT Ts see The weTeTT mpeTeTeTe eehTTel h a sheweT Ts geee exa pe e seT The heTeele valveslu gwe a TTT bl lellempalalule she 2v T hThg Wulks TeTle ll h T e Te he 7 he sehseT meeseTThg The eeTe l TempeTeT Te eT eT e T semeehe T Ths eh The TshwesheT thle yuu eTe Th T e s 1 sh e heTweTeT pTesseTe decleases lhele Ts he eeTemeTTe eeleslmehT Te We The sysTem back TeweTe The salpulmiyuu mesT manually TeeelesT The valves SE l Dlll CoTTTTolleT s e SysTeTn BeTTTg 5 lnnm T39c PTogTeTh TzonTTelled Figuresa OEen leep cnnlrnlsyslemThere is aseTgeinT haul and z eenTrel signal but nesensene mezsurelhe actual nuIEuI el The syslem lh elesee leep EDMYDL semeTTmes eellee Teeeeeeh EDMYDL a sehseT Ts esee Te meeseTe The sysTem eeTpeT she eempeTe The actual eeTpeTwTTh The seTpeThT FTgeTe 54 Ts a Genelally epeTeTTeh Te eTeeTe wheT Ts eellee The eTTeT Slgnali Ellulrselpulmramualslate The eTTeT sTghel TeTms The basls TeT The eehTTel Slgnal wTTh The eeTeeTwe eeThg Te We The eTTeT sTghel Te zeTe lT Ts easy Te see hem The sehemeTTe wheTe The Tehhs elesee leep she 59 feedback ceme hum The cluseu lump system can aulust rur chahges lh system ur alllpl lllllmlla l acmateu lh yuur car lquot System om plll Selpolhlg q lllput Belrlg Controlled Sellsol Fg re 54 closed loop control s stem A s provldes feedback to help adjust for system changes The lnput to the controller ls an error slgnal and sometlmes the setpolnt also dependlng on the control scheme Loops Either Way Control Program Flow le dEvlSlrlg ls upeh lump ur cleseu lump the s are glyeh beluw Nate the Stupibutturlomrlc un ls useu as the cehultleh rerthe whlle lee Open Loop Control Example whlle stopibuttono Recall ehae l means loglca NOT olnt fnsetpont on o shut down Closed Loop Control Example whlle stopibuttor n read setpolnt read feedback error a e pom e feedback control fnsetpont error cuepue control lay shue down Nate that lh hmh er the eltamples abwe the central slghal ls glyeh as a mhctleh er eltherthe setpelht erthe elmr slghal ur bum The term at that mhctleh can be uulte slmple ur extremely cemplelt The slmplestrerm er certrel ls prepemehal central and the mhctleh ls slmplya multlpllcatleh o ut K setpolm Fforopen loop case ur output K error orK1 setpoInH39 K2 ermr Horcloseo loop case K is some constant called the gain lso note that in both the examples the loop included a delay step This is because the computer can execute this little loop so fast that most of the other components can t keep up If you are using the Handy Board to control the temperature of the room there is no point in trying to adjust the temperature every 000001 seconds In fact there s not a lot you can do to anything mechanical in that short a time So chill In an advanced class we would learn how to send the program off to check the outside temperature make sure the windows were closed check to see if you were out of the shower if so turn on the dishwasher if not dial the office and download your email etc etc then come back and do the loop again In here we ll just work on the loop But do stick in a little delay say 01 sec or so The easiest way to do this is with the sleep function provided by IC Check out sleep and msleep HBM p 234 Setpoints Tweaking the Dials An important concept within a control structure is the setpoint A setpoint can be a fixed or adjustable point within the range of the machine that is being controlled which serves as the goal for the control system Some examples of setpoints are the temperature at which you set your thermostat in your house the speed at which you set the cruise control on your car and the number of rings that it takes for your answering machine to kick on The controllers in each one of those machines watches for that setpoint and once the setpoint is reached there is a change in the operation of the machine either the furnace turns off the fuel supply is decreased or the answering machine answers the incoming call In the case of the answering machine once the greeting begins to play the control loop ends and does not reset until after the incoming message is recorded Because the loop ends without checking the outside variable whether or not someone actually recorded a message is irrelevant to the processor the answering machine is an openloop system In the case of the thermostat and the cruise control the systems are considered closedloop because the controller will continue to check the status of the setpoint by comparing it to feedback from a sensor until the device the furnace or the cruise control system is turned off So where does the setpoint come from In some control systems it is fairly obvious you set the dial on the thermostat for a certain temperature you set the volume knob on your stereo for a certain level you push the elevator button for the floor you want In other systems the setpoint is sometimes the hardest function to spot Take the cover off your toilet tank and find the knob that sets the water level in the tankThe key to remember is that the setpoint is connected with the desired state of the system Sometimes there is a knob sometimes not Sometimes as in a car cruise control we push a button when the speed is correct The computer then reads the car speed sensor and stores that value as the setpoint ln computercontrolled equipment the setpoint will be just a number like everything else in the computer You will learn more about setpoints in a controls class For now we will use the little user knob on your Handy Board as a way to put in the setpoint The knob is just a potentiometer connected to one of the analog input channels that39s why you only have 7 It returns a value from 0 to 255 like any other analog input You can read the knob setting by using the knob function see p 22 of the HB Manual Try it with the HB running go to the command line and type printfquotIn d nquot knob Recall that knob is a function which returns an integer value So to use it you must assign the value of the function to a variable you have declared as an integer Example void main declare setpoint as an integer int setpoint setpoint knob printfquotKnob set at d nquot setpoint 61 Feedback Where it s at 0 we have the setpoint To close the loop we have to compare the actual state of the system to the setpoint Usually there is some scaling involved too Refer to the section in this chapter on scaling Collecting feedback is fairly obvious although not always simple We just need to stick some kind of sensor Won the system and measure the state No big deal provided you can find a sensor to measure what it is you are looking for You will learn about sensors in MAE 411 In the meantime we ll measure simple stuff like temperature pressure speed time etc The big deal here is that you have to scale the feedback and the setpoint signals so they are compatible with each other For example when you set the temperature control on your oven it s probably a potentiometer like the user knob on the HB You are setting a voltage that corresponds to the temperature you want in the oven Similarly the feedback device may be a gas bulb thermometer pressure output a thermocouple millivolt output an RTD voltage change output etc Each of these devices provides an output that represents the temperature in the oven It is necessary to scale the output of the feedback device so that it matches the input from the setpoint transducer before you can generate a meaningful error signal For linear systems this is usually not hard it just takes a little algebra DATA CONVERSION Although computers communicate in a digital language we do not live in a digital world Most of the information that we want to manipulate with computers exists in analog form Things like temperature pressure and speed have infinitely many values in a continuum and the computer must be able to deal with th se kinds of signals as well if it is to control many types of machinery omputers cannot deal directly with analog signals Like a foreign language the analog signals must be translated into a format that the computer can understand Analog to Digital Converters ADC perform this operation by measuring the input voltage of the analog signal and comparing it to a reference voltage A number is then generated that indicates the relative level of the input to the reference In the case of the HB the reference voltage is 5 V and the numbers representing the input level range from 0 to 255 ie 8 bits That is when the input voltage is 0 the number assigned to represent it will be 0 When the input voltage is 5 V the number representing it will be 255 Ideally all values in between 0 and 5V would be linearly proportional as in Figure 55 5 4 g 3 o gt 2 1 0 r r r r r r r r r r r r r 0 20 40 60 80 100 120 140 160 180 200 220 240 260 Increments Figure 55 Linear relationship between voltage and bitsize For example the number 73 would represent 732555 143 Volts Unfortunately the world is not ideal Once an analog signal is converted to digital values each of digital output represents a range of analog values dependent upon the resolution of the converter Resolution is the number of binary bits output by the converter Because ADC circuits take in an analog signal which is continuously variable and resolve it into one of many discrete steps it is important to know how many of these steps there are in total For example an ADC with a 10bit output can represent up to 1024 210 unique conditions of 62 5913 mexuremem Ovenhe vs ge mmeasuemml mm mm nub6 Wave Wu be exa v mm umque bwnarv numbevs mm W We mnvenev m umuuumuu thvmgh 1111111101an ADC mnsmdtwueasma vstahesm nsmmmrzuw avZM numam mucus EIEI U51E15 2U 25 3D 35 4D 45 5D Analoglnput mm 55 nunMm a Allmzlmu am me mm mm 1quot him nu my new Inns 1 non nmml mug mu munn links We maglnaw hne vepresems We ammg sqna hemg smp sd and We smwsepmd mmm hnes repyem me ma ah e mgna mm m am ug WM and mm mm amev s 3H wuss Wnae We hnes an mm names we mgna ampm Wu heme vaqu a he mmm hne m1 5 dasmmthe mm mama mm we me warm evmnhat En ammsanemnxhgSmea ked g a stms We genea equanm my rmer a s u m 57 WaxrvmmlM 4 Wave vmax an mamum and mmmum mm Mme ADC mmhevm ts mADCvesuan Fm eyathe Th ah Erbn eehyeneT WTTh a TeTeTehee vuhage ea D5yeTTs has a mamium TeseTuTTeh em IZVuhsslep SVUJZSEVT n me The amuum eTeuahTTzaTTeh eTTeTwuuTu heeeuaTTe u Esteps 577Vuhs2564512ps u uthTTs ahhTemiaTeTy Thu 2 NuTTee ThaT The euahTTzaTTeh eTTeT en The ADC Ts a TuheTTeh ea WEI ThThgs We haye eeyeTeu The humheT eT hTTs eT eemeTsTeh Em The eTTeT T aTse TuheTTeh en The ThhuT ah e eneTs aTe ayaTTahTe WTTh mahy hessThTe TDMW ITDW UTDSV andUTDWW ah ThhuT YangE eT may WhaT Ts The uhhese We aye ah a c euahTTzaTTeh eTTeT Th yeTTs uTThTs ueyTee u 5 Tum237T 5255 IUZVDHS rlwme The eTTeT M The 05v eehyeneT FeTThTs YEaSDn TT Ts Tm enahT Te maTeh The ThhuT YangE eTThe sehseTs and The ThhuT YangE M as use s ss AuuTe TeeeTuThgs aTe ahuTheT cummun use TeT ah ADC ATT seuhus aTe anaug sTghaTs Th The Tehh eTyyayes Wheh a mTeT h e eTTeeTs aeeusTTe Waxes They aTe sehT Te The ADC Th The Team eT yahyThg vuhages The eehyeneT musT Theh change These yahyThg vuhages ThTe a bmary TehTesehTaTTeh M The eTTgThaT seuhu yyaye Th eTueT Te sTeTe The ThTehhaTTeh TeT TaTeT use FTguTe 5 7 shews ah ahahg sThe yyaye and us uTgTTaT TehTesehTaTTeh o AhaTae Wave DTeTTaT TehTesenTaTTah Andng sineume and ils digilzl rquesmtzlinn The uTTTmaTe geaT Th TeeeTuThg seuhu eT ahy eTheT uaTa Ts Te he ahTe Te TehTeuuee The euThuT sTghaT su ThaT TT Ts TuehTTeaT Te Th e eTTgThaT ThhuT Hewweh pe ect hTayhaeh Ts TmhessThTe heeause as WTTh ahy Tahguage DENVEYSTDVL ThTehhaTTeh Ts TesT ThTheTTahsTaTTeh As yeu ha T uy EamEd eheTaeTeT aTTeeTThg The aeeuTaey eTThe TehTeuueTTeh Ts TeseTuTTeh AheTheT Ts euahTTzaTTeh heeause as Th maThe aTTeaT euaTTehs ehee ahumheT Ts YDLded TT Ts TmhessThTeTe TeyeTse The pmcEss ahu geT ah aeeuTaTe ah T A we TaeTeT aTTeeTThg The DC s s aeeuTaeyA eTTeuTThyT hTeT e quotEvy m h TTehTaTe ThTs Ts sTthy Thes eeuaT Te Thee T huT HEWbmaN humheT LTkEvEsuMT HyMTSEDHSMEWITDMS WKEd Te The sheeme ahhTTeaTTeh en The AD TTT e hyeTTeT Ts 2mg e m T e y ehahgThg sTg aTs such as TweT Th sluvage Tahh TT eeuTu hT ahTy ham a VEN sTeTh sa e TTe uehey and TT h uvm aueeuaTeTy uT TT Ts bEmg useu Te uTg e ah auuTe T euehey sTghaT eyeThg aT sweTaT Theusahu TT e heT seeeh y T Th Te he ADC s sathe heeuehey THEVEVDVE ahADC eTTeuTT has a satheTTeeuehey ea 5uuuu sz The thhesTTTeeuehey wayeTeTm TT eah sueeessTuTTy Tesehe yTTT he The NyeuTsT heeuehey ea 2 Dun Hz aluvaw The TasTeTThe ADC ahueTThe thheT The humheT ea hTTs eT YESDMTDH The meTeeyhehsheT Ts TT ah ADC Ts suhTeeTeu Te ah ahaTeg ThhuT sTghaT Wnuse heeuehey eyeeeus The mamium heeuehey ThaT ADC eah hard The eehyeneT yTTT euThuT a dTganEd sTghaT eT TaTseTy hm heeuehey ThTs hhehemeheh Ts hhuhh as ahasmg FTguTe 5a Ts a gTahhTeaT TehTesehTaTTeh eT hew ahasmg uccuvs Sampling Times Analog Signals Digital Signal Figure 58 Example of Aliasing A practical means of preventing aliasing is to place a lowpass filter before the input of the ADC This filter will block any signal frequencies greater than the practical limit The ADC circuitry will be prevented from seeing any excessive frequencies and thus will not try to digitize them It is generally considered better that such frequencies go unconverted than to havethem be 39aliased39 and appear in the output as false s39 nals 39 39 synt esizers create soun s yworking with dig39nal representations of sound waves in the form of b39na These representations can then be manipulated in a variety of mathematical ways different equations can produce effects such as fades an echoes but in order to hear the results 0 t ese changes orto hear a reproduction of any sound that has been digitallyrecorded the numbers have to be passed through a digitalto analog converter DAC The DAC changes the numeric representations of the sound waves to equivalent electrical analog voltages These voltages become sound after being fed into an amplifierand out ofa speakersystem Of course Cs are useful for many applications besides music and there are u erous wa to affect Digital to Analog conversion In the world of industrial control the ost common method is PulseMdth Modulation PWM PWM is used to control DC motor speed electric heater cunent lighting levels and manyother thin s PWM works bydilliding time into a series of on and off pulses The relative width of the two determines the output leve Figure 5 illustrates the idea Suppose we have a motor we want to nln at 2 speed If R runs at full speed with n Vmax then will run at 2 speed at n max2 But in a digital wor max2 is not convenient to create directly Instead we approximate it by turning on the power for half ofthe time and turning off the power for halfofthe time Then the average voltage is VmaxZ t on toff Time Figure 53 Illustration ol Pulse Width Modulation Tu maket e motor run and speediwe make ton 3 toll By controlling tne ratio ol ton to toll We can generate anyyaye between 0 and ymak ll tne suitcninglreguencies are yery ni deyices like mulurs neaters and lamps don eyen see tne onoll cycles Fortunately digital electronics are so lasttriat riigri sWitcriing rates are easyto optain Control Structure Now tnat you naye a pasic understanding ol now a processor communicates Witn liyes trien design the systems that control the macriine s lunction to suittriose parameters Closedrluup or continual control systems reguire some spe al consideration during i i a Sumet example il your lurnace were set to 72 de ees i lurnace to maintain sucn an exact temperature Opening a door to anotner 5 room or ap r ine lurnace Wuuld pe snutting on and oil constantly trying to keep tne temperature a tne desired leyel Tu preyenttne Wear and teartnat is associated Witn tne lreguent starting and neadnandi simply ln tne lurnace system example Witn tne setpoint still at 723 deadpand Wuuld alluw lor maype plus or minusl degree pelore reporting a cnange to tne processor Fulexample the lurnace Wuuld remain on until tne leedpack lromt e tn mostat reported a temperature UHSF and NF Man systems in Wnicn tne output is onoll contain deadpandto preyent rapid cycling Scalin g As discussed in tne section on ADC computers can only deal Witn digital signals Must oltne yariaples tnat are measured and manipulated are analog signals ln order to relationsnip ol tne analog signal to its digital eguiyalent Vuu must pe aple to tell tne summary in tne lorm ol a pluglam ekactlywnat tnat relationsnip is so tnat tne controller can oyer to a triermometer to crieck the temperature only to lind that it read l 55 Vults orto tryto sing a song in tne key UMAU Hertz 55 th eaeh meme Once the vanges at the memes are knDWn yuu have te knuW the vange at the pvucessuv Atter yuu knuW the vange at the pvucessuv yuu can set up a retattehshtp t h w u t the retattehshtps that yuu wtu eeat wtth m MAE 2M vesuh m stmpte hhear eeuattehs Ah exam e etthe scahng preeesster a temperature sehser ts thustratee m thure 5 tn ereer te estahhsh a retattehshtp hetweeh vahahtee yuu have te knuW the vange Volts 1 at y005x725 w Voltage Output 5 N o o 50 too 150 Temperature Input degrees F rigure51n Linear relminnship between temperature input and vnhzge nulpul as shewh m thure EIEIEIEI H T5EIF the sehser eutputs V vuhs H T15EIF the sehser eutputs VZSVUHS Between SEIF ahe WSDF v ts hheahy preperttehat te T Nuw when the 255 Thus wheh we mad the sehser mpuL the vesuh re a humher N that we must he ahte te camequot back tn the temperature T V N gt gt gt Fvum atgehra we can the v0 v mT b m tsthe stepe AVAT 5n t5ur5u u U5 v D5 T H atT D V l su L kew se we can the N as a tuhetteh at v Deh t wehy aheut euahttzatteh er W5 steprhea he ADC as a hhear dewce See gure 5 M ADC output N 0 1 2 3 4 5 Volts V Figure 511 Relationship between input Volts and ADC output N mV b m 255050 51 since N0 at V0 b therefore N 51V And from above V 005T 25 so N 51005T25 But we know N and want to find T so solve for T T N 1275 255 0392N 50 So if we want to display the measured temperature on the HandyBoard screen we can use this simple equation to calculate it How does quantization error affect this system Let s look Recall that N can only be an integer Suppose N1 then T 03921 50 504 Now suppose N2 T 03922 50 508 or N3 T 03923 50 512 You can see the pattern an accuracy of 02 degrees in this way or by using the formula for quantization error q 05 VmaxVmin 2N 1 055255 001Volts or 02 Over the sensors range of 100 degrees 150F50F this means that we can only measure the temperature to within 02 degrees For most purposes this will be adequate but if it were not we would need to use an ADC with a higher resolution perhaps 10 bits instead of 8 68 Controls Homework Set Show all work and provide proper units with answers where appropriate Round answers to 3 significant figures 1 Explain what is meant by Shit 10bit or 12bit when applied to Analog to Digital converters How are they different from each other What are the pros and cons of having more hits 2 An 8 bit AD has an input range of 0 5V If an input voltage of 177 V is applied to the AD converter what is the converter output 3 An 8 bit AD operates on an input range of 0 1V If its output reading is 89 what is the input voltage 4 What is meant by the quantization error of an AD converter and what factors affect it 5 A 10 hit AD converter is operating over the input range of 10V to 10V What is the quantization error resolution in volts for this converter 69 6 Explain the difference between open loop and closed loop control systems Give two examples of each system that are not listed in the text 7 What is deadband and why is it used in a control system Are there systems in which including deadband would not be appropriate 8 Explain in your own words the phenomenon of aliasing What is it and how does it occur 9 Light is shining on a photoresistor Rp so that its resistance is 10kg If the resistor is connected to analog input 1 on the HandyBoard what will be the value of x in the command xanalog 1 Recall that the HB inputs all have a 47k pull up resistor to 5V 47k0hm Handy Board g Analog 1 70 10 What is the possible range values of Rp in ohms when the HandyBoard reads 200 on analog 1 HINT This deals with quantization error 11 You are designing a control system for an oven based on the Handy Board The setpoint will be read from a potentiometer similar to the HB39s kn0b that is graduated from 200F to 500F as shown in the sketch below A special resistor called a thermistor will sense the temperature in the oven The resistance of the thermistor changes with its temperature You have already designed a clever circuit which causes the voltage quotoutputquot from the thermistor to be as shown in the graph You must now figure out how to scale the setpoint input and the feedback voltage so they represent the same thing temperature Both the setpoint voltage Vsetpoint and the feedback voltage eredback will go to the HB39s analog inputs 5V SOOF Vsetpoint Nsetpoint 8Bit AD OSV input range Nfeedback eredback 4v 5 B Oven 8 839 T g 15V I 200F 500F Temperature Deg F Find two equations a Find the equation that gives the setpoint temperature given the AD output from the setpoint knob Nsetpoint b Find the equation that gives the actual temperature in the oven given the AD output from the sensor Nfeedback NOTE that you do not need to find one to nd the other they are independent NOTE You do not need to find one to find the other they are independent 71 12 Suppose you connect your Handy Board to an LM34 Temperature Sensor The output of the sensor is 001 Volt per F If the temperature in the room is 93F what will be the reading from the AD converter on the HB 13 The relationship between Celsius and Fahrenheit degrees for measuring temperature is linear Find an equation relating C and F if 0 C is equal to 32 F and 100 C is equal to 212 F Show all work and draw a graph to illustrate your answer 14 The Kelvin scale for measuring temperature is obtained by adding 273 to the Celsius temperature Write an equation that relates the voltage output of an LM34 to the temperature in both Celsius and Kelvin 15 You are to design a control system for a fan The fan will be used to control air ow in and out of a kiln When the kiln needs to warm up the fan is to run clockwise blowing warm air from the combustion process into the holding area When the kiln needs to cool the fan must run counter clockwise in order to blow the hot air out of the holding area and up the exhaust While the kiln is at the desired holding temperature the fan should not run The fan speed should be a function of temperature whereas the larger the difference between the setpoint and the actual temperature the faster the fan should run The maximum range of the fan controls should be plus or minus 100 F from the setpoint Deadband should encompass plus or minus 5 F from the setpoint Full speed clockwise and counterclockwise is equivalent to positive 24V and negative 24V respectively Derive the equations for the functions relating the fan speed percent of full power and the temperature Show all work and draw graphs to illustrate your answers Explain how pulse width modulation could be used to control the fan and write the equation that could be used to control the fan speed with PWM Hint The equation will be a function of time on and time off 72 16 A simplified y by wire controller is shown in the schematic below The pilot moves the control yoke which is attached to a potentiometer The potentiometer puts out a voltage which can range from 05 V when the yoke is all the way back to 45 V when the yoke is all the way forward The signal goes to a Handy Board The HR drives a motor that controls the position of the elevators which have a range of 30 degrees A potentiometer is connected to the elevators and provides a signal of 5V when the elevators are at 30 degrees and 0V when they are at 30 degrees Control Yoke Potentiometer output Nbvenent 0 5Volts A HB l nalo 5 on HB Analog4 on lB Elevator deflection Potentiometer output 30 to 30 degrees 05 45Volts In your control code you will read the elevator pot by writing something like E analog4 a Find a scaling function De ection fE that will calculate the elevator de ection in degrees so it can be displayed in the cockpit b Assume that the position of the control yoke is the desired position for the elevators ie yolk back30 up etc Find the scaling function to relate the HB s ADC output to the desired elevator position in degrees 73 c The diagram below is a control block diagram for the system Label the boxes and signals to show where the yoke motor HB potentiometers etc fit in the diagram You may add boxes if you wish and remember that some parts of the diagram are software not hardware H d The error signal is S 9d 9 where 9d desired position and 9 actual position Assume a motor control similar to the HB with motorx100 full speed CW elevator up and motorx100 full speed CCWelevator down Derive a control algorithm so that o 05 S S S 05 2 motor off 0 05 S S S 15 amp 05 2 S 2 15 2 motor speed proportional to S o lsl 2 15 2 motor speed max speed e Create a logic ow diagram showing how you would use the signals from the pilot and the elevators to perform closed loop control of the elevator drive motor and display the actual elevator position on the screen at all times Do not worry about putting deadband into your controller yet You do not need to include the actual scaling equations in the ow chart but you do need to show where in the program they would be 74