Anda di halaman 1dari 166

SOLUTION MANUAL FOR

INTRODUCTION TO

MECHATRONIC DESIGN
J. EDWARD CARRYER
R. MATTHEW OHLINE
THOMAS W. KENNY
Mechanical Engineering
Stanford University

Boston Columbus Indianapolis New York


Amsterdam
Delhi

Cape Town
Mexico City

Dubai London
Sao Paulo

Sydney

San Francisco Upper Saddle River

Madrid Milan Munich


Hong Kong

Paris

Seoul Singapore

Montreal

Toronto

Taipei Tokyo

Vice President and Editorial Director, ECS:


Marcia J. Horton
Senior Editor: Tacy Quinn
Acquisitions Editor: Norrin Dias
Editorial Assistant: Coleen McDonald
Vice President, Production: Vince OBrien
Senior Managing Editor: Scott Disanno
Production Liaison: Jane Bonnell
Production Editor: Pavithra Jayapaul, TexTech International
Senior Operations Supervisor: Alan Fischer
Operations Specialist: Lisa McDowell
Executive Marketing Manager: Tim Galligan
Marketing Assistant: Mack Patterson
Senior Art Director and Cover Designer:
Kenny Beck
Cover Image Somatuscan/Shutterstock
Art Editor: Greg Dulles
Media Editor: Daniel Sandin
Composition/Full-Service Project Management: TexTech International
Company and product names mentioned herein are the trademarks or registered trademarks of their respective owners. See p. xxiii f
additional trademark acknowledgments.

or

Copyright 2011 by Pearson Education, Inc., Upper Saddle River, New Jersey 07458.
All rights reserved. Manufactured in
the United States of America. This publication is protected by Copyright and permissions should be obtained from the publisher
prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic,
mechanical, photocopying, recording, or likewise. To obtain permission(s) to use materials from this work, please submit a written
request to Pearson Higher Education, Permissions Department, 1 Lake Street, Upper Saddle River, NJ 07458.
The author and publisher of this book have used their best efforts in preparing this book. These efforts include the development
research, and testing of the theories and programs to determine their effectiveness. The author and publisher make no warranty of
any kind, expressed or implied, with regard to these programs or the documentation contained in this book. The author and
publisher shall not be liable in any event for incidental or consequential damages in connection with, or arising out of, the
furnishing, performance, or use of these programs.

Library of Congress Cataloging-in-Publication Data


Carryer, J. Edward.
Solution Manual for introduction to mechatronic design / J. Edward Carryer, R. Matthew Ohline, Thomas W. Kenny.
p. cm.
Includes bibliographical references and index.
ISBN-13:
ISBN-10:
1. Mechatronics. I. Ohline, R. Matthew. II. Kenny, Thomas William. III. Title.
TJ163.12.C37 2010
621dc22
2010033713

10 9 8 7 6 5 4 3 2 1
ISBN-13:
ISBN-10:

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 2 Whats a Micro?


1.1)

Compile a list of at least 25 everyday objects that incorporate microcontrollers, microprocessors or digital
signal processors.
Cell phone
Mp3 player
Microwave oven
PDA
Automobiles (many!)
Desktop computer
Disk drives
Digital cameras
Dishwashers
Washing machines
Ovens
DVD players
CD players
Stereo receivers
Electronic musical keyboards
Computer keyboards
Computer mice
Network routers / wireless access points
Laser Printers
Ink Jet printer
Navigation systems
Bicycle computers
Noise cancelling headphones
Video cameras
TVs

1.2)

Using the internet, locate the data sheet for the Atmel ATmega128A microcontroller, and answer the
following:
a)
b)
c)
d)

Does the ATmega128A have a von Neumann or a Harvard architecture?


How much non-volatile Flash program memory is incorporated?
How much volatile RAM data memory is incorporated?
List at least 5 other important peripheral systems that are included (there are many more than 5!)

a)

Harvard, but the data sheet doesnt explicitly call this out. You need to study the block diagram to see
that the program flash is connected directly to the instruction register.
b) 128K Bytes
c) 4K Bytes
d) UART
16 bit Timer
A/D Converter
Analog comparator
Brown out detector
Pulse Width Modulation
Real Time Clock
Two Wire Interface
Watchdog

Carryer, Ohline & Kenny

Copyright 2011

2-1

Solution Manual for Introduction to Mechatronic Design

1.3)

Do Not Circulate

How is a microprocessor different from a microcontroller?


A microprocessor does not contain program memory and data memory and I/O.

1.4)

How big is the address space for a microcontroller whose address bus is 24 bits wide?
224-1 = 16,777,215 locations

1.5)

What is the biggest number that can be represented with 28 bits?


228-1 = 268,435,455

1.6)

List three different types of non-volatile memory.


Flash EEPROM
ROM
EEPROM

1.7)

1.8)

Using the internet, locate the data sheet for the Microchip PIC16LF727, and answer the following:
a)
b)
c)
d)

What is the fastest clock source that can be used with this chip? What is the slowest?
Is there an analog-to-digital converter peripheral included on this chip?
How wide is the program memory bus? That is, how many bits are the program instructions?
How many input/output (I/O) pins does the PIC16LF727 have?

a)
b)
c)
d)

20MHz, DC (0Hz)
YES: 8 bits
14 bits
36

What kind of microcontroller peripheral is present on the PIC12F609 that is not present on the
MC9S12C32?
An analog comparator

1.9)

What prevents a microcontroller with a von Neumann architecture from attempting to execute data? What
about a microcontroller with a Harvard architecture?
Nothing prevents the processor from executing data in a von Neumann architecture.
In a Harvard architecture, the instructions are not fetched from the data space so it is impossible to execute
data.

1.10)

How many I/O pins are available in the largest HC9S12C32? How many are input only?
60 total I/O pins: 58 are inputs or outputs (I/O) and 2 are input only

Carryer, Ohline & Kenny

Copyright 2011

2-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 3 Microcontroller Math and Number Manipulation


3.1)

Convert the following binary patterns to hexadecimal:


1101
01010
10011
11001100
110011000001
1101 = 0xD
01010 = 0xA
10011 = 0x13
11001100 = 0xCC
110011000001 = 0xCC1

3.2)

Construct a comparison expression that will test if bits 0, 2 & 4 in a byte are all in the high state without
altering the state of the byte.
If ((ByteToTest & 0x15) == 0x15) is true

3.3)

Construct an expression that will clear bits 1, 3 & 5 in a byte-sized variable called Bumpers while not
altering any of other bits.
Bumpers = (Bumpers & 0xD5)

3.4)

Construct an expression that will set bit 1 in a byte-sized variable called PortA without affecting any of the
other bits in the variable.
PortA = (Bumpers | 0x02)

3.5)

Write out the 16 bit hexadecimal representation of the following signed decimal numbers (assume the
representation is 2s complement):
10
17
27
-45
-128
127
10 = 0x000A
17 = 0x0011
27 = 0x001B
-45 = 0xFFD3
-128 = 0xFF80
127 = 0x007F

Carryer, Ohline & Kenny

Copyright 2011

3-1

Solution Manual for Introduction to Mechatronic Design

3.6)

Do Not Circulate

Construct an expression that will test if either bit 0 or bit 3 in a byte-sized variable is in the high state
without altering the state of the byte.
If ((ByteToTest & 0x09) != 0) is true

3.7)

Construct an expression that will test if either bit 1 or bit 3 in a byte-sized variable is in the low state
without altering the state of the byte.
If ((ByteToTest & 0x0A) != 0x0A) is true

3.8)

What result would you expect from the following expressions if all values were contained in byte-sized
variables?
(240 2)/4
(240 2)/10
(240/10) 2
(240/4) 2
(240 2)/4 = 56
(240 2)/10 = 22
(240/10) 2 = 48
(240/4) 2 = 120

3.9)

Construct an expression that will clear bit 1 in a byte-sized variable called PortA without altering any of
the other bits.
Bumpers = (Bumpers & 0xFD)

3.10)

Construct an expression to toggle (change a zero to a 1 or a 1 to a zero) bit 3 in a byte-sized variable called
PortB that doesnt alter the value of any of the other bits.
PortB = (PortB ^ 0x08)

3.11)

Construct an expression that quickly divides an integer variable by 32 without using the division operator.
Variable = Variable >> 5

Carryer, Ohline & Kenny

Copyright 2011

3-2

Solution Manual for Introduction to Mechatronic Design

3.12)

Complete the blank cells in the following table:

1
2
3
4
5
6
7
8
9
10

1
2
3
4
5
6
7
8
9
10

3.13)

Do Not Circulate

Binary
1100 0111
0110 1010
0001 1100
0101 1001
1011 0110

Hexadecimal

0xB4
0x1E
0x72
0x39
0xFF

Binary
1100 0111
0110 1010
0001 1100
0101 1001
1011 0110
1011 0100
0001 1110
0111 0010
0011 1001
1111 1111

Hexadecimal
0xC7
0x6A
0x1C
0x59
0xB6
0xB4
0x1E
0x72
0x39
0xFF

What is the range of a 24 bit twos compliment number?


-524,288 to 524,287

Carryer, Ohline & Kenny

Copyright 2011

3-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 4 Programming Languages


4.1)

Describe the differences between an interpreter and a compiler.


An interpreter interprets (that is, extracts the meaning of the programmer) from every line of a program just
before the actions associated with that line are to be executed. This is referred to as run time.
A complier translates the program from the higher level language into the machine code for the processor
once, before the code is placed into the memory of the processor, and the microprocessor then executes the
translated version of the code.

4.2)

Explain how this line of BASIC code tests the state of bit 2:
10 IF ((V/4)-((V/8)*2)) = 1
The expression (V/4) does an effective right shift by 2 positions on the variable V. This puts the original
Bit2 into the Bit0 position. The expression ((V/8)*2)) does an effective right shift by 3 positions followed
by a left shift by 1 position. The result of this will have a 0 in the LSB, but the other bits (bits 1-7) holding
the same value as the result of the expression (V/4). After subtracting the two, the result will be the state of
the bit that was originally in position bit 2 of the variable V.

4.3)

True or False: It is easy to improve the performance of a program written in an interpreted language by
selectively coding in assembly language.
False. It is generally very difficult to insert assembly language code segments into an interpreted program.

4.4)

True or False: Assembly language is considered a high-level language.


False, assembly language is the lowest level language that is used to write programs.

4.5)

When is the meaning of a compiled program converted into actions?


As with any program, the actions are associated with the run-time behavior, that is, when the program is
executed by the micro-processor.

4.6)

True or False: Assembly language and machine language are synonymous.


False. While it may be a common usage, it is sloppy to treat these two terms as synonymous. Assembly
language is actually a set of (more or less) human readable mnemonics that have a 1:1 correspondence with
the machine language of a micro-processor, but they are not the same as the true binary machine language
that the processor executes.

4.7)

Which of the languages described in this chapter was designed to teach programming?
BASIC by Kemney and Kurtz at Dartmouth College

Carryer, Ohline & Kenny

Copyright 2011

4-1

Solution Manual for Introduction to Mechatronic Design

4.8)

Do Not Circulate

Which are the object-oriented languages described in this chapter?


C++ and Java

4.9)

Describe a scenario in which programming in an interpreted language might be an advantage.


Debugging untested hardware. In this situation, the interactive nature of the interpreted environment could
prove to be significantly faster than the repeated compile-download-run cycles associate with a compiled
language. This is one of the reasons that the Forth variant OpenBoot was developed for SUN workstations
and used in some Apple and IBM workstations.

4.10)

Describe two similarities between Java and the PBASIC language used by the BASIC Stamp.
Both are interpreters and both use byte-codes as the entity that is interpreted (as opposed to plain text in
conventional BASIC interpreters).

4.11)

Name at least three other widely-used computer languages that were not mentioned in this chapter.
COBOL (still used in some business applications over 50 years after it was invented).
Delphi (sometimes referred to as Object Pascal)
PASCAL (another language invented to teach programming)
Wiring (a C-like language used on the Arduino platform)
Clearly, there are many other possible answers to this question.

4.12)

You are beginning to test a new circuit in which a microcontroller is connected to a large number of
peripheral devices a process commonly referred to as bring-up. What language(s) would you choose
for this task? Why?
An interpreted language such as BASIC or Forth would provide for a very fast incremental test cycle to
explore the interaction between the processor and the hardware.

4.13)

You are writing final production code for a microcontroller used to control a servomotor. What
language(s) would be reasonable choices for this application? Why?
A compiled language such as C or a compiled version of BASIC would be appropriate here, as would be
assembly language if the utmost in functionality needed to be extracted. Object oriented languages such as
C++ may be suitable depending on the size of the memory available and the complexity of the application.

Carryer, Ohline & Kenny

Copyright 2011

4-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 5 Program Structures for Embedded Systems


5.1)

Work with a DVD player and develop an exhaustive set of events that you think the sofware must sense
and respond to.
There will be a wide variety of responses to this question. Grade based on reasonableness and
thoroughness of the answer.
Example:
Any button pressed on the user interface (front panel or remote): Stop, Play/Pause, Forward pressed, Back
pressed, Forward held down, Back held down, , Open/Close/Eject, Root Menu, Up Arrow, Down Arrow,
Left Arrow, Right Arrow, Enter/Select, time to fetch digital data from DVD, time to convert digital data
from DVD into analog video signal for output, etc.

Carryer, Ohline & Kenny

Copyright 2011

5-1

Solution Manual for Introduction to Mechatronic Design

5.2)

Do Not Circulate

Identify the events and draw an STD for the behavior of a DVD player. Limit yourself to the events
generated by the DVD player (ignore the remote control).
There will be a wide variety of responses to this question. Grade based on the reasonableness and
thoroughness of the answer. For the state diagram, ensure that standard state diagram conventions are
used.

Carryer, Ohline & Kenny

Copyright 2011

5-2

Solution Manual for Introduction to Mechatronic Design

5.3)

Do Not Circulate

Given a function GetRoomTemperature() that returns the room temperature and a variable, SetPoint, write
a pair of functions in pseudo-code called IsTemperatureTooHot() and IsTemperatureTooCool() that return
TRUE-FALSE values and together implement a hysterisis band around the SetPoint temperature.
Both routines return TRUE or FALSE and adjust hysteresis threshold SetPoint as a side effect.
IsTemperatureTooHot()
Read GetRoomTemp() and store result in CurrentTemp
If CurrentTemp > LastTemp
If CurrentTemp > SetPoint
Set SetPoint to LowerHysteresisThreshold
EndIf
Save CurrentTemp as LastTemp
Report TRUE
Else
Save CurrentTemp as LastTemp
Report FALSE
EndIf
End
IsTemperatureTooCool()
Read GetRoomTemp() and store result in CurrentTemp
If CurrentTemp < LastTemp
If CurrentTemp < SetPoint
Set SetPoint to UpperHysteresisThreshold
EndIf
Save CurrentTemp as LastTemp
Report TRUE
Else
Save CurrentTemp as LastTemp
Report FALSE
EndIf
End

5.4)

Work with an answering machine to develop the list of events that the machine's software must respond to.
There will be a wide variety of responses to this question. Grade based on reasonableness and
thoroughness of the answer.
Example:
Phone call received, phone not answered, outgoing message completed, no speaking detected, phone hangup detected, time to update clock, button pressed: Play, Back, Forward/Skip, Pause, Delete/Erase,
Time/Date Set, Volume Up, Volume Down, etc.

Carryer, Ohline & Kenny

Copyright 2011

5-3

Solution Manual for Introduction to Mechatronic Design

5.5)

Do Not Circulate

You are writing code to implement cruise control for a car. Given a function GetVehicleSpeed() that
returns the speed of a vehicle, write a single function TestAccelDecel() in pseudo-code that returns,
NeedAccelerate, NeedDecelerate or SpeedOK based on the speed relative to a setpoint DesiredSpeed. To
provide noise immunity, implement hysteresis around the switch point.
Note: implement so that there is a hysteresis band around the DesiredSpeed, with an UpperThreshold
some amount above DesiredSpeed and a LowerThreshold below DesiredSpeed:
UpperThreshold

DesiredSpeed

LowerThreshold
Routine returns NeedAccelerate, NeedDecelerate or SpeedOK and adjusts a hysteresis threshold called
SetPoint as a side effect.
TestAccelDecel()
Read GetVehicleSpeed() and store result in CurrentSpeed
If CurrentSpeed > SetPoint and LastSpeed < SetPoint (only happens when
SetPoint = UpperThreshold)
Set SetPoint to LowerThreshold
Set LastSpeed equal to CurrentSpeed
Report NeedDelerate
Else If CurrentSpeed < SetPoint and LastSpeed > SetPoint (only happens when
SetPoint = LowerThreshold
Set SetPoint to UpperThreshold
Set LastSpeed equal to CurrentSpeed
Report NeedAccelerate
Else If CurrentSpeed > LowerThreshold and CurrentSpeed < UpperThreshold
Set LastSpeed equal to CurrentSpeed
Report SpeedOK
EndIf
End

Carryer, Ohline & Kenny

Copyright 2011

5-4

Solution Manual for Introduction to Mechatronic Design

5.6)

Do Not Circulate

In an application, the state of a switch is determined by reading a variable called PortA. The state of the
switch is indicated by the state value of bit 4 within the byte variable PortA. In pseudo-code, write an event
checking function TestSwitch() that returns Opened, Closed, or NoChange depending on what has
happened since the last time TestSwitch() was called.
Create SwitchMask constant = 0x10 (the switch is at bit 4 in PortA)
Routine returns Opened, Closed or NoChange.
TestSwitch()
Read PortA, use SwitchMask to mask out all bits other than bit 4, and
store result in CurrentSwitchState
If CurrentSwitchState = LastSwitchState
Set LastSwitchState = CurrentSwitchState
Report NoChange
Else If CurrentSwitchState = 0 and LastSwitchState 0
Set LastSwitchState = CurrentSwitchState
Report Opened
Else If CurrentSwitchState 0 and LastSwitchState = 0
Set Last SwitchState = CurrentSwitchState
Report Closed
EndIf
End

5.7)

Work with a microwave oven to develop the list of events that the oven's software must respond to.
There will be a wide variety of responses to this question. Grade based on reasonableness and
thoroughness of the answer.
Example:
Door open, Door closed, Number pressed (any of 0 9), Start button pressed, Stop button pressed, Clear
button pressed, Time to decrement timer, Timer expires, Power setting entered, quick minute button
pressed, popcorn button pressed, time to update clock display etc.

Carryer, Ohline & Kenny

Copyright 2011

5-5

Solution Manual for Introduction to Mechatronic Design

5.8)

Do Not Circulate

Figure 5.7 shows a simple microwave oven. Draw an STD that captures the behavior described by the
following description as follows:
a) The Open button opens the door, stops cooking, holds time.
b) The Clear button clears the timer. If cooking was active it is disabled.
c) The Start button starts cooking for whatever time has been set. While cooking, the timer decrements to
zero and turns off cooking when it reaches zero.
d) The Popcorn button forces a time of 2 minutes to be set into the timer.
e) The Def/Light button forces the power level to 50%.
f) Time is set by twisting the dial and then pressing the button at the center of the dial. No action takes
place until the button is pressed. At that point, the time on the dial is entered into the timer.
g) There is a switch connected to the door to show whether it is open or closed.

Figure 5.7: Front view of the microwave oven described in Problem 5.8.
A representative solution is shown below. Wide variation in execution is likely. Grade based on whether
the solution will function correctly, whether the ovens function is completely described, and whether state
diagram conventions are used.
CLEAR Pressed
Power = 100%, Timer = 0
CLEAR Pressed
Power = 100%, Timer = 0
DEF/LIGHT Pressed
Power = 50%
OPEN Pressed
POPCORN Pressed
Open Door
Timer = 2 min.

DEF/LIGHT Pressed
Power = 50%
POPCORN Pressed
Timer = 2 min.

IDLE
Door Closed

IDLE
Door Open

TIMER Button Pressed


Load Timer with time
indicated on Timer Dial

Door Closed
Do nothing

TIMER Button Pressed


Load Timer with time
indicated on Timer Dial

START Pressed
Start/Resume Timer,
Enable Magnetron

TIMER Expires
Disable Magnetron,
Power = 100%
STOP Pressed
Disable Magnetron,
CLEAR Pressed
Suspend Timer
Disable magnetron
Timer = 0,
Power = 100%

OPEN Pressed
Disable Magnetron,
Suspend Timer,
Open Door

COOKING

This particular solution allows for changes to power setting and timer setting any time cooking isnt in
process. Other solutions may require that these actions be done sequentially, and that CLEAR be pressed
before a new time may be set or a new power setting selected.

Carryer, Ohline & Kenny

Copyright 2011

5-6

Solution Manual for Introduction to Mechatronic Design

5.9)

Do Not Circulate

Assume that the switches from the microwave oven in Problem 5.8 are available in a single variable
(Switches), that the timer can be set with a function SetTimer(),that the timer can be read with a function
IsTimerExpired(), and the power level can be set with a function SetPower(). In pseudo-code, write
routines for the required event checkers, state machine function and main() to implement the your design
from Problem 5.8.
main()
Initialize HW and variables:
If door = closed, initialize state to IDLE, Door Closed
Else if door = open, initialize state to IDLE, Door Open
Loop forever:
If state = IDLE, Door Closed
Check for SwitchEvent(s)
If SwitchEvent = CLEAR: SetPower = 100%, SetTimer = 0
If SwitchEvent = DEF/LIGHT: SetPower = 50%
If SwitchEvent = POPCORN: SetTimer = 2 min.
If SwitchEvent = TIMER: SetTimer to time indicated on dial
If SwitchEvent = OPEN: OpenDoor, set state = IDLE, Door Open
If SwitchEvent = START
Enable magnetron
Start/resume decrmenting timer
Set state = COOKING
End If state = IDLE, Door Closed
If state = IDLE, Door Open
Check for SwitchEvent(s)
If SwitchEvent = CLEAR: SetPower = 100%, SetTimer = 0
If SwitchEvent = DEF/LIGHT: SetPower = 50%
If SwitchEvent = POPCORN: SetTimer = 2 min.
If SwitchEvent = TIMER: SetTimer to time indicated on dial
If SwitchEvent = Door is Closed: set state = IDLE, Door Closed
End If state = IDLE, Door Open
If state = COOKING
Check for SwitchEvent(s)
If SwitchEvent = OPEN:
Disable magnetron
Suspend timer
Open door
Set state = IDLE, Door Open
If SitchEvent = STOP:
Disable magnetron
Suspend timer
Set state = IDLE, Door Closed
If IsTimerExpired = TRUE:
Disable magnetron
SetPower = 100%
Set state = IDLE, Door Closed
If CLEAR button pressed:
Disable magnetron
Set timer = 0
Set power = 100%
Set state = IDLE, Door Closed
End If state = COOKING
End Loop
End main()

Carryer, Ohline & Kenny

Copyright 2011

5-7

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Function SwitchEvent() returns one of the following constant values: NO_SWITCH_EVENT, CLEAR,
OPEN, START, STOP, DEF/LIGHT, POPCORN, TIMER, DOOR_CLOSED. Events, with the exception
of NO_SWITCH_EVENT, are reported when there is a change of state from not active (e.g. not being
pressed) to active (e.g. being pressed).
SwitchEvent()
Read Switches and store in CurrentSwitchState
If CurrentSwitchState = LastSwitchState
Save CurrentSwitchState as LastSwitchState
Report NO_SWITCH_EVENT
End If
Else If CurrentSwitchState LastSwitch State
If OPEN switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report OPEN
If CLEAR switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report CLEAR
If START switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report START
If POPCORN switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report POPCORN
If DEF/LIGHT switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report DEF/LIGHT
If TIMER switch is active in CurrentSwitchState and inactive in LastSwitchState:
Save CurrentSwitchState as LastSwitchState
Report TIMER
If DOOR CLOSED is active in CurrentSwitchState and inactive in LastSwitchState:
Report DOOR_CLOSED
End Else If
End SwitchEvent()

Function IsTimerExpired() returns TRUE if the value in the Timer register is 0, FALSE if the value is > 0
and TIMER_ERROR otherwise. Function will return TRUE in subsequent calls until Timer has been
reloaded elsewhere with a time value > 0.
IsTimerExpired()
Read Timer variable and store in CurrentTIme
If CurrentTime > 0
Report FALSE
Else If CurrentTime = 0
Report TRUE
Else Report TIMER_ERROR
End IsTimerExpired()

Carryer, Ohline & Kenny

Copyright 2011

5-8

Solution Manual for Introduction to Mechatronic Design

5.10)

Do Not Circulate

Draw the STD for a soft drink machine that accepts nickels, dimes and quarters and sells drinks that cost
$0.75 each.
A representative solution is shown below. Wide variation in solutions is likely. Grade this problem based
on whether the solution will function properly and is reasonably complete, and whether correct state
diagram conventions are used.

5.11)

Draw a state diagram for modified combination lock like that shown Figure 5.4. Make your lock such that
it will not accept unlock if 4 or more digits are entered that end with the combinations that end in 2-1-8
sequence.
A representative solution is shown below. Wide variation in solutions is likely. Grade this problem based
on whether the solution functions as specified (does not unlock when more than 3 numbers that end with
218 are entered), and whether correct state diagram conventions are used.

Carryer, Ohline & Kenny

Copyright 2011

5-9

Solution Manual for Introduction to Mechatronic Design

5.12)

Do Not Circulate

There are many common behaviors that can be described using state machines. As an example, identify the
relevant events and draw a state diagram to describe the behavior of a 'Shy Party Guest' (a guest who does
not initiate conversations but participates when someone else initiates).
A representative solution is shown below. Wide variation in execution is likely. Grade based on whether
the student has devoted reasonable effort to the solution, whether the proposed solution adequately
represents the behavior of a Shy Party Guest, and whether correct state diagram conventions are used.

Carryer, Ohline & Kenny

Copyright 2011

5-10

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 6 Software Design


6.1)

Describe three ways in which programming is different than writing prose.


1) Writing code is about preparing a set of instructions while, in general, prose is not simply instructions.
2) In prose, it is possible to coin new words, while in most programming languages adding new keywords is not possible. (Forth is an exception.)
3) The goal of (most) code isnt to evoke an emotion in the reader, while this is often the case in prose.
4) Putting sentences one after the other to make a paragraph is highly frowned upon on programming.
Using white-space to guide the reader is much more akin to writing some kinds of poetry.
5) Prose has but a single consumer: the reader, while code is written both for the reader and for the
compiler/interpreter.

6.2)

Describe three ways in which programming is similar to building a house.


1)
2)
3)
4)
5)

You need a plan both for the design as well as the implementation stages before starting.
Requirements drive the architecture.
There are both structural as well as detail aspects to code and buildings.
The implementation involves the construction of the framework first followed by the interior (details).
Overall success depends on both the design and the implementation.

There are clearly many more possible parallels that could be drawn. In general, the goal is to get the
students to be reflective about the software design process and not treat it as a throw-away.

6.3)

Define decomposition in the context of software design.


Decomposition: breaking down a big problem into a series of smaller problems that are easier to
understand and that will, when linked together, solve the larger problem.

6.4)

True or False: Coupling is a desirable characteristic between modules.


False. Coupling makes modules harder to test independently.

6.5)

True or False: All functions in a module should be represented in the public interface to the module.
False. Only the public interface functions should be represented in the public interface.

6.6)

Write a pseudo-code test harness for the Morse Elements module described in Section 6.5.6.2.
Print a message to the screen announcing that we are testing
InitializeMorseElements()
Call InitializeMorseElements()
If the state of the appropriate bit in the DDR is not correct
Print error message about port initialization
Endif
If the value of FirstDelta is not 0
Print error message about FirstDelta initialization
Endif

Carryer, Ohline & Kenny

Copyright 2011

6-1

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

If the value of CurrentState is not correct


Print error message about CurrentState initialization
Endif
Print a message to the screen announcing that we are finished testing
InitializeMorseElements()
Print a message to the screen announcing that we are testing
CheckMorseEvents()
With a legal Morse code signal applied to the input test
CheckMorseEvents:
Do
Call CheckMorseEvents()
Until return value is DotDetected
Print a message that a dot was detected
Do
Call CheckMorseEvents()
Until return value is DashDetected
Print a message that a dash was detected
Do
Call CheckMorseEvents()
Until return value is CharSpaceDetected
Print a message that a character space was detected
Do
Call CheckMorseEvents()
Until return value is WordSpaceDetected
Print a message that a word space was detected
Print a message to the screen announcing that we are finished testing
CheckMorseEvents()
Print a message to the screen announcing that we are testing
MorseElementsSM()
(prepare two arrays. One with a sequence of events and the other with
the state that the state machine should be in after that event)
For every element in the event array
call MorseElementsSM(), passing the event
test if the value of CurrentState matches the expected value.
If test fails, print error message noting: index in the array, last
event passed, expected value and actual value
endFor
Print a message to the screen announcing that we are testing
MorseElementsSM()
Print a message to the screen announcing that we are testing
StartCalibration()
Call StartCalibration()
If the value of CurrentState is not correct
Print error message that StartCalibration failed
Endif

Carryer, Ohline & Kenny

Copyright 2011

6-2

Solution Manual for Introduction to Mechatronic Design

6.7)

Do Not Circulate

Describe the function of a test harness in the context of an individual module.


The test harness is a main() routine that is used to exercise and test the functions of the module. It will
typically consist of a series of calls to the public functions of the module interspersed with tests to be sure
that the public functions responded as they should have, given the full range of possible input values.

6.8)

True or False: Pseudo-code is a part of the design process, not the implementation process.
True. The translation of the pseudo-code into real code is the first step in the implementation process.

6.9)

Using the pseudo-code from Section 6.5.6.2, write code in a real programming language to implement the
InitializeMorseElements function.
In C for the MC9S12C32:
static MorseElementsStates_t CurrentState;
static int FirstDelta
Void InitializeMorseElements(void)
{
//Initialize the port line to receive Morse code
DDRT &= BIT0LO;
//Set CurrentState to be CalWaitForRise
CurrentState = CalWaitForRise;
//Set FirstDelta to 0
FirstDelta = 0;
}

6.10)

Write code in a real programming language to implement the following snippet of pseudo-code:
For every element in the array
multiply the element value by Gain and add the result to the running sum

In C: (assuming that Array is of type int)


For (i=0; i<((sizeof(Array)/sizeof(int)); i++)
{
RunningSum += Array[i]*Gain;
}

Carryer, Ohline & Kenny

Copyright 2011

6-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 7 Inter-Processor Communications


7.1)

True or False: Asynchronous communications involves a shared clock line.


False.
Asynchronous means without clock, and does not incorporate a shared clock line.

7.2)

Describe the fundamental difference between bit-serial and bit-parallel communications.


In bit-serial communications, one bit of data is relayed at a time from the source of the data to the
recipient. The bits are thus relayed serially one at a time.
In bit-parallel communications, more than one bit of data is relayed simultaneously from the data source
to the recipient. Multiple bits (2 or more) are thus relayed in parallel more than one at a time.

7.3)

Under what conditions will the noise flag in a typical UART be set?
In general, the noise flag will be asserted when there is disagreement between the three samples of a bits
state that are collected by a UART while receiving data. The samples occur in the middle of a bit-time
(start bit, data bit, or stop bit), so they should all agree and have the same state. Disagreement indicates the
presence of noise (or possibly some other problem, such as a mismatch in baud- or bit-rate) on the
connection.

7.4)

What is the role of the SS* line in synchronous serial communications?


The SS* line is the slave select line, and the * indicates that it is asserted when it is in the logical low
state (0). Its role is to indicate which slave device in an SPI (Serial Peripheral Interface) bus the master is
exchanging data with. In effect, the master uses it to select a slave to communicate with using the
MISO, MOSI and CLK lines.
If a devices SS* line is not active, it must ignore the data present on the other SPI lines.

7.5)

True or False: All standard synchronous serial communications protocols involve 2 data lines and 1 clock
line.
False.
While this is true for the SPI (Serial Peripheral Interface) protocol, it is not true of the I2C (Inter-Integrated
Circuit) protocol, which uses 1 bi-directional data line instead of 2 uni-directional data lines.

7.6)

What is the purpose of the parity bit?


The parity bit provides a degree of error-checking and is used in bit-serial data communications. It is an
extra bit, added at the end of each frame of data, that ensures that the total number of 1s in the frame is
always even (for even parity) or odd (for odd parity). However, because of the low level of error
protection provided by this approach, it is no longer commonly used.

Carryer, Ohline & Kenny

Copyright 2011

7-1

Solution Manual for Introduction to Mechatronic Design

7.7)

Do Not Circulate

True or False: IR remote controls typically use FSK modulation.


False.
A typical IR remote uses OOSK to modulate the carrier, and an encoding technique such as pulse-, space-,
or shift coded waveforms. A preamble is also commonly used to establish the bit rate.

7.8)

True or False: RS-485 is an example of a differential signaling standard.


True.
RS-485 is a differential signaling standard, where the voltage differential between two lines indicates 1s
and 0s.

7.9)

Explain the basic difference between the RS-232 and RS-485 signaling standards.
RS-232 is a single-ended signaling standard, which relies on the voltage difference between a single
connection and ground to indicate a 1 (when the data line has a voltage between -3 V and -25 V) or a 0
(when the data line has a voltage between +3 V and +25 V). The wide range of valid voltages relative to
ground is intended to prevent, or at the very least mitigate, data errors due to noise. It is point-to-point, and
each data line is uni-directional.
RS-485 is a balanced differential signaling standard, which relies on the voltage differential between
two data lines (#1 and #2) to indicate a logical 1 (when #1 > #2 by at least 200 mV) and a logical 0 (#1 <
#2 by at least 200 mV). This eliminates the dependence on the magnitude of the voltage present on any
given line relative to ground, so that only the difference between the voltages on the lines is meaningful.
RS-485 allows for multi-drop implementations (vs. point-to-point) and can support half-duplex (on a single
shared pair of lines) or full-duplex (on two sets of paired lines).

7.10)

What UART error bit (if any) would be set if the center of the 10th bit time after the falling edge of the
start bit in an 8N1 asynchronous serial bit stream was found to be at the spacing level?
Framing error.
The 10th bit should be the stop bit, which is required to be in the marking state (logical level 1). If this is
not the case, the frame of data is likely to include errors, and the framing error bit would be set.

7.11)

Identify the type of modulation shown in Figure 7.28. Which types of devices use this scheme?

Figure 7.28
Frequency Shift Keying (FSK).
This modulation scheme was used by early computer modems.

Carryer, Ohline & Kenny

Copyright 2011

7-2

Solution Manual for Introduction to Mechatronic Design

7.12)

Do Not Circulate

Identify the type of waveform shown in Figure 7.29, which is commonly implemented with OOSK. Which
types of devices commonly use this scheme?

Figure 7.29
Pulse Coded Waveform.
This encoding technique is commonly used in IR remote controls.

Carryer, Ohline & Kenny

Copyright 2011

7-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 8 Microcontroller Peripherals


8.1)

Based on the diagram of Figure 8.1, what value should you write into the DDR to make the pin an input?
The topmost multiplexer labeling shows that if the Direction Control state is 0, the multiplexer will connect
the pin state to the Port Data register.

8.2)

Given a microcontroller that implements separate input and output registers (call them INPUT &
OUTPUT), write C code to sample input bit 3 and transfer its value to output bit 7 while leaving all other
bits undisturbed.
if ((INPUT & BIT3HI) != 0)
OUTPUT |= BIT7HI;
else
OUTPUT &= BIT7LO;

8.3)

In terms of the registers introduced in this chapter, what architecture feature is necessary to be able to tell if
an output pin is being loaded heavily enough that its output voltage is outside the input voltage range for
that state?
You must be able to read both the state on the pin and the state in the output latch.

8.4)

A particular application requires both high-resolution timing and timing of long enough intervals that the
total time can not be counted using a single 16-bit register. Write pseudo-code using other features of the
timer systems described in this chapter to implement a virtual 32-bit input capture timer. Write the pseudocode using an events and services paradigm (a set of event checkers and associated services).
TimerOverflowEventChecker:
if TimerOverFlowFlag is set
then
ClearTimerOverFlowFlag
return OverFlowOccurredEvent
else
return NoEvent
endif
TimerOverflowService:
increment 16-bit overflow counter
InputCaptureEventChecker:
if InputCaptureFlagSet
then
ClearInputCaptureFlag
return InputCaptureEvent
else
return NoEvent
endif
InputCaptureService:
Concatenate the 16-bit overflow counter (as upper 16 bits) with the
contents of the input capture register (as the lower 16 bits) to form a
32-bit input capture time.

Carryer, Ohline & Kenny

Copyright 2011

8-1

Solution Manual for Introduction to Mechatronic Design

8.5)

Do Not Circulate

Write pseudo-code for an initialization routine and an input capture event checker and service pair that
would calculate the speed of a motor assuming that the output of a 100 pulse per revolution motor was
connected to the input capture pin of a timer system being clocked by a 100 kHz clock.
InitializationRoutine:
clear module level variable LastCaptureTime
program input capture system to capture on rising edges
InputCaptureEventChecker:
if InputCaptureFlag set
then
return NewEncoderEdgeEvent
else
return NoEvent
NewEncoderEdgeEventService:
save value in the input capture register as CurrentTime
calculate DeltaT as (CurrentTime LastCaptureTime) * SecsPerTick
calculate SpeedRPM as (60*100)/DeltaT

8.6)

Given a PWM subsystem like shown in Figure 8.6, what duty cycle would be generated if DUTY
contained 128 and PERIOD contained 240 and POLARITY = 1?
1-128/240 because with POLARITY = 1, DUTY sets the low time

8.7)

Given a PWM subsystem like shown in Figure 8.6, with DUTY = 128 and PERIOD = 129, what sequence
of values would you expect to see in COUNTER?
0,1,2,3,4,.126,127,128,129,0,1,2,3,4,5 The time spent with COUNTER = 129 would be very short
since it is immediately reset to 0.

8.8)

Given a microcontroller with a clock rate of 24 MHz, an A/D converter clock prescaler with divide-by
ratios of 2, 4, 6, 8, 10, 12, , 64, an A/D converter with a minimum clock speed of 500 kHz and a
maximum clock speed of 2 MHz, what range of prescale dividers result in A/D clock speeds that fall
within the A/D converter limits?
Divide-bys greater than or equal to 12 (24 MHz/12 = 2 MHz) and less than or equal to 48 (24 MHz / 48 =
500 kHz) would work.

8.9)

How are the Freescale DDR registers and the Microchip TRIS registers alike?
They both control the direction of input/output pins on a port.

8.10)

Given a PWM subsystem like that shown in Figure 8.6 with a Clock Source of 24 MHz, what is
the maximum PWM output frequency that can still achieve 1% resolution on the duty cycle?
1% duty cycle resolution requires that the period be set to at least 100, therefore the maximum frequency
of the PWM would be 24 MHz/100 = 240 kHz.

Carryer, Ohline & Kenny

Copyright 2011

8-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 9 Basic Circuit Analysis and Passive Components


9.1)

If, for a particular two-terminal device the voltage and current entering one terminal is 7.5 V and 1 A and
the voltage and current leaving the other terminal is 5 V and 1 A, how much power is being dissipated in
the device?
P = VI, in this case V=7.5 V 5 V = 2.5 V and I = 1 A, so P = 2.5 W

9.2)

What is the resistance seen across terminals A and B in Figure 9.61?

Figure 9.61 Circuit for Problem 9.2.

1
Rtotal
9.3)

1
1
1
+
+
= 1.8 x10 3 , Rtotal = 545
1k 2k 3k

Determine the Thevenin equivalent circuit for the subcircuit block labeled A in Figure 9.62.

Figure 9.62 Circuit for Problems 9.3-9.6.


166.615K
6.3262V

9.4)

Determine the Thevenin equivalent circuit for the subcircuit block labeled B in Figure 9.62.
375.022
15.641mV

Carryer, Ohline & Kenny

Copyright 2011

9-1

Solution Manual for Introduction to Mechatronic Design

9.5)

Do Not Circulate

What is the voltage at the point labeled V in Figure 9.62?


166.615K

6. 3262V

375.022

Combining the Thevenin equivalents of Problems


9.3 and 9.4 gives us a circuit like that to the left.
Now, with only one loop, it is a simple matter to
determine the voltage at point V:
0 = 6.3262 V I 166.615 k I 375.022 +
15.641 mV
0 = 6.341841 V - I 166.99 k
I=

15. 641mV

6.341841V
= 37.977 A
166.99k

With that last bit of information we can calculate


the voltage at point V as:
-15.641mV + 37.977A375.022 =-1.39865mV
9.6)

If the voltage at point V in Figure 9.62 were measured with a voltmeter with a 100 k internal resistance,
what voltage would be measured?
The Thevenin equivalent resistance would simply be 166.615 k || 375.022 or 374 . This would form a
voltage divider with the 100 k of the meter and we would read:

100k
1.39865mV
= 1.39344mV
100k + 374
9.7)

The graph in Figure 9.63 represents the output of an RC circuit excited by a 0-5 V rising edge. Draw the
RC circuit configuration. Based on the data shown, what is the time constant?

Figure 9.63 Waveform for Problem 9.7.


The circuit configuration will be that of Fig 9.26. The voltage has risen to about 63% of the driving voltage
at t = 0.1 s, so the time constant is 0.1 s.

Carryer, Ohline & Kenny

Copyright 2011

9-2

Solution Manual for Introduction to Mechatronic Design

9.8)

Do Not Circulate

Figure 9.64 shows the current waveform for a series RL circuit excited by a 0-5 V rising edge.
a) Estimate the total resistance seen by the exciting voltage source.
b) Estimate the inductance in the circuit.

Figure 9.64 Waveform for Problem 9.8.


a) The final value of the current is 50 mA, indicating a resistance of R = E/I = 5/50 mA = 100 .
b) The current rises to the 63% point (31 mA) at about 0.1 s, so that time constant is 0.1 s. The time
constant for an RL circuit is L/R so with a value of 100 for R, L = 100 0.1 s = 10 H.
9.9)

Design a circuit that takes a sinusoidal input of varying frequency at 1 V amplitude and produces an output
amplitude of approximately 1 V when the frequency is 1 Hz and approximately 0.5 V when the frequency
is 1,000 Hz. Choose real component values to get as close as possible to the specified amplitudes.
Given that the amplitude at 1 kHz is smaller than at 1 Hz, we know that this is to be a low-pass filter, with
a configuration like that of Fig. 9.37. We can use Equation 9.54 to calculate the RC product required as
2.76 10-4. We can achieve this, using 1% resistors, with a 102 k resistor and a 2.7 nF capacitor.

9.10)

For the circuit that you designed in Problem 9.9, at what frequency is the output approximately 0.707 V?
Since 0.707 is the corner frequency point, we can use Eq. 9.55 to calculate the corner frequency:

1
= 578Hz
2RC
9.11)

What is the minimum voltage would you need to apply across a 10 k 1/8 W resistor in order to cause its
power rating to be exceeded?
P = I2R, 0.125 W/10 k = I2, I = 3.5 mA, E = IR, so E = 3.5 mA 10 k=35 V.

Carryer, Ohline & Kenny

Copyright 2011

9-3

Solution Manual for Introduction to Mechatronic Design

9.12)

Do Not Circulate

If a resistor with a temperature coefficient of 1,000 ppm that measures 997 at 25C is cooled to -40C (a
cold night in Minnesota), what range of resistances would you expect to see? How about if it were heated
to 65C (inside a car on a sunny summer day in Arizona)?
On the cold night, the T is 65C, with a 1,000 ppm temperature coefficient, that would be a change of
6.5% yielding a resistance of 932.2 . In the sunny car, the T is only 40C, yielding a change of 4% and
a resistance of 1036.9 .

9.13)

Which capacitor would you expect to be physically larger: a 0.1 F ceramic disk or a 0.1 F monolithic
ceramic capacitor?
The monolithic ceramic capacitor would be smaller, assuming similar voltage ratings.

9.14)

Which capacitor would you expect to be physically larger: a 10 F electrolytic or a 10 F tantalum


capacitor?
The 10 F electrolytic would be larger, assuming similar voltage ratings.

9.15)

If a monolithic ceramic capacitor were labeled 103X5F, what would you expect its capacitance value to
be?
103 means 10 103 pF = 0.01 F

9.16)

You have been presented with two monolithic ceramic capacitors. One is labeled 104C0G, the other
104Z5U. How are these capacitors alike? How are they different?
They have the same capacitance value (0.1 F) but different compositions and therefore temperature
coefficients (the COG capacitor will have a smaller change in value with temperature).

9.17)

If you were designing an RC low-pass filter to operate with a corner frequency of 10 kHz for a signal of a
few volts amplitude at less than 0.1 mA, what types of resistors and capacitors (i.e., which values and
technologies) would be good choices?
For resistor accuracy, the metal film resistors would be best. For capacitance stability a film capacitor such
as a mica, mylar, polyester, polypropylene, or polystyrene would be best.

9.18)

Design a circuit that takes a sinusoidal input of varying frequency at 1 V amplitude and produces an output
amplitude of approximately 1 V when the frequency is 1,000 Hz and approximately 0.5 V when the
frequency is 1 Hz. Choose real component values to get as close as possible to the specified amplitudes.
Given that the amplitude at 1 kHz is larger than at 1 Hz, we know that this is to be a high-pass filter, with a
configuration like that of Fig. 9.39. We can use Equation 9.57 to calculate the RC product required as
0.0919. We can achieve this, using 1% resistors, with a 511 k resistor and a 0.18 F capacitor.

Carryer, Ohline & Kenny

Copyright 2011

9-4

Solution Manual for Introduction to Mechatronic Design

9.19)

Do Not Circulate

Some monolithic ceramic capacitor materials exhibit a voltage dependency. What happens as the applied
voltage is increased?
The effective capacitance decreases.

9.20)

List two examples each of polar and nonpolar capacitor types.


Polar: tantalum & electrolytic
Non-polar: ceramic, monolithic ceramic, mylar, mica

Carryer, Ohline & Kenny

Copyright 2011

9-5

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 10 Semiconductors
10.1)

If the forward voltage drop for D1 is 0.6 V, what is the current flowing in the circuit showing in Figure
10.42? Assume that the diode behaves as an ideal diode.

Figure 10.42
Vs Vr Vd = 0
6 V I 220 0.6 V = 0 V
I = 5.4 V / 220 = 25 mA
10.2)

If the forward voltage drop for D1 is 0.6V, what is the current flowing in the circuit in Figure 10.43?
Assume that the diode behaves as an ideal diode.

Figure 10.43
The supply voltage (Vs = 0.5 V) is insufficient to forward bias the diode D1 enough for current to flow.
For an ideal diode, the current flowing in the circuit will be 0. (For a real diode, a small amount of leakage
current will flow. The amount of leakage current will depend on the specifications for D1.

Carryer, Ohline & Kenny

Copyright 2011

10-1

Solution Manual for Introduction to Mechatronic Design

10.3)

Do Not Circulate

The arrangement of diodes shown in Figure 10.44 is known as a diode bridge or a full-wave rectifier.
If the output of the AC voltage source VS is 24 V peak-to-peak (12 V) with a frequency of 100 Hz, draw a
plot of the resulting voltage drop across the resistor (assume ideal diode characteristics).

Figure 10.44
Problem 10.3 Solution
14
12

Vin
10

Vout

8
6

Voltage (V)

4
2
0
-2
-4
-6
-8
-10
-12
-14
0

10

20

30

40

50

60

70

80

90

100

Time (ms)

Carryer, Ohline & Kenny

Copyright 2011

10-2

Solution Manual for Introduction to Mechatronic Design

10.4)

Do Not Circulate

For the circuit shown in Figure 10.45, use the diode specifications provided in Figure 10.46 to determine
the maximum amount of current you can expect to flow when TA = 25C. If you were to increase the
power supply voltage, how much could you increase it before exceeding the diodes reverse breakdown
voltage?

Figure 10.45

Figure 10.46: Data sheet excerpt. (Courtesy of Diodes Incorporated. All rights reserved.)
Because D1 is reverse biased, the specification needed is the Peak Reverse Current (IRM) at TA = 25C. For
the 1N4935 (and all other diodes in this family of parts), the maximum value of IRM at this temperature is 5
A.
The power supply voltage could be increased to 200 V (DC), at which point it would exceed the maximum
allowable value for the 1N4935(VR). AC voltages are limited to 140 Vrms (VR(RMS)).

Carryer, Ohline & Kenny

Copyright 2011

10-3

Solution Manual for Introduction to Mechatronic Design

10.5)

Do Not Circulate

If D1 and D2 are treated as ideal diodes:


a) Draw a graph of Vout when the input voltage Vin ranges from -10 V to +10 V.
b) Draw a graph of the current flowing through the resistor over the same range of values for Vin.
c) Given that this type of circuit is commonly called a voltage clamp, briefly describe the function of
this circuit.

Figure 10.47
a)
Problem 10.5(a) Solution
6

Vout (V)

-1
-10

-8

-6

-4

-2

10

Vin (V)

From -10 V Vin -0.6 V, D2 is forward biased and conducting. Since we are treating D2 as ideal,
we assume that VF = 0.6 V, and this holds Vout to a value of -0.6 V. D1 is reverse biased, and since
we are treating it as ideal, there is no leakage current through D1.
From -0.6 V < Vin 0 V, D2 is forward biased, but since Vin < VF, D2 is not conducting and there is
no leakage current. D1 is reverse biased, and we assume no leakage current flows. Vout follows Vin.
From 0 V < Vin 5 V, D2 is reverse biased and not conducting, as is D1.
From 5 V < Vin 5.6 V, D2 is forward biased, but not high enough to cause D1 to conduct (Vin < 5 V
+ VF). D2 remains reverse biased and not conducting.
From 5.6 V Vin 10 V, D1 is forward-biased and conducting. We assume that VF = 0.6 V, so Vout
is held at 5.6 V.

Carryer, Ohline & Kenny

Copyright 2011

10-4

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

b)
Problem 10.5(b) Solution
0.06
0.04
0.02

Ires (A)

0.00
-0.02
-0.04
-0.06
-0.08
-0.10
-10

-8

-6

-4

-2

10

Vin (V)

The current flowing through the resistor R is Ires = (Vin Vout)/R. Using the values from part (a) of
the problem for Vin and Vout gives the above result.
c) Vout is clamped (i.e., held) to within a diode forward voltage drop (VF) of the power supply voltage (0
V / ground and +5 V).
10.6)

If the Zener voltage of the (ideal) Zener diode D1 (Figure 10.48) is 4.3 V, what is Vout when:
a) Vs = 3.3 V
b) Vs = 5 V
c) Vs = 12 V
d) Vs = -5 V

Figure 10.48
a) 3.3 V. The Zener diode is reverse biased, but not enough to cause it to go into reverse breakdown.
b) 4.3 V. The Zener diode is reverse biased and beyond the reverse breakdown voltage of 4.3 V, holding
Vout at the reverse breakdown voltage.
c) 4.3 V. The Zener diode is further reverse biased and beyond the reverse breakdown voltage of 4.3 V,
holding Vout at 4.3 V.
d) -0.6 V. The Zener diode is forward biased, and under these conditions it behaves like a regular diode,
with a typical value of VF = 0.6. This holds Vout at 0 V VF = 0 V 0.6 V = -0.6 V.

Carryer, Ohline & Kenny

Copyright 2011

10-5

Solution Manual for Introduction to Mechatronic Design

10.7)

Do Not Circulate

Design a circuit that uses a 5 V power supply to illuminate an LED that has a forward voltage drop of Vf =
2.2 V. Use only standard 5% resistors in your design, and insure that the current flowing through the LED
is between 17 and 20 mA.
+5V
R

LED1

For the circuit shown, the value of R will determine the current flowing from the 5 V power supply to
ground using Ohms law:

I=

VS VF 5V 2.2V
=
R
R

The target current is 17 mA I 20 mA. Solving for the value of resistor that results in a current that is
the average of 17 mA and 20 mA (18.5 mA) gives R = 151.4 , which is not a standard 5% resistor value.
The nearest standard 5% tolerance resistor is 150 . Considering the tolerances, this could be as low as
142.5 (resulting in a current of 19.6 mA) or as high as 157.5 (resulting in a current of 17.8 mA).
These satisfy the requirements, so we choose R = 150 .
10.8)

If Q2 in Figure 10.23 were replaced by an NPN transistor, what voltage would be necessary at Vin in order
to insure that Q2 is on and saturated?
The rules-of-thumb for the behavior of a typical NPN transistor tell us that it will be on and in saturation
when its base is at least 0.6 V above its emitter (VBE 0.6 V). With an NPN transistor instead of the PNP
transistor shown in Figure 10.23, when the transistor is on, the emitter will be one collector-emitter voltage
drop below the power supply voltage. For a typical NPN transistor in saturation, VCE = 0.2 V, and for the
circuit shown VS = VC = +10 V, so the base must be held at VB = VS VCE + VBE = 10 V 0.2 V + 0.6 V =
10.4 V.
The voltage at Vin must be higher than the value of VB by the voltage drop across the base resistor, R3.
The current flowing into the base must be sufficient to guarantee that Q2 is saturated, and from the rule-ofthumb described in this chapter IC:IB = 10:1. The current flowing through the lamp when Q2 is on and
saturated will be:

IC =

VS VCE ,SAT 10V 0.2V


= 98mA
=
RLAMP
100

So the base current should be at least 1/10th of this, or 9.8 mA. Since the value of the base resistor R3 is
fixed at 2.2 k, this requires Vin to be:

Vin = (9.8mA 2.2k) + 10.4V = 21.56V + 10.4V = 31.96V

Carryer, Ohline & Kenny

Copyright 2011

10-6

Solution Manual for Introduction to Mechatronic Design

10.9)

Do Not Circulate

What is the minimum value of Vin required to insure that at least 2.125 A flow through the load resistor in
the circuit from Figure 10.49? Use the specifications included for the IRLZ34N N-channel MOSFET
(Figure 10.50). What is the power dissipated in the resistor under these conditions? In the MOSFET?

Figure 10.49

Figure 10.50
In order for the specified current to flow through the load, the RDS(on) for Q1 is determined from:

RDS ( on ) =

12V
5.6 = 0.047
2.125 A

From the data sheet, to have an RDS(on) of at most 0.047 Vin = VGS must be at least 5 V.
For Vin = 5 V, RDS(on) = 0.046 , so the current that flows through the load and Q1 is

I=

12V
= 2.125 A
5.6 + 0.046

Power dissipation can then be determined as:

PLOAD = I 2 R = (2.125 A) 2 5.6 = 25.3W

PMOSFET = I 2 R = (2.125 A) 2 0.046 = 0.21W

Carryer, Ohline & Kenny

Copyright 2011

10-7

Solution Manual for Introduction to Mechatronic Design

10.10)

Do Not Circulate

For each of the following circuits from Figures 10.51 and 10.53, state whether the transistor is off, on but
not operating in the linear region, or on and operating in the linear region. Where possible, calculate the
minimum current that will flow through the load resistor using the specifications given in Figures 10.52
and 10.54.

Figure 10.51

Figure 10.52: IRL9Z34N data sheet excerpt. (Courtesy of International Rectifier 1998.)

Figure 10.53

Carryer, Ohline & Kenny

Copyright 2011

10-8

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Figure 10.54: IRFU5305 data sheet excerpt. (Courtesy of International Rectifier 2000.)
For the circuits in Figure 10.51, using the IRL9Z34N:
a) OFF (VGS = 0 V)
b) ON and operating in the linear region (VGS = 5 V)
From data sheet, RDS(on) = 0.046 when VGS = 5 V, so the minimum current flowing through the load
is

I=

12V
= 2.125 A
5.6 + 0.046

c) ON and operating in the linear region (VGS = 12 V)


From data sheet, RDS(on) = 0.035 when VGS = 10 V (not the exact VGS in the problem, but the closest
thing to it that is given in the data sheet and a conservative choice), so the minimum current flowing
through the load is

I=

12V
= 2.130 A
5.6 + 0.035

Carryer, Ohline & Kenny

Copyright 2011

10-9

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

For the circuits in Figure 10.53, using the IRFU5305:


a) ON and operating in the linear region (VGS = -12 V)
From data sheet, RDS(on) = 0.06 when VGS = -10 V (not the exact VGS in the problem, but the closest
thing to it that is given in the data sheet and a conservative choice), so the minimum current flowing
through the load is

I=

12V
= 2.120 A
5.6 + 0.06

b) ON, and operating in the linear region (VGS = -7 V with ID = ~-2.1 A)


We cant read the value of RDS(on) from the data sheet table for VGS = -7 V. From the plot, when VGS =
-7 V and ID is ~2.1 A, -VDS is ~0.1 V. Restate as RDS(on) = 0.048 when VGS = -7 V, so the minimum
current flowing through the load will be

I=

12V
= 2.125 A
5.6 + 0.048

c) OFF (VGS = 0 V)
10.11)

Design a circuit that satisfies all of the following conditions:


a) Use a single BJT (use rule-of-thumb characteristics for the BJT, and insure operation in the saturated
region).
b) Use the BJT to switch the current flowing through an LED (Vf = 2.2 V).
c) Use a 5 V power supply.
d) The base of the BJT is driven by a signal that is 0 V when the LED is to be off and 3 V when the LED
is to be on.
e) The current through the LED is approximately 0 mA in the off state and 100 mA ( 10%) in the on
state.
f) Use standard 5% resistor values.
g) Answer the following:
i. Is this a low-side drive or a high-side drive configuration?
ii. How much steady-state current is required to drive the base of the BJT?
+5V
R1
47
LED1
Rb
240
Vin

Q1
NPN

a) f):
92 mA ILED 101 mA

g)

i. Low-side drive
ii. IB = IC/10 = 10 mA, and alternately

IB =

Vin VB 3V 0.6V
=
= 10mA
240
Rb

Carryer, Ohline & Kenny

Copyright 2011

10-10

Solution Manual for Introduction to Mechatronic Design

10.12)

Do Not Circulate

Design a circuit that satisfies all of the following conditions:


a) Use a single IRL9Z34N N-channel MOSFET (the data sheet for this component may be found on the
Internet). Operate the MOSFET in the linear region.
b) Use the MOSFET to switch the current flowing through and LED (Vf = 2.2 V).
c) Use a 5 V power supply.
d) The gate of the IRL9Z34N is driven by a signal that is 0 V when the LED is to be off and 5 V when the
LED is to be on.
e) The current through the LED is approximately 0 mA in the off state and 100 mA ( 10%) in the on
state.
f) Use standard 5% resistor values.
g) Answer the following:
i. Is this a low-side drive or a high-side drive configuration?
ii. How much steady-state current is required to drive the gate of the IRL9Z34N?
+5V
R1
27
LED1

Vin

Q1
IRLZ34N

a) f):
97 mA ILED 107 mA

g)

i. Low-side drive
ii. The steady state current required to drive the gate (IG) is very small due only to leakage current.
According to the data sheet, the maximum gate-to-source forward leakage (when voltage at the
gate, VG, is 16 V greater than the voltage at the source, VS) is 100 nA, and the gate-to-source
reverse leakage (when VG is 16 V less than VS) is -100 nA. This is a very small current in either
case.

Carryer, Ohline & Kenny

Copyright 2011

10-11

Solution Manual for Introduction to Mechatronic Design

10.13)

Do Not Circulate

Design a circuit that satisfies all of the following conditions:


a. Use a single BJT (assume ideal characteristics, and operate the BJT in the saturated region).
b. Use the BJT to switch the current flowing through a 50 load.
c. Use a 5 V power supply.
d. The base of the BJT is driven by a signal that is 5 V when the load is to be off and 0 V when the load is
to be on.
e. The current through the load is approximately 0 mA in the off state and 35 mA ( 10%) in the on state.
f. Use standard 5% resistor values.
g. Answer the following:
i. Is this a low-side drive or a high-side drive configuration?
ii. How much steady-state current is required to drive the base of the BJT?
+5V
Rb
1.3K
Vin

Q1
PNP BJT

RLOAD
50
RCL
87

a) f):
33 mA ILOAD 35 mA

g)

i. High side drive configuration


ii. -IB = IC/10 = -3.5 mA, and alternately

IB =

Vin VB 0V (5V 0.6V )


= 3.4mA
=
1300
Rb

(NOTE: 1.2 k is another standard 5% resistor value that could have been used. This would have resulted
in a IC:IB ratio of slightly less than 10:1, whereas the solution shown above has a ratio of slightly more than
10:1. Both answers are reasonable and acceptable.)

Carryer, Ohline & Kenny

Copyright 2011

10-12

Solution Manual for Introduction to Mechatronic Design

10.14)

Do Not Circulate

Design a circuit that satisfies all of the following conditions:


a. Use a single IRFU5305 P-channel MOSFET (the data sheet for this component may be found on the
Internet). Operate the MOSFET in the linear region.
b. Use the MOSFET to switch the current flowing through a 50 load.
c. Use a 12 V power supply.
d. The base of the BJT is driven by a signal that is 12 V when the load is to be off and 0 V when the load
is to be on.
e. The current through the load is approximately 0 mA in the off state and 200 mA ( 10%) in the on
state.
f. Use standard 5% resistor values.
g. Answer the following:
i. Is this a low-side drive or a high-side drive configuration?
ii. How much steady-state current is required to drive the gate of the IRFU5305?
+12V

Vin

Q1
IRFU5305

RLOAD
50
RCL
10
1/2 Watt

a) f):
198 mA ILOAD 201 mA

g)

i. High side drive configuration


ii. The steady state current required to drive the gate (IG) is very small due only to leakage current.
According to the data sheet, the maximum gate-to-source forward leakage (when voltage at the
gate, VG, is 20 V greater than the voltage at the source, VS) is 100 nA, and the gate-to-source
reverse leakage (when VG is 20 V less than VS) is -100 nA. This is a very small current in either
case.

Carryer, Ohline & Kenny

Copyright 2011

10-13

Solution Manual for Introduction to Mechatronic Design

10.15)

Do Not Circulate

For the circuit shown in Figure 10.55, what is the voltage at Vout when Vin = 0 V? What is Vout when
Vin = 3.3 V? How much current will Vin be required to source or sink in each state?

Figure 10.55
For Vin = 0 V:
Q1 is off and the gate of Q2 is pulled high to 5 V through R2. This turns Q2 on and it operates in the linear
region. The data sheet for the 2N7000 states that RDS(ON) is typically 1.8 and has a maximum value of
5.3 . Assuming that RDS(ON) = 5.3 represents the worst case design (the problem statement doesnt
specify, but typically the goal is to get Vout as close to 0 V in this state as possible), we will determine
Vout for this condition:

RDS ( on )
= 3.3V 5.3 = 17.4mV
VOUT = VS
R

5.3 + 1k
DS ( on ) + R3
When Vin = 0 V, it will sink the leakage current from the base of the Q1 (which is turned off). From the
data sheet, this is IBL, the Base Cutoff Current, which has a maximum value of 50 nAdc. No minimum
value is given, so the conservative assumption is that it could be as low as 0 nA (which is not physically
possible, but is a safe assumption that allows us to bound the design). Thus, when Vin = 0:

0 A I IN 50nA
For Vin = 3.3 V:
Q1 is on and saturated (IC/IB = 13.5, which is slightly more than the rule-of-thumb goal of 10, but much
less than the rule-of-thumb limit of 20). This pulls the gate of Q2 low, turning it off. Vout will be very
close to the 3.3 V power supply voltage in this case. The amount of leakage current through Q2
determines how close (less leakage current results in Vout closer to 3.3 V). The most realistic scenario
from the data sheet is for the case where TA = 25C, in which case the spec for IDSS (Zero Gate Voltage
Drain Current) is 1 A and the resulting Vout is given by

VOUT = VS I DSS R3 = 3.3V 1A 1000 = 3.299V


When Vin = 3.3 V, Q1 is on and saturated, so the base current is

IB =

VIN VB 3.3V 0.6V


=
= 297 A
9100
R1

Carryer, Ohline & Kenny

Copyright 2011

10-14

Solution Manual for Introduction to Mechatronic Design

10.16)

Do Not Circulate

What is the current that flows through RL when Vin = 0 V? What is the current through RL when Vin = 5
V? How much current will Vin be required to source or sink in each state? Refer to Figure 10.56.

Figure 10.56
For Vin = 0 V:
Q1 is off, and the gate of Q2 is pulled to 12 V through R1. Since Q2 is a P-channel MOSFET, this turns it
off.
The current that flows through RL when Q2 is off is the drain-source leakage current. From the data sheet,
the maximum value for IDSS (Drain-to-Source Leakage Current) is -25 A at 25C and -250 A at 150C.
With justification, either answer is acceptable, though -25 A at 25C is more realistic for most circuits.
The minimum value for IDSS is not stated in the data sheet. The most conservative assumption we can
make is that the minimum value is 0 A, which isnt physically possible but allows us to bound the
problem completely:
When Vin = 0 V, the current flowing is 0 A RL 25 A.
For Vin = 5 V:
Q1 is on and operating in the linear region, which will pull Q2s gate near 0 V, turning Q2 on. From the
datasheet for the IRFU5305, RDS(on) 0.065 when VGS = -10 V. Thus, the minimum current flow
through RL when Q2 is on will be:

I MIN =

VS
R DS ( on ) + RL

12V
= 2.952 A
0.065V + 4V

The minimum value for RDS(on) is not stated in the data sheet. The most conservative assumption we can
make is that the minimum value is 0 , which isnt physically possible but allows us to bound the problem
completely. In this case

I MAX =

VS
R DS ( on ) + RL

12V
= 3A
0V + 4V

Finally, the full range of possible currents flowing through RL is:

2.952 A I LOAD 3 A

Carryer, Ohline & Kenny

Copyright 2011

10-15

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 11 Operational Amplifiers


11.1)

Show how you could use the voltage divider expression to develop the transfer function (input-output
relationship) for the non-inverting op-amp configuration.

Ri
Vout
R +R
i
f

= Vin

R f + Ri
Vout =
Ri

Vin

R f Ri
+ Vin
Vout =
Ri Ri
Rf

Vout =
+ 1Vin
Ri

11.2)

Which Golden Rule enables you to use the voltage divider expression in Problem 11.1?
The inputs draw no current

11.3)

Design a circuit that will function as a non-inverting summer with a gain of 2 on the sum of the input
voltages. Assume an ideal op-amp and choose standard 5% resistors
R1

R2

10K

30K

VCC

Vin2

R3

100K

R4

Vout

11

Vin1

100K

Carryer, Ohline & Kenny

Copyright 2011

11-1

Solution Manual for Introduction to Mechatronic Design

11.4)

Do Not Circulate

Design a trans-resistive amplifier for a photo-transistor such that the circuit will have an output of 2.5 V
with no light falling on the sensor and an output voltage that rises with increasing light levels. You have
only a +5 V supply available, but may assume an ideal op-amp. Write the gain expression relating photocurrent to output voltage for the circuit that you design.
R2
2.7K

R3
10K

+5

U2A
Ideal Op-Amp
2
3

R4
10K

+5

Output

11

Q1
LTR3208E

VOUT = 2.5V + I PHOTO R2


11.5)

If the voltage divider of Figure 11.9 was to produce a voltage of 2.5 V and deliver 0-2 mA into the external
circuit, what values for R1 and R2 would keep the variation in Vref below 1% of its no-load value? What
would the power rating of the resistors need to be?
For the disturbance in voltage to be below 1%, the disturbance in current must also be below 1%. If we
want 2 mA of current to flow out of the divider, then that must be 1% or less of the undisturbed current in
the divider. Therefore, we need 100 2 mA = 200 mA flowing in the divider. This requires resistors of 25
capable of dissipating P = I2R = (200 mA 200 mA)(25 )= 1 W.

11.6)

Describe how the output stage of most comparators is different from the output stage of op-amps.
The output stage of most comparators is an open-collector rather than a push-pull style used in op-amps.

Carryer, Ohline & Kenny

Copyright 2011

11-2

Solution Manual for Introduction to Mechatronic Design

11.7)

Do Not Circulate

In the circuit shown in Figure 11.24, as the input voltage, Vin, is ramped from 0 V to 5 V:
a) Graph the state of the LED (D1) over the specified range of input voltages.
b) Graph the output voltage over the specified range of input voltages and include the corresponding state
of the LED.

Figure 11.24 Circuit for Problem 11.7.


LED On
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5

Vin

Vout

Carryer, Ohline & Kenny

Copyright 2011

11-3

Solution Manual for Introduction to Mechatronic Design

11.8)

Do Not Circulate

Design a circuit to implement an inverting comparator with hysteresis having an approximately 200 mV
hysteresis band centered at approximately 1 V. Choose standard 5% resistors and report the expected
thresholds if the values of those resistors were exact.

+Vcc
+Vcc
RPU

Vin

R1

Vout

Vref
R2
R3

R2 = 30 k, R1 = 120 k, R3 = 560 , RPU=3.3 k.


Thresholds will be at 1.164 V and 0.959 V.
11.9)

What range of thresholds (min to max) would you expect to see in the circuit of Problem 11.8 if the 5%
resistors were at the outer limits of the tolerance?
The lowest lower threshold would be if R2 & R3 were at their minimum values, and R1 was at its
maximum. This results in a lower threshold of 0.883 V.
The highest upper threshold would be if R2 was at its maximum and R1 & R3 were at their minimum
values. This results in an upper threshold of 1.255 V.

11.10)

For the circuit of Figure 11.25, answer the following questions:


a) What is Vout for the circuit as drawn?
b) What would Vout be if R2 were changed to 2 k?
c) How does the current through R1 change between the conditions of part a) and part b)?
d) Write a general expression for Vout as a function of the value of R2.

Figure 11.25 Circuit for Problem 11.10.


a)
b)
c)
d)

2.5 V + 0.25 V = 2.75 V


2.5 V+ 0.5 V = 3.5 V
It doesnt change.
Vout = 2.5V + 2.510-4 R2

Carryer, Ohline & Kenny

Copyright 2011

11-4

Solution Manual for Introduction to Mechatronic Design

11.11)

Do Not Circulate

For the circuit shown in Figure 11.26, answer the following questions:
a) If V1 = V2 = 1 V, what are the voltages at points A and B?
b) If V1 = 1.1 V and V2 = 1 V, what are the voltages at points A and B?
c) If V1 = 1 V and V2 = 1.1 V, what are the voltages at points A and B?
d) Write an expression for the voltage at B minus the voltage at A in terms of V1, V2 and the values of
the resistors.

Figure 11.26 Circuit for Problem 11.11.


a) VA = 1 V, VB = 1 V
b) VA = 2.1 V, VB = 0 V
c) VA = 0 V, VB = 2.1 V

d) VB V A = (V2 V1 )1 +

Carryer, Ohline & Kenny

2 R1

R2

Copyright 2011

11-5

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 12 Real Operational Amplifiers and Comparators


12.1)

Use the Internet to find the data sheet for the Microchip MCP6294 amplifier and use the specifications for
the device when it is operated with a single 5 V supply to answer the following questions.
a) For a circuit with a closed loop gain of 10 and desired maximum gain error of 10%, use the guidelines
provided in this chapter to determine the maximum signal frequency that can be amplified?
b) What would the actual gain be at that frequency?
c) How would these answers change if the power supply voltage were reduced to 3.3 V?
a) Only a typical GBW is specified at 10 MHz. To keep the gain error below 10% we need an open loop
gain that is 10 times the desired closed loop gain. To achieve a closed loop gain of 10 we need an open
loop gain of 100. With a GBW of 10 MHz, this corresponds to 100 kHz.
b) The gain equation that accounts for non-infinite open-loop gain is:

Rf

10
)
100(
)
R f + Ri
+
10
1
=
G=
= 9.0
Ri
1
)
1 + A(
) 1 + 100(
10 + 1
R f + Ri
A(

c) The GBW spec is given for a power supply range from 2.4-5.5 V so lowering the supply to 3.3 V
would not change the result.
12.2)

Use the Internet to find the data sheet for the Microchip MCP6294 amplifier. If the MCP6294 amplifier
operates with a single 5 V supply across the full range of temperatures, what is the possible range of output
voltages for the circuit shown in Figure 12.10? You may neglect the effects of temperature on all other
circuit elements.

Figure 12.10 Circuit for Problem 12.2.


Ideal output = -0.1 V 100 k/10 k = 1 V, The maximum bias current of 200 pA will flow across Rf
creating a voltage drop of 20 V. Since the bias current is shown as a positive number, it is flowing into
the pin and must be supplied by the output, raising the output by the 20 V. The input offset voltage is
listed as 5 mV, which will be amplified by the noise gain resulting in a 55 mV swing in the output.
Since the bias current raises the output, the minimum output will be when it is zero and the input offset
voltage is at its negative minimum: 1 V 55 mV = 0.945 V, The maximum output will be when both the
bias and the input offset voltage are at the maximum: 1 V + 55 mV + 20 V = 1.05502 V.

Carryer, Ohline & Kenny

Copyright 2011

12-1

Solution Manual for Introduction to Mechatronic Design

12.3)

Do Not Circulate

How much GBW is required of an op-amp in order for it to amplify a 10 kHz sine wave by a factor of 10
with a gain error of less than 1%?
To maintain a gain error of less than 2% requires that we have 50 times the open loop gain as the required
closed loop gain, 10 50 = 500. To have an open loop gain of 500 at 10 kHz requires an op-amp with a
GBW of 500 10 kHz = 5 MHz.

12.4)

Design a circuit to implement an inverting comparator with hysteresis having an approximately 200 mV
hysteresis band centered at approximately 1 V. Choose standard 5% resistors and report the expected
thresholds if the values of those resistors were exact.
+Vcc
+Vcc
RPU

Vin

R1

Vout

Vref
R2
R3

R2 = 30 k, R1 = 120 k, R3 = 560 k, RPU = 3.3 k.


Thresholds will be at 1.164 V and 0.959 V.
12.5)

What range of thresholds (min to max) would you expect to see in the circuit of Problem 12.4 if the 5%
resistors were at the outer limits of the tolerance?
The lowest lower threshold would be if R2 and R3 were at their minimum values, and R1 was at its
maximum value, resulting in a lower threshold of 0.883 V.
The highest upper threshold would be if R2 was at its maximum value, and R1 and R3 were at their
minimum values, resulting in an upper threshold of 1.255 V.

Carryer, Ohline & Kenny

Copyright 2011

12-2

Solution Manual for Introduction to Mechatronic Design

12.6)

Do Not Circulate

For the circuit shown in Figure 12.11, what is Vout? Write an expression for Vout in terms of the relevant
device parameters.

Figure 12.11 Circuit for Problem 12.6.


Vout = 4.3 V.

VOUT = VZ + I1R1 = I 2 R2 + I 2 R3 = 3.3V + I1 (1k) = I 2 (3.3k) + I 2 (1k)


Since the voltage at V+ and V will be driven to be the same, I1will equal I2.
12.7)

In the circuit of Figure 12.11, what purpose does resistor R1 serve?


It limits the current through D1 and creates the voltage drop that will be matched to that at the noninverting input.

12.8)

Using the Web, classify the following op-amps according to their input and output characteristics (i.e.,
RRI, RRO, RRIO): LM139A, MCP6031, OPA337, MC34072A, ADA4051-2, LT1012.
LM139:
MCP6031:
OPA337:
MC34072A:
ADA4051-2:
LT1012:

12.9)

The LM139 is a comparator, not an op-amp


RRIO
RRO
Neither RRI or RRO, but the output is close to RRO
RRIO
Neither RRI nor RRO

For the MC6294, across the range of temperatures from -40 to 125C, what is the maximum expected
input offset voltage and input bias current? How do these numbers change if the temperature range is
reduced to -40 to 85C?
Across full temp range: the input offset voltage: 5 mV, and the input bias current: 2 nA. Limiting the
temp to 85C lowers the bias current spec to 200 pA.

Carryer, Ohline & Kenny

Copyright 2011

12-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

12.10) For the circuit of Error! Reference source not found., what is Vout ? Write an expression for Vout in
terms of the relevant device parameters.

Figure 12.12 Circuit for Problem 12.10.

R3

R3 + R 2

Vout = 1.09V; Vout = Vz

12.11)

Locate a data sheet for a MAX9024 and answer the following questions:
a) How does its pin-out compare with that of the comparator shown in Figure 12.9?
b) How does its output stage compare with that described in Section 11.5?
c) How does its propagation delay compare with that of the specifications for the LM339A?
a) Even though it is a comparator, this device uses a pin-out that matches a quad op-amp.
b) This device has a totem pole/push-pull output, unlike most comparators that have an open collector
output.
c) The LM339A is specified at typically 1.3 s with 5 mV of overdrive. The MAX9024 is specified at
typically 8 S with 10 mV of overdrive.

Carryer, Ohline & Kenny

Copyright 2011

12-4

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 13 Sensors
13.1)

A microphone has a dynamic range of 88 dB and a maximum output of 2.5 V rms. What is the output
signal (in V rms) that corresponds to the minimum sound level it is capable of detecting?

Max Measurable Signal


can be rewritten and solved as:
Min Measurable Signal

Eq. 11.4 dB = 20 log10

Min Measurable Signal =

Max Measurable Signal


10

13.2)

dB

20

2.5Vrms
10

dB

20

= 99.5Vrms

From the list below, pick two sensor technologies and succinctly describe their theory of operation:
a) Geiger counter
b) Torque sensor
c) LVDT
d) pH sensor
e) Vortex flow meter
This is a go learn about it and tell us what you learned problem. Responses will vary. Check for a
reasonably thorough and well-understood response.
a) A tube filled with inert gas (e.g. helium, argon, etc.) briefly conducts electricity when a particle of
radiation or a photon passes through it. This very small electrical signal is amplified and quantified to
measure ambient radiation.
b) There are several types of torque sensors, but one of the most common makes use of strain gages
oriented at 45 to the longitudinal axis of a shaft. The strain exhibited by the shaft is proportional to
the applied torque. Powering and measuring the strain on a rotating shaft is a more challenging
problem (though not specifically required to answer this question). This is most commonly achieved
by means of slip-rings or inductive coupling.
c) A linear variable differential transformer uses a moveable ferrous core to measure displacements. A
primary coil is externally excited by an AC signal, and the differential signal measured in two
secondary coils is related to the position of the core. By measuring the signal in the secondary coils,
the position of the core may be very precisely determined.
d) A glass electrode immersed in a solution develops a potential (voltage) related to the concentration of
hydrogen ions present in the solution. The concentration of hydrogen ions in a solution determines its
pH. The glass electrode may be constructed with small amounts of other materials mixed in
(dopants), such as Na, K, Li, Al, etc. Often, two electrodes are used to create a sensor assembly: a
measurement electrode and a reference electrode. The measurement electrode is exposed to the
solution to be measured, and the reference electrode provides a stable signal to compare with the
reference electrode.
e) A body is placed in the path of a flowing fluid, which sheds vortices downstream of the body. The
period of oscillation of the vortices is related to the velocity of the flow.

Carryer, Ohline & Kenny

Copyright 2011

13-1

Solution Manual for Introduction to Mechatronic Design

13.3)

Do Not Circulate

For one of the sensors you chose to describe in your answer to Problem 13.2, identify a commercially
available example, locate the data sheet for the device that describes its performance, and answer the
following questions:
a) What is the range of the sensor?
b) In what form is the output (e.g., voltage, resistance, capacitance, and so on)?
c) What is the transfer function for the sensor?
d) What are the categories of error for the sensor? What is the overall accuracy?
e) Does the sensor exhibit hysteresis? If so, how much?
This is a go learn about it and tell us what you learned problem. Responses will vary. Check for a
reasonably thorough and well-understood response. The device data sheet used is required as part of a
complete answer.

13.4)

Using PDL (also called pseudo-code, see Chapter 6, Software Design), describe an algorithm for
performing switch debouncing in software. Does your routine report when the switch is initially activated
or when it is released?
Since this is a software design exercise, responses will vary. Evaluate answers based on plausibility and
how thoroughly the solution is thought through.
Example pseudo-code:
Routine returns with SwitchOpen, SwitchClosed, NoNewSwitch
If switch has changed states since the last call
Save current switch state as LastSwitchState
If debounce timer is not active
Start debounce timer
Report current switch state
Else (timer is active)
Ignore switch closure (report NoNewSwitch)
Endif
Else (switch hasnt changed states)
Report NoNewSwitch
In this example solution, the software reports a switch press at the beginning of the debounce cycle.

Carryer, Ohline & Kenny

Copyright 2011

13-2

Solution Manual for Introduction to Mechatronic Design

13.5)

Do Not Circulate

An LM35DT temperature sensor is used to monitor an environment where the temperature ranges from 0
to 50C. Design an interface circuit that has an output ranging from 0.5 to 4.5 V that is linear with
temperature over the range to be measured. For your circuit, you may make use of ideal op-amps, but
select only standard 5% tolerance resistor values.
From the LM35 data sheet:
Vout = 0 V when T = 0C
Vout = 500 mV when T = 50C
Since we need to translate this to have a value of 0.5 V at T = 0C and 4.5 V at T = 50C, we need to add
an offset of 0.5 V and amplify the LM35 output by a gain of (4.5V-0.5V)/0.5V = 8. Also, the requirements
state that the slope of the output must be positive, as is the output of the LM35, so we will need to use a
non-inverting amplifier configuration. One solution uses a non-inverting amplifier with a voltage offset,
rather than simply amplifying the output of the LM35 and adding a constant offset after the
fact/simultaneously (although this would work too). Here is a solution using the approach of a noninverting amplifier with offset:
Ri

Rf

Vos
+5V
+5V
Vin

Vout

Golden Rule #2 gives us that V+ = Vin and thus V- = Vin


Ohms law across Ri: Vin Vos = Ii Ri
Ohms law across Rf: Vout Vin = If Rf
Golden Rule #1 (inputs draw no current) gives us Ii = If, so we can combine above expressions to write:

VIN VOS VOUT = VIN


=
Ri
Rf
R
Rf
VOS f
VOUT = R f 1 +
Ri
Ri

Rf

1 +
R
i
is the gain term, we set this equal to the desired gain = 8. Then
Since

Rf

Ri

= 7

Selecting from 5% tolerance resistors gives and using Rf = 36 k and Ri = 5.1 k gives us a ratio of 7.06,
which is close enough and we will use those values.
To solve for Vos, we know that the offset when Vin = 0 must be 0.5 V, so we use that to solve

VOS 7 = 0.5V = 0.071V

Carryer, Ohline & Kenny

Copyright 2011

13-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

The circuit is then fully defined as:


-0.071V

Ri
5.1K

Rf
36K
+5V

+5V
Vout

Vin

13.6)

One method of creating a pseudo-linearized output from a standard NTC thermistor is called voltage mode
linearization in which the thermistor is placed in series with a standard resistor (where R1 = R25C, the
thermistors resistance at 25C) to create a voltage divider, as shown in Figure 13.80.
Temperature (C)
-25
-20
-15
-10
-5
0
5
10
15
20
25
30
35
40
45
50

R (Ohms)
4,240
3,311
2,607
2,070
1,656
1,335
1,083
885
727
601
500
418
352
298
253
216

Figure 13.80
For the thermistor characteristics shown, plot the resulting Vout. What is the maximum linearity error that
results (the difference between the best-fit straight line through the data and the data point furthest from the
line), stated both in volts and in % F.S.O.?
Maximum error is at the lowest value (-25 C), which is -3.8%. Overall, this is a simple and effective
method for linearizing the NTC thermistors output. The following plot and table were used to determine
the performance:
Temp (C)

4
3.5
y = 0.0416x + 1.4353
R2 = 0.9969

Vout (V)

3
2.5
2
1.5
1
0.5
0
-25

25

50

Temperature (C)

Carryer, Ohline & Kenny

Copyright 2011

-25
-20
-15
-10
-5
0
5
10
15
20
25
30
35
40
45
50

R (ohms)
4,240.10
3,310.70
2,607.30
2,070.10
1,656.20
1,334.80
1,083.20
884.8
727.3
601.3
500
418.3
352
297.6
253
216

Vout (V) Best fit (V)


0.52741503
0.3953
0.65604745
0.6033
0.80455701
0.8113
0.9727248
1.0193
1.15944718
1.2273
1.36254633
1.4353
1.57908034
1.6433
1.80531485
1.8513
2.03699177
2.0593
2.27004449
2.2673
2.5
2.4753
2.72242187
2.6833
2.9342723
2.8913
3.13440321
3.0993
3.32005312
3.3073
3.49162011
3.5153

Error (V) Error (%FSO)


-0.132115
-3.8%
-0.052747
-1.5%
0.006743
0.2%
0.046575
1.3%
0.067853
1.9%
0.072754
2.1%
0.06422
1.8%
0.045985
1.3%
0.022308
0.6%
-0.002744
-0.1%
-0.0247
-0.7%
-0.039122
-1.1%
-0.042972
-1.2%
-0.035103
-1.0%
-0.012753
-0.4%
0.02368
0.7%

13-4

Solution Manual for Introduction to Mechatronic Design

13.7)

Do Not Circulate

Design a strain gage interface circuit based on a Wheatstone bridge. The strain gage has a nominal
(unstrained) resistance of 120 and a gage factor of 2. The interface circuits output should be 0 V when
the gage is not subjected to strain, and sensitivity of 0.5 mV/.
With GF = 2, we can write R = 2 120
From this, we can construct a Wheatstone bridge circuit and calculate the output. For the bridge shown, Ra
is the strain gage all other resistive elements are 120 resistors.
+10V

Rd

Ra
Vout+

Rc

Rb

Vout-

For this circuit then, Vout = V+ - V-, resulting in the following table:
ue (microstrain)
0
10
20
30
40
50
60
70
80
90
100

Delta R
Bridge sensorDelta V
0.0000
5.000000 0.000000
0.0024
5.000050 0.000050
0.0048
5.000100 0.000100
0.0072
5.000150 0.000150
0.0096
5.000200 0.000200
0.0120
5.000250 0.000250
0.0144
5.000300 0.000300
0.0168
5.000350 0.000350
0.0192
5.000400 0.000400
0.0216
5.000450 0.000450
0.0240
5.000500 0.000500

Since the sensitivity of this circuit is .005 mV/ , and the problem specifies sensitivity 100x this, a
differential amplifier/instrumentation op-amp will be used with a gain of 100 to achieve the desired result.
For this solution, we have chosen an Analog Devices AD626, which can be configured to supply a gain of
100 (by grounding pin 7). Any suitable instrumentation op-amp or differential amplifier circuit may be
substituted for the suggested solution.
+10V
4

Ra

Rd

+10V

1
Rc

Vout

Rb

AD626AN

-10V

Carryer, Ohline & Kenny

Copyright 2011

13-5

Solution Manual for Introduction to Mechatronic Design

13.8)

Do Not Circulate

Design an interface circuit for the photo-diode whose specifications are given in Figure 13.28 that uses a
74HC14 (a logical inverter with Schmitt trigger inputs) at the output stage. The 74HC14 is to be powered
by a 4.5 V power supply and its output should be guaranteed to have made a transition from logical high to
logical low when the irradiance increases above 3 mW/cm2, and guaranteed to have made the logical low
to logical high transition when the irradiance then falls to 0.1 mW/cm2.
An interface circuit exactly like that shown in Fig. 11.27 is appropriate, with the correct selection of an
appropriate offset voltage (must be less than 0.9 V to guarantee the high-low output transition), the gain
resistor in the feedback loop to adjust the output voltage to the appropriate level for the HC14 input.
Correct answers will recognize that the output of the amplifier must be greater than or equal to the
maximum positive going voltage threshold (3.15 V) when irradiance is 3 mW/cm2, and less than the
minimum negative going voltage threshold (0.9 V) when irradiance is 0.1 mW/cm2.
D1
0.75V
+5V

+5V
R1
56K

R3
24K

0.75V

Vout

74HC14
R2
10K

For the positive going threshold: with irradiance of 3 mW/cm2, Ip is typically 100 A. This sets Vout for
the op amp at 0.75 V + 100 A R3. The guaranteed maximum positive going trip voltage for the
74HC14 is 3.15 V, so we select R3 such that the amplifiers Vout is greater than or equal to 3.15 V when
Ip is 100 A. A value of 24k results in Vout = 3.15 V. (For this answer, we have neglected tolerances for
the resistor and the diode.)
For the negative going threshold: with irradiance of 0.1 mW/cm2, Ip is typically 4 A. This sets Vout for
the op amp at 0.75 V + 4 A R3. The guaranteed maximum negative going trip voltage for the 74HC14
is 0.9 V, so we need to verify that the value of R3 we selected for the positive going voltage meets the
requirement of Vout 0.9 V. Above, we selected R3 = 24 k, so Vout = 0.75 V + 4 A 24 k = 0.846
V, which is lower than 0.9 V and meets the requirements.

Carryer, Ohline & Kenny

Copyright 2011

13-6

Solution Manual for Introduction to Mechatronic Design

13.9)

Do Not Circulate

For the photo-transistor interface circuit (Figure 13.81), use the specifications given for the LTR-3208E in
Figure 13.30 to plot Vout for values of irradiance between 0 and 3 mW/cm2, assuming that the LTR-3208E
is selected from Bin A. If all resistors used in the circuit have 5% tolerance, what is the range of possible
values of Vout when the irradiance is 3 mW/cm2?

Figure 13.81
For this solution, we plot the results of a device whose Ic is the average of the maximum and minimum
specified values. From Bin A, Ic,min = 0.64 mA and Ic,max=1.68 mW when the irradiance is 1 mW/cm2.
We know that the output characteristic is linear with irradiance, so we can consider Ic,ave to be the gain of
the sensor.
For the circuit, when no current is flowing through the phototransistor (no light is incident), the output of
the op-amp will be 2.5V (the reference voltage at V+). When light is incident on Q1, current will flow and
Vout will adjust to maintain 2.5V at the op-amps V- terminal. That results in the following table and
graph:
Irradiance
0
1
2
3

Ic ave

Vout
0
1.16
2.32
3.48

2.500
2.952
3.405
3.857

5.000

Vout (V)

4.000
3.000
2.000
1.000
0.000
0

0.5

1.5

2.5

Irradiance

For the max and min possible output values at 3 mW/cm2, we take into account the tolerances of all the
parts: the resistors and the phototransistor.
The minimum value is when the reference voltage is at a minimum, which occurs when R1 = 10.5 k and
R2 = 9.5 k (the limits of their 5% tolerances). The reference voltage is then 2.375 V instead of 2.5 V.
The photo-transistors minimum Ic specification is 0.64 mA at 1 mW/cm2, and will be 3 times this at 3
mW/cm2. Finally, if the gain resistor is as low as possible (390 5%), the minimum output voltage of
the circuit will be 3.086 V.
Using similar logic, the maximum value is found when the reference voltage is maximum (R1 = 9.5 k,
R2 = 10.5 k) = 2.625 V, when the phototransistors Ic has the maximum specification (Ic = 1.68 mA at 1
mW/cm2) and Rg has its maximum value. Under these conditions, the maximum output of the circuit will
be 4.689 V.
Carryer, Ohline & Kenny

Copyright 2011

13-7

Solution Manual for Introduction to Mechatronic Design

13.10)

Do Not Circulate

If R1 in Figure 13.82 is a sensor whose resistance varies from 8 to 11 k,


a) what is the range of output voltages for the op-amp on the left (U1A)?
b) what are the output voltages for the op-amp on the right (U1B)?

Figure 13.82
U1A (on the left) uses a constant current configuration. Using the Golden Rules, we know that the node
between R1 and R2 is held at a constant 1 V (the same as V+), and that the current through R2 is a constant
at 1 V / 7.5 k = 0.133 mA. Since this current must also flow from V+ (held at 1 V) through the sensor
R1 to Vout, that requires Vout to have a range from 8 k 0.133 mA + 1 V = 2.067 V to 11 k 0.133
mA + 1 V = 2.467 V.
With this as the input to the second amplifier block on the right, we can then solve for the output of U1B.
This is an inverting amplifier with an offset voltage, and in Chapter 11 section 11.4.3.2 we solved for the
transfer function

Vout = (Vref Vin )(

Rf
Ri

) + Vref

In our case, Vref = 2.287 V, Rf = 10 k and Ri = 1 k. We can then solve for Vout for the range of values
of Vin, and the result is that Vin ranges from 0.5 V to 4.5 V.

Carryer, Ohline & Kenny

Copyright 2011

13-8

Solution Manual for Introduction to Mechatronic Design

13.11)

Do Not Circulate

For the MPX2010 pressure sensor, use the specifications provided in Figure 13.83 to answer the following
questions:
a) What is the range of pressures you can measure with this device?
b) What is the equation for the transfer function?
c) What is the output voltage when the sensor measures 7.5 kPa?
d) What is the total accuracy of the device at 25C without calibration (in % F.S.O., referred to here as
VFSS, or voltage at full scale span)?
e) What is the (typical) power dissipated by the device in normal operation when it is powered at 5 V?

Figure 13.83
a) 0-10 kPa
b) Vout = ( 2.5mV / kPa) P , where P is the pressure to be measured, in kPa
c) Vout = (2.5mV / kPa) 7.5kPa = 18.75mV
d) Total accuracy at 25C is the sum of the error from linearity error (1% max), pressure hysteresis (0.1%
typical), variation in full scale span (1 mV/25 mV = 4% max), and variation in offset (1 mV/25 mV =
4% max). If all of these had the worst case values simultaneously, the accuracy (error) would be 1% +
0.1% + 4% + 4% = 9.1%.
e) P = VI = (5V )(6mA) = 30mW

Carryer, Ohline & Kenny

Copyright 2011

13-9

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 14 Signal Conditioning


14.1)

What kind of capacitors would make a good choice for a DC blocking capacitor?
Plastic film: Teflon, polypropylene, polystyrene are best. Monolithic ceramic are OK.

14.2)

What is the minimum number of resistors that need to be changed to alter the differential gain of the circuit
of Figure 14.16 while maintaining the insensitivity to common mode voltage?
1 (see section 12.1.5.5).

14.3)

You have been asked to design the signal conditioning circuit to make the signal from a new temperature
sensor suitable for use with a microcontroller. The sensor has a linear response over the range from 0 to
100 C with a temperature coefficient of -100 /C. At 0C, it has a resistance of 11 k. Your circuit
should produce an output that is linearly proportional to temperature with a scale factor of 20 mV/C over
a range from 0 to 100C. The actual voltages that the circuit produces are up to you (i.e., the offset is not
specified), provided no device limits are exceeded and the scale factor requested is delivered. You may
assume ideal components limited only by the 5 V supply available.
To get a linear temperature to voltage transfer through an element that has a linear temperature-toresistance characteristic requires a constant current through the resistive element. In this case, we have R
= 100 for a 1C change in temperature and want a 20 mV change in voltage. This implies a constant
current through the element of 0.2 mA. We can achieve that with a circuit like the following:
Sensor
R1
+5

11K
+5
2
3

11

1K

R2
2.2V

At 0C the output voltage will be 11 k 0.2 mA + 2.2 V = 4.4 V. When the temperature rises by 1C, the
resistance will fall to 10.9 k and the output voltage will be 10.9 k 0.2 mA + 2.2 V = 4.38 V. The
output voltage changed by 20 mV for a 1C increase in temperature. At 100C the resistance will have
changed by 100C -100 /C = -10 k, giving a resistance at 100C of 1 k. The output voltage will
then be 1 k 0.2 mA + 2.2 V = 2.4 V.

Carryer, Ohline & Kenny

Copyright 2011

14-1

Solution Manual for Introduction to Mechatronic Design

14.4)

Do Not Circulate

Given a slowly changing (treat it as DC) signal with an amplitude that varies between 0 and 0.2 V that is
superimposed on a 2 V true DC offset voltage, design a circuit that will amplify the slowly changing signal
by a factor of 10 while not amplifying the DC offset. The actual range of output voltage that you choose is
up to you (it may include an offset), but you must stay within the 0 and 5 V supplies that are available to
power your circuit.
+5

+5

U1A

0.1uF

R4
200K

R2

R3

10K

100K
+5

11

C1

R1
300K

U1B

6
R5

10K

R6

Vout

11

Vin

100K

The upper left portion of the circuit produces a 2 V reference which will be subtracted from Vin before it is
amplified by 10. The right hand portion is a basic difference amplifier with a gain of 10.
14.5)

Given a sinusoidal signal at 6 kHz with an amplitude of between 0 and 0.2 V superimposed on a 60 Hz
signal that varies between 0 and 1 V, design a circuit that will amplify the 6 kHz signal by a factor of
approximately 10 and attenuate the 60 Hz signal by a factor of at least 10. You should look for a design
that will use the simplest possible circuit to achieve your goals.
R2

R3

10.5K

95.3K
+5

+5

R4
68K

C2
Cap
3.9nF

Vout

R1
68K

11

3.9nF

11

Vin

C1

U1B

U1A

While not particularly elegant, this is the simplest circuit to achieve the desired result. The 2 passive stages
have their corners set at 600 Hz each, which results in an attenuation of the 60 Hz (after the gain of 10
stage) of 0.099 while the 6,000 Hz signal is only minimally attenuated.

Carryer, Ohline & Kenny

Copyright 2011

14-2

Solution Manual for Introduction to Mechatronic Design

14.6)

Do Not Circulate

Some sensors produce an output that is not a single voltage but a pair of voltages in which the actual signal
of interest is the difference between the two voltages. This is referred to as a differential output. In these
situations, it is common for there to be some DC offset that exists on both signals. For example consider
the case of an accelerometer that produces a differential output with a nominal output voltage on each of
outputs of 2.5V. The exact value of this offset is not well controlled (it may vary from device to device).
Design a circuit that will take a 0-0.2 V differential signal with frequency content from DC to 100 Hz from
such an accelerometer and amplify it by a factor of approximately 10 while minimizing the effects of the
offset voltage common to both inputs. You may assume ideal op-amps and exact value resistors are
available for your design.

V1

A R3

R4
47k

47k

R1
61.9k

Vout

R2

13.7k

R1

61.9k

V2

R3
47k

R4

47k

The instrumentation amplifier is the perfect solution for this situation. If we make the second stage gain
equal to unity, then the overall gain is set by the values of R1 and R2. For the values shown, the gain will
be

14.7)

(1 +

2 R1
2 61.9k
) = (1 +
) = 10.04
R2
13.7k

Given a 200 mV peak-peak 1 kHz sinusoidal signal offset by a 200 mV peak-peak 2.710-4 Hz (1 cycle per
hour) signal, design a circuit to amplify the 1 kHz sinusoid by a factor of 10 while reducing the amplitude
of the low frequency signal below 1 V. Use only passive filters. You may assume ideal op-amps and
exact value resistors are available for your design. How would you modify your design if the only fixed
resistors available were 1% resistors?
R7

R8

5.6K

68K

+5

36nF

3
R2
442K

Vout

11

Vin

C1

If we make a high pass filter with a corner frequency at 1 kHz, followed by a gain stage with a gain of
14.14, the combination will provide an overall gain of 10 at 1 kHz. Meanwhile, the low freq signal will
have been reduced to 0.054 V by the filter, then amplified to produce an output of 0.76 V. The values
shown are the best for 1% values.
Carryer, Ohline & Kenny

Copyright 2011

14-3

Solution Manual for Introduction to Mechatronic Design

14.8)

Do Not Circulate

A DC motor tachometer outputs -5 to 5 V proportional to the speed and direction of the motor. Design a
circuit that takes this signal and maps it onto the range of 0-5 V so that it can be presented the input of an
analog-to-digital converter.
R7

R8

100K

100K

+5
VTachGenerator
R1
1K

2
100K R5

Vout

100K

11

+5

R3
10K

R4
10K

11

C1
10uF

R6

R2
1K

+5

Run the input through a divide-by-2 voltage divider to get something that goes from -2.5 to 2.5 V. Then
sum it with a 2.5 V source to produce the 0-5 V signal.
14.9)

Show the design for a circuit using the Texas Instruments INA156 to amplify by a factor of 10 the output
of a sensor with a Wheatstone bridge sensing element powered by 5 V.
+5V

(2)

Bridge
Sensor

+
VIN

3
1

VIN

7
INA156

VOUT = 0.01V to 4.99V

8
2

NOTES: (1) VREF should be adjusted for 2.5V

VREF(1)

Carryer, Ohline & Kenny

Copyright 2011

14-4

Solution Manual for Introduction to Mechatronic Design

14.10)

Do Not Circulate

You have been asked to design the signal conditioning circuitry for an inclinometer based on a pendulum
and a potentiometer. The range of measurement should be 45 around vertical. The potentiometer has a
full scale resistance of 25 k and a 270 angular sweep. The potentiometer is at mid-scale when vertical
and the output of your circuit should exhibit a linear transfer function of 10 mV/.
To get a linear angle-to-voltage transfer through an element that has a linear angle-to-resistance
characteristic requires a constant current through the resistive element. In this case, we have R = 92.6
for a 1 change in angle and want a 10 mV change in voltage. This implies a constant current through the
element of 0.108 mA. We can achieve that with a circuit like:
Sensor

R1
10.65K

+5

2
1.15V

R2

+5

Vou

11

1K

At vertical the output voltage will be 12.5 k 0.108 mA + 1.15 V = 2.5 V. When the angle changes by
1, the resistance will fall to 12.407 k and the output voltage will be 10.9 k 0.2 mA + 1.15 V = 2.49
V. The output voltage changed by 10 mV for a 1 change in angle. At 45 the resistance will have
changed by 45 -92.6 / = -4.167 k, giving a resistance at 45 of 8.333 k. The output voltage will
then be 8.333 k 0.108 mA + 1.15 V = 2.05 V.

Carryer, Ohline & Kenny

Copyright 2011

14-5

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 15 Active and Digital Filters


15.1)

How does an active filter differ from a passive filter?


An active filter contains active circuit elements, most commonly op-amps.

15.2)

Which of the named filter responses provides the best preservation of the time domain shape of a
waveform?
Bessel

15.3)

If the signal of interest is at 1 kHz and the interfering signal to be suppressed is at 4 kHz, what order filter
is required to achieve at least a 40 dB reduction (-40 dB gain) in the interfering signal if a) the filter type is
Bessel; b) the filter type is Butterworth?
a) 6th order
b) 4th order

15.4)

If the filter corner frequency is 1 kHz, how much attenuation of a 4 kHz signal would you expect from a
fourth-order filter if a) the filter type was Bessel; b) the filter type was Butterworth; c) the filter type was 3
dB Chebyshev?
a) 35 dB
b) 40 dB
c) 55 dB

Carryer, Ohline & Kenny

Copyright 2011

15-1

Solution Manual for Introduction to Mechatronic Design

15.5)

Do Not Circulate

Design a sixth-order Sallen-Key filter using the simplified design procedure laid out in this chapter. Choose
from available 1% resistors.
To do something different, lets do a 1kHz low pass Butterworth filter this time:
First Stage
Second Stage
Third Stage
1
1
1
RC Product RC =
= 1.59 x10 4
RC =
= 1.59 x10 4
RC =
= 1.59 x10 4
2 * 1kHz

R
C
G
R3
R4

2 *1kHz

2 *1kHz )

44.2 k
3.6 nF
1.068

44.2 k
3.6 nF
1.586

44.2 k
3.6 nF
2.482

16.9 k
15.8 k

34.0 k
21.5 k

34.0 k
13.7 k

3.6e-9
C1A

Vin

2uF
CiA

44.2K
R1A
RiA
100K

44.2K
R2A

U1A

3.6e-9
C1B
+5

44.2K
R1B

C2A
3.6e-9

44.2K
R2B

U1B

+5

C2B
3.6e-9

+2.5

R3A
16.9K

R3B
34.0K

R4A
15.8K

R4B
21.5K

+2.5
+2.5
+5

3.6e-9
C1C

0.1F
+5

U1D
100K

+2.5

44.2K
R1C

44.2K
R2C

U1C

+5
Vout

0.1F

C2C
3.6e-9

100K

R3C
34.0K
R4C
13.7K
+2.5

Carryer, Ohline & Kenny

Copyright 2011

15-2

Solution Manual for Introduction to Mechatronic Design

15.6)

Do Not Circulate

Write a C function to implement a 16-point moving average filter using the shortcut outlined in Figure
15.11. The prototype for the function should be:
int MoveAvg16Pt(int);
/****************************************************************************
Function
MoveAvg16
Parameters
NewValue

int, the new value to enter into the moving average

Returns
int, the value of the moving average after entering the NewValue
Description
Implements a 16-point moving average using a 16-entry buffer and
an algorithm that keeps a sum and subtracts the oldest value from
the sum, followed by adding in the new value before dividing by 16.
A very literal implementation.
Notes
While the buffer is initially filling it is hard to really call the
average accurate, since we force the initial values to 0.
Author
J. Edward Carryer, 12/19/10 15:40
****************************************************************************/
int MoveAvg16( int NewValue)
{
static int RunSum = 0;
static int Buffer[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static unsigned char Newest = 0;
static unsigned char Oldest = 1;
// update the running sum: remove oldest value and add in the newest
RunSum = RunSum - Buffer[Oldest] + NewValue;
// put the new value into the buffer
Buffer[Newest] = NewValue;
// update the indices by incrementing modulo 16
// for a binary modulo, the AND operation is faster than using %
Newest = (Newest + 1) & 0x0F;
Oldest = (Oldest + 1) & 0x0F;
// now return the result by dividing by 16 (shortcut = shift right by 4)
return(RunSum >> 4);
}

Carryer, Ohline & Kenny

Copyright 2011

15-3

Solution Manual for Introduction to Mechatronic Design

15.7)

Do Not Circulate

Write the pseudo-code for a four-function module to implement a peak-to-peak amplitude measurement in
software. The prototypes for the functions should be:
void InitPeakRead(void);
void AddNewValue(int);
unsigned char IsNewPeakDetected(void);
int GetPeak2PeakAmp(void);
module level variables
NewPeakReady
LastPkPkVal
void InitPeakRead(void);
set NewPeakReady to FALSE
set LastPkPkVal to 0
end InitPeakRead
void AddNewValue(CurrentVal)
static locals: CurrentState (initialized to LookingForPeak), LastVal, PeakVal,
TroughVal
if CurrentState is LookingForPeak
if CurrentVal > LastVal
set PeakVal to CurrentVal
else (it has started to decend)
set CurrentState to LookingForTrough
endif
else (state is LookingForTrough)
if CurrentVal < LastVal
set TroughVal to CurrentVal
else (it has started to rise again)
set CurrentState to LookingForPeak
set LaskPkPkVal to PeakVal - TroughVal
set NewPeakReady to TRUE
endif
set LastVal to CurrentVal
end AddNewValue
unsigned char IsNewPeakDetected(void)
return state of NewPeakReady flag
end IsNewPeakDetected
int GetPeak2PeakAmp(void)
set NewPeakReady to FALSE
return LastPkPkVal
end GetPeak2PeakAmp

Carryer, Ohline & Kenny

Copyright 2011

15-4

Solution Manual for Introduction to Mechatronic Design

15.8)

Do Not Circulate

Given a sinusoidal signal at 6 kHz with an amplitude of between 0 and 0.2 V superimposed on a 60 Hz
signal that varies between 0 and 1 V, design a circuit that will amplify the 6 kHz signal by a factor of
approximately 10 and attenuate the 60 Hz signal by a factor of at least 10. You should look for a design
that will use the simplest possible circuit to achieve your goals.
R2

R3

10.5K

95.3K
+5

+5

R4
68K

C2
Cap
3.9nF

Vout

R1
68K

11

3.9nF

11

Vin

C1

U1B

U1A

While not particularly elegant, this is the simplest circuit to achieve the desired result. The 2 passive stages
have their corners set at 600 Hz each, which results in a gain for the 60 Hz (after the gain of 10 stage) of
0.099 while the 6,000 Hz signal is only minimally attenuated.

Carryer, Ohline & Kenny

Copyright 2011

15-5

Solution Manual for Introduction to Mechatronic Design

15.9)

Do Not Circulate

Given the same input signal as in Problem 15.8, design a circuit that will amplify the 6 kHz signal by a
factor of approximately 200 and attenuate the 60 Hz signal by a factor of at least 100.
Since we want to amplify the 6 kHz by 200 and have a net attenuation of the 60 Hz by 100, we need a filter
that will attenuate the 60 Hz by 200 100 = 20,000. Thats 86 dB. Using Fig. 15.8 we can estimate that the
corner frequency needs to be about 3 times higher than the frequency to be attenuated, if we use a 6th order
3db Chebychev filter. Well do the gain in 3 stages to minimize the errors due to finite GBW in the opamps.
First Stage
Second Stage
Third Stage
1
1
1
RC
RC =
RC =
RC =
2 *1.023 *180 Hz )

2 * 3.356 *180 Hz
= 2.63 x10 4

2 *1.384 *180 Hz
= 6.38 x10 4

73.2 k
3.6 nF
2.042

237 k
2.7 nF
2.711

66.5 k
13 nF
2.922

10.7 k
10.2 k

17.4 k
10.2 k

22.1 k
11.5 k

R
C
G
R3
R4

Carryer, Ohline & Kenny

Copyright 2011

= 1.4 x10 4

15-6

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

R2A
73.2K
Vin

C2A

C1A

R2B

+5
U1A

3.6nF 3.6nF

C2B

R1A
73.2K

237K

2.7nF
C1B

2.7nF

+5
U2A

R1B
237K

R3A
10.7K

R3B
17.4K

R4A
10.2K

R4B
10.2K

+2.5
+2.5

R2C
C2C

66.5K

13nF
C1C

13nF

+5
U3A

R1C
66.5K
R3C
22.1K
R4C
11.5K
+2.5

13.7K

13.7K

66.5K
0.1F

+2.5

66.5K
+5

+5

+5
+2.5

13.7K

66.5K
0.1F

+2.5

0.1F

Vout

Carryer, Ohline & Kenny

Copyright 2011

15-7

Solution Manual for Introduction to Mechatronic Design

15.10)

Do Not Circulate

Write a C function to implement the synchronous sampling algorithm described in the last paragraph of
Section 15.2.3. The function should be nonblocking assuming that it would be called repeatedly, and on
each call step through the next phase of the sampling process. Each call should return the most recently
completed measurement.
#define SENSOR 1
typedef enum { Wait4Dark, Wait4Light } SyncSampleState_t ;
unsigned int SyncSample(void)
{
static SyncSampleState_t CurrentState = Wait4Dark;
static unsigned int LastDarkVal;
static unsigned int LastMagnitude;
switch(CurrentState)
{
case Wait4Dark:
// read dark value
LastDarkVal = ADS12_ReadADPin( SENSOR);
PTT |= BIT0HI; // turn on LED
CurrentState = Wait4Light;
break;
case Wait4Light:
// read light value and calc magnitude
LastMagnitude = ADS12_ReadADPin( SENSOR) - LastDarkVal;
PTT &= BIT0LO; // turn off LED
CurrentState = Wait4Dark;
break;
}
return LastMagnitude;
}

Carryer, Ohline & Kenny

Copyright 2011

15-8

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 16 Digital Inputs and Outputs

Figure 16.21: 3.3V I/O Characteristics for the Freescale MC9S12C32.


(Copyright of Freescale Semiconductor, Inc. 2010. Used by Permission)
16.1)

If an MC9S12C32 is operated on a nominal 3.3 V supply that is 10% higher than the nominal value, how
would that affect the input high voltage requirement? To answer, compare the input high voltage when
operating with a supply at exactly 3.3 V to the input high voltage required when the supply voltage is 10%
higher than 3.3 V.
When the supply voltage is exactly 3.3 V, the minimum value of VIH is 0.65 3.3 V = 2.145 V, and the
maximum value is VDD5 + 0.3 V = 3.3 V + 0.3 V = 3.6 V.
When the supply voltage is 10% higher than 3.3 V (VDD5 = 3.3 V 1.1 = 3.63 V), the minimum value of
VIH is 0.65 3.63 V = 2.36 V, and the maximum value is VDD5 + 0.3 V = 3.63 V + 0.3 V = 3.93 V.
In table form:
Nominal
Vsupply
Vih, min
Vih, max

16.2)

3.3
2.145
3.6

Nominal+10%
3.63
2.36
3.93

For an MC9S12C32 operated on a nominal 3.3 V supply, what is the maximum expected output low
voltage when the output sinks 4 mA from an external source? (Use Figure 16.21 and assume full drive
strength.)
Maximum VOL @ 4 mA = 0.4 V.
Since the question asks what the maximum output low voltage will be while sinking 4 mA but the data
sheet only gives specifications when the output sinks 0.9 mA and 4.75 mA (VOL is 0.4 V in both cases), it
is reasonable to conclude that the maximum value of VOL is also 0.4 V when the output sinks 4 mA.

Carryer, Ohline & Kenny

Copyright 2011

16-1

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Figure 16.22: I/O characteristics for the Microchip PIC16F690 microcontroller.


( Microchip Technology Incorporated.)
16.3)

What is the maximum input low voltage for a TTL type input on the PIC16F690 when operated on a
nominal 5 V supply? (Use the specifications provided in Figure 16.22.)
Maximum VIL = 0.8 V for 4.5 V VDD 5.5 V.

16.4)

What is the maximum input low voltage for a Schmitt trigger type input on the PIC16F690 when operated
on a nominal 3.3 V supply? (Use the specifications provided in Figure 16.22.)
Maximum VIL = 0.2 VDD when 2.0 V VDD 5.5 V.
A nominal 3.3 V supply may be as low as 2.97 V (3.3 V 10%) or as high as 3.63 V (3.3 V + 10%), and
the maximum value of VIL depends on the power supply voltage. This is summarized in the table below:
Vdd
Min (-10%)
Nom (exact)
Max (+10%)

Carryer, Ohline & Kenny

2.97
3.3
3.63

Copyright 2011

Maximum Vil
0.594 V
0.66 V
0.726 V

16-2

Solution Manual for Introduction to Mechatronic Design

16.5)

Do Not Circulate

If an output of PIC16F690 operating with a 5 V ( 10%) supply is connected to an input of an MC3479


operating with a 7.5 V supply, will the devices be operating within their specifications? Use Figure 16.22
and quote the relevant specifications to support your answer.
Yes all specifications are met. The following tables cite the relevant specifications and give the
justifications for the conclusion.
PIC16F90 Output
(VDD = 5 V 10%)
Logical Low:

MC3479
(VM = 7.5 V)
VIL 0.8 V

VOL 0.6 V

Logical High:

The PIC output will be at most


0.6 V, and the MC3479 input
will interpret inputs up to 0.8 V
as logic-level low.
VIH 2.0 V

VOH VDD 0.7 V

YES
The PIC output will be at least
3.8 V (this is the minimum value
when the power supply has the
lowest possible voltage: 4.5V),
and the MC3479 input will
interpret inputs as low as 2.0 Vas
logic-level high.

VOH 4.5 V 0.7 V = 3.8 V

Carryer, Ohline & Kenny

Is this OK /
operating within specifications
YES

Copyright 2011

16-3

Solution Manual for Introduction to Mechatronic Design

16.6)

Do Not Circulate

Is it possible to have a PIC16F690 operating at 3.3 V exchange data (both inputs and outputs) with an
MC9S12C32 operating at 3.3 V with both devices operating within their specifications? Use Figures 16.21
and 16.22 and quote the relevant specifications to support your answer.
Yes this works in both directions. The following tables cite the relevant specifications and give the
justifications for the conclusion.
PIC16F90 Output
(VDD = 3.3V)
Logical Low:
VOL 0.6 V

MC9S12C32 Input
(VDD5 = 3.3V)

YES
VIL 0.35 VDD5 = 1.155V

Logical High:
VOH VDD 0.7 V

The PIC output will be at most


0.6 V, and the MC9S12C32
input will interpret inputs up to
1.155 V as logic-level low.
YES

VIH 0.65 VDD5 = 2.145V

VOH 3.3 V0.7 V = 2.6 V

PIC16F90 Input
(VDD = 3.3V)

MC9S12C32 Output
(VDD5 = 3.3V)
Logical Low:

The PIC output will be at least


2.6 V, and the MC9S12C32
input will interpret inputs as low
as 2.145 V as logic-level high.

Is this OK?
YES

VOL 0.4 V

VIL 0.15 VDD5 = 0.495 V

Logical High:

The MC9S12C32 output will be


at most 0.4 V, and the PIC input
will interpret inputs up to 0.495
V as logic-level low.
YES

VOH VDD5 0.4 V

VIH 0.25 VDD5 +0.8 = 1.625


V

VOH 3.3 V0.4 V = 2.9 V

16.7)

Is this OK?

The MC9S12C32 output will be


at least 2.9 V, and the PIC input
will interpret inputs as low as
1.625 V as logic-level high.

What is the maximum value for a pull-up resistor that is to be used on the F/HS input on an MC3479 that
is operated with a 5 V supply? Use the specifications given in Figure 16.14. Quote a standard 5% resistor
value and dont forget to allow for resistor tolerances.
From Figure 16.14, we see that VIH = 2 V (called the Threshold Voltage (Low-to-High)) and that the
input current at 5.5 V = +100 A.
With a pull-up resistor to 5 V and up to 100 A flowing (the conservative choice), the maximum pull-up
resistor value is:
Rmax = V/I
Rmax = (5 V 2 V)/100 A = 30 k
Next, we need to choose a 5% resistor value that will always be 30 k, which is Rmax = 27 k (the
maximum possible value is 29.7 k).

Carryer, Ohline & Kenny

Copyright 2011

16-4

Solution Manual for Introduction to Mechatronic Design

16.8)

Do Not Circulate

Which of the inputs of a PIC16F690 (operated at 5 V 10%) can an output from an XBee-Pro module
(operated at 3.3 V) properly drive? (Use the specifications given in Figure 16.18 and 16.22.) If only a
subset of the inputs is compatible with the XBee-Pro outputs, identify which inputs. Quote specifications to
support your answer.
Comparing the XBee-Pros outputs to the PIC16F690s inputs:
XBee-Pro Output
(VCC = 3.3 V)
Logical Low:
VOL 0.5 V

PIC16F90 Input
(VDD = 5 V 10%)

Is this OK?
YES

TTL: VIL 0.8 V


Schmitt Trigger:
VIL 0.2 VDD
Min VIL 0.2 4.5V = 0.9V

Logical High:

The XBee-Pro output will be at


most 0.5 V. The PIC TTL input
will interpret inputs up to 0.8 V
as logic-level low, and the PIC
Schmitt Trigger input will
interpret inputs up to 0.9 V as
logic-level low.
TTL Inputs: YES

VOH VCC 0.5 V

TTL: VIH 2.0 V

VOH 3.3 V 0.5 V = 2.8 V

Schmitt Trigger:
VIH 0.8 VDD
Max VIL 0.8 5.5V = 4.4V

Schmitt Trigger Inputs: NO


The XBee-Pro output will be at
least 2.8 V. The PIC TTL input
will interpret inputs as low as
2.0 V as logic-level high, so this
works. The PIC Schmitt Trigger
input will interpret inputs as low
as 4.4 V (the worst case for a 5
V 10% power supply) as logiclevel high, so this does NOT
work.

Results:
This works for the PICs TTL inputs, but not for its Schmitt Trigger inputs, which will not properly
recognize the logic-level high output state from the XBee.

Carryer, Ohline & Kenny

Copyright 2011

16-5

Solution Manual for Introduction to Mechatronic Design

16.9)

Do Not Circulate

Design a circuit using only passive components that will allow an output from a PIC16F690 operated at 5
V ( 10%) to properly drive the inputs of an XBee-Pro module operated at 3.3 V. You may assume that
the absolute maximum input high voltage for the XBee-Pro module is Vcc + 0.4 V. Use the specifications
given in Figures 16.18 and 16.22.
The term passive components applies only to resistors, capacitor and inductors. The only reasonable
choice from this group is resistors, and the best way to reduce an output voltage from ~5V to ~3.3V is to
use resistors in a voltage divider configuration. We will choose the resistor values so that the range of
expected output voltages from the PIC satisfies the requirements for the XBees inputs. The circuit is:
PIC16F690 Output
R1
XBee-Pro Input
R2

The PIC16F690s power supply is 5 V 10%. Because of this, its outputs logical high voltage may be as
low as Vcc 0.7 V = (0.9 5 V) - 0.7 V = 3.8 V, and it may be as high as the maximum possible power
supply voltage, 1.1 5 V = 5.5 V.
The XBee-Pros power supply is specified as 3.3 V. From Figure 16.18, we see that it will interpret input
voltages as low as Vcc 0.7 = 3.3 V 0.7 = 2.31 V as a valid logic-level high, and that the input voltage
should not be allowed to exceed the absolute maximum rating given in the problem statement: 3.3 V + 0.4
V = 3.7 V.
The ratio between the maximum possible PIC output voltage and the maximum allowable XBee input
voltage is: 5.5 V / 3.7 V = 0.673.
The ratio between the minimum possible PIC output voltage and the minimum allowable XBee input
voltage is: 3.8 V / 2.31 V = 0.608.
For our voltage divider, the factor applied to the PIC input voltage to create the XBee output voltage is
R2/(R1+R2). We will select from standard 5% resistor values, and account for the tolerances. One
solution is to choose R1 = 91 k and R2 = 160 k. The resulting minimum value for the factor is 0.614
and the maximum is 0.660, which is within the allowable range and satisfies the requirements. (Note:
there are many possible resistor combinations that produce the desired ratio. The resistor values selected
should not violate the output current specifications for the PIC16F690.)
With R1 = 91 k and R2 = 160 k, the minimum possible input high voltage with our circuit is 2.33 V,
which is higher than the 2.31 V required by the XBee. The maximum possible input high voltage is 3.63
V, which is lower than the 3.7 V absolute maximum.
Finally, though it is not likely to be problematic, we must check what happens when the output of the PIC
is at a logical low value. From Figure 16.22, we see that the maximum output low voltage for the PIC is
0.4 V, and the maximum input low voltage for the XBee is 0.35 Vcc = 0.35 3.3 V = 1.155 V. Since the
output of the PIC is lower than the input requirement of the XBee without any voltage divider in place, any
voltage divider values will work (as long as the current specifications for both devices are satisfied),
including the voltage divider designed above.

Carryer, Ohline & Kenny

Copyright 2011

16-6

Solution Manual for Introduction to Mechatronic Design

16.10)

Do Not Circulate

Can an output from an XBee-Pro module powered by a 3.3 V supply (Figure 16.18) properly drive an input
of a MC9S12C32 powered at 5 V 10% (Figure 16.1)? Quote specifications to support your answer.
No, this will not work. The following table examines the component specifications and identifies the
problem:
XBee-Pro Output
(VDD = 3.3V)
Logical Low:
VOL 0.5 V

MC9S12C32 Input
(VDD5 = 5.5V10%)

YES
VIL 0.35 VDD5
Min VIL 0.35 4.5 V = 1.575 V

Logical High:

16.11)

Is this OK?
The XBee output will be at most
0.5 V, and the MC9S12C32
input will interpret inputs up to
1.575 V as logic-level low.
NO

VOH VCC 0.5 V

VIH 0.65 VDD5

VOH 3.3 V 0.5 V = 2.8 V

Max VIH 0.65 5.5 V = 3.575 V

The XBee output will be at least


2.8 V, but the MC9S12C32 input
will only interpret inputs as low
as 3.575 V as logic-level high.
The output of the XBee is not
high enough to register as logiclevel high at the input of the
MC9S12C32.

What is the maximum value for a pull-down resistor to be used on an input to an XBee-Pro module? Use
Figure 16.18 and quote specifications to support your answer.
To answer this problem, we need to know the supply voltage for the XBee-Pro. None is given in the
problem statement, so we will use the range of voltages for which the specifications are given in Figure
16.18. The specifications we will use in the solution of this problem are:
2.8 V VCC 3.4 V
VIL 0.35 VCC
IIIN 1 A
The maximum value of the pull-down resistor is found when the maximum amount of input current flows
(1 A) and the input voltage is equal to the maximum that will be correctly interpreted as a logic-level low,
VIL. Over a range of voltages, the most conservative value of the voltage drop across the resistor (VCC-VIL)
that is, the smallest drop occurs at the lowest power supply voltage, which is given in Figure 16.18 as
2.8 V. Under these conditions:

RPD =

VCC VIL 2.8V 0.35 2.8V


=
= 1.82 M
I IIN
1A

The nearest 5% tolerance resistor that does not exceed this value at the high limit of its tolerance range is
RPD = 1.6 M.

Carryer, Ohline & Kenny

Copyright 2011

16-7

Solution Manual for Introduction to Mechatronic Design

16.12)

Do Not Circulate

Given the circuit in Figure 16.23, what is the range of acceptable values for the resistor R? Consider that
the connector may be disconnected, and under those conditions, the input to the PIC16F690 should be a
valid logic-level high. The power supplies are nominal 5 V 10% supplies (remember to consider the full
range of output voltages possible from the full range of power supply voltages when determining the upper
& lower limits for the resistor). Report the largest and smallest standard 5% resistor value that will result
in all devices operating within their specifications. Use the specifications for the PIC16F690 provided in
Figure 16.22. Locate the data sheet for the LM339 on the Internet. Quote the specifications you used to
determine your answers.

Figure16.23: Circuit for Problem 16.12


Three cases must be considered:
a) the LM339 is connected and its output is logical low
b) the LM339 is connected and its output is not logical low (note: its an open collector output)
c) the LM339 is not connected, and the input of the PIC is pulled high by the resistor R
For CASE A (LM339 connected, output low):
The specifications for the LM339 (5V supply, any temperature in operating range) when the output is
sinking current show that the saturation voltage may be as high as 0.7 V when sinking up to 4 mA.
The specifications for the PIC (supply up to 5.5V, any temperature in operating range) for the Schmitt
trigger input show that the input low voltage spec is VIL 0.2 VDD.
The minimum value of the pull-up resistor allows the LM339 to pull the input down to a voltage that will
be recognized by the PIC as logical low. Note that the power supply voltage may be anywhere from 4.5 V
to 5.5 V (a nominal 5 V 10% supply).
When the LM339 output is sinking up to 4 mA, the circuit and current flows are as follows:
+5V Nom
R

PIC16F690

Ir

LM339

I1

I2

Schmitt
Trigger
Input

From the specifications, the maximum value of I1 is 4 mA, and I2 is the PICs maximum input leakage
current IIN, which is 1 A. From Kirchoffs current law, Ir = I1 I2 = 4 mA 1 A = 3.999 mA.
Carryer, Ohline & Kenny

Copyright 2011

16-8

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

From Ohms law, we can see that the most conservative minimum value of R occurs when the voltage drop
across the resistor is maximized, since the current flow Ir has been determined. This occurs when the
power supply has its maximum value: 5 V + 10% = 5.5 V, and the PICs input voltage is minimized. We
have specifications for the maximum possible input voltage (both from the 339s saturation voltage
specification and VIL for the PIC), however, the maximum voltage drop across the resistor will occur when
the input voltage is at its minimum value, which is not given in the specifications for either the LM339 or
the PIC. The lowest possible value it could possibly approach is 0 V (it can never get quite there, since the
saturation voltage of the LM339s output will not be exactly 0, but it could be close). Under such
conditions, RMIN = (5.5 V 0 V) / 3.999 mA = 1375 . Choosing the next higher standard 5% resistor
whose value is guaranteed to remain above this value, we find this to be RMIN = 1.5 k (which could be as
low as 1425 ).
For CASE B (LM339 connected, output not low):
The LM339 has an open collector output, and does not actively pull the output voltage high. Rather, it
goes into a high impedance state, and the external pull-up resistor performs the task. The following circuit
represents this case:
+5V Nom
R

PIC16F690

Ir

LM339

I1

I2

Schmitt
Trigger
Input

The current through the pull-up resistor supplies the leakage current to both the LM339 output and the PIC
input (1 A in both cases). Ir = I1 + I2 = 1 A + 1 A = 2 A.
The current through the pull-up resistor must not result in a voltage drop that brings the input voltage
below the PICs VIH, which is 0.8 VDD. The most conservative result will be the lowest value of pull-up
resistor for any value of VDD, which occurs when the numerator of Vr/Ir is minimized (the denominator is
fixed at 2 A). This occurs when VDD has its minimum value, which for our supply is 5 V 10% = 4.5 V.
This results in VIH = 0.8 4.5 V = 3.6 V, and the pull-up resistors resulting maximum value is RMAX =
(4.5 V 3.6 V) / 2A = 450 k. The next lower standard 5% resistor whose maximum possible value
does not exceed 450 k is RMAX = 390 k.

Carryer, Ohline & Kenny

Copyright 2011

16-9

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

For CASE C (LM339 not connected):


Since we have already determined the maximum and minimum value for the pull-up resistor that will work
when the LM399 is connected, we need to check if this range will work when the LM339 is disconnected
and the pull-up resistor is only acting on the PICs input.
In this case, the drop across the pull-up resistor must allow for the PIC to recognize the voltage at its input
as a logical high. This case is similar to Case B, but with the current reduced by a factor of 2, so we can be
assured that this will work.
+5V Nom
R

PIC16F690

Ir

I2

Schmitt
Trigger
Input

From Ohms law, we know that RMAX = (VDD VIH) / Ir. Ir = I2 = 1 A, so RMAX for Case C is 2 times the
result we got for Case B.
So the value of RMAX for when the LM339 is connected is OK: the maximum pull-up resistor value
determined for Case B also satisfies the requirement for Case C.
As discussed in the chapter text (section 16.6.3), the minimum value of a simple pull-up resistor is 0 , but
a non-zero resistance is advised.

Carryer, Ohline & Kenny

Copyright 2011

16-10

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 17 Digital Outputs and Power Drivers


17.1)

If you wanted to drive an LED to the maximum possible brightness with the output of a 7400, would you
arrange it so that the LED was on when the 7400s output was in the low state or the high state? Use worstcase design principles and quote specifications from Figure 17.2 to support your answer.
The device is capable of sinking much more current in the low state (16 mA) than it can source in the high
state (0.4 mA). It will be possible to make the LED much brighter if it is arranged so that the LED is lit
when the output is low.

17.2)

If you wanted to drive an LED to the maximum possible brightness with the output of a 74HC04 would
you arrange it so that the LED was on when the 74HC04s output was in the low state or the high state?
Use worst-case design principles and quote specifications from Figure 17.3 to support your answer.
Since the output high current is the same as the output low current (4 mA), it doesnt matter which state
you chose.

17.3)

If an LED is to be driven from either a 7400 or a 74HC04 which would you expect to produce the greater
LED light output? Use worst-case design principles and quote specifications from Figures 17.2 and 17.3 to
support your answer.
The7400 is capable of sinking 4 times the current of the 74HC04 (16 mA vs. 4 mA) so you could make the
LED brighter by driving it from the 7400.

17.4)

If the outputs from two LM339A devices are to be used in a wired OR configuration to drive a single input
of an MC9S12 family device (use the specifications from Figures 17.8 and 16.1) what are the minimum
and maximum values for the pull-up resistor? Choose from among commercially available 5% tolerance
resistors.
The maximum pull-up value will occur when the output is in the high state and it must provide the leakage
current to the two LM339A outputs (50 nA 2) plus the input high current to the MC9S12 (2.5 A) while
providing a legal high input voltage (3.25 V) to the MC9S12:

5 3.25
= 673k .
(2 50nA) + 2.5A

The next smaller standard 5% resistor whose 5% tolerance will be below this value is 620k.

The minimum value will be determined by the current sinking capability of the LM339A (6 mA). The
current to be sunk will come from the combination of the pull-up resistor and the input current from the
MC9S12, which is 2.5A:

5 1.5
= 584 .
6mA 2.5A

The next larger 5% resistor whose tolerance will not be below this value is 620

Carryer, Ohline & Kenny

Copyright 2011

17-1

Solution Manual for Introduction to Mechatronic Design

17.5)

Do Not Circulate

Using the ULN2003A specifications from Figure 17.12, what is the minimum required input voltage to be
able to support an output current of 250 mA?
2.7 V

17.6)

For the conditions specified in Problem 17.5, what is the expected output voltage at the collector of the
ULN2003A?
2V

17.7)

If an L293B powered by 5 V is used to drive a motor whose stall current is 1 A, what is the minimum
voltage that you would expect to see across the terminals of the motor under stall? Use the specifications
from Figure 17.17, and include a schematic of the circuit with your answer.
Since max VCEsatH and VCEsatL are both 1.8V, the guaranteed minimum voltage available at the motor is:
5 3.6 V = 1.4 V.

Direction

Enable

17.8)

If an L293B is used without a heat sink to drive a motor whose stall current is 400 mA, what is the
expected maximum junction temperature if the motor is stalled indefinitely? Assume the maximum
specified voltage drop across the L293B and an ambient temperature of 25C.
The maximum specified voltage drop is 3.6 V and the current is 0.4 A, therefore the power dissipated is
3.6 V 0.4 A = 1.44 W. The junction to-ambient thermal resistance is 80C/W, so we would expect a rise
over ambient of 80C/W 1.44 W = 115.2C at an ambient temp of 25C This puts the junction at
140.2C.

Carryer, Ohline & Kenny

Copyright 2011

17-2

Solution Manual for Introduction to Mechatronic Design

17.9)

Do Not Circulate

If, under the same conditions as Problem 17.8, the heat sink shown in Figure 17.21 were added to the
L293B, what will the expected maximum junction temperature be?
The junction-to-case resistance is 14C/W and the case-to-ambient resistance through the heat sink is
20C/W, giving a total of 34C/W. With 1.44 W, this would put the junction at:
25C + (1.44 W 34C/W) = 74C.

17.10)

In a particularly bright smart product, the designer needs to turn on a set of 40 IR LEDs (Vf = 1.4 V), each
carrying 50 mA. Design a circuit that performs this task using the output from a single MC9S12 family
device (use the specifications in Figure 16.1) as the drive signal and a minimal number of other
components (the number of active elements should not exceed 3). You have +5 V, +12 V, and +15 V
power supplies available. Show, by calculations and reference to the relevant specifications, that your
design does not exceed the capabilities of any of the devices involved.
We will minimize the number of components if we put as many of the LEDs in series as possible. With a
+15 V supply, we could put 10 in series, yielding a total of 4 strings of LEDs. The total current to be
switched would be 4 50 mA = 200 mA, which is far more than the outputs of the MC9S12 can manage
( 10 mA for full drive). The easiest solution would be to use the MC9S12 to drive a power N-channel
MOSFET like the IRLZ34N.
To size the current limiting resistor in each of the chains with 10 LEDs:

15V (10 1.4V )


= 20
50mA

+15
R1
20

R2
20

R3
20

R4
20

D1

D11

D21

D31

D2

D12

D22

D32

4 chains of 10 LEDs

From MC9S12 output

Carryer, Ohline & Kenny

Q1
IRLZ34N

Copyright 2011

17-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 18 Digital Logic and Integrated Circuits


18.1)

Write the pseudo-code to bit-bang three output lines to use a 74HC595 to create an extra eight output
lines. Structure the code with a high level function that will take an 8-bit value and transfer it to the outputs
of the 74HC595. Also write the pseudo-code for lower level functions that will isolate the interaction with
the hardware and therefore make it easier to change which output ports and bits are being used.
Loop 8 times
if LSB of input value is 1
set output data to 1
else
set output data to 0
endif
pulse the clock line to the '595
shift the input value to the right by 1 position
end loop
pulse the register clock line on the '595
set output data (state)
place state on data output line
end set output data
pulse clock line
set clock line high
set clock line low
end pulse clock line
pulse register clock line
set register clock line high
set register clock line low
end pulse register clock line

18.2)

In Figure 18.5, if TMR1ON, TMR1GE and T1GINV are all true, what state must be present on the T1G
pin in order for the Clock Input to be passed to the Gated Clock?

T1G must be low to cause the output of the XNOR gate to be a 1 and allow the clock to pass.
18.3)

In Figure 18.5, what is the function of the TMR1GE bit? (Describe the difference in behavior of the logic
based in its 2 states.)
The TMR1GE bit controls whether or not the Gated Clock output is actually gated or runs continuously. If
TMR1GE is a 1, then the output is gated, if it is zero (and the timer is enabled by setting TMR1ON to 1),
then the output of the OR gate will be 1 allowing the clock to pass through continuously.

Carryer, Ohline & Kenny

Copyright 2011

18-1

Solution Manual for Introduction to Mechatronic Design

18.4)

Do Not Circulate

Referring to Figure18.29, with Analog Input Mode = 0, Read TRISA = 0, Read PORTA = 0:
a) If all Q outputs are 0, what is the state on the I/O pin (high, low, indeterminate)?
b) If Data = 1, Write PORTA = 0, and Write TRISA pulses high, then low, what will happen to the state
of the I/O pin?
c) From the conditions left after part b), if Data = 1, Write TRISA = 0, and Write PORTA pulses high,
then low, what will happen to the state of the I/O pin?
d) From the conditions left after part c), if Data = 0, Write PORTA = 0, and Write TRISA pulses high,
then low, what will happen to the state of the I/O pin?

Figure 18.29 Figure for circuit in Problem 18.4.


a)
b)
c)
d)

The output is pulled low by the N-MOSFET because its gate will be high.
It will become dependent on the state of any drive connected to the I/O pin.
Nothing happens.
It will be driven high, as the P-MOSFET will turn on.

Carryer, Ohline & Kenny

Copyright 2011

18-2

Solution Manual for Introduction to Mechatronic Design

18.5)

Do Not Circulate

As is all too often the case, the microcontroller for your project has come up short of input and output
lines. You have four programmable direction I/O lines available and you need four inputs and four outputs.
Design a circuit that will expand the four available lines into the eight required lines. Changes to the
expansion ports should mimic the behavior of ordinary ports in that reads of the input port should return
the state of all four input bits at the same instant in time and updates of the four output bits should all
appear simultaneously on those 4 bits. Show the directions for each of the four port lines that you use.
Micro-Controller
ShiftClock (Output)

1
15
2

SI
A
B
C
D
E
F
G
H

QH
QH

+5
R1
10K

13
12
10
11
14

9
7

OE
VCC
RCLK
QA
SRCLR QB
SRCLK QC
QD
SER
QE
QF
QG
QH
GND
QH'
74HC595

16
15
1
2
3
4
5
6
7
9

+5

RegisterClock (Output)

Outputs

Inputs

10
11
12
13
14
3
4
5
6

S/L VCC
CLK INH
CLK

+5
16

GND

SerialDataOut (Output)

74HC165
SerialDataIn (Input)

OR
Micro-Controller
ShiftClock (Output)

1
15
2

SI
A
B
C
D
E
F
G
H

QH
QH

16

R1
10K

9
7

Shift/Load (Output)

+5
13
12

OE
VCC
RCLK
QA
SRCLR QB
SRCLK QC
QD
SER
QE
QF
QG
QH
GND
QH'

10
11
14

16
15
1
2
3
4
5
6
7
9

+5

Outputs

Inputs

10
11
12
13
14
3
4
5
6

S/L VCC
CLK INH
CLK

+5

74HC595

GND

SerialDataOut (Output)

74HC165
SerialDataIn (Input)

OR, using a Mux for the inputs

Carryer, Ohline & Kenny

Copyright 2011

18-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Micro-Controller
ShiftClock (Output)
Shift/Load (Output)

+5

14
2

15
10
11
12
13
8

18.6)

VCC

1OE
1C0
1C1
1C2
1C3

Y1

2OE
2C0
2C1
2C2
2C3

Y2

R1
10K

13
12
10
11
14

7
8

OE
VCC
RCLK
QA
SRCLR QB
SRCLK QC
QD
SER
QE
QF
QG
QH
GND
QH'

16
15
1
2
3
4
5
6
7
9

Outputs

Inputs

1
6
5
4
3

A
B

+5
16

+5

74HC595

SerialDataOut (Output)
SerialDataIn (Input)

GND
74AC153PC

What named function does the circuit in Figure 18.30 implement?


A

D
FIGURE 18.30
Schematic for circuit in
Problem 18.6.

This is a 2:1 multiplexer with A as the control line and B & C as the logic inputs and D as the output.
When A is high input B is placed on D, and when A is low, input C is placed on D.

Carryer, Ohline & Kenny

Copyright 2011

18-4

Solution Manual for Introduction to Mechatronic Design

18.7)

Do Not Circulate

Write the pseudo-code to use the circuit from Problem 18.5 to read in the four inputs and write the four
outputs. Your code should provide any required initialization function and a function to read the lines and a
function to write the lines.
Code for the first solution (uses serial data out line to control Shift/Load on input 165)
void InitExpansionPortLines(void)
Set data lines for ShiftClock and SerialDataOut to be low
Set data lines for RegisterClock to be low
Set ShiftClock, RegisterClock and SerialDataOut to be outputs
Set SerialDataIn to be an input
End InitExpansionPortLines
Unsigned char ReadExpansionInputs(void)
Local variables unsigned char InVar
Clear InVar
Set SerialDataOut port line hi, then lo then hi latches input into the
165
Begin loop to shift new data in
Place state of the SerialDataIn port line into the MSB of InVar
Pulse SerialClock high then low to shift next bit from the 165
Shift InVar 1 bit to the right
Loop 8 times
Return value of InVar
Void WriteExpansionOutputs( unsigned char NewOutputs)
Begin loop to shift out data
Place MSB of NewOutputs on SerialDataOut port line
Pulse SerialClock high then low to clock data into the 595
Shift NewOutputs 1 bit to the left
Loop 8 times
Set RegisterClock high then low latches 595 outputs
End WriteExpansionOutputs

Carryer, Ohline & Kenny

Copyright 2011

18-5

Solution Manual for Introduction to Mechatronic Design

18.8)

Do Not Circulate

Design a circuit using a 555 that will light an LED with 20 mA of forward current for a period of 0.5 s for
every 1 ms long low-going pulse from a 74HC04.
+5
+5
Ra
47k
C
10F

U1
4
6
5
2

Input

RST
THR
CVOLT
TRIG

C1
0.01F

GND

VCC

DISC

OUT

NE555

Rled
68

18.9)

Using a 555, design an astable multivibrator. Shoot for a frequency of about 10 kHz ( 10%) and a duty
cycle (ratio of high time to total time) of about 50% ( 10%). Do not choose Ra too small (less than 1 k
or it won't work in practice. Include the calculations that you did to set the frequency and duty cycle. In
your answer, include a schematic for the circuit, including component values and types.
+5
+5
Ra
1k
Rb
2k

U1
4
6
5
2

C
C1
0.029uF

0.01uF

RST
THR
CVOLT
TRIG
GND

VCC
DISC
OUT

8
7
3

Output

NE555

Duty =

Carryer, Ohline & Kenny

Copyright 2011

Ra + Rb
Ra + 2Rb

1.44
f = (Ra+2Rb)C

18-6

Solution Manual for Introduction to Mechatronic Design

18.10)

Do Not Circulate

Write pseudo-code to control the circuit of Figure 18.19. The top level function should take a symbolic
constant (Light0-Light7, All_OFF) to determine which of the LEDs will be lit.
Assume that the constant All_OFF is greater than 7
ControlLEDs(WhichOn)
If WhichOn > 7
Set enable line to low
Else
Set enable line to high
Place 0-7 (corresponding to Light0 through Light7) onto the 3 SelectBit
lines
Endif
End ControlLEDs

Carryer, Ohline & Kenny

Copyright 2011

18-7

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 19 A-to-D and D-to-A Converters


19.1)

You wish to sample a signal with frequency content between 0 and 1 kHz with an A/D converter. What is
the minimum sampling rate required to ensure that aliasing will not inhibit your ability to accurately
interpret the data?
The minimum sampling frequency is at the Nyquist limit: twice the frequency of the signal being sampled.
In this case: 2 1 kHz = 2 kHz.

19.2)

You wish to use an 8-bit A/D converter with Vref = 5 V to measure a signal (amplitude = 2 Vpp, frequency
= 1 kHz) that includes substantial noise (amplitude 0.5 Vpp, frequency > 5 kHz). You will sample the
signal at a rate of 10 kHz. Design an anti-aliasing filter that prevents the noise from affecting your
readings, and alters the amplitude of the 1 kHz signal by 20% or less.
Our objective is to attenuate the noise to below 1 LSB of the converter, which is

LSB = Vref

1
5V
=
= 19.5mV .
2 1 255
N

Since we sample at 10 kHz, if we use the Nyquist limit and attenuate signals with frequency content 5
kHz, we will attenuate the noise and prevent aliasing.
In order to reduce the effect of the filter on the 1 kHz signal, one viable approach would be to select an norder low-pass RC filter with a corner frequency above 1 kHz, for example ~3.5 kHz. With this as a
starting point, a 6th-order filter can be constructed that achieves the required attenuation of the signal and
the noise.

R = 20.2 k
C = 2200 pF (2.2 x 10-9 F)
Filter order: 6
5 kHz noise amplitude at output of filter = 0.0194 V (less than 1 LSB)
1 kHz signal amplitude at output of filter = 1.6 V (20% attenuation)

Depending on the choice of corner frequency and filter order, many solutions and implementations are
possible (e.g. active filters instead of RC to faster filter roll-off).
19.3)

For an A/D converter with VRL = 0 V and VRH = 5 V, what is the value of an LSB if the resolution of the
converter is 8 bits? 10 bits? 16 bits? 24 bits?
8 bits:
10 bits:
16 bits:
24 bits:

19.4)

1 LSB = 5 V/28 = 19.5 mV


1 LSB = 5 V/210 = 4.88 mV
1 LSB = 5 V/216 = 76.3 V
1 LSB = 5 V/224 = 298 nV

For an A/D converter with VRL = -5 V and VRH = 5 V, what is the value of an LSB if the resolution of the
converter is 8 bits? 10 bits? 16 bits? 24 bits?
8 bits:
10 bits:
16 bits:
24 bits:

1 LSB = 10 V/28 = 39.1 mV


1 LSB = 10 V/210 = 9.77 mV
1 LSB = 10 V/216 = 153 V
1 LSB = 10 V/224 = 596 nV

Carryer, Ohline & Kenny

Copyright 2011

19-1

Solution Manual for Introduction to Mechatronic Design

19.5)

Do Not Circulate

For a 12-bit A/D converter with Vref = 3.3 V, what is the uncertainty contributed by quantization error?
Quantization error is 1/2 LSB everywhere except the highest code, which is -1/2 LSB or +1 LSB. For
this system, 1 LSB =

3.3V
= 806V .
212

For all codes except the highest code (from 0x000, up to and including 0xFFE), quantization error = 806
V/2 = 403 V.
For the highest code (0xFFF), quantization error = -403 V / +806 V.
19.6)

For a 10-bit D/A converter with VRL = 0 V and VRH = 5 V, what is the output voltage if the input code is
721?
General D/A converter output, Eq. 19.5: Vout = VRL +
Since VRL = 0 in this problem, this simplifies to Eq. 19.6:

Result:

19.7)

Vout =

Vout =

code
VREF
2N

721
5V = 3.521V
210

For a 16-bit D/A converter with VRL = -2.5 V and VRH = 2.5 V, what input code would be needed to
produce an output of 0.701 V?
General D/A converter output, Eq. 19.5:

Rearrange to solve for the code:

Result: code = 2

19.8)

code
(VRH VRL )
2N

Vout = VRL +

code = 2 N

code
(VRH VRL )
2N

(Vout VRL )
(VRH VRL )

(Vout VRL )
(0.701V + 2.5V )
= 216
= 41,956 (or 0xA3E4 in hex)
(VRH VRL )
(2.5V + 2.5V )

For an 8-bit A/D converter with Vref = 5 V, what is the input voltage if the output code is 241 (decimal)?
General ADC output, Eq. 19.4: Vin =
Since VRL = 0V: Vin =

code
code
VFULLSCALE = N
(VRH VRL )
max code
2 1

code
VFULL SCALE
2N 1

code
241
VFULL SCALE = 8 5V = 4.725V
N
2 1
2 1
However, due to quantization error the actual input voltage is only known to within 1/2 LSB. In this
case, an LSB is 5 V/28 = 0.0195 V.
Final result: 4.716 V Vin 4.735 V
Or: Vin =

Carryer, Ohline & Kenny

Copyright 2011

19-2

Solution Manual for Introduction to Mechatronic Design

19.9)

Do Not Circulate

For a 20-bit A/D converter with VRL = 0.25 V and VRH = 3 V, what is the input voltage if the output code is
725,413 (decimal)?
General ADC output, Eq. 19.4: Vin =

Or: Vin =

code
code
VFULLSCALE = N
(VRH VRL )
max code
2 1

725,413
code
(VRH VRL ) = 20
(3V 0.25V ) = 1.9024731V
N
2 1
2 1

However, due to quantization error the actual input voltage is only known to within 1/2 LSB. In this
case, an LSB is (3 V 0.25 V)/220 = 2.623 V.
Final result: 1.9024718 V Vin 1.9024744 V
For this answer, we should also note how much precision to use. This decision should be based on the
resolution of the converter. For a 20-bit converter with VRL = 0.25 V and VRH = 3 V, 1 LSB = 2.623 V,
so we may reasonably go to the hundreds of nV place or possibly to the tens of nV, depending on the
performance of the overall circuit.
19.10)

Without adding any op-amps, how could you redesign the circuit shown in Figure 19.17 so that the output
of the summing D/A converter ranges from 0 to 10 V?
This can be achieved by adding gain to the summing amplifier circuit that is already in place. Currently,
the gain is 1, but by adding resistors in the feedback loop as is done in simple (non-summing) noninverting amplifier circuits, we can select other gains.
The circuit shown in Figure 19.17 has an output with a range of 0 to 5 V, and the problem specifies a range
of 0 to 10 V, so we need a gain of 2. The following circuit achieves the desired result:
R

R
+Vs

D1
D0

Carryer, Ohline & Kenny

Vout

2R

Copyright 2011

19-3

Solution Manual for Introduction to Mechatronic Design

19.11)

Do Not Circulate

Using the Internet, find examples of a flash A/D converter, a SAR A/D converter and a sigma-delta A/D
converter from the following manufacturers: Maxim Integrated Products and Texas Instruments. Create a
table that compares their resolution, maximum sample rates, and price. Hint: it may simplify your search
if you begin by locating the manufacturers data converter selection guides.
This question requests that students perform research on the Internet and report their findings. There is a
wide variety of correct answers. To grade responses, verify reasonableness, and that the components listed
have the specified architecture and manufacturer. A representative solution is:
Maxim
Flash
MAX105
6
800 Msps
$
42.80

Part No.
Resolution (bits)
Sampling rate (max)
Price (qty 1 @ Digikey)

Maxim
SAR
MAX1065
14
165 ksps
$
27.27

Maxim
Sigma-Delta
MAX11040
24
64 ksps
$
36.57

TI
Flash*
TLC5540
8
40 Msps
$
5.56

TI
SAR
ADS7950
12
1 Msps
$
5.60

TI
Sigma-Delta
ADS1281
24
4 ksps
$
43.13

* The TLC5540 uses a half-flash architecture

19.12)

Construct a table like the one shown in Figure 19.28 that illustrates each of the steps for an 8-bit SAR A/D
converter if the input voltage is 1.095 V and Vref = 5 V. What is the output code when the conversion is
complete?
Test
1
2
3
4
5
6
7
8

Bit
Comparator MSB
Clock Status
Output
D7

D6

D5

D4

D3

D2

D1

LSB
D0

1
0

Test
Reject

1
0

1
0

1
0

Test
Reject

1
0

1
0

1
0

Test
Keep

1
1

1
1

1
0

Test
Keep

1
0

1
1

1
0

Test
Keep

1
0

1
1

1
0

Test
Reject

1
0

1
0

1
0

Test
Reject

1
0

1
0

1
0

Test
Reject

1
0

1
0

Tests
Is it above 2.5

and below

NO

Is it above 1.250 and below 2.500

NO

Is it above 0.625 and below 1.250

YES

Is it above 0.938 and below 1.250

YES

Is it above 1.094 and below 1.250

YES

Is it above 1.172 and below 1.250

NO

Is it above 1.172 and below 1.211

NO

Is it above 1.172 and below 1.191

NO

The final result is 0011 1000 (binary) = 0x38 (hex) = 56 (decimal).


Cross-checking this using Eq. 19.4: Vin =

56
code
VFULL SCALE = 8
5V = 1.098V
N
2 1
2 1

This is correct, given the rounding to the nearest code integer (recall from Problem 3 that 1 LSB = 19.5
mV).

Carryer, Ohline & Kenny

Copyright 2011

19-4

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 20 Voltage Regulators, Power Supplies and Batteries


20.1)

A 5 V LDO voltage regulator has a maximum dropout voltage specification of 0.21 V. If it is to provide a
stable output of 5 V, what is the minimum voltage that must be supplied at the input of the regulator?
A voltage of at least Vout + VDO must be supplied:

VIN VOUT + VDO = 5V + 0.21V


VIN 5.21V
20.2)

What is the efficiency of the LDO voltage regulator described in Problem 20.1 if the input voltage is the
minimum voltage that results in a regulated 5 V output? What is the efficiency if the input voltage is
increased to 9 V? 15 V?
The efficiency is

POUT VOUT I OUT VOUT


=
=
since IOUT=IIN.
PIN
VIN I IN
VIN

Calculating efficiency for the three values of VIN using the above equation gives:
Vin
5.21 V
9V
15 V

20.3)

Efficiency
96.0%
55.6%
33.3%

An LM7805 linear voltage regulator is used to provide a stable output voltage of 5 V. What is the
minimum voltage that must be supplied at the input of the regulator to ensure the output is at 5 V?
A voltage of at least Vout + VDO must be supplied:

VIN VOUT + VDO = 5V + 2V


VIN 7V
20.4)

What is the efficiency of the LM7805 voltage regulator described in Problem 20.3 if the input voltage is
the minimum voltage that results in a regulated 5 V output? What is the efficiency if the input voltage is
increased to 9 V? 15V?
The efficiency is

POUT VOUT I OUT VOUT


since IOUT=IIN.
=
=
PIN
VIN I IN
VIN

Calculating efficiency for the three values of VIN using the above equation gives:
Vin
7V
9V
15 V

Carryer, Ohline & Kenny

Copyright 2011

Efficiency
71.4%
55.6%
33.3%

20-1

Solution Manual for Introduction to Mechatronic Design

20.5)

Do Not Circulate

For the circuit shown in Figure 20.49, the LED has a forward voltage drop Vf = 2 V. How much heat is
dissipated in the regulator? In the resistor? In the LED? If the ambient temperature is 40C, is the
LM7805 operating within specifications (use the specifications in Figure 20.14)? If the resistor is rated at
1/4 W and the LED is rated for a maximum continuous current of 40 mA, are these components operating
within specifications?

Figure 20.49: Schematic for circuit in Problem 20.5.


The current that flows in the circuit is given by:
VOUT VR VLED = 0
VR = VOUT VLED = 5 V 2 V = 3 V
VR = 3 V = I R = I 100
I = 3 V / 100 = 0.03 A
Power dissipated by the regulator:
PREG = V I = (VIN VOUT) I = (12 V 5 V) 0.03 A = 0.21 W
For the regulator, the thermal circuit from the junction to the ambient is:
TJ = TA + PREG RJA
We are given that TAMB = 40 C, we solved above for PREG = 0.21 W, and from Figure 20.14 we find that
RJA is 65 C/W. The result is:
TJ = 40 C + (0.21 W)(65 C/W) = 53.7 C
This is OK, since the maximum operating temperature is given in Figure 20.14 as 125 C
Power dissipated by the resistor:
PR = V I = 3 V 0.03 A = 0.09 W
This is OK, because the resistor is rated for 0.25 W
Power dissipated by the LED:
PLED = VF I = 2 V 0.03 A = 0.06 W
This is OK, because the LED is rated for 0.04 A

Carryer, Ohline & Kenny

Copyright 2011

20-2

Solution Manual for Introduction to Mechatronic Design

20.6)

Do Not Circulate

A switching voltage regulator circuit operates at 85% efficiency, and its input voltage is 24 V. If it
provides a regulated output of 12 V at 2 A, what is the average current flowing into the input? How much
power does the regulator circuit dissipate under these conditions?
Efficiency is defined as:

POUT
PIN

All but PIN is given in the problem statement: 85% =

Solving for PIN: PIN =


Result: I IN =

(12V )(2 A)
PIN

(12V )(2 A)
and PIN = VIN I IN
85%

(12V )(2 A)
= 1.18 A
(24V )(85%)

The power dissipated in the circuit is given by: PHEAT = PIN POUT = VIN I IN VOUT I OUT
Result: PHEAT = VIN I IN VOUT I OUT = ( 24V )(1.18 A) (12V )(2 A) = 4.2W

20.7)

Your bench-top laboratory power supply has three regulated outputs. The first is a fixed +5 V output,
capable of supplying up to 3 A. The second is an adjustable 0 to +15 V output that can supply up to 1 A,
and the third is an adjustable 0 to -15 V output, also capable of up to 1 A (Figure 20.50). The ground for
the fixed output is independent of the ground for the adjustable outputs. To power a new prototype circuit,
you need 18 V and a maximum of 0.8 A. Can you use this power supply to power the circuit? If so, show
how it will be configured. If not, explain why not.

Figure 20.50: Power supply front panel for Problem 20.7.

Carryer, Ohline & Kenny

Copyright 2011

20-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

YES, you can use this power supply to power the proposed circuit. There are 3 ways this could be done:
V = 18 V

Option 1:
Adjust the negative and positive adjustable power
supply outputs so that the following equation is
satisfied: VPOS VNEG = 18 V. For example, if
the positive supply were adjusted to +10 V and
the negative supply to 8 V, the equation gives:
+10 V (8 V) - +18 V. To power the circuit,
connect the negative voltage terminal to the
circuits GND and the positive voltage terminal
to the circuits +V. Both supplies are capable of
delivering up to 1 A, which is greater than the 0.8
A required by the circuit.

Adjust to
+10V

Adjust to
-8V

ADJUSTABLE ADJUSTABLE
0 V to +15 V
0 V to -15 V
OUTPUT
OUTPUT

POWER
ON

FIXED +5V
OUTPUT
OFF

+5V
3A

0 to -15V
1A

GNDa

GNDb 0 to +15V
1A

Connect to
Circuit +V

Option 2:
Use the fixed +5 V supply in combination with
the adjustable positive supply (adjusted to +13
V). Connect them in series so that the ground of
one supply is connected to the positive output of
the other supply. For example, connect the +5 V
output on the fixed supply to GNDb of the
adjustable supply. Then connect GNDa to the
GND of the circuit to be powered, and the
adjustable voltage output to the circuits +V. The
sum of the two supplies in series is +5 V + (+13
V) = +18 V, as required by the circuit. The fixed
supply is capable of up to 3 A and the adjustable
supply is capable of up to 1 A, both of which are
greater than the 0.8 A required by the circuit.

V = 18 V

Carryer, Ohline & Kenny

Copyright 2011

Adjust to
+13V
ADJUSTABLE ADJUSTABLE
0 V to +15 V
0 V to -15 V
OUTPUT
OUTPUT

POWER
ON

FIXED +5V
OUTPUT
OFF

+5V
3A

GNDa

Connect to
Circuit +V

0 to -15V
1A

GNDb 0 to +15V
1A

Connect GNDa
Connect to
to GNDb
Circuit GND

Option 3:
Use the fixed +5 V supply in combination with
the adjustable negative supply (adjusted to -13
V). Connect them in series so that the ground of
one supply is connected to the ground of the
other supply: connect GNDa on the fixed supply
to GNDb on the adjustable supply. Then connect
the negative supplys output to the GND of the
circuit to be powered, and the fixed +5 V output
to the circuits +V. The sum of the two supplies
in series is +5 V (13 V) = +18 V, as required
by the circuit. The fixed supply is capable of up
to 3 A and the adjustable supply is capable of up
to 1 A, both of which are greater than the 0.8 A
required by the circuit.

Connect to
Circuit GND

V = 18 V

Adjust to
-13V

ADJUSTABLE ADJUSTABLE
0 V to +15 V
0 V to -15 V
OUTPUT
OUTPUT

POWER
ON

FIXED +5V
OUTPUT
OFF

+5V
3A

GNDa

Connect to
Circuit +V

0 to -15V
1A

Connect GNDa
to GNDb

GNDb 0 to +15V
1A

Connect to
Circuit GND

20-4

Solution Manual for Introduction to Mechatronic Design

20.8)

Do Not Circulate

You revise the circuit you created in Problem 20.7, and now it requires 28 V and as much as 0.5 A of
current. Can you use the power supply described in Problem 20.7 for this new circuit? If so, show how
you will configure it to meet the circuits requirements. If not, explain why not.
YES, you can use this power supply to power the proposed circuit.
Adjust the negative and positive adjustable power supply outputs so that the following equation is satisfied:
VPOS VNEG = +28 V. For example, if the positive supply were adjusted to +14 V and the negative supply
to 14 V, the equation gives: +14 V (14 V) - +28 V. To power the circuit, connect the negative voltage
terminal to the circuits GND and the positive voltage terminal to the circuits +V. Both supplies are
capable of delivering up to 1 A, which is greater than the 0.5 A required by the circuit.
Configure the power supply and connect it as shown below:
V = 28 V
Adjust to
+14V

Adjust to
-14V

ADJUSTABLE ADJUSTABLE
0 V to +15 V
0 V to -15 V
OUTPUT
OUTPUT

POWER
ON

FIXED +5V
OUTPUT
OFF

+5V
3A

GNDa

0 to -15V
1A

GNDb 0 to +15V
1A

Connect to
Circuit +V

20.9)

Connect to
Circuit GND

Determine the minimum battery capacity (in mAH) required to power a portable device that consumes an
average of 350 mA at 3 V for at least 8 hours. The battery voltage is 4.8 V and the device incorporates a 3
V regulator that operates at 85% efficiency.
Under the conditions given, the battery is required to deliver the following current:
From the expression for efficiency:

85% =
PIN =

POUT
PIN

(3V )(0.35 A)
PIN

(3V )(0.35 A)
and PIN = VBAT I BAT
85%

Result: I BAT =

(3V )(0.35 A)
= 0.257 A
(4.8V )(85%)

Finally, delivering 0.257 A for at least 8 hours will require a battery with a minimum capacity of:

(0.257 A)(8H ) = 2059mAH

Carryer, Ohline & Kenny

Copyright 2011

20-5

Solution Manual for Introduction to Mechatronic Design

20.10)

Do Not Circulate

Using Table 20.3, what is the minimum possible volume and mass of the NiMH battery pack needed to
satisfy the requirements of Problem 20.9?
From Table 20.3:
NiMH mass density = 75 Wh/kg
NiMH volumetric density = 240 Wh/liter
Required number of cells in series n =

4.8V
= 4 cells
1.2V / cell

Minimum energy required = IBATVBATLifen = (0.257 A)(4.8 V)(8 hours)(4) = 39.5 Wh

39.5Wh
= 0.527kg
75Wh / kg
39.5Wh
= 0.165 liter
Volume of battery required:
240Wh / liter

Mass of battery required:

20.11)

A particular car uses an internal combustion engine with 20% thermodynamic efficiency for locomotion,
carries 12 gallons of gasoline (energy density = 44 MJ/kg) and gets 25 miles per gallon. If all other factors
are assumed to be equal, what mass (in kg) and volume (in m3) of lead-acid batteries would be needed to
provide an equivalent range for an electric version of the vehicle? What volume and mass are required if
Li-ion batteries are used instead? Assume that the overall energy conversion efficiency for an electric
vehicle is 85%.
First, determine the energy content of the gasoline used by the internal combustion engine:
Gasoline volume: (12 gal )(3.784liters / gal )(0.001m 3 / liter ) = 0.0454m 3
Gasoline energy: (0.0454m 3 )(719.7kg / m 3 )(44.4MJ / g ) = 1451MJ
Considering thermodynamic efficiency of IC engine, the energy used to move the car is:

20% 1451MJ = 290 MJ

In units more convenient for batteries:

(290MJ )(0.288kWh / MJ ) = 80.6kWh

Including the drivetrain efficiency of electric vehicles, the minimum capacity of the batteries needed for
the EV version of the car is:

80.6kWh
= 94.8kWh
85%

For lead-acid batteries:


Lead-acid mass:

94836Wh
= 2710kg = 5974lb
35Wh / kg

Lead-acid volume:

Carryer, Ohline & Kenny

94836Wh
= 1355 liters = 1.355m 3 = 47.8 ft 3
70Wh / liter

Copyright 2011

20-6

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

For Li-ion batteries:

94836Wh
= 632kg = 1394lb
150Wh / kg
94836Wh
= 237 liters = 0.237m 3 = 8.37 ft 3
Li-ion volume:
400Wh / liter

Li-ion mass:

20.12)

What fraction of an alkaline cells original charge remains if it is stored at room temperature for 5 years?
What fraction of a NiMH cells original charge remains if stored at room temperature for 5 months?
Alkaline cell:
Discharge rate at room temperature: 5%/year
Charge retained after 5 years of storage:

(1 0.05) 5 = 0.774 = 77.4%

NiHM cell:
Discharge rate at room temperature: 20%/month
Charge retained after 5 months of storage:

20.13)

(1 0.2) 5 = 0.328 = 32.8%

A given batterys self-discharge rate is 2% per year at 0C and 5% per year at 25C. How much more
charge will the battery stored at 0C hold than an identical battery stored at 25C after 10 years? Is it a
good idea to store batteries in a freezer?
Charge retained after 10 years at 0C:
Charge retained after 10 years at 25C:

(1 0.02)10 = 0.817 = 81.7%


(1 0.05)10 = 0.599 = 59.9%

Difference in charge retained: 81.7% - 59.9% = 21.8%


YES it is a good idea to store batteries at lower temperatures (such as in a freezer)

Carryer, Ohline & Kenny

Copyright 2011

20-7

Solution Manual for Introduction to Mechatronic Design

20.14)

Do Not Circulate

Design a circuit that uses alkaline cells and an LM7805 linear voltage regulator to provide a portable
device with 5 V. Alkaline cells have a terminal voltage of 1.5 V when new (fully charged), and an end
voltage of 0.8 V. Design your circuit so that it provides a regulated output voltage of 5 V across the full
range of the cells terminal voltage (0.8 V to 1.5 V).
The number of cells needed is determined by the input voltage requirement of the LM7805 in order for it to
provide a regulated 5 V output for the device. This is determined by the drop-out voltage:
VBAT VREG + VDO 5 V + 2 V 7 V
The minimum number of cells required is: 7 V / 0.8 V/cell = 8.75 cells
Round this up to the nearest whole number of cells: 9 cells are required.
When the cells are fully discharged, their combined series voltage will have a minimum value of:
9 cells 0.8 V/cell = 7.2 V
When the cells are fully charged, their combined series voltage will have a maximum value of:
9 cells 1.5 V/cell = 13.5 V

Alkaline Battery
9 Cell
Vmin = 7.2V
Vmax = 13.5V

20.15)

Cin
0.22uF

LM7805
IN
OUT
GND

+5V

Cout
0.1uF

For the circuit you designed in Problem 20.14, calculate the resulting heat dissipation in the LM7805 under
the full range of possible cell terminal voltages when delivering 275 mA. For an ambient temperature of
25C, is a heat sink required? If so, what is the maximum thermal resistance that the heat sink could have
to satisfy the requirements? If not, what is the maximum allowable ambient temperature?

P = VI = (7.2V 5V )(0.275 A) = 0.605W


Heat dissipated when VBAT = 13.5 V: P = VI = (13.5V 5V )(0.275 A) = 2.34W
Heat dissipated when VBAT = 7.2 V:

From Figure 20.14, we see that maximum junction operating temperature is 125C and JA = 65C/W.
With TAMB = 25C:
For minimum VBAT: TJ = TAMB + P JA = 25C + (0.605 W)(65C/W) = 64.3C
For maximum VBAT: TJ = TAMB + P JA = 25C + (2.34 W)(65C/W) = 177C
The junction temperature exceeds the 125C A heat sink IS required when the battery voltage is at
the maximum value.
To determine the required heat sink performance, use the general expression (Eq. 20.5): T = P

TMAX T AMB= P( JC + HA ) where HA is the thermal resistance between the heatsink and the
ambient environment. Rearranging and solving for the maximum value of HA gives:

HA =

TMAX T AMB
125C 25C
5C / W = 37.8C / W
JC =
P
2.34W

Carryer, Ohline & Kenny

Copyright 2011

20-8

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 21 Noise Grounding and Isolation


21.1)

What are the dominant noise coupling channels within typical mechatronic systems?
Conductive, capacitive present the biggest challenges. Inductive noise could be a problem if the wiring is
laid out poorly.

21.2)

True or False: When building a small circuit (1-2 ICs) on a breadboard, it is acceptable to omit the
decoupling capacitors.
False. Decoupling caps should never be omitted.

21.3)

True or False: Analog circuits do not require decoupling capacitors.


False. Even analog circuits experience transients and therefore require decoupling capacitors.

21.4)

True or False: When using shielded wire, the shield should be connected to ground at both ends so that it
provides a common ground connection between the systems.
False. The shield should be grounded at only one end.

Carryer, Ohline & Kenny

Copyright 2011

21-1

Solution Manual for Introduction to Mechatronic Design

21.5)

Do Not Circulate

Figure 21.20 shows the block diagram for a mechatronic system with two power supplies, a
microcontroller, an analog sensor block, and a motor driver block. The microcontroller and the analog
sensor block need to be powered by 5 V, while the motor driver runs on 12 V. The motor driver takes its
input (DI) from the microcontroller digital output (DO) and the microcontroller receives its analog sensor
input (AI) from the sensor circuit output (AO). Draw a set of wires that will supply power and connect
control and sensor signals between the blocks while minimizing the potential for conducted noise coupling
between the subsystems.
12 V

5V

G
Microcontroller

FIGURE 21.20

AI

System block diagram for Problem 21.5.

12 V

21.6)

G
Motor Driver

AO

DI

5V

+ G
Microcontroller
AI

DO

G
Sensor Circuit

DO

+ G
Sensor Circuit
AO

Motor Driver
DI

True or False: Simply twisting wires together is an effective way to minimize inductively coupled noise.
True, this minimizes the loop area

21.7)

Explain in your own words how optical isolation can reduce conductively coupled noise.
Optical isolation removes the need for there to be any conductive connection between 2 systems. With no
conductive connection, there can be no conductively coupled noise.

Carryer, Ohline & Kenny

Copyright 2011

21-2

Solution Manual for Introduction to Mechatronic Design

21.8)

Do Not Circulate

In the circuit of Figure 21.21, if the digital output is in the high state, would you expect the signal seen by
the digital input to be in a high or low state? Explain why.
5V

From Digital Output

Q1

D1

To Digital Input
R1
R2

FIGURE 21.21
C ircuit for Problems 21.8 and 21.9. .

When the digital output is high, the LED will be on. This will cause the phototransistor to conduct a
current that will flow through R2, creating a voltage drop and causing the line labeled To Digital Input to
rise above ground (high state)
21.9)

In the circuit of Figure 21.21, if the digital output swings between 0 and 5 V, D1 has a Vf of 1.5 V, R1 =
3.3 k, R2 = 10 k, and IIH on the digital input is 1 A, what is the minimum CTR required of the optocoupler in order to produce a high-state voltage of 3.5 V at the digital input?
The LED current will be 5 V 1.5 V = 3.3 k I, I = 1.06 mA. To produce 3.5 V across the 10 k of R2
requires 3.5 V/10 k = 350 A of current. Add to the 1 A that will be supplied to the digital input and we
require 351 A through the phototransistor. The minimum CTR is therefore 351 A/1.06 mA= 33%.

Carryer, Ohline & Kenny

Copyright 2011

21-3

Solution Manual for Introduction to Mechatronic Design

21.10)

Do Not Circulate

In the circuit of Figure 21.22, if the digital output is in the high state, would you expect the signal seen by
the digital input to be in a high or low state?
+5 V
R1
D1

+5 V

Q1

From Digital Output

To Digital Input
R2
FIGURE 21.22
C ircuit for Problems 21.10 and 21.11.

If the digital output is in the high state, then the LED will be off. If the LED is off, then only a tiny leakage
current will flow through the photo-transistor, causing only a tiny voltage drop to develop across R2 so the
line labeled To Digital Input will be in a low state.
21.11)

In the circuit of Figure 21.22, if the digital output connected to the cathode of the diode (D1) swings
between 0.4 V while sinking a maximum of 3.2 mA and 4.5 V while sourcing a maximum of 1 mA, D1 has
a Vf of 1.5 V, the CTR of the opto-coupler is 50%, and the digital input connected to the collector of the
photo-transistor has specifications of VIH = 3.5 V, IIH = 10 A, VIL = 1.5 V, IIL = -10 A, choose values for
R1 and R2 that will result in acceptable input voltages to the digital input.
The ON state of the LED is most critical here and that is the low state of the output. The output will be at
0.4 V while sinking a maximum of 3.2 mA, so the minimum value for R1 is (5 V 1.5 V 0.4 V)/3.2 mA
= 968 . The next larger standard size whose 5% tolerance will not be below 968 is 1.1 k. The
maximum value of that resistor will then be 1.155 k and therefore the minimum current flowing will be
2.68 mA. With a CTR of 50%, this implies that we can have up to 1.34 mA flowing through the
phototransistor. The current through the resistor can be this amount less the input current of 10 A: 1.34
mA 10 A = 1.33 mA. We need to produce at least 3.5 V with this current so we need a value for R2 of
at least 3.5 V/1.33 mA = 2,632 . A 2.7 k resistor (considering the 5% tolerance) would be too small so
we need to go up to a 3 k resistor for R2. To check the LED OFF state, we note that IIL = -10 A, which
will cause a 10 A 3.15 k (3 k+5%) = 31.5 mV drop across R2. The dark current of the phototransistor is not specified, but it could be as high as (1.5 V 0.0315 V)/3.15 k = 466 A, which is a huge
amount of leakage.

Carryer, Ohline & Kenny

Copyright 2011

21-4

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 22 Permanent Magnet Brushed DC Motor Characteristics


22.1)

The mechatronic system shown in Figure 22.12 is designed to periodically hoist a 10 oz. mass above a
platform where it is normally resting. The spool has radius 3/8 in., and is directly connected to the output
shaft of the motor. If the motor has a stall torque of 29.5 in.oz. at 15 V, what is the minimum voltage
required to hoist the mass?

Figure 22.12 Mechanism for Problem 22.1.


Since the weight of the mass is given in ounces, gravity is already included: the force F needs to be 10
oz. to hoist the mass. The torque required for the motor to turn the spool is given by:

T = F R = (10oz.)(3.8in.) = 3.75oz. in.

The equation for the torque produced by a brushed DC motor is T=KTI. From Ohms law we can substitute

V
TR
and then rearrange to K T =
. Since KT is a constant, we can write:
R
V
(29.5oz.in.) R (3.75oz.in.) R
KT =
=
V
15V

in for I=V/R to get

T = KT

Canceling R and rearranging, we get:

V=

(3.75oz.in.)(15V )
= 1.907V
29.5oz.in.

Carryer, Ohline & Kenny

Copyright 2011

22-1

Solution Manual for Introduction to Mechatronic Design

22.2)

Do Not Circulate

As you stroll the isles of the local flea market, you come across a booth stocked with surplus permanent magnet
brushed DC motors. Your eyes widen with excitement as you notice a particularly shiny gear motor priced at
just $1.50. Whipping your trusty multimeter out of its belt holster, you measure the winding resistance to be 18.9
. Next, you pull a small torque wrench out of your fanny pack and measure the stall torque, which is 2.8 Nm
when powered by the 12 V battery you keep handy for just such occasions. The gearhead is marked 100:1.
The application you have in mind for this motor requires that the gearhead output shaft deliver 400 mNm at 35
rpm when driven at 15 V. You assume that the frictional losses in the motor and gearbox are negligible.
Determine the appropriateness of the motor by answering the following:
a) Will the motor and gearhead meet the requirements for torque and speed at 15 V? If not, what drive voltage
would enable you to meet the design requirements?
b) What is the current required to operate at the design point?
a)

We have adequate information about the motor to calculate KT and KE:

T TR (2.8 Nm / 100)(18.9)
=
=
= 0.0441Nm / A
I
V
12V
KT
0.0441Nm / A
KE =
=
= 4.618V / krpm
-3 Nm / A
9.5493 10
9.5493 10 -3 Nm / A
V / krpm
V / krpm
KT =

With these, we can solve for the motor output at the design point for a drive voltage of 15 V:

= NL RM T =

V
R
15V
(18.9)(0.004 Nm)

T=

= 2.877 krpm
K E KT K E
4.618V / krpm (0.0441Nm / A)(4.618V / krpm)

When the motor is providing 0.004 Nm with a drive voltage of 15 V, it spins at 2877 rpm (28.77 rpm at the
gearhead output shaft). This is slower than the requirement (35 rpm at the gearhead output shaft) and thus
does not meet the requirements.
In order to meet the requirements, we solve the Eq. 22.9, since V is the only unknown:

V = IR + K E =

TR
+ K E =
KT

(0.4 Nm / 100)(18.9)
+ (4.618V / krpm)(.035krpm)(100) = 17.9V
0.0441Nm / A
b)

Rearranging Eq. 22.6 for I:

I=

22.3)

T
(0.4 Nm) / 100
=
= 91mA
K T 0.0441Nm / A

A motor with KT = 105 mNm/A, RCOIL = 10 and NL (at 48 V) = 4,320 rpm will be operated with a 48 V
supply. If this motor is connected to a mechanism that has frictional torque losses of Tf, = 55 mNm, what
will its output shaft rotational speed be?
From the given quantities, we can determine KE from Eq. 22.11:

KE =

NL

48V
= 11.1V / krpm
4.322krpm

Then, using Eq. 22.13:

= NL RM T = NL

Carryer, Ohline & Kenny

R
(10)(55mNm)
T = 4.322krpm
= 3.85krpm
K E KT
(105mNm / A)(11.1V / krpm)

Copyright 2011

22-2

Solution Manual for Introduction to Mechatronic Design

22.4)

Do Not Circulate

For the system shown in Figure 22.13, electrical contact A is attached to a fixed reference point via spring
A with spring constant KA. The spring is spooled onto the shaft of a DC motor in order to move the
electrical contact from its initial location, until it makes contact with electrical contact B that is also
attached to a fixed reference point via spring B that has a spring constant KB. The first spring constant is
KA = 100 N/m, the second spring constant is KB = 15 N/m and the motors shaft diameter is 0.5 in. The
motor is powered at 15 V, has a no-load speed NL = 4,080 rpm (at 15 V), and coil resistance R = 9.73 .
What is the value of the initial distance, x, between the contacts to ensure that contact B is displaced 1 mm
when the motor is switched on and pulls contact A into contact B and compresses spring B?

Figure 22.13 Mechanism for Problem 22.4


The motor will move the contact attached to spring A until it stalls.
At 15 V, the stall torque is

TSTALL = K T

We find KT by solving first for KE:

V
R

KE =

NL

15V
= 3676V / rpm = 3.676V / krpm
4080rpm

= 0.0351Nm / A
K T = 3.676V / krpm * 9.5493e - 3 Nm/A
V/krpm

V (0.0351Nm / A)(15V )
Then, at 15 V, the stall torque is: TSTALL = K T
=
= 0.0541Nm
R
9.73
T 0.0541Nm
This applies a force on the contacts and springs of: FMOTOR = =
= 8.52 N
r 0.00635m
At stall, the total force goes into deflecting spring A by XA (the unknown quantity) and spring B by XB
(given as 1 mm):

FMOTOR = FA + FB = K A X A + K B X B
F
K B X B 8.52 N (15 N / m)(0.001m)
X A = MOTOR
=
= 0.0851m = 85.1mm
KA
100 N / m
Since we need contact B attached to spring B to deflect by 1 mm, we subtract 1 mm from XA to get x, the
initial position of the second contact:

x = X A 1mm = 85.1mm 1mm = 84.1mm

Carryer, Ohline & Kenny

Copyright 2011

22-3

Solution Manual for Introduction to Mechatronic Design

22.5)

Do Not Circulate

You wish to design a new ultrahigh quality, portable, battery-powered coffee burr grinder for backpacking
espresso fanatics. The grinding elements you have selected (Figure 22.14) are adjustable so that a course
grind results when the burr cones are moved far apart from each other, a fine grind results when the cones
are moved close together, and any intermediate point may be selected by the user. The manufacturer of the
burr cones claims that the torque required to grind coffee ranges from 0.1 Nm (course grind) to 0.5 Nm
(fine grind), and that the burr cones only function when rotating between 6 to 10 rpm. You will use a 12 V
battery and a motor with NL = 13,900 rpm, TSTALL = 28.8 mNm, ISTALL = 3.55 A, coil resistance R = 3.38
, maximum continuous current I = 0.614 A, KT = 8.11 mNm/A, and KE = 0.847 V/krpm. There are three
gearheads available to you for this design: the first has a 850:1 ratio with 65% efficiency, the second has a
ratio of 1,621:1 with 59% efficiency, and the third has a ratio of 3,027:1 with 59% efficiency. Which
gearhead satisfies all the constraints (including continuous operation of the motor)?

Figure 22.14 Burr coffee grinder elements for Problem 22.5.

Carryer, Ohline & Kenny

Copyright 2011

22-4

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

This problem is a straightforward application of Eq. 22.13 for each of the gearhead choices, then checking
to see which of them satisfies the constraints.
The first quantity to determine is the minimum and maximum torque required from the motor, at the input
shaft of the gearhead with gear ratio GR:
TMOTOR = TGEARHEAD/GR
From Eq. 22.13, the motors minimum and maximum rotational speed may be calculated, and all quantities
are known/given:

= NL RM T = NL

R
T
K E KT

Again using the gear ratio (GR), we find the resulting rotational speed of the gearhead as:

GEAR = MOTOR GR
A spreadsheet or table is an efficient means of assessing each of the available choices:
1
1

580
0.65

1621
0.59

Tmotor out max


Tmotor out min

0.500000
0.100000

0.001326
0.000265

0.000523
0.000105

Wmotor out min


Wmotor out max

-232.127
-35.305

13.247
13.769

13.643
13.849

Wgear out min


Wgear out max

-232126.8
-35305.4

22.8
23.7

8.4
8.5

4.5 rpm
4.6 rpm

0.005

1.877

4.762

8.893 Nm

Gear Ratio
Efficiency

Tcont, max

Not enough T, W

Too fast

Just right

3027
0.59
0.000280 Nm
0.000056 Nm
13.762 krpm
13.872 krpm

Too slow

This shows that the 1,621:1 gearhead results in the specified rotational speed at the output of the
gearhead/input of the burr grinder, and that the maximum continuous torque that can be provided by the
motor with the gearhead (4.762 Nm) is greater than the highest force required by the burr grinder (0.5 Nm).
22.6)

A motor with KT = 16.1 mNm/A, RCOIL = 1.33 and NL (at 18 V) = 10,300 rpm will be operated with an
18 V supply. The maximum permissible continuous torque specification is 24.2 mNm. What rotational
speed does this correspond to?
Eq. 22.13 gives:

= NL RM T = NL

R
T
K E KT

All quantities except for KE are known. Use Eq. 22.11 to determine:

KE =

NL

Finally:

= NL

18V
= 1.748V / krpm
10.3krpm

R
(1.33)(24.2mNm)
T = 10.3krpm
= 9.16krpm
K E KT
(1.748V / krpm)(16.1mNm / A)

Carryer, Ohline & Kenny

Copyright 2011

22-5

Solution Manual for Introduction to Mechatronic Design

22.7)

Do Not Circulate

Starting with the expression for motor power output given in Eq. 22.18, show that maximum power is
developed at TSTALL.
Eq. 22.18 is

P=

VT
RM T 2
KE

To find the maximum with respect to torque and set the result equal to 0:

V
2 RM T = 0
KE
V
= 2 RM T
KE
R
VK E K T
V
T=
and RM = COIL so T =
2 RM K E
K E KT
2 RCOIL K E
Simplifying this gives:

T=

1 V

KT
2 RCOIL

When a motor is stalled, V = ISTALL RCOIL, so further simplification yields the final result:

T=

22.8)

1
1
K T I STALL = TSTALL
2
2

What are the roles of the commutator and brushes in a brushed DC motor?
The commutator and brushes control the current that flows in the coils on the rotor of a brushed DC motor
so that current flows in coils that are in a physical position that allows them to generate torque in the
magnetic field established by the stators permanent magnets. When the torque causes the motors rotor to
rotate, the brushes and commutator switch the current in new coils that are coming into position to
contribute torque.
Without a commutator and brush that is, without controlling when current flows in a coil and what
direction it is flowing the rotor would come to rest at an equilibrium position where the force resulting
from the interactions between the current in the coil wire and the magnetic field are in line with the rotors
axis of rotation.

22.9)

A motor has a measured R = 14.5 , and a measured stall torque of 4.47 mNm when operated on 9 V.
What is the expected no-load speed of this motor? You should ignore motor friction for this problem.

9V
= 620mA
14.5
4.47mNm
K E = 7.20 10 3V /(rad / s )
KT =
= 7.20 10 3 Nm / A ;
0.62 A
V
9V
NL =
=
= 1,250 rad / s = 11,936 rpm
3
K E 7.20 10 V /( rad / s )
I=

Carryer, Ohline & Kenny

Copyright 2011

22-6

Solution Manual for Introduction to Mechatronic Design

22.10)

Do Not Circulate

A motor has a measured no-load speed of 11,500 rpm, measured stall torque of 4.47 mNm. What is the
expected speed of this motor when delivering 1.5 mNm of torque into an external load?
The slope of the speed-torque line is

11,500 rpm
= 2,573 rpm / mNm
4.47 mNm

When delivering 1.5 mNm of torque, the speed will be:

11,500 rpm (2.573 rpm / mNm)(1.5 mNm) = 7,641 rpm


22.11)

A motor has R = 14.5 , a no-load speed of 11,500 rpm and no-load current of 12 mA when operated at 9
V. What is the maximum efficiency when operated on 9 V?
2

MAX = 1

Carryer, Ohline & Kenny

I NL
IS

0.012

= 1
= 74%
9

14.5

Copyright 2011

22-7

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 23 Permanent Magnet Brushed DC Motor Applications


23.1)

Why is it necessary to include a snubber circuit when switching inductive circuit elements (e.g., brushed
DC motors)?
When an inductive circuit element is switched off, the phenomenon of inductive kickback can create
voltage spikes large enough to damage or destroy other circuit elements, especially the switch (e.g.,
transistor, relay, mechanical switch) used to control the inductor. A snubber circuit reduces the voltage
from the inductive kickback to levels that are within the specifications for the other circuit elements.

23.2)

Name at least two benefits of using higher PWM frequencies.


1.
2.
3.
4.

Lower current ripple


Lower torque ripple / smoother motor operation
Frequencies above ~20 kHz are not audible to humans
Improved linearity of response with respect to PWM duty cycle vs. rotational speed.

Carryer, Ohline & Kenny

Copyright 2011

23-1

Solution Manual for Introduction to Mechatronic Design

23.3)

Do Not Circulate

For each of the snubbing methods described in this chapter:


a) Rank them in order of slowest current decay time to fastest.
b) Draw a schematic showing how each is connected, label the peak voltage drops across each of the
components that comprise the snubber circuit, and write the expression for the peak voltage at the
connection to the switching element.
a) Slowest to fastest: diode, diode + resistor, Zener only, diode + Zener.
b)
Vs

Vs

Diode
Vd

Motor

Diode
Vd

Motor

Rs
Vr
Vc
Vin

Rb

Vc
NPN BJT

Vin

During kickback: Vc = Vs + Vd
Vd ~ 1 V for most fast-recovery diodes with
current levels typical of DC motors (100s of mA
or more)

Rb

NPN BJT

During kickback: Vc = Vs + Vd + Vr
Vd ~ 1 V for most diodes and typical current
levels
Vr = IR from Ohms law

Vs

Vs

Motor

Diode
Vd

Motor

Zener
Vz
Vc
Rb
Vin
NPN
BJT

Vc
Zener
Vz

During kickback: Vc = Vz
Vz is the Zener diodes reverse breakdown voltage

Carryer, Ohline & Kenny

Copyright 2011

Vin

Rb

NPN BJT

During kickback: Vc = Vs + Vd + Vz
Vd ~ 1 V for most diodes and typical current
levels
Vz is the Zener diodes reverse breakdown voltage

23-2

Solution Manual for Introduction to Mechatronic Design

23.4)

Do Not Circulate

A sensor will be mounted on a small platform that will be required to rotate continuously at a slow, steady
rate. A motor with the following specifications is proposed for turning the platform: R = 102 , NL =
427.3 rad/s at 36 V, TSTALL = 29 mNm at 36 V. The application calls for the motor to deliver 5 oz.in. of
torque at 300 rpm. The system is to be powered by a 12 V supply and switched by a BJT rated to handle a
maximum of 500 mA continuously with a collector-emitter voltage drop of VCE = 0.2 V.
a) Can the BJT safely switch the required current?
b) Is it possible to meet the design requirements for torque and speed with the given motor and power
supply? Justify your answer and show all calculations performed to reach your conclusion.
c) What is the average current required when running at the design point?
d) What applied voltage is required when running at the design point?
a) The highest current that will occur at any point in operation is stall current (when = 0). This happens
any time the motor is started from a stopped position, as well as any time sufficient torque is applied to
the shaft in a direction opposite that of the desired rotation. Under these conditions, back-EMF is 0,
and the motors coils can be treated as a simple resistive load:
V = IR + KE

and = 0

V = IR
ISTALL = V/R = 12 V / 102 = 0.118 A
This is less than the BJTs maximum of 0.5 A, so YES the BJT can safely switch this load
b) Solve the voltage equation to see if the required V is lower than the available voltage from the power
supply. If so, we can use a technique such as PWM to adjust the average voltage to achieve the
desired torque and speed.
V = IR + KE
We need to solve for I and KE. First I:
T = KT I
TSTALL = KT ISTALL = KT V/R
KT = TSTALL R/V = (29 mNm)(102 ) / (36 V) = 82.2 mNm/A
KE = KT / [9.5439e-3 (mNm/A)/(V/krpm)] = 8.61 V/krpm
Finally:
V = IR + KE = TR/KT + KE = (35.31 mNm)(102 )/(82.2 mNm/A) + (0.3 krpm)(8.81 V/krpm)
VREQUIRED = 8.79 V
Since we have 12 V available to power the motor, we ARE able to achieve the design requirements
with the circuit as it is.
c) We solved for the required current in the calculations above:
IREQUIRED = T/KT = (35.31 mNm) / (82.2 mNm/A) = 0.061 A
d) The required voltage (see our solution to part B above) is 8.79 V. We can create this with an
adjustable voltage regulator, or through the use of PWM.
However, this is the voltage applied across the motor, and not the power supply voltage. This does not
take into account VCE, the voltage drop across the BJT we are using to control the motor. We are
given that VCE is ~ 0.2V, so including this gives:
VREQUIRED = 8.79 V + 0.2 V = 8.99 V

Carryer, Ohline & Kenny

Copyright 2011

23-3

Solution Manual for Introduction to Mechatronic Design

23.5)

Do Not Circulate

A Pittman 14203-48 DC motor is to be used in an application where it is required to produce torque of at


least 10 oz.in. when stalled. The motor has a no-load speed of NL = 3,330 rpm (at 40 V), stall torque TS
= 161 oz.in. (also at 40 V), torque constant KT = 18.8 oz.in./A, speed constant KE = 13.9 V/krpm, and
resistance R = 5.53 . Design a circuit to drive the motor using an ST L298N H-bridge with two separate
power supplies: +9 V for driving the motor and +5 V for powering the logic. Incorporate kickback diode
protection. The design should take in logic-level signals for enabling the motor (turning it on and off) and
changing the direction of the motors rotation. Show how all specifications of the motor, the kickback
diodes and the L298N are satisfied.

+5V

U1

Vin1
Vin2

5
7
10
12

Vin3

6
11

OUT1
OUT2
EN A OUT3
EN B OUT4

2
3
13
14

ISEN A
GND ISEN B

1
15

IN1
IN2
IN3
IN4

VSS
VS

9
4

+9V

+9V

D1
MR850

D3
MR850

+9V
D2
MR850

Motor

D4
MR850

L298N

For the L298N, the logic-level inputs satisfy the requirements, and the power supplies are also within
specifications at 5 V for the logic and 9 V for the motor (which must be at least 2.5 V above the logic input
voltage).
At the outputs, we must ensure that the maximum current drawn by the motor is within specifications for
the L298: IMAX = ISTALL = V/R.
First, we a calculation that neglects losses across the L298 will help us determine approximately how much
current will flow: ISTALL 9 V / 5.52 1.63 A.
The actual voltage across the motor is the supply voltage minus the losses across the L298s high side
driver (VCEsat(H)) and low side driver (VCEsat(L)). The worst case (that is, the greatest current that might
flow) is when the losses in the chip are at a minimum. The data sheet gives a minimum specification for
conditions at 1 A, but not at 2 A. Since the losses at 2 A are certain to be higher than the losses at 1 A, it is
conservative to apply the specifications at 1 A even thought we know that more than 1 A of current will
flow at stall.
This results in the following value for IMAX, which includes consideration of the losses across the L298s
high and low side drivers:
IMAX = ISTALL = V/R = (9 V 1.8 V) / 5.53 = 1.3 A
This is below the maximum for the L298 (which allows up to 2 A peak) so this is OK.
Next, we look at the choice of kickback diode. We selected the MR850 from ON Semiconductor, which
features fast reverse recovery specifications (good for inductive kickback). Specifications for the MR850
show that the max average forward current allowed is 3 A, and up to 100 A peak (non-repetitive) is ok.
We can expect a maximum kick-back current of 1.3 A in very brief spikes, which is well below the 3 A
maximum specification for the diode. Also, the reverse breakdown voltage of the MR850 is 50 V well
above the 9 V drive voltage used in this circuit.
Finally, we consider the application of the motor. Will this particular motor, when driven by 9 V by the
L298N, be capable of providing the minimum specified stall torque (10 oz.in.)? To determine this, we
will check if the minimum stall torque that might be produced by this combination of motor and the L298
is at least 10 oz.in. This is determined by the maximum value of VCE(sat) for the L298N (4.9 V maximum
when 2 A are flowing).
The minimum expected voltage applied across the motor is:
VMIN = 9V 4.9V = 4.1V
The resulting torque from the motor under these conditions would be:
TMIN = KTI = KTV/R = (18.8 oz.in./A)(4.1 V) / (5.53 ) = 13.9 oz.in.
This is above the required 10 oz.in., and meets the requirements.

Carryer, Ohline & Kenny

Copyright 2011

23-4

Solution Manual for Introduction to Mechatronic Design

23.6)

Do Not Circulate

A motor with a stall current of 0.9 A and coil inductance of 12 mH is driven with PWM frequency of 500
Hz. The kickback protection for the drive circuit consists of a standard diode (a 1N4935) in combination
with a 24 V, 5 W Zener diode (a 1N5359B). What is the peak power dissipated by the standard diode? By
the Zener? Does this circuit operate within the specifications of these diodes?
For the 1N5359B: Pmax = 5 W.
For the 1N4935: Since no power dissipation specification is provided, we must calculate it from other
specifications.
Maximum average current: 1 A
Maximum VF at 1 A: 1.2 V
So, the maximum average power dissipation must be: P = VI = 1.2 V 1 A = 1.2 W
Eq. 23.8 gives us the approximate power dissipation that results in the circuit:

1 2

P = I STALL
L Frequency
2

P = (0.9 A) 2 0.012 H 500 Hz = 2.43W


2

This is OK for both parts:


OK for the regular diode: the stall current is 0.9A, which is less than the maximum continuous current
allowed for the diode (1A). The peak power dissipated by the diode will be (2.43 W) (1.2 V / 25.2 V) =
0.12 W, which is well below the maximum average (1.2 W) calculated above.
OK for the Zener diode: the average power dissipation is 2.43W, which is less than the 5W rating on the
1N5252B. The peak power dissipated by the Zener will be (2.43 W) (24 V / 25.2 V) = 2.3 W, which is
also well below the maximum average specification (5 W).
23.7)

Design a circuit that performs bi-directional control of a DC motor that uses only the following
components: a 2-position, ON-ON type, double-pole, double-through (DPDT) switch; a DC motor; and
standard diode(s). Show a wiring diagram of your circuit and be sure to include kickback protection with
the standard diodes.
+V

+V

D1
1N4935

D2
1N4935

Motor

SW DPDT

D3
1N4935

Carryer, Ohline & Kenny

+V

Copyright 2011

D4
1N4935

23-5

Solution Manual for Introduction to Mechatronic Design

23.8)

Do Not Circulate

When implementing PWM in a circuit using a 12 V power supply, what is the average output voltage when
the duty cycle is 42%? If the output voltage is to be increased so that its average value is 8.79 V, what
duty cycle is required?
With 42% duty cycle: VAVE = 0.42 12 V = 5.04 V
To get VAVE = 8.79 V, the required duty cycle DC = 8.79 V / 12 V = 73.3%

23.9)

In a general and qualitative way, sketch the current response vs. time for a motor with L = 15 mH and R =
5 ( = L/R = 3 ms) under PWM control for the following scenarios. Include a sketch of the PWM drive
signal on a separate axis for reference. Do not perform any calculations or analysis to answer these
questions. Assume that the motor is stalled, and that a snubbing technique is used that results in a current
fall time that is roughly equivalent to the rise time.
a) PWM frequency = 25 Hz, duty cycle = 90% (period = 40 ms, on time = 36 ms, off time = 4 ms).
b) PWM frequency = 500 Hz, duty cycle = 40% (period = 2 ms, on time = 0.8 ms, off time = 1.2 ms).
c) The motor is initially off. At time t0, a 20 kHz drive signal is enabled at 60% duty cycle (period = 50
s, on time = 30 s, off time = 20 s). Illustrate the current transient response.
d) The motor is initially running at 100% duty cycle. At time t0, the PWM duty cycle is changed to 25%
at 20 kHz (period = 50 s, on time =12.5 s, off time = 37.5 s). Illustrate the current transient
response.
e) The frequency of the PWM drive signal is increased steadily from 25 Hz to 1 kHz while the duty cycle
is held constant at 20%. (The initial period = 40 ms, initial on time = 8 ms and initial off time = 32 ms.
The final period = 1 ms, final on time = 0.2 ms and final off time = 0.8 ms).
A) PWM frequency = 25 Hz, duty cycle = 90%
= L/R = 15mH/5 = 3 ms

Motor
Current

+Vs PWM
Drive Voltage

I AVE = 90% * Vs/Rm


Current

Voltage

80
Time (ms)

40

120

160

B) PWM frequency = 500 Hz, duty cycle = 40%


= L/R = 15mH/5 = 3 ms
+Vs PWM
Drive Voltage

Motor
Current

IAVE = 40% * Vs/Rm


Current

Voltage

Carryer, Ohline & Kenny

8
10
Time (ms)

Copyright 2011

12

14

16

18

23-6

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

C) Motor initially off. At time t = 0, motor turned on.


PWM frequency = 20 kHz, duty cycle = 60%
= L/R = 15mH/5 = 3 ms
+Vs PWM
Drive Voltage

Current

I AVE = 60% * Vs/Rm

Voltage

Motor
Current

10

15

20

25

30

35

Time (s)

D) Motor initially driven at 100% duty cycle.


At time t = 0, PWM frequency = 20 kHz, duty cycle = 25%
= L/R = 15mH/5 = 3 ms
+Vs PWM
Drive Voltage

Current

Motor
Current

Voltage

I AVE = 25% * Vs/Rm

10

15

20

25

30

Time (s)

E) Initial PWM frequency = 25 Hz, duty cycle = 20%


Frequency ramps up to 1 kHz, duty cycle = 20% (constant)
= L/R = 15mH/5 = 3 ms
Motor
Current

+Vs PWM
Drive Voltage

Current

Voltage

I AVE = 20% * Vs/Rm

Initial PWM
Frequency = 25 Hz
Period = 40 ms
Duty cycle = 20%

Carryer, Ohline & Kenny

Copyright 2011

Time

Final PWM
Frequency = 1 kHz
Period = 1 ms
Duty cycle = 20%

23-7

Solution Manual for Introduction to Mechatronic Design

23.10)

Do Not Circulate

A motor with KT = 1.657 oz.in./A, KE = 1.230 V/krpm and terminal resistance R = 20.3 is driven at 14
V. How fast will the motor spin under a constant 0.15 oz.in. load if it is driven by PWM with a 25% duty
cycle and a frequency well above the motors electrical time constant? What is the speed if the duty cycle
is increased to 85%?
We can apply Eqs. 20.11, 20.12 and 20.13 and solve directly at each duty cycle:
Eq. 20.11:

NL =

Eq. 20.12: RM =

Eq. 20.13:

V
Ke

R
KT K e

= NL RM T

Combine to get:

V
R

T
K E KT K E

At 25% duty cycle (and given that the PWM frequency is much higher than the motors electrical time
constant):

0.25 14V
20.3
V
R

T=

(15oz.in.) = 1,351rpm
1.23V / krpm (1.657oz.in.)(1.23V / krpm)
K E KT K E

At 85% duty cycle:

V
R
0.85 14V
20.3

T=

(15oz.in.) = 8,181rpm
K E KT K E
1.23V / krpm (1.657oz.in.)(1.23V / krpm)

Carryer, Ohline & Kenny

Copyright 2011

23-8

Solution Manual for Introduction to Mechatronic Design

23.11)

Do Not Circulate

Design kickback protection circuitry that incorporates a standard diode and a resistor for a motor that has
coil inductance of 50 mH and a stall current of 900 mA when driven by a 12 V power supply. The motor
is controlled by an NPN bi-polar junction transistor (BJT). Limit the inductive kickback voltage spike to
36 V at the collector of the BJT. Draw a schematic diagram of the complete circuit. Under what
conditions can the diode and the resistor safely manage the current and resulting power dissipation? Is the
maximum PWM frequency a reasonable choice?
+12V

1N4935
Motor
24
1/2W
Vc
Vin

Rb

NPN BJT

For this circuit, the voltage at the BJTs collectors is: Vc = Vs + Vd + Vr = Vs + Vd + Istall R
With 900 mA flowing in the motor at stall (and hence flowing in the kickback loop when the motor is
switched off) the forward voltage drop for the diode is likely to be around 1V (rule of thumb).
36 V = 12 V + 1 V + 0.9 A R
R = 26
However, 26 is not a standard 5% resistor value, so we will choose the more conservative, next lower
value: R = 24 . This results in a maximum Vc of 34.2 V.
The diode allows for up to 1 A continuous, so 0.9 A intermittently meets its requirements in all
circumstances.
The resistor, as shown, is 1/2 W. This will be acceptable for PWM frequencies up to a limit, at which
point the power dissipation rating will be exceeded.

1 2

I STALL L Frequency , we recognize that this total power is dissipated by both


2

Using Eq. 23.8: P =

the diode and the resistor. The fraction of the power that will be dissipated by the resistor is
VR/(VR + VD) = 21.6 V / (21.6 V + 1 V) = 0.96
Thus, the maximum PWM frequency is:

Frequency =

0.96

1 2

I STALL L
2

0.5W

0.96
= 25.8Hz
1

2
(
900
mA
)
(
0
.
05
H
)

This is a rather low PWM frequency not a particularly reasonable choice, as it is likely to be near the
mechanical time constant for the motor. There may be noticeable torque ripple and speed oscillations, and
the resulting duty cycle vs. speed response will not be very linear.

Carryer, Ohline & Kenny

Copyright 2011

23-9

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 24 Solenoids
24.1)

Describe the general characteristics of applications in which solenoids may be a good choice.
Applications in which linear motion over a short distance is required with low- to moderate actuation
forces, and for which high actuation current flow (e.g., > 1 A) are acceptable.

24.2)

If solenoids prove to be a poor choice for meeting the requirements of a given application, name at least
three alternative means of creating linear motion.
There are many answers to this question (far more than three), including:
Motor (e.g., brushed DC, brushless DC, stepper, etc.) with rack and pinion gearing
Motor with crankshaft and connecting rod
Motor with cam and cam follower
Motor with leadscrew
Motor and belt with platform attached to belt (e.g. inkjet printer head)
Pneumatic piston
Hydraulic piston

Carryer, Ohline & Kenny

Copyright 2011

24-1

Solution Manual for Introduction to Mechatronic Design

24.3)

Do Not Circulate

Given the performance characteristics for four solenoids shown in Figure 24.13, answer the following
questions:

Figure 24.13: Data for Problem 24.3.


a) Which solenoid(s) would be suitable for a continuous duty application that needed to provide more
than 2.5 N of force at a displacement of 5 mm?
b) Which solenoid(s) would be suitable for the same application if a 4:1 peak and hold driver (i.e., the
initial phase of actuating the solenoid is driven with four times the voltage corresponding to a
continuous duty cycle) were used to drive the solenoid?
c) The construction of solenoid #4 differs from that of the others shown. How is it different? What
impact does the difference have on its force vs. stroke characteristics?
a) Solenoid #4 is the only one that continuously provides net force (solenoid force ~5.75 N return
spring force ~3 N = ~2.75 N) of 2.5 N at a stroke of 5 mm. The other solenoids are only capable of
providing that level of force when used at duty cycles of less than 100%.
b) All of the solenoids shown (1-4) are capable of meeting the specifications with a 4:1 peak and hold
driver, though solenoid #1 is very close to or at the limit.
c) Solenoid #4 is the only option that incorporates a return spring. The force of the return spring opposes
the actuating force of the solenoid, and the result is a lower net output force than the solenoid would
have without the spring, but with the benefit of returning the plunger to its initial position for future
actuation cycles.

Carryer, Ohline & Kenny

Copyright 2011

24-2

Solution Manual for Introduction to Mechatronic Design

24.4)

Do Not Circulate

The performance requirements for an automotive fuel injector are stringent. For example, calculate the
total time available for a fuel injector to introduce fuel into an automotive cylinder when a four-stroke
engine is turning at 6,000 rpm. How does this compare to the mechanical actuation times of typical
solenoids?
For a four-stroke engine, the only beneficial time to allow fuel to flow through the injector and into the
cylinder is during the intake stroke, which is the first of the 4 strokes, or 180 of rotation, of the engine
(the others, in order after the intake stroke, are the compression , ignition, and exhaust strokes).
For an engine turning at 6000 rpm:
6000 rotations 1min ute
rotations

= 100
1min ute
60 sec onds
s
1
= 0.01 s / rot = 10 ms / rot
100 rotations sec ond

The intake stroke occurs during half of a rotation, so the available time for the injector to fire is:
10 ms/rotation 0.5 intake strokes/rotation = 5 ms/intake stroke
For small solenoids, the typical mechanical actuation time stated in the chapter is a few milliseconds
these are on the same order. This is a highly demanding application for a solenoid, and the techniques
outlined in the chapter for maximizing performance (peak-and-hold drive, chopper drive, diode+zener
snubbing) are all routinely used to meet the requirements.
24.5)

Design a peak and hold driver that will take two separate 0-5 V digital inputs and control the current
through a solenoid to a 4:1 peak:hold ratio. The two inputs are called Peak / Hold and Hold / Off . When
the Peak / Hold input has is in the logical high state, the Hold / Off input will be in a logical low state, and
the current through the solenoid should be at the peak value. When the Hold / Off input is in the logical
high state, the Peak / Hold input will be in the logical low state and the current should be at the hold value.
When both inputs are in the logical low state, the solenoid should be off (no current flowing). The two
inputs will never be in the logical high state at the same time. The solenoid has a resistance of 12 and
will be operated from a 12 V power supply. Choose standard 5% resistor values, but do not account for the
5% variation in your answer when assessing the current ratios.
+12
Solenoid
R = 12 Ohms

R1
36
Peak/Hold

Q1
IRLZ34N

Q2
Hold/Off

IRLZ34N

When Peak / Hold is high and Hold / Off is low, then about 1 A (12 V / 12 ) flows. When

Hold / Off is high & Peak / Hold is low, then about 0.25 A (12 V / 48 ) flows.
Carryer, Ohline & Kenny

Copyright 2011

24-3

Solution Manual for Introduction to Mechatronic Design

24.6)

Do Not Circulate

The circuit shown in Figure 24.14 uses a standard diode (whose maximum average power dissipation
specification is 0.3 W) as a snubber. If the solenoid is driven with PWM at a frequency of 10 Hz, what is
the minimum coil resistance Rc that the solenoid may have without violating the diodes power dissipation
specification? You may assume that VCE(SAT), the voltage drop across the TIP31 transistors collector and
emitter, is 0.5 V when the transistor is on and saturated. You may also assume that the diode D has a
forward voltage drop of 0.6 V when forward biased.

Figure 24.14: Circuit for Problem 24.6.


The governing expression is:

P=

1 2
I Lf
2

And we are required to limit this to 0.3 W. The only unknown here is current, so we can solve for that as:

I=

2P
(2)(0.3W )
=
= 2A
Lf
(0.015H )(10 Hz )

Since we are limited to a current of 2 A flowing through the solenoid, we can solve for R because the
voltage drop across the solenoid is also given:

R=

VS VCE ( SAT )

Carryer, Ohline & Kenny

12V 0.5V
= 5.8
2A

Copyright 2011

24-4

Solution Manual for Introduction to Mechatronic Design

24.7)

Do Not Circulate

For the circuit shown in Figure 24.15, specify the resistor Rs in the diode-resistor snubber circuit that
results in the fastest possible decay of current flowing in the solenoid and does not violate specifications
for any circuit component. Use the specifications provided for the TIP31 in Figure 24.16, and select a
resistor with standard 5% tolerance. You may assume that the diode D has a forward voltage drop of 0.6 V
when forward biased.

Figure 24.15: Circuit for Problem 24.7.

Figure 24.16: Data for Problem 24.7. (Used with permission from SCI LLC, DBA ON Semiconductor.)

Carryer, Ohline & Kenny

Copyright 2011

24-5

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Solution for Problem 24.7:


NOTE: The problem statement incorrectly omits the A in TIP31A for Q1. This was omitted in error,
and the circuit schematic in Figure 24.15 is as intended. Since specifications for a TIP31 are not included
in Figure 24.16, this omission is not likely to cause too much confusion.
The goal is to allow the voltage at the collector of the TIP31A to get as close to the maximum allowable
value without going over. That is, VC must not exceed the VCEO(sus) specification, which for the TIP31A is
60 V.
When the solenoid is switched off, it may have as much current flowing through it as:
(VS VCE(sat))/RC = (12 V 0.2 V)/10 = 1.18 A
At the moment when the transistor is switched off, the full current flows through the snubber network, and
the resulting voltage rise is:
VC = VS +VD + VR = 12 V + 0.6 V + IC RS
Where IC is the current through the coil and RS is the resistor in the snubber network, and VC is the voltage
at the transistors collector (at the bottom of the coil).
Since the maximum allowable voltage at the collector of the TIP31A is 60 V, we can solve this for RS,
since all other values are known:
VCEO(sus) = VS + VD + IC RS
RS = (VCEO(sus) VS VD)/IC = (60 V 12 V 0.6 V)/1.18 A = 40.16
40.16 is not a standard 5% resistor. 39 is the closest, lower (more conservative, since V=IR) standard
value. When we take the full 5% tolerance band into account, the maximum possible resistance is 40.95 ,
which is above the 40.16 maximum value calculated. The best choice is then the next smaller value, 36
, which might be as high as 37.8 .
Choose RS = 36

Carryer, Ohline & Kenny

Copyright 2011

24-6

Solution Manual for Introduction to Mechatronic Design

24.8)

Do Not Circulate

Specify the Zener voltage for the Zener diode (D2) shown in the circuit of Figure 24.17. You may use the
specifications for the TIP31 provided in Problem 24.7. You may assume that the diode D1 has a forward
voltage drop of 0.6 V when forward biased. Include the data sheet for the Zener diode you select in your
answer.

Figure 24.17: Circuit for Problem 24.8.


NOTE: The problem statement incorrectly omits the A in TIP31A for Q1. This was omitted in error,
and the circuit schematic in Figure 24.17 is as intended. Since specifications for a TIP31 are not included
in Figure 24.16, this omission is not likely to cause too much confusion.
The goal of this problem is the same as Problem 24.7: allow the voltage at the collector of Q1 (VC) to
come as close as possible to the maximum allowable value (VCEO(sus) = 60 V), without exceeding it. This
can be achieved by specifying a Zener diode with a reverse breakdown voltage, VZ, that, in combination
with the power supply and the forward diode drop across D1, is close to, but not greater than, VCEO(sus) = 60
V.
Algebraically:
VCEO(sus) VS + VD + VZ
VZ VCEO(sus) VS VD
VZ 60 V 12 V 0.6 V = 47.4 V
Any value up to VZ = 47V is an acceptable response.
A better answer takes into consideration the tolerance of the part (1%? 2.5% 5%?).
Also, since there is no need to take VCEO(sus) right up to the absolute maximum limit of 60 V, a conservative
choice of VZ would be somewhat less than 47 V.

Carryer, Ohline & Kenny

Copyright 2011

24-7

Solution Manual for Introduction to Mechatronic Design

24.9)

Do Not Circulate

The electrical relay shown in Figure 24.18 (the RT1 from Tyco Electronics) is capable of switching up to
250 VAC at 16 A with a 0 to 5 V input signal. Using the specifications provided for the RT114005 (5V
DC coil), answer the following questions:
a) When controlling the coil with a 5 V drive signal, how much current will flow? What is the threshold
voltage at which the contacts will close? What is the threshold voltage at which the contacts will
open?
b) How many switching cycles are the electrical contacts rated for? How many actuation cycles are the
mechanical elements rated for? Which is most likely to fail first?
c) What is the highest voltage and current you can control with this relay?
d) How quickly can the contacts switch on or off? Is it reasonable to use this relay to implement PWM
control? Why or why not?
e) You are to use this relay to build a motion controlled porch light. Design a circuit which controls
power to a standard 120 VAC / 60 W light bulb with an input signal that is 0 V when the light bulb is
off and 5 V at up to 100 mA when the light bulb is to be on.

Figure 24.18: Relay and data for Problem 24.9. (Courtesy of Tyco Electronics Corp.)

Carryer, Ohline & Kenny

Copyright 2011

24-8

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Solution for Problem 24.9:


a) The resistance for the -005 coil (5 VDC) is 62 10%. From Ohms law
I = V/R = 5 V/62 = 81 mA 10%
The contacts will close at 3.5 V or more.
The contacts will open at 0.5 V or less.
b) Electrical contacts: 50,000 cycles
Mechanical contacts: 30,000,000 cycles
The electrical contacts are likely to fail first, with 1/1000 the predicted life of the mechanical contacts.
c) 250 VAC / 12 A
d) The operate time (time for contacts to close) is 8 ms.
The release time (time for contacts to open) is 6 ms.
It would not be reasonable to use this relay to implement PWM, unless the frequency is much lower
than typical PWM. With a load (that is, when some useful circuit is connected to the relay) the
maximum frequency of operation is 6 Hz. Also, if you operate at 6 Hz, you exhaust the electrical
contacts in 8333 seconds (50,000 cycles at 6 cycles/second). Thats a little over 2 hours.
e)
60W
120 VAC

A1

Vin
0-5V
100 mA max

A2
1N4935

Carryer, Ohline & Kenny

13
11
12

RT114005

Copyright 2011

1
2

L
N

120 VAC

24-9

Solution Manual for Introduction to Mechatronic Design

24.10)

Do Not Circulate

You are building a test fixture for a piece of electronic equipment, and you need to characterize the life of a
momentary switch located on the devices front panel. You decide to use a solenoid with the
characteristics shown in Figure 24.19 to depress the switch repeatedly and count the number of cycles until
failure. If you position the solenoid plunger 0.220 in. away from the switch and the switch deflects 0.020
in. when pressed, what is the maximum force you can generate with the solenoid in the fixture? If the
switch requires 5 oz., what is the corresponding maximum duty cycle you can use with this solenoid?

Figure 24.19: Data for Problem 24.10.


The limiting force generated by the solenoid is at the farthest distance, which is 0.240. At this distance,
this solenoid could generate ~12 oz. (limited to 10% duty cycle).
Since the switch only requires 5 oz. to actuate and the stroke is specified at 0.240, this point is within the
capability of the 25% duty cycle line. 25% is the maximum duty cycle allowed to generate 5 oz. at 0.240.

Carryer, Ohline & Kenny

Copyright 2011

24-10

Solution Manual for Introduction to Mechatronic Design

24.11)

Do Not Circulate

If the solenoid from Problem 24.10 has 965 turn windings and a DC resistance of 20 , design a drive
circuit to control the solenoid at the maximum permissible current for 10% duty cycle. The control signal
will be a 0-5 V output from a microcontroller. (IOH = -100 A). Specify the components and necessary
power supply voltage chosen from the set of 5, 12, 15 and 24 V.
+24V

L1
Solenoid
20 Ohms

0-5V Control Signal

Q1
IRLZ34N

The maximum current through the solenoid will be given by the 10% DC specification of 1155 AmpereTurns / 965 Turns = 1.19 A. This is too much current for a small-signal MOSFET such as a 2N7000, but is
very comfortable for a power MOSFET such as a IRLZ34N. This device has an RDS(on) (drain-to-source on
resistance) specification of 0.046 when VGS (the gate-to-source voltage) is 5 V. The supply voltage
necessary to cause 1.19 A of current to flow through a total resistance of 20.046 is 1.19 A 20.046 =
23.9 V, so for this design we will need a 24 V supply.
The IRLZ34N MOSFET incorporates a body Zener diode, which will effectively snub the kickback
voltage. No additional snubbing component(s) is(are) needed.

Carryer, Ohline & Kenny

Copyright 2011

24-11

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 25 Brushless DC Motors


25.1)

How do the terminal-to-terminal inductances compare between a Wye-connected and a delta-connected


motor?
For the same coil inductances, the delta wired motor would exhibit lower terminal to terminal inductances.

25.2)

How would you expect the difference in inductance between a Wye-connected and a delta-connected
motor to be manifested in the performance of the motor? Describe the differences in expected performance.
The lower inductance will allow the currents to be switched more quickly resulting in a higher maximum
speed at the same drive voltage.

25.3)

What is the relationship between mechanical and electrical degrees for a BLDC motor with 48 internal
poles?
60 electrical degrees = 7.5 mechanical degrees.

25.4)

If the coils in Figure 25.1 were not wired in pairs, how many phases would this motor have?
6 phases. Each coil would be an independent phase.

25.5)

If the coils in Figure 25.1 were not wired in pairs, how many stages would the electrical cycle contain?
6 stages, since each of the coils would be driven independently.

25.6)

Explain why a high-resolution encoder is necessary to achieve the smoothest torque output when using
sinusoidal drive.
The smoothest output torque will be achieved when the discrete steps are as small as possible. Since the
steps correspond to rotational position of the rotor, the smallest steps will be achieved when you have the
highest resolution information about the position of the rotor.

25.7)

Using the types of subsystems commonly available on a microcontroller, how would you generate (in
general terms) the varying drive currents necessary to implement sinusoidal drive?
The most straightforward way would be to use a DAC to control the coil driver. Some microcontrollers
include DACs. Without a DAC, the easiest way would be to use PWM on the coil drive to achieve the
intermediate current levels.

Carryer, Ohline & Kenny

Copyright 2011

25-1

Solution Manual for Introduction to Mechatronic Design

25.8)

Do Not Circulate

If a microcontroller with circuitry to measure coil currents were used to implement sensor-less
commutation, explain one way that you could use the microcontroller to measure the inductance of the
coils.
Energize a coil and monitor the rise of current in the coil. Fit that rise to the known exponential nature of
the current rise to calculate the time constant (). Use the steady state current to calculate the resistance (R)
of the coil. Calculate inductance from R = L.

25.9)

Cite three reasons for why a brushless DC motor would be a superior choice over a brushed motor in a
laptop computer cooling application.
1)
2)
3)
4)

25.10)

BLDC motors are more reliable than brushed DC motors.


BLDC motors are more efficient than brush-type motors.
BLDC motors can be more compact for the same power output.
The BLDC motor is quieter acoustically.

What is the alternative to block commutation for a brushless DC motor? Why would a designer choose
block commutation?
Sinusoidal commutation would be an alternative that produces much less torque ripple, but at the expense
of much more complex drive. Block commutation will be the less expensive solution so it will be the
choice when cost is the dominant factor.

25.11)

How many output transistors are necessary in the drive circuit for delta wound motor? Is there an
alternative winding and/or wiring layout that requires fewer transistors?
Three half-bridges comprising 6 transistors are necessary to drive a delta wound motor. The center tapped
Wye wound motor can be driven with on 3 low side drive transistors.

Carryer, Ohline & Kenny

Copyright 2011

25-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 26 Stepper Motors


26.1)

Show the three different wiring configurations with three different coil resistances for a universal wound
motor driven in a bi-polar drive circuit.

+
+
+

26.2)

- Single Coil
Series

- Parallel

Show how you would wire a universal wound motor to use it in a uni-polar drive circuit.

+5

A-

A+

A+

A-

+5

B-

B+

B+

B-

The solution is to use the two coils wound on the same set of poles to create an effective bi-filar winding.
26.3)

If a stepper motor were specified as having a maximum step error of 1, what is the worst case positional
accuracy for that motor?
Positional accuracy is the maximum difference between 2 step positions as a deviation from the ideal. A
1 stepper could be -1 at one position and +1 at a second position resulting in a 2 positional accuracy
between those two positions.

26.4)

Name the three types of stepper motor construction described in this chapter.
Permanent magnet
Variable reluctance
Hybrid

Carryer, Ohline & Kenny

Copyright 2011

26-1

Solution Manual for Introduction to Mechatronic Design

26.5)

Do Not Circulate

For the motor shown in Figure 26.32:


a) How many phases does the motor shown below have?
b) Is it bi-polar or uni-polar?
c) Draw a basic schematic that shows how to connect the motor. For your answer, use a representative
power supply and generic transistors.

Fig. 26.32: Motor for Problem 26.5.


a) 2 phases. (From the text, we know that its bi-filar, and though you could individually control the 4
coils, 2 of them would cancel out if they were active at the same time because they are wound in
opposite directions around the same pole piece)
b) Uni-polar (bi-filar).
c) Circuit for connecting the motor:
+V

Q3
NPN

Q1
NPN

Q2
NPN

Carryer, Ohline & Kenny

Copyright 2011

Q4
NPN

26-2

Solution Manual for Introduction to Mechatronic Design

26.6)

Do Not Circulate

For the motor shown in Figure 26.33:


a) How many phases does the motor shown below have?
b) Is it bi-polar or uni-polar?
c) Draw a basic schematic that shows how to connect the motor. For your answer, use a representative
power supply and generic transistors.

Fig. 26.33: Motor for Problem 26.6.


a)
b)
c)

2 phases
Bi-polar
Circuit for connecting the motor:

+V

Carryer, Ohline & Kenny

+V

+V

+V

Q1
PNP

Q3
PNP

Q5
PNP

Q7
PNP

Q2
NPN

Q4
NPN

Q6
NPN

Q8
NPN

Copyright 2011

26-3

Solution Manual for Introduction to Mechatronic Design

26.7)

Do Not Circulate

The motor shown in Figure 26.34 can be wired and used in two different configurations.
a) Describe the two different configurations (how many poles, bi- or uni-polar, bi-filar or not bi-filar)
b) Draw a basic schematic showing the two ways the motor can be wired. (For your answer, use a
representative power supply and generic transistors).

Fig. 26.34: Motor for Problem 26.7.


a) Option 1: Uni-polar 2-phase (bi-filar)
Option 2: Bipolar 2-phase (not bi-filar)
b) Circuits for connecting the motor:
Option 2: Bi-polar 2-Phase

Option 1: Uni-polar 2-Phase (Bi-filar)


+V

Q1
NPN

+V

n/c

Q3
NPN

Q2
NPN

Carryer, Ohline & Kenny

Q4
NPN

+V

n/c

+V

+V

+V

Q1
PNP

Q3
PNP

Q5
PNP

Q7
PNP

Q2
NPN

Q4
NPN

Q6
NPN

Q8
NPN

Copyright 2011

26-4

Solution Manual for Introduction to Mechatronic Design

26.8)

Do Not Circulate

For the motor whose torque-speed characteristics are shown in Figure 26.35, answer the following
questions:
a) What is the maximum step rate?
b) If the motor is initially not rotating, will it be possible to immediately begin stepping the motor at a
rate of 200 pps (pulses per second) while generating 20 mNm of torque?
c) What is the maximum starting torque?
d) What is the fastest the motor can be stepped while generating 40 mNm of torque?
e) How much torque can the motor generate if it immediately begins stepping at 250 pps?
f) What is the maximum starting step rate?
g) A motor is required to generate 20 mNm of torque and step at a rate of 250 pps. Describe a control
scheme that allows you to achieve the desired performance.

Figure 26.35: Motor specifications for Problem 26.8. (Courtesy of Portescap.)


a)
b)
c)
d)
e)
f)
g)

26.9)

350 pps
Yes this is just inside the pull-in line
39 mNm
120 pps
15 mNm
250 pps
Assuming the torque generated is a constant 20 mNm, we can start at any speed below the pull-in line.
For this motor, that occurs at approximately 215 pps. For example, we can start at a step rate of 100
pps and ramp the speed up linearly to reach 250 pps. As long as we dont try to start stepping abruptly
at rates of 215 pps or higher, the motor can meet the requirements.

Name the thee types of drive modes for stepper motors. For each type of drive mode, state whether the
torque produced is consistent from step to step, or if it varies. If it varies, state why it varies.
1) Wave drive mode Torque is consistent from step to step
2) Full step drive mode Torque is consistent from step to step
3) Half step drive mode Torque is not consistent from step to step: it alternates: higher torque when 2
coils are active / lower torque when 1 coil is active.

26.10)

Which motor characteristic(s) limit its maximum step rate?


Rise time and fall time of current in motors coils
Rotor dynamics

Carryer, Ohline & Kenny

Copyright 2011

26-5

Solution Manual for Introduction to Mechatronic Design

26.11)

Do Not Circulate

The maximum step rate for a motor is related to the rate at which current begins to flow in the motors
coils and the rate at which it stops flowing. For the 1423-012-40343 motor whose specifications are given
in Fig. 26.24:
a) Calculate the characteristic rise time, , of the current in the motors coils.
b) Calculate the new value of , when you implement L/R drive by adding an external resistance of three
times the motors internal coil resistance. What drive voltage is needed to achieve the same steadystate current that would result without L/R drive when the motor is driven with its rated voltage? How
much power is dissipated (i.e., wasted) in the external resistors?
c) If you implement chopper drive with a drive voltage that is three times the rated voltage for the motor,
how much time is required for the current to reach the level achieved in the characteristic rise time
calculated for part (a)?

L 0.027 H
=
= 1.08ms
R
25
L
0.027 H
=
= 270s
b) =
(3R + R) 75 + 25
V 12V
Steady state current from part a): I =
= 0.48 A
=
R 25
Voltage required to achieve the same current with 4R: VL / R DRIVE = 0.48 A 100 = 48V

a)

Power dissipated in the external resistors: PEXT = I R = (0.48 A) 75 = 17.3W


2

c) VCHOP = 3VNOM = 36V


At time from part a): I = 0.632 I SS = 0.632 0.48 A = 0.303 A
With chopper drive: I SS =

VCHOP 36V
=
= 1.44 A
R
25

To solve for the time required to reach 0.303 A (the current level flowing at for the motor driven at
VNOM in part a) we need:

I (t ) = I SS (1 e t / )

I (t )
I (t )
L
0.027 H
0.303 A
= ln1
=
t = ln1
ln1
= 25.5s
I SS
R
I SS
25
1.44 A

Carryer, Ohline & Kenny

Copyright 2011

26-6

Solution Manual for Introduction to Mechatronic Design

26.12)

Do Not Circulate

Show how you would wire the stepper motor from Fig. 26.7d to be driven using bi-polar drive.
n/c

+V

Carryer, Ohline & Kenny

n/c

+V

+V

+V

Q1
PNP

Q3
PNP

Q5
PNP

Q7
PNP

Q2
NPN

Q4
NPN

Q6
NPN

Q8
NPN

Copyright 2011

26-7

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 27 Other Actuator Technologies


27.1)

Describe the basic difference between a solenoid, as introduced in Chapter 24 and the solenoid valve
introduced in this chapter.
A solenoid is general purpose actuator, usually linear, though rotary examples also exist. The solenoid
produces the forces directly.
A solenoid valve is an application of a solenoid, specific to controlling the flow of a working fluid. A
solenoid valve uses a solenoid to control a valve and the working fluid produces the forces.

27.2)

How does a direct acting solenoid valve differ from a piloted solenoid valve?
In a direct acting solenoid valve the solenoid controls the main fluid valve directly. In a piloted solenoid
valve, the solenoid controls a small pilot valve that uses pressure differentials from the working fluid itself
to apply forces to a larger diaphragm to control a main fluid valve.

27.3)

How does a solenoid valve differ from a servo valve?


The solenoid valve is intended for on-off control, whereas a servo valve is intended for modulated control.

27.4)

Would you expect a single vane or double vane rotary actuator to be smaller for a given amount of torque
produced? Explain why?
The double vane actuator would be smaller because the area exposed to the high pressure fluid can be
larger for a given body size.

27.5)

A servo motor capable of a 270 rotation responds to a range of pulses between 0.5 ms and 2.5 ms to move
between the two extremes of its rotation. What timing resolution is necessary in the pulse generation in
order to provide position control in 1 increments?
2 ms / 270 = 7.4 s/

27.6)

An engineer wants to use a microcontrollers 8-bit hardware PWM subsystem to generate the pulses to
position the motor from Problem 27.5. If the clock for the PWM subsystem is chosen so that the maximum
PWM period is 20 ms, what duty cycles (0-255 for the full 8-bit PWM) should be requested to place the
servo at its minimum and maximum positions?
0.5 ms / 20 ms = 2.5%, 2.5% of 255 = 6 counts for minimum position.
2.5 ms / 20 ms = 12.5%, 12.5% of 255 = 32 counts for maximum position.

27.7)

For the combination of motor and PWM drive system from Problem 27.6, what is the best expected
angular resolution for the system (i.e. how much will the motor move when the PWM count changes by
1)?
d / dPW= 270 / (32-6)= 10.3 / count

Carryer, Ohline & Kenny

Copyright 2011

27-1

Solution Manual for Introduction to Mechatronic Design

27.8)

Do Not Circulate

A particular positioning application requires motion on the order of 1 cm to be produced with m


resolution while producing 10 N of force. Suggest an appropriate actuator technology to fit this application.
An inchworm piezo motor would be a good choice here.

27.9)

Explain the process that you would go through to produce an actuator that produced a pull-force using a
length of Nitinol wire. Start with the raw, untrained wire and describe the processes through to actuation.
Step 1:
Step 2:
Step 3:
Step 4:

27.10)

Coil the wire around a form to allow for a long length to keep the strain down.
Anneal (raise temp to 540C for 5 minutes) in the coiled form to train the shape.
When cooled, you can stretch the wire as you would a spring by pulling on it.
Heat the wire to its transition temperature to get it to pull back into the trained shape.

From the list of actuator technologies below (none of which were discussed in this chapter), select one and
1) briefly describe its theory of operation, 2) cite at least one application, and 3) complete a new row for
Table 27.1 corresponding to the actuator technology you selected (include justifications for your answer to
part 3).
a) Magnetorestrictive actuators
b) Magnetorheological actuators
c) Dielectric electroactive polymer actuators
This question asks readers to research the listed technologies and report their findings. A wide variety of
answers will result. We recommend grading responses based on correctness, thoroughness, and
reasonableness.

Carryer, Ohline & Kenny

Copyright 2011

27-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 28 Basic Closed-Loop Control


28.1)

Which PID term(s) contribute(s) instability to the system when the gain is too large? Which one(s)
contribute(s) stability?
Integral gain contributes to instability.
Derivative gain contributes to stability.

28.2)

Write pseudo-code for a function to implement a bang-bang control law as described in Section 28.4.
If Measurand > SetPoint + 1/2 Hysteresis width
Turn output Off
If Measurand < SetPoint 1/2 Hysteresis width
Turn output On

28.3)

Explain, in your own words, why proportional-only control can never reach the set-point.
The key thing to note is that if the system ever achieved the set-point, the control effort would go to zero
(since the effort = KP Error). With no control effort, the system would not stay at the set-point.

28.4)

A system that implements PI control exhibits a step response like that shown in Figure 28.19.
a) How would you modify the gains to eliminate the oscillatory behavior while preserving as much of the
rise time as possible?
b) If you were simply to add a derivative term (with some nonzero gain) to this system (keeping the other
gains the same) how would you expect the response to change?

Figure 28.19: System response for Problem 28.4.


a) Start by decreasing the integral gain slightly.
b) The rise time would stay the same, overshoot would decrease, settling time would decrease, steady
state error would remain the same.

Carryer, Ohline & Kenny

Copyright 2011

28-1

Solution Manual for Introduction to Mechatronic Design

28.5)

Do Not Circulate

Lab-mates have collected some step response data from a system that they are trying to control using a PI
controller. The plots of rpm and duty cycle are shown in Figure 28.20. They have asked you whether or
not you think that they can increase the gains to improve the response of this system, and if so, which gain
should they try increasing first?

Figure 28.20: System response for Problem 28.5.


Yes, the system can tolerate increased gain, notice that the control effort never reaches 100%. Suggest
starting by increasing the proportional gain to get at least a short period of 100% DC right after the
beginning of the transient.

28.6)

A particular mechanical system with a time constant of 100 ms is to be controlled using a PID controller
running at a 25 ms loop rate. Would you expect to be able to use the Ziegler-Nichols formulas to calculate
stable gains for this system? Explain your answer based on the guidelines from this chapter.
The guideline for using ZN tuning formulas is that the loop rate be 7-10 times faster than the mechanical
time constant. This system does not meet that. At 4 times faster, it may be possible to produce a stable
system, but it will likely require hand tuning of the gains.

28.7)

The results of an open-loop step response for a particular system yield the following data:
Pseudo-delay = 8 ms
T = 25 ms
Change in output = 20 rpm for a 10% change in commanded duty cycle.
If the system is to be controlled using a PID controller running at a loop rate of 1 ms, what should the
Ziegler-Nichols gains be for KP, KI and KD?
For the given characteristics, Ziegler-Nichols gains are as follows:
GP = 2
KP = 1.875
KI = 0.065
KD = 4

Carryer, Ohline & Kenny

Copyright 2011

28-2

Solution Manual for Introduction to Mechatronic Design

28.8)

Do Not Circulate

The results of an open loop-step response for a particular system yields the following data:
Pseudo-delay = 2 ms
T = 12 ms
Change in output = 30 rpm for a 10% change in commanded duty cycle.
If the system is to be controlled using a PID controller running at a loop rate of 1 ms, what should the
Ziegler-Nichols gains be for KP, KI and KD?
For the given characteristics, Ziegler-Nichols gains are as follows:
GP = 3
KP = 2.4
KI = 0.25
KD = 1

28.9)

The results of an open loop step response for a particular system yields the following data:
Pseudo-delay = 30 ms
T = 120 ms
Change in output = 30 rpm for a 15% change in commanded duty cycle.
If the system is to be controlled using a PID controller running at a loop rate of 5 ms, what should the
Ziegler-Nichols gains be for KP, KI and KD ?
For the given characteristics, Ziegler-Nichols gains are as follows:
GP = 2
KP = 2.4
KI = 0.0833
KD = 3

28.10)

A particular actuator driven mechanical system is found to have a time constant of 30 ms from actuation to
stable response. Suggest a reasonable control loop rate to use in controlling this system. Explain your
reasoning.
To be able to use the Ziegler-Nichols tuning formulas (a very good thing, especially for a neophyte control
engineer) we need to have a loop rate at least 7-10 times faster than the mechanical time constant, therefore
I would propose a minimum loop rate of 3-4 ms. An even faster loop rate will make the system easier to
tune due to decreased sensitivity to the control gains.

28.11)

Only certain systems are good candidates for bang-bang control. What is the prime characteristic to
consider when evaluating whether or not a system is suitable for use with bang-bang control?
The system must be able to tolerate the variations in output that are inherent with the set point swinging
between the edges of the hysteresis band.

Carryer, Ohline & Kenny

Copyright 2011

28-3

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 29 Rapid Prototyping


29.1)

Describe a situation in which you might want to build a foam core prototype rather than build a solid
model to test out a concept.
When the design is simple enough that the time to cut it out of foamcore is less than the time to build the
individual solid models and assemblies.
Also, the scale of a solid model viewed on a computer monitor can be misleading. Things that look about
right can turn out to be tiny or huge when realized full scale. A foamcore model communicates scale very
well.

29.2)

Describe a situation in which it might make more sense to make the first prototype as a solid model rather
than a physical model.
If the design had a relatively large number of parts some (or many) of which were similar. In this case, the
time to model could be substantially quicker than the time to build. If you werent sure of the exact
dimensions or volumes that would be necessary, it would be easier to modify the solid model as that
information became available.

29.3)

True or False: because of its sheet nature, foamcore is only suitable for creating planar shapes.
False: it is possible to make 3-D curved shapes using foam core.

29.4)

What is the purpose of using tab and slot construction?


Adding strength to the structure.

29.5)

What are the advantages of SLS over SLA prototyping? What are the drawbacks?
The primary advantage of SLS over SLA is that the parts are considerably stronger, and a variety of
materials can be used that approximate the strength of common materials, such as polycarbonate and
nylon. In addition, materials that are chemically resistant are available, as are flexible materials suitable
for creating living hinges and snap features. SLS parts can be put under considerable loads and handled
with lower risk than SLA parts. The resolution achievable with SLS parts is about the same as SLA parts,
however the surface finish is usually inferior. SLS part delivery times are a little longer (3-5 days for some
vendors), and cost is a little higher than SLA parts.

29.6)

Contrast hard tooling with soft tooling. List advantages and disadvantages for each.
Hard tooling is made with hard materials, typically metals, while soft tooling is made with softer materials:
plastics, plaster, etc. Soft tooling is quicker to make and cheaper than hard tooling but doesnt last as long,
has a more limited range of materials that can be used in the tooling and doesnt provide as repeatable a
product as hard tooling does.

Carryer, Ohline & Kenny

Copyright 2011

29-1

Solution Manual for Introduction to Mechatronic Design

29.7)

Do Not Circulate

True or False: Cast parts made from soft tooling are limited to low durometer (soft) materials.
False. A wide range of durometers are available.

29.8)

List at least three distinct functions that a schematic diagram serves in the design/build process.
Documenting the design
Communicating the design among team members
Providing a reference document for the build, test and debug process
Facilitating production of a printed circuit board (PCB) of the circuit design

29.9)

In the context of electronic design, what is SPICE?


A circuit simulation program

29.10)

What are some drawbacks to circuit prototypes made using solderless breadboards.
They are not especially robust in the face of vibration and shocks. It is relatively easy to knock wires and
components out of place. With moderate- to high-complexity circuits, it can become difficult to manage
the organization, which in turn makes it difficult to troubleshoot when connections come loose.

29.11)

What is the major advantage of a wire wrapped prototype over a solderless breadboard prototype?
It is much more robust.

Carryer, Ohline & Kenny

Copyright 2011

29-2

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 30 Project Planning and Management


30.1)

What is the focus of the systems engineering approach to structuring a project? What kinds of people are
essential when using this methodology?
Focus: to divide complex systems into simpler functional subsystems in order to ease development. This
requires that special attention be paid to the interfaces, so that independently-developed subsystems
perform as required when integrated with other subsystems to create the final product.
People: highly specialized experts selected to optimize the results for each subsystem, as well as
optimizing the integration of subsystems (i.e. integrators).

30.2)

What is the focus of the concurrent design approach to structuring a project? What kinds of people are
essential when using this methodology?
Focus: including consideration of the various lifecycles of a project during planning and design. The goal
is to reduce or minimize the cost of each of the stages of a projects life.
People: individuals who are expert at dealing with the project at each stage of its life cycle. For instance,
to plan for optimal results during the manufacturing phase, assembly technicians should be included in the
design team. To plan for optimal results during the operation phase, end-users and repair technicians
should be included.

30.3)

Are the project management, systems engineering, and concurrent design approaches mutually exclusive
(i.e., if you use one of these approaches, are you precluded from using others)? Explain.
No: they may and should be used together in the same project. Any project may benefit from
considering it from the many different perspectives outlined by these approaches. Neglecting to think a
project through using these techniques leaves the project vulnerable to oversights and omissions, or at the
very least may result in an outcome that is less than optimal.

Carryer, Ohline & Kenny

Copyright 2011

30-1

Solution Manual for Introduction to Mechatronic Design

30.4)

Do Not Circulate

Using a systems engineering approach, enumerate at least 20 subsystems for the Ferrari 599 shown in
Figure 30.8.

Figure 30.8: A Ferrari 599.


There are a great many ways to view this question, and answers will vary widely. As a starting point, we
suggest the following subsystems:
Engine, engine controller, clutch, transmission, braking system (may include ABS), suspension,
chassis, body (may or may not be lumped together with bumpers/collision considerations), dynamic
stability control, seats, upholstery, dashboard/instrument panel, radio/sound, cooling, climate control,
convertible top and associated mechanisms, lighting, fuel storage and delivery, lubrication, glass, air
ducting, wheels, tires.

30.5)

You are tasked with designing the successor to the Ferrari 599 (Figure 30.8), and wish to incorporate as
much input from different domain experts as possible. Name a minimum of 10 types of experts will you
include on your team?
There are a great many ways to view this question, and answers will vary widely. As a starting point, we
suggest the following experts:
Stamped steel component designers & manufacturing technicians
Carbon fiber component designers & manufacturing technicians
Cast metal components designers & manufacturing technicians
Tire designers, manufacturers & application engineers
Wheel designers, manufacturers & application engineers
Assembly technicians
Repair technicians
Salesmen
Shipping/transport experts
Legal requirements / certifications experts
Computer programming experts
Engine tuning experts
Emissions controls / exhaust gas management experts
Paint manufacturers, painters

Carryer, Ohline & Kenny

Copyright 2011

30-2

Solution Manual for Introduction to Mechatronic Design

30.6)

Do Not Circulate

6)
Create a Gantt chart that reflects the syllabus for a course you are currently taking. Include
interdependencies, start and end dates for all assignments, due dates and milestones.
Answers to this question will vary widely. We suggest scoring responses based on the following:
a) A reasonable amount of detail is included, indicating that a reasonable effort went in to answering the
question.
b) As far as the grader is able to determine, the chart is accurate.
c) The chart adheres to the conventions of Gantt charts, as described in the chapter.

30.7)

Create draft requirements for a laptop computer targeting the market segment of college students enrolled
in an engineering program.
Responses to this question will vary widely. We suggest scoring responses based on the following:
a) A reasonable amount of detail is included, indicating that a reasonable effort went in to answering the
question.
b) The requirements are truly requirements, as defined in the chapter.
c) The requirements are adequately matched with the target market of engineering students.

Carryer, Ohline & Kenny

Copyright 2011

30-3

Solution Manual for Introduction to Mechatronic Design

30.8)

Do Not Circulate

Which phase of the following products life cycles would you anticipate would cost the most for the
producer? Support each answer with a brief explanation.
a) Disposable surgical tool
b) Automobile
c) Mars rover
d) Communications satellite
e) Ream of paper
f) Desktop personal computer
Responses may vary, and as long as they are reasonably well supported, should be acceptable.
a) Production
Producing, testing and packaging the surgical tool is likely to be more expensive than the analysis,
development or operation phases.
b) Production
Manufacturing each of the components and performing final assembly of a car is a major undertaking
most likely larger than development or operation, which only costs the manufacturer money when
repairs are covered by the warranty.
c) Operation
Once the analysis and development of a rover is complete (admittedly, each of these may be very
expensive), the operation phase is likely to be even more expensive. Launch & delivery of the rover
(both part of the operation phase) is very costly. The personnel and equipment required to operate the
rover are also expensive. Finally, when the cost of failure at any point in the operation phase is
considered (there would be no return at all on the costs of the previous phases), this is clearly the most
expensive phase.
d) Operation
Similar to the rover, the cost of launching, delivering and operating the satellite are likely to dominate.
Repairing the satellite in space, if it ever became necessary or were justified, would also be very
costly.
e) Production
Paper requires vast quantities of raw material (wood pulp). Also, economical production of paper
requires a large-scale manufacturing effort, with large up-front capital expenses for facilities and
equipment. The combination of these is likely to dominate, since expenses in the operational phase
consists mostly of delivery and marketing.
f) Production or operation
This depends primarily on how reliable the final device is. A well-designed and manufactured
computer will require fewer repairs and calls to technical support. Good documentation will also help
reduce these expenses (which are incurred in the operation phase). In this case, the production phase is
likely to be the costliest. If, however, the design, documentation or manufacturing are not done well,
then assisting the end-user and repairing the devices is likely to be the most costly for the devices.

Carryer, Ohline & Kenny

Copyright 2011

30-4

Solution Manual for Introduction to Mechatronic Design

30.9)

Do Not Circulate

You are tasked with leading the team that will design the next version of the Apple iPod.
a) Create draft requirements for the device.
b) Using a systems engineering approach, decompose the iPod into subsystems.
c) Identify as many of the products lifecycle stages as you can think of.
d) Identify the types of experts whose input will help minimize the expense of each of the iPods lifecycle
stages.
Responses to these questions will vary widely. A reasonable amount of detail should be included,
indicating that a reasonable effort went in to answering the questions. For each of the parts of the question,
we provide the following suggestions:
a) The requirements are truly requirements, as defined in the chapter.
(For example: the maximum size is 0.7 cm thick by 3 cm wide by 5 cm tall; there shall be a color
display; the maximum weight is 200 g; it must be capable of playing MP3 music files; it must be
capable of playing MPG video files; it must be able to store at least 1000 hours of music files; etc.)
b) The subsystems identified for the systems engineering approach are reasonable.
c) The lifecycle stages identified for the concurrent design approach are reasonable.
d) The list of experts is reasonable, but should include molded plastic part producers, battery
manufacturers, assembly technicians, computer interconnection experts / computer programmers, and
end-users.

Carryer, Ohline & Kenny

Copyright 2011

30-5

Solution Manual for Introduction to Mechatronic Design

30.10)

Do Not Circulate

You are assigned a class project in which you are to design a robot that putts 10 golf balls, 1 at a time, into
one of 3 targets on a 4 ft. 8 ft. playing field. There is a 2 in. drop-off at the boundaries of the playing
field, and your robot must stay on the playing field for the duration of the game. Each target is active for
10 seconds, after which time a new, randomly selected target becomes active. The active target is
identified by a beacon that modules an infrared (IR) light at a frequency of 2 kHz with a 50% duty cycle.
The wavelength of light emitted is easily sensed with an IR phototransistor. Each round of the game lasts
for 2 minutes. The robot that successfully putts the most golf balls into active targets wins. Each design
team will be comprised of 4 students, and you will have 2 weeks to complete your design.
a) Create a list of the requirements for a robot that can successfully compete in this putting game.
b) Identify areas where the project specifications are vague.
c) Identify loopholes in the project specifications.
d) Create a Gantt chart describing how your team will go about completing the project.
e) Identify the subsystems required by your robot.
f) Create a morphologic chart with as many candidate designs as possible for each of the subsystems
identified in e., above.
a) Carry 10 golf balls
Shoot 1 golf ball at a time
If the robot is not designed to be mobile, it must be capable of rolling a ball into the cup from
anywhere on the field.
If the robot is designed to move, it must be capable of moving from any legal starting position to a
desired (and legal) ball-dispensing position.
Robot must be capable of meeting performance requirements within 2 minute game duration
Robot must stay on the playing field
Robot must be capable of detecting a beacon and dispensing a ball within the 10 s beacons are active
Robots must be able to detect IR light modulated at 2 kHz with 50% duty cycle from beacons
Teams have 4 members
It must be possible to design, build, test and debug the robot within the 2 week duration of the project
b) No rules stated about how ball is to be delivered. Rolled? Bounced? Flung?
Infrared beacons on targets are not completely described. Do they emit in all directions or in a specific
direction? What is the intensity of the light? Is there a pause between when one target becomes
active and the previously active target becomes inactive?
Do the robots need to move?
Where are the targets on the field? Will they always be in the same place?
Where will the robots be placed at the start of each game? Will it always be the same?
c) There are many potentially acceptable answers to this question. Heres one as an example:
Is it allowable to build several robots? One could navigate to each of the targets and wait until that
target becomes active to drop balls in without having to aim and with minimal or no time delay.
If several robots are built, do they need to begin the round as a single robot which then separates into
multiple sub-robots? (E.g., a hive with worker bees.)
d) There are many acceptable answers to this question. Scoring should be based on whether it is
reasonably complete, whether a reasonable amount of effort was devoted to creating the Gantt chart,
and whether respondents adhered to Gantt chart conventions (see Figure 30.4).
e) There are many acceptable, design-dependent, responses to this question. Possibilities include:
Structural / chassis
Beacon sensing
Orientation
Navigation
Ball aiming
Ball dispensing
f) There are many acceptable answers to this question. Scoring should be based on whether it is
reasonably complete, whether a reasonable amount of effort was devoted to creating the morphological
chart, and whether respondents adhered to the conventions for morphological charts (see Figure 30.3).

Carryer, Ohline & Kenny

Copyright 2011

30-6

Solution Manual for Introduction to Mechatronic Design

30.11)

Do Not Circulate

For your mobile phone, answer the questions below. If you do not own a cell phone, borrow one and
explore its behavior to answer this question.
a) List the functions that your phone is able to perform.
b) From the list you generated to answer part a), identify the set of functions that you consider to
comprise the base level of functionality. What fraction of the phones total function is essential to
you?
a) There are many acceptable responses to this question, depending on which cell phone is used for the
answer. Possibilities include:
Voice communications (phone calls), text messaging, web surfing, email, instant messaging, media
player (MP3, video, still pictures), address book, games, camera, extras (calendar, alarms,
pedometer, task list, notes, sync, timer, stopwatch, calculator, pass
word saver), Bluetooth.
b) Again, individual responses will vary. One of many valid answers is:
Voice communications (phone calls), address book, text messaging.

30.12)

Create a Gantt chart that describes your career goals for the next 15 years. Be sure to include important
milestones.
Responses will vary widely, but in any event should be very interesting and illuminating to read. Evaluate
based on whether the question was responded to diligently, and whether Gantt chart conventions were
applied correctly.

Carryer, Ohline & Kenny

Copyright 2011

30-7

Solution Manual for Introduction to Mechatronic Design

Do Not Circulate

Chapter 31 Troubleshooting
31.1)

What is the first step in the troubleshooting process?


Identifying the problem.

31.2)

How is good troubleshooting like the scientific method?


You should start the process with a hypothesis about what you think is wrong, follow this with the design
of an experiment that will test the hypothesis, then carry out the experiment and evaluate the results against
the original hypothesis. Repeat as required to find and solve the problem.

31.3)

While troubleshooting, it is important to maintain a ____ ____. (two words)


Log Book

31.4)

When assembling a mechatronic system for the first time, the methodology should be I______ I______.
(two words each beginning with the letter I)
Incremental Integration

31.5)

Name at least 3 steps that you can take during the design/build phase that will make troubleshooting easier.
Build in debugging LEDs
Include debugging printf() statements in your code
Provide for electrical test points along a circuit path
Lay out the circuit to facilitate subsystem testing
Provide test harnesses to test individual software modules and small sets of modules

31.6)

What is the key aspect of the physical location of an adjustment potentiometer?


It must be accessible if it is to be adjusted.

31.7)

What is a service loop and what is its role in troubleshooting?


A service loop is an extra length of wire in a wiring harness, not necessary to the function of a device, that
allows the systems to be disassembled but remain connected for testing purposes.

31.8)

Describe some of the advantages of not troubleshooting alone.


Someone to bounce ideas off of
A check & balance against getting carried away or making rash decisions
Someone to help make sure that a sound methodology is followed
Extra eyes to observe what is happening

Carryer, Ohline & Kenny

Copyright 2011

31-1

Solution Manual for Introduction to Mechatronic Design

31.9)

Do Not Circulate

What kinds of things are more likely to happen while troubleshooting when you are extremely tired?
Reversed battery/power supply connections
Things broken due to rough handling
Failure to observe something important on an oscilloscope or other display
Failure to follow good debugging methodology
Failure to be careful and methodical
Neglecting to log the tests that you perform and their results in your log book

31.10)

True or False: It is possible to build a system that functions 100% correctly the first time that it is
assembled.
True, but in practice it is so rarely achieved that it should be considered impossible practically.

Carryer, Ohline & Kenny

Copyright 2011

31-2

Anda mungkin juga menyukai