electrical components and design - stanford...

32
ME 218 B – Team Finesse Ezra Schiff, Mike Rode, Mark Sherwood Electrical Components and Design 1) Constraints Several top level decisions were made to guide design and constructions of the electrical subsystems on the robot. These constraints are as follows: Due to the mechanical and software subsystems potentially lagging the electrical subsystem, work was to begin immediately constructing the circuit boards Two batteries would be incorporated, 1 for providing power to the motors, 1 for providing power to everything else Both the E128 and the C32 would be incorporated and use SPI communication The system would incorporate encoders to allow for tracking of motor shaft rotation. The encoders would not homemade using the coin sensors introduced in ME218A (not off the shelf parts) The electrical subsystems would be constructed on different circuit boards as much as possible. This was one for the following reasons: 1. Availability of small circuit boards from teaching staff 2. Modules could be detached and removed without taking down the entire robot 3. Presumed easier problem identification if modules were kept separate 4. Building circuits on different boards would provide the greatest amount of flexibility for mechanical design. Circuits could be physically integrated at the greatest number of spots on the robot. With the previous constraint in mind, solid models would be created of all circuit boards showing at the least all connection point and locations of integrated circuits. This would allow for integration during mechanical design and to avoid the “Christmas Tree Effect” (circuit boards looking like they are attached and dangling off the robot like ornaments on a Christmas tree) 2) Common Specifications Commons specifications for circuit board design were implemented to ensure consistency. All components will be soldered to the circuit boards (instead of wire wrapping). Where possible solder bridges will be used to make connections on the circuit board All sensors and communication wires will be connected to circuit boards by way of a header or a terminal. No connections that could not be detached and reattached will be allowed. With the exception of screw terminals, circuit boards will have the male header part and the wire attaching to it will have the female connection part. All integrated circuits will be connected to circuit boards by way of dip socket. All circuit boards would have a power rail and a ground rail. When implementing power and ground rails, the outside will be ground and the inside rail will be power With the key on top, and looking straight down on a header, pin 1 will always be the left most pin When boards have headers for multiple sensors of the same type corresponding to locations on the robot (such as right and left encoders), looking down the circuit board with the power header, with the key on the inside, the position of the header on the board will correspond to the location on the robot (the header for the right encoder will be on the right)

Upload: vanbao

Post on 16-May-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

ME 218 B – Team Finesse Ezra Schiff, Mike Rode, Mark Sherwood

Electrical Components and Design 1) Constraints

Several top level decisions were made to guide design and constructions of the electrical subsystems on the robot. These constraints are as follows: • Due to the mechanical and software subsystems potentially lagging the electrical

subsystem, work was to begin immediately constructing the circuit boards • Two batteries would be incorporated, 1 for providing power to the motors, 1 for

providing power to everything else • Both the E128 and the C32 would be incorporated and use SPI communication • The system would incorporate encoders to allow for tracking of motor shaft rotation.

The encoders would not homemade using the coin sensors introduced in ME218A (not off the shelf parts)

• The electrical subsystems would be constructed on different circuit boards as much as possible. This was one for the following reasons: 1. Availability of small circuit boards from teaching staff 2. Modules could be detached and removed without taking down the entire robot 3. Presumed easier problem identification if modules were kept separate 4. Building circuits on different boards would provide the greatest amount of

flexibility for mechanical design. Circuits could be physically integrated at the greatest number of spots on the robot.

• With the previous constraint in mind, solid models would be created of all circuit boards showing at the least all connection point and locations of integrated circuits. This would allow for integration during mechanical design and to avoid the “Christmas Tree Effect” (circuit boards looking like they are attached and dangling off the robot like ornaments on a Christmas tree)

2) Common Specifications

Commons specifications for circuit board design were implemented to ensure consistency. • All components will be soldered to the circuit boards (instead of wire wrapping).

Where possible solder bridges will be used to make connections on the circuit board • All sensors and communication wires will be connected to circuit boards by way of a

header or a terminal. No connections that could not be detached and reattached will be allowed. With the exception of screw terminals, circuit boards will have the male header part and the wire attaching to it will have the female connection part.

• All integrated circuits will be connected to circuit boards by way of dip socket. • All circuit boards would have a power rail and a ground rail. When implementing

power and ground rails, the outside will be ground and the inside rail will be power • With the key on top, and looking straight down on a header, pin 1 will always be the

left most pin • When boards have headers for multiple sensors of the same type corresponding to

locations on the robot (such as right and left encoders), looking down the circuit board with the power header, with the key on the inside, the position of the header on the board will correspond to the location on the robot (the header for the right encoder will be on the right)

Page 2: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

• The power header will be in the upper left hand corner when looking down on top of the robot.

• All headers will be keyed and the key will be pointed to the inside of the circuit board, with the exception of the power headers.

• All intra-board signals not made by a solder bridge will be made with 30 AWG wire

with the following exception: 1. The power module should use smaller gage wire (18 – 24) for power connections 2. The LED module should use a smaller gage wire for the connection from the LED

arrays to the grounding rail 3. The Ball Delivery module should use small gage wire for high amperage

connection (from L293B to snubber circuit) • LED (both visible and IR emitting) currents should be kept below 25 milliamps unless

justification is provided for a greater value • All ball delivery actuators must be drivable by a single L293B or L293E • 24 gage, twisted pair wire (the type available in the TA office) will be used for all

sensor and actuator connections. Connecting wires may be soldered directly to sensors and actuators. Heat Shrink will be used whenever a solder joint to a sensor or actuator is exposed. 1. As discussed in lecture 24 gage twisted pair wire will be sufficient to handle call

current draws, including drive motors, that will be seen on during the robot project.

• Molex KK©, 2.54mm (0.100”) pitch type headers (the ones available in the TA office), connectors and crimp terminals will be used exclusively. Note that the power headers on E128, C32 and the motor driver boards are the larger pitch type headers. The corresponding larger connectors will be incorporated on the power delivery cables but these will be the only exceptions. 1. The specifications for these headers lists the maximum current as 4.0 amps but

leaves it to the discretion of the designer with the statement:

Power Rail

Pin 1

Key

Header for Left Sensor Header for Right Sensor

Ground RailPower Header

Page 3: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Current is dependent on connector size, contact material, plating, ambient temperature, printed circuit board characteristics and related factors. Actual current rating is application dependent and should be evaluated for each application. Because of the availability and the easy integration with the selected circuit boards, these components were incorporated and found to be acceptable for this application, even when used in the power supply cable for the motors.

• All pull up and pull down resistors will be in the range of 2.2k ohm to 33k ohm, ¼ watt power dissipation. Resistors of this type have been shown to be acceptable for all applications that will be incorporated on the robot. The wide range will allow for the use of available resistors.

Page 4: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

3) Pin Out

a. Explanation The diagram illustrated in this section was constructed as a starting spot to ensure that every module had an available place on the C32 or the E128. This document proved very helpful when developing #define’s in the software and when debugging issue during system level integration testing. Of all the schematics this one proved to be the most useful.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:18:18 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Microcontrollers.SchDoc

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

U7

U6

T0

T1

T2

T3

T4

T5

T6

PE0

GND

U5

U4

U3

U2

U1

U0

E7

T7

E1

S2

S3

P2

P0

AD0

AD1

AD2

AD3

P5

P4

P3

P1

AD4

AD5

AD6

AD7

GND GND

GND GND

E128

GND

M2

M3

M4

M5

AD7

AD6

AD5

AD4

AD3

AD2

AD1

AD0

NCNC

E0

E1

T7

T6

T5

T4

T3

T2

T1

T0

M0

M1

GND

C32

E128 SPI PinsSS

SCK

GND

MOSI

MISO

+5

6900

C32 LED Array - 74C164, Pin 1 (data)

Beacon Detection Module - Duty Cycle

E128 LED Array - 74C164, Pin 1 (data)

Bump Sensor Module - Left Bump

PWM Right Motor

Direction Right Motor

PWM Left Motor

Direction Left Motor

Encoder Module - Right Encoder

Encoder Module - Left Encoder

Tape Sensor Module - Right

Tape Sensor Module - Left

Tape Sensor - End Line

Ball Detection Module - Ball Received

Ball Detection Module - Ball Delivered

Ball Detector Module - Ball Color

Beacon Detection Module - Left Tracking

Beacon Detection Module - Right Tracking

Ball Delivery Module - L293A Pin 7 (PWM Actuator 1)

Ball Delivery Module - L293A Pin 10 (PWM Actuator 2)

Ball Delivery Module - L293A, Pin 1 (Enable Actuator 1)

Ball Delivery Module - L293A, Pin 9 (Enable Actuator 2)

Ball Delivery Module - L293A, Pin 2 (Direction, Actuator 1)

Ball Delivery Module - L293A Pin 15 (Direction, Actuator 2)

E128 LED Array - 74C164, Pin 8 (clk)

E128 LED Array - 74C164, Pin 9 (clear)

Bump Sensor Module - Right Bump

C32 LED Array - 74C164, Pin 9 (Clear)

C32 LED Array - 74C164, Pin 8 (Clock)

Beacon Detection Module - Flash Detection

Error Flag - Right Motor

Error Flag - Left Motor

Figure 1: Pin out

c. Model N/A

d. Design Calculations See Communication Board Section for applicable calculations

Page 5: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

4) E128 and C32 Communication Boards

a. Explanation The communication boards were constructed to provide a single point where communication cables from modules and the two microcontroller could plug in. It was originally conceived as a single board but it proved impossible to fit the three necessary dip sockets in the available space. Shown in the schematic are the various headers connected to the associated pins on the C32 and E128.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:19:21 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Microcontrollers - Headers.SchDoc

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

U7

U6

T0

T1

T2

T3

T4

T5

T6

PE0

GND

U5

U4

U3

U2

U1

U0

E7

T7

E1

S2

S3

P2

P0

AD0

AD1

AD2

AD3

P5

P4

P3

P1

AD4

AD5

AD6

AD7

GND GND

GND GND

E128

GND

M2

M3

M4

M5

AD7

AD6

AD5

AD4

AD3

AD2

AD1

AD0

NCNC

E0

E1

T7

T6

T5

T4

T3

T2

T1

T0

M0

M1

GND

C32

6800

1 2 3 4 5 6

Header 6

Ball Delivery

1 2

Header 2

Encoders

1 2 3

Header 3

C32 LED Array\

12

Header 2

Power

123

Header 3Tape Sensors

123

Header 3Ball Detection

1 2

Header 2

Collision Detection

1 2 3

Header 3

LED Array E128

1234

Header 4Beacon Detection

12345

Header 5SPI Communication C32

E128 SPI PinsSS

SCK

GND

MOSI

MISO

12345

Connector

SPI Communication E128

1 2 3

Motor Controller Board - Right

1 2 3

Motor Controller Board - Left

6800 6800 6800 6800 6800 6800 12

Header 2

Power

SPI Communication Cable

CC32 Communication BoardE128 Communication Board

Figure 2: Schematic for Comunication Boards

c. Model

Page 6: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 3: E128 Communication Board

Figure 4: C32 Communication Board

d. Component Selection and Design Calculations

Power - +5V

E128 Ribbon

E128 Ribbon

Tape Sensors

Ball Detectors

IR / Flash

LED Array

Bump Sensors

Ball Delivery

Power - +5V

SPI Communication

Left Motor

Right Motor

Encoders

LED Array

Page 7: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Selection of Dip Sockets Used dip sockets available in TA office. Data sheets for similar items were consulted (Mill-Max connectors) and it was seen that the current rating is up to 3 amps. This is well below any of the current values that would be seen by these dip sockets. Selection of Headers See system specifications section. All currents flowing into or out of the C32 and E128 will be much less than the 4 amp limit. Selection of 6.8k Pull Down Resistors (C32 board) Meets system specifications. From the data sheet the worst case Vlow is 1.2 volts for the TLE-5206. The worst case input current in the low state is 10µA. Using the equation:

Ω===

800,610

*

RAIRIVµ

It is shown that the maximum voltage at the TLE-Pin in the low state will be 0.068 volts, well below the 1.2 volt worst case. The pull down resistor will be sufficient for ensuring the TLE-5206 registers a low. The power dissipated in the resistors is calculated with the following equations:

WPP

RIP

250.0800,6*00001.0

*2

2

<<=

=

P = I*V

And is much, much lower than the resistor limit of ¼ watt. Selection of 6.8k Pull Up Resistor (C32 board) This line is used to the tie the Slave Select line of the SPI communication module on the E128 high (making it the master). Assuming that there is some sort of buffer protecting the E128 from engineering students as long as the resistor level is within the system specifications (see system specifications section) it will function as intended.

Page 8: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging
Page 9: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

5) Power Module

a. Explanation The power module is intended to distribute power to all the electrical pieces of the robot. Two batteries are used for power with one battery supplying unregulated, assumed to be nominally 7.2 volts, to the drive motors and the motor module and the other battery supplying regulated 5volt power to the circuit board and unregulated, assumed nominal 7.2 volt power, to the C32 and the E128. There are two green indicator LEDs that are incorporate to provide a visual indicator that power is on. The design of the E-stop switch and circuitry was to keep from running a high current line all the way from the power module (assumed during design to be near the bottom of the robot, all the way to the top of the robot, where it was assumed the E-Stop would be mounted.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:21:05 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Battery_module_rev3.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

Battery 1Battery 1 - 7.2 V

12

LED - GREEN

390

VinVoutGND

LM7805 - 5 V Voltage Regulator

Battery 1Battery 2 - 7.2 V

12

LED - GREEN

390

12

Header 2Driver Motor - Right

12

Header 2Ball Delivery

12

Header 2C32 - COM

12

Header 2C32

12

Header 2E128

12

Header 2LED Array

12

Header 2Tape Sensors, Encoders, Collison

12

Header 2Ball Detectors

12

Header 2IR Detectors

12

Header 2

Battery 1

12

Header 2

Battery 2

12

Connecotr

Battery 1 Connector

12

Connector

Battery 2 Connector

12

Header 2Driver Motor - Left

12

Header 2E128 - COM

0.1uF 0.33uF

IRLZ34N

ILRZ34N

E STOP

10K

10K

1 2

1 2

E-Stop

Figure 5: Schematic for Power Module

c. Model

Page 10: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 6: Power Module

d. Component Selection and Design Calculations Selection of Batteries The batteries offered by the ME218B teaching staff were selected for use on the robot. During lecture it was said that this type of battery could supply enough current for what we would be doing. Since the teaching staff is considered an expert in the field no additional data gathering on the battery was done. Selection of Battery Terminals These were the only components available that would interface nicely with the battery cables which were offered with the batteries. Selection of Headers The headers met system specifications. The only headers which were of concern were the headers used for supplying power to the motor drivers. It was found empirically that these headers met the need despite being slightly outside of the current rating on the data sheet. Selection of LM7805

5V Regulated power to: • E128 Communication Board • C32 Communication Board • Tape / Encoder / Bump Module • IR / Flash Module • LED Array • Ball Detector

Power Terminals – motor battery LM7805 Voltage Regulator

IRLZ34N

E-Stop Button

Indicator LED

Unregulated (nominal 7.2 V) battery power to: • C32 • E128

Power Terminals – microcontroller / module power

Unregulated (nominal 7.2 V) battery power to:

• Right Motor • Left Motor • Ball Delivery Module

Page 11: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

After moving the higher current draws of the C32 and the E128 to unregulated power there was little concern that the 1 amp maximum from the LM7805 would be an issue. Adding up the current draws from each of the five modules powered by the 5 volts regulated power supply results in a current draw of around ¾ of an amp (please note that the LED module was never used in testing or in the final configuration so these values assume this module is not powered) Once concern about the LM7805 was that the data sheet calls out a needed 7.5 volts to maintain the 5 volt output. Since the battery was running at nominal 7.2 volt there was a risk the component would not work. Empirical data gathered by testing indicated it function down into the 6 volt levels without turning off. Since there was no intention to run the batteries that low the component was selected. Selection of Capacitors Application notes of LM7805 showed the proper values of capacitors to use. Selection of IRLZ34N The main consideration for the IRLN34N was ensuring that they could pass the high currents on the motor side. The data sheets indicate these components can take up to 30amps which is around twice the current expected to be passing through the transistor (max 15 amps when both motors stalled). The voltage drop across the transistor was evaluated with the maximum anticipated current. With an RDSon value of 0.034 ohms the max voltage drop across the component

voltsVR

AIRIV

DSon

5.0034.0

15*

max

=Ω=

==

Which meant that there would be a voltage drop of 0.5 when the motors were in a stall state, which would not be an issue.

Proper heat dissipation was another concern with the IRLZ34N. The component is rated up to 68 watts which is a lower than the

Page 12: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

VPVVAI

VIP

nom

5.75.0

15*

max

===

=

This is well below the specification.

Selection of 10k pull up resistor Pull up resistor value meets system specifications.

Selection of LED resistors Assuming a voltage drop of around 1.2 volts across the LED, the current when using a resistor of 390 ohms the current draw is:

AmpsIR

voltsvoltsVRVI

010.0390

2.15

=Ω=−=

=

Which meets the system specification of keeping the LED current draw under 25 milliamps.

Page 13: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

6) IR / Flash Module

a. Explanation The IR/Flash module was conceived as a unit that would be mounted near the top of the unit and provide interface between the sensors and the E128. These circuits were essentially the same as Lab 8, as the robot designed for that exercise were successful in detecting beacons and flashes. The module incorporates three beacon detecting circuits, configured as left, right and middle. The middle detector is responsible for delivering a digital signal that tracks the beacon duty cycle and frequency. This allows for the E128 to evaluate the duty cycle and determine where the robot is facing. On the E128 side the signal commands an interrupt that triggers anytime there is a transistion. This interrupt driven setup requires that the signal be crisp and completely digital. Because of this a comparator is necessary. The other two beacon detectors are set up to be read on an analog port. This allows for the robot to compare the two voltage readings to get an idea of which detector is more closely aligned with the beacon (higher voltage = better alignment). By attempting to keep the two voltage levels equal the robot can beacon track. The flash circuit is set up through the LM339 to give a digital signal to the E128.

b. Schematic

Page 14: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 10:22:24 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\IR_Sensors.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

LTR-3208E

LTR-3208ELTR-3208E

2

3

Op AmpLM324

2

36

47 Comparator

LM339

10KR5

100KR6

3.3KRpu

Vref 1

0.1uFCap

2.2KR1

2.2KR1

Vref 2

33KR1

10KR1

10KR1

Left IR Detector Right IR Detector Middle IR Detector

RIGHTLEFT

E128 PU Pin 0

E128 - PAD Pin 6

E128 - PAD Pin 5

1412

13

44

11

LM324AN

2

3

Op AmpLM324

47k

LTR-3208E

Flash Detector

10KR1

E128 - PT, Pin 7

1 2

Header 2

Power (Battery 2)

1234

Header 4

IR Detectors to E128

12

Connector

IR Sensor

12

Connector

IR Sensor

12

Connector

IR Sensor

12

Connector

IR Sensor

1 2

Header 2

Left IR

1 2

Header 2

Right IR

1 2

Header 2

Middle IR

12

Header 2

Flash

47k

47k

47k

47k

Figure 7: IR / Flash Detection Circuit

c. Model

Page 15: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

`

Figure 8: IR Module

d. Component Selection and Design Calculations Headers Met system specifications. No currents would be close to the 4 amp maximum rating DIP sockets No currents greater than 3 amps so the dip sockets should be fine LM324 This component was selected because this is the op-amp of choice in ME218. One of the ports was used to setup a virtual ground for the other op amp used in the beacon detection circuit. The driving voltage divider for the virtual ground is 2.5 volts.

Other calcultions

Power - +5V

LM324

LM339 To E128

Left Beacon Detector

Middle Beacon Detector

Right Beacon Detector

Flash Detector

Page 16: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

-IR Beacon frequency = 1250 Hz f = corner frequency (3dB point) C = 0.1 uF R = 1 / (2*pi*f*C) Set corner frequency below 1250 Hz. At fcorner = 1000, R = 1.6 kOhm Using R = 2.2 kOhm to ensure that 1250 Hz gets through. Comparator Threshold Voltages: R5 = 10 kOhm R6 = 100 kOhm (see schematic above) (2.5 – V+) / R5 = (V+ - 0) / R6 Vth = 2.27 V (5 – V+)/R6 = (V+ - 2.5) / R5 Vth = 2.72 V LM339 See above for the threshold voltages. The pull up resistor was a standard 3.3k value which was given as a rule of thumb value in class. 10k gain resistors on the left and right beacon detectors During testing these values were shown to provide a nice voltage level when used for tracking a beacon.

Page 17: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

7) Tape / Encoder / Bump Module

a. Explanation The Tape / Encoder / Bump module was intended to be a board that would be mounted near the bottom of the robot where it was assumed the encoders, tape sensors and bump sensors would all be located and then provide communication back to the C32 (encoders) and E128 (tape sensors and bump sensors). The Tape Sensors were used in Lab 8 with strong success. One additional challenge was having the ability to detect different color tape lines which was solved by adjusting the gain values on the op amps in the circuit. On the microcontroller side the signal from the tape sensors were read on A/D ports. The encoders were a simple coin sensor introduced during ME218A. The system would have a mechanical wheel with spokes that would rotate in some relationship to the motor shaft. The spokes would break the beam in the coin sensor and an encoder tick would be registered. This system called for an inverter that would provide a digital signal to the C32 so the signal could be tracked with an interrupt. Finally, the bump sensors were a direct carry over from ME218A with circuit for debouncing. Originally the thought was that additional bump sensors might be necessary to up the performance of the robot. In the end only one sensor was used for detecting the ball dispenser.

b. Schematics

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 10:23:12 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Tape Sensors.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:

A

Drawn By: *

2

311

LM324AN

5

672

LM324AN

810

9

3

LM324AN

1412

13

4

411

LM324AN

12

Tape Sensor

12

Tape Sensor

12

Tape Sensor

47k

47k

47k

390 390 390

E128 - PAD, Pin 0

E128 - PAD, Pin 1

E128 - PAD, Pin 2

123

Header 3Tape Sensor to E128

Right

Left

End

1234

Connecotr

Tape Sensor Connector

1234

Connector

Tape Sensor Connector

1234

Connector

Tape Sensor Connector

1234

Header 4

Tape Sensor 1

1234

Header 4

Tape Sensor 2

1234

Header 4

Tape Sensor 3

1 2

Header 2

Power (Battery 2)

10k

24k

10k

10k

10k

Figure 9: Tape Sensor Schematic

Page 18: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:22:03 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Encoders.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:

A

Drawn By: *

12

Break Beam / Coin Sensor

12

Break Beam / Coin Sensor

75

4.6k

75

4.6k

12

MC74HC14AN

12

MC74HC14AN

Right Encoder Left Encoder

C32 - PT, Pin 6

C32 - PT, Pin 7

1 2

Header 2

Power (Battery 2)

12

Header 2

Encoders to C32

1234

ConnectorCoin Sensor

1 2 3 4

Header 4

Coin Sensor Header

1234

ConnectorCoin Sensor

1 2 3 4

Header 4

Coin Sensor

Figure 10: Encoders Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:22:21 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Bump Sensors.SchDoc

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

12

MC74HC14AN

SW-SPST

10K

0.01microF

12

MC74HC14AN

SW-SPST

10K

0.01microF

Left BumpRight Bump

E128 - PU, Pin 4E128 - PU, Pin 5

1 2

Header 2

Power (Battery 2)

12

Header 2Bump Sensor to E128

12

Connector

12

Connector

1 2

Header 2

Switch

1 2

Header 2

Switch

Figure 11: Bump Sensors Schematic

c. Model

Page 19: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 12: Tape / Bump / Encoder Module

d. Component Selection and Design Calculations Headers Per system specs. Currents on this module should be much, much less than 4 amp rating on headers.

DIP Sockets Currents on this module should also be much, much less than the 3 amp ratings on the dip sockets. If the board gets anywhere near that the ICs will fry long before the DIP socket fails. LM324 OP amp of choice. The 4th op amp on the chip was used to set up a virtual ground for use with the other three amps. The virtual ground was set up to be 3.5 volts since this is the max voltage that can be achieved with the LM324 in the configuration we are using. This was accomplished with a simple voltage divider coming off the 5 volt source. The high side 10k ohm resistor was selected and then using the voltage divider equation:

Power - +5V

LM324

Bump SensorsTo E128

74HC14 To E128

Left Tape Sensor

Right Tape Sensor

Tape Sensor

To C32

Left Encoder

Right Encoder

Page 20: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

voltsVvoltsV

R

VRR

RV

in

out

inout

0.55.3000,101

21

2

==

Ω=+

=

R2 was solved to be 24k ohms. LM324 Gain Resistor The gain resistor on the LM324 was set incorrectly and required a rework. A value of 47k ohm was selected because that is what was used on Lab 8. Unfortunately, on Lab 8, the robot only detected a black line and ignored other line colors. For the final project the robot needed to be able to differentiate between different colors. In addition, the robot for the final project had the tape sensors much closer to the ground with and upper limit for adjustment. To rework the equation for resistances in parallel was used:

21

21

RRRRRtotal +

=

It was determined that gain resistance of around 10k ohm was desired. Using the above equation and R2 set at 47k ohm it was found that soldering a 10k resistor in parallel would yield a final resistance of 8.2k, which was fine for what we needed.

74HC14 At this point we had plenty of experience using the 74HC14 in conjunction with a break beam sensor and in conjunction with a switch. Coin Sensor The gain and current limiting resistors were selected based on the specifications on the data sheet for these components. The one problem was that the resistor selected for current limiting on the emitter (75 ohms) results in a current of 44mA going through the emitter. This was in violation of the system specifications but because the encoders were to be such an important component for the robot an exception was made.

Page 21: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

8) Ball Delivery Module

a. Explanation The ball delivery module was designed to drive two different actuators in two directions. At the time of design the ball delivery system for the robot was not designed. It was decided that incorporating an L293B motor driver with a simple snubbing circuit would give the greatest amount of flexibility. When selecting motors during the mechanical design we had to be very careful to select component that could be driven by the L293B.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:22:38 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Ball_Delivery.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

EN11

EN29

IN12

IN27

IN310

IN415 OUT1 3

OUT2 6

OUT3 11

OUT4 14

VC 8VCC 16

GND4

GND5

GND12

GND13

L293B

1N4935D1

1N4935D2

1N4935D3

1N4935D4

1N4935D5

1N4935D6

1N4935D7

1N4935D8

M M

6.8k6.8k6.8k

6.8k6.8k

6.8k

Actuator 1 Actuator 2

E128 - PT Pin 3 (PWM Actuator 1)E128 - PT, Pin 4 (PWM Actuator 2)

E128 - PT, Pin 0 (Enable Actuator 1)E128 - PT, Pin 1 (Enable Actuator 2)

E128 - PT, Pin 5 (Direction, Actuator 2)

E128 - PT Pin 2 (Direction, Actuator 1)1 2

Header 2

Power (battery 1)

12

ConnectorGate

12

ConnectorAgitator

1 2

Header 2

Agitator

1 2

Header 2

Gate

1 2 3 4 5 6

Header 6

Ball Delivery to E128

Figure 13: Ball Delivery Schematic

c. Model

Page 22: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 14: Ball Delivery Module

d. Component Selection and Design Calculations Headers Met system specifications. Assuming current levels are not too much for the L293B they will be handled by the header. DIP Socket As discussed in other areas the DIP sockets are thought to be able to handle up to three amps of current. Assuming the L293B is being run within its specifications then the current draw will not be an issue for the DIP sockets.

L293B From the data sheets (and what had been mentioned in class) the maximum output current was known to be 1 Amp. Since the L293B the motors for ball delivery were selected to not draw more than 1 amp of current when run at 7.2 volts.

Power – +7.2V, unregulated

L293B

To E128

Agitator Motor

Gate Motor

Page 23: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

The position of the ball delivery module in the robot allowed us to closely monitor its performance and it was found that the power dissipation through the component while running the motors was not making it hot. Therefore, no heat sink was added.

1N4935 Diode (snubbing) From the course reading it was known that there were two main factors in selecting a snubbing resistor:

• Switching time • Maximum current specification

The switching time was supposed to be as fast as possible. The course reader mentions that the type of resistors desired are usually labeled “fast recovery” or “ultra fast recovery”. It goes on to say a few hundred nanosecond or less are good candidates. Looking at the spec sheet for the 1N4935 it was found that the recovery time was listed at 150 ns. Good enough for this application. The maximum current for the diode needed to be greater than the motor stall current. The max current would be motor stall current which was known to be less than 1 Amp (because we did not burn out the L293B). The data sheet lists the maximum continuous current at 1 Amp so the 1N4935 met the need for this value as well. Selection of 6.8 kOhm Resistor (pull down) The exact configuration of the E128 protection board is unknown but we assumed that the input is put through a buffer / inverter of the HC family. In this case (assuming a 74HC04) the max low level input voltage is 1.35 volts with a current draw of 1µA. Using the following equation:

ampsvolts

R downpull 000001.035.1

_ =

It was found that any resistor value smaller than 1.35MΩ would be sufficient. The value of 6.8kΩ was selected because it was available and met the system specification for pull up and pull down resistors.

Page 24: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

9) Motor Drivers

a. Explanation This module was purchased from the teaching staff of ME218B. The unit incorporates a TLE-5206 which is allows for a higher current draw that other motor drivers that have been worked with in ME218. Two of these units, one of each motor, were used in the final robot.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:23:00 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Drive Motors.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

M M

Left Motor Right Motor

1 2

Connector

Motor 2

1 2

Connector

Motor 1

EF

IN1

IN2

GND

V

Out1

Out2

1 2Header 2

Power Header

12

Header 2

Motor Header

123

C32 Communication Header

C32 - Port T, Pin 0C32 - Port T, Pin 1C32 - Port T, Pin 2

470uF

0.1uF

EF

IN1

IN2

GND

V

Out1

Out2

1 2

Header 2

Power Header

12

Header 2

Motor Header

123

C32 Communication Header

C32 - Port T, Pin 3C32 - Port T, Pin 4C32 - Port T, Pin 5

470uF

0.1uF

Right Motor Controller

Left Motor Controller

c. Model

Page 25: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 15: Motor Drivers

d. Component Selection and Design Calculations This module was purchased “off-the-shelf” from the ME218B teaching staff. The required quiz was completed prior to integration. Because the teaching staff are considered expert in the field the module was trusted as delivered.

470 microfarad capacitor

To C32

Power - +7.2V Unregulated To Motors

TLE-5206

Page 26: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

10) LED Module

a. Explanation The LED arrays were conceived as a tool that could be used during debugging to output system status and error states. By using a shift register only three lines would be needed to control up to eight output lights. Since we had used this setup in our ME218A project it would be easy to get them up and running. In practice it turned out that it was not a problem to run the communication cable through the rafters back to the computer. This allowed for communication by printing directly to the computer terminal rather than decoding a series of lights. In the end the LED arrays were not used for testing or in the final device.

b. Schematic

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:23:19 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\LED_Arrays.SCHDOC

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

OE11

A12

A24

A36

A48 Y4 12Y3 14Y2 16Y1 18

Y8 3Y7 5Y6 7Y5 9

GND10

A511

A613

A715

A817

OE219 VCC 20

MM74HC244N

390 390 390 390 390 390 390 390

CLR9

CLK8

A1

B2 QA 3

QB 4

QC 5

QD 6

QE 10

QF 11

QG 12

QH 13

VCC 14

GND7

MM74C164N

Shift Register 1

E128 - PU, Pin 3E128 - PU, Pin 2

E128 - PU, Pin 1

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

12

LED

OE11

A12

A24

A36

A48 Y4 12Y3 14Y2 16Y1 18

Y8 3Y7 5Y6 7Y5 9

GND10

A511

A613

A715

A817

OE219 VCC 20

MM74HC244N

390 390 390 390 390 390 390 390

CLR9

CLK8

A1

B2 QA 3

QB 4

QC 5

QD 6

QE 10

QF 11

QG 12

QH 13

VCC 14

GND7

MM74C164N

Shift Register 1

C32 - PAD, Pin 5C32 - PAD, Pin 6

C32 - PAD, Pin7

C32 LED Array

E128 LED Array

123

Header 3LED Array - C32

123

Header 3LED Array - E128

1 2

Header 2

Power (battery 2)

c. Model

Page 27: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 16: LED Module

d. Component Selection and Design Calculations Headers Met system specifications DIP Sockets Used the DIP sockets available in the teaching assistant room. A similar component from Mill-Max specifies a max current of 3 amps. The small current signals in this circuit are no where near 3 amps.

LED Arrays These LED arrays were purchased with the lab kits for ME218B. We selected them because they were available, compact and free. Buffers These were the same buffers used in Lab 6 as an indicator panel to represent motor speed visually. There were two main concerns:

Power - +5V

To C32

LED Array

Buffers - MM74C244N

LED Array

To E128

Shift Registers - MM74C164N

Page 28: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

1) The buffers could source enough current to drive the LEDs 2) The buffers will interface correctly with the shift register (ie, the buffers will not draw too much current when input is high, or source too much current when the input is low) The buffer, worst case can source up to 14 milliamps. As will be shown in the calculation for the current limiting resistor for the LED the current draw for each LED is less than 14 milliamps (~10). The shift register can source up to 1.75mA while the buffer will draw only up to 1.0µA. In addition the shift register can sink up to 1.75mA when the output is low. The buffer will source at worst case 1.0µA when the input is low. The shift register and buffer pair will work fine together. Shift Registers These shift registers were used in our groups ME218A final project so it was known they would interface with the C32 and E128 properly. See the discussion in the buffer section for interface with the MM74C244N. 390 Ohm Current Limiting Resistors Assuming a voltage drop of around 1.2 volts across the LED, the current when using a resistor of 390 ohms the current draw is:

AmpsIR

voltsvoltsVRVI

010.0390

2.15

=Ω=−=

=

Which meets the system specification of keeping the LED current draw under 25 milliamps. This also meets the minimum current requirements for the buffer as well.

Page 29: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

11) Ball Detection Module

a. Explanation The ball detection module was originally conceived as a system that would detect when a ball had been detected, when a ball had been dispensed and to detect the color of a ball. The ball receipt and ejection was to be a simple break beam setup while the ball color detection was to be done with a tape sensor. About half was through the project the idea of detecting ball color was scrapped so the extra tape sensor, and the circuit to support it was thrown out. As the mechanical design matured it became evident that detecting when a ball had been collected or dispensed would not be necessary thanks to a large, open hopper design. At the same time another challenge was presenting itself. The robot fit in a 12”x12” space, but exactly, so getting out of a corner might be nearly impossible. At this time the ball detectors were reconceived as wall sensors where the IR light from the emitter could be detected by the detector when close to a wall. The bottom of the robot was also redone to be circular which proved to be enough to deal with the issue. This meant that in the end the ball detection module was not used at all on the final robot.

b. Schematic

Page 30: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

1

1

2

2

3

3

4

4

D D

C C

B B

A A

Smart Product Design Lab201 ThorntonStanford UniversityStanford, CA94305-40213/13/2008 3:23:30 PM

U:\_TeamFolders\MikeMarkEzra\218B_Project\Schematics\Rev 2\Ball_Detector.SchDoc

Title

Size: Number:

Date:File:

Revision:

Sheet ofTime:A

Drawn By: *

12

MC74HC14AN

Ball Delivery Detector

LTR - 3208E 12

LTE-5208A

3.3k

47k

1 2

MC74HC14AN

Ball Collection Detector

E128 - PP, Pin 3E128 - PP, Pin 1

1234

ConnectorIR Emitter / Detector Combo

1 2 3 4

Header 4

IR Detector / Emitter Combo

1 2 3

Header 3

Ball Detection to E128

1 2

Header 2

Power (battery 2)

LTR - 3208E 12

LTE-5208A

1234

ConnectorIR Emitter / Detector Combo

1 2 3 4

Header 4

IR Detector / Emitter Combo

3.3k

47k

c. Model

Page 31: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

Figure 17: Ball Detection Module

d. Component Selection and Design Calculations 74HC14 inverter These components were used heavily in the ME218A project so our group was very familiar with them. The main concern was that the positive going threshold voltage was achieved with the emitter collector pair when the detector was seeing IR light. In the absolute worst case this voltage needs to be 3.15 volts. With the gain resistor associated with the phototransistor set as high as it is, there will be little problem achieving this minimum voltage level. Headers Met system specs DIP sockets As discussed in other section, rated up to 3amps, nothing on this board was even close. 47k gain resistors for IR Detectors The 47k resistor guarantees that the input the 74HC14 inverter sees the full 4.6 volts available (0.4 volts drop across the detector when fully saturated) even when only a little light is hitting it. The detector on state collector current is 2 milliamps.

Power - +5V74HC14

Break Beam

Break Beam

To E128

LM324 – not actually implemented

Tape sensor – not used

Page 32: Electrical Components and Design - Stanford Universitydesign.stanford.edu/.../0708/finesse/p/Electrical_Design.pdf• Due to the mechanical and software subsystems potentially lagging

voltsVRI

RIV

6.447000

002.0*

>>Ω=

==

3.3k current limiting resistors for IR emitters In order to keep the IR from flooding the robot, and potentially interfering with the robot on the other field, the current was limited very heavily. The current drop across the emitters is nominally 1.2 volts:

AmpsIR

voltsvoltsVRVI

001.0300,3

2.15

=Ω=−=

=

0.001 A drive current was significantly less than the values used on the data sheet for the emitter. However, it was determined empirically that this value resulted in a break beam sensor that would work reliable up to about two inches from the detector pair.