SMART PRODUCT DESIGN
Transcript of SMART PRODUCT DESIGN
3/8/2010 ME 8243 LECTURE NOTES 3
Resources
• http://microchip.com/• http://ww1.microchip.com/downloads/en/DeviceDoc/39630C.pdf
3/8/2010 ME 8243 LECTURE NOTES 4
PICmicro ARCHITECTURE
Ref: “Architecture - PICmicro Mid-Range MCU Family “
3/8/2010 ME 8243 LECTURE NOTES 12
Instruction Cycle
• 1 instruction cycle = 4 oscillator cycles• If 4 MHz oscillator, 1 instruction per
microsecond
3/8/2010 ME 8243 LECTURE NOTES 13
'16F88 Clock Choices
• 8 MHz, 4 MHz, 2 MHz, 1 MHz, 500 KHz, 250 KHz, 125 KHz
Challenge Question:Why not always go at 8 MHz?
3/8/2010 ME 8243 LECTURE NOTES 16
Use TMR1 for Sample Clock
• 16 bit (65536)• Count up• Flag or interrupt for FFFF to 0000 transition• Ticks every instruction cycle (every 4
oscillator cycles)– If 8 MHz oscillator, ticks every 0.5 uS– 0.5 x 65536 = 32.768 mS
• Prescaler for slower ticks– 1, 2, 4, 8
3/8/2010 ME 8243 LECTURE NOTES 19
Sampling Clock Example
• Sensor sampling at 100 Hz• T = 10.00 mS• 8 MHz oscillator, 0.5 uS ticks• 10.00 mS = 20,000 ticks• 65536 – 20000 = 45546, load this into
TMR1
3/8/2010 ME 8243 LECTURE NOTES 20
CCS Code#define BASECOUNT 45536setup_timer_1(T1_INTERNAL | T1_DIV_BY_1);set_timer1(BASECOUNT)enable_interrupts(INT_RTCC);enable_interrupts(GLOBAL);
#int_timer1void timer1_isr(void){
set_timer1(BASECOUNT); ...sample data...
}
3/8/2010 ME 8243 LECTURE NOTES 33
Feedback Control System
Σ
SENSOR
SYSTEM
+
-
OUTPUTINPUT eCONTROLLER
3/8/2010 ME 8243 LECTURE NOTES 38
Digital algorithm structure
Sample 10-20 times faster than desired closed-loop bandwidth
Need fast computation engine for rapid control. Fast multiply/add.
2413121 *** −−− +++= kkkkk ukukekeku
k k ke r y= −
1 1 2( , , , , , )k k k k ku f e e u u− − −= ⋯ ⋯
error
sample k
control
3/8/2010 ME 8243 LECTURE NOTES 42
Pseudo Codeinit
k1 = kp + kd/Tk2 = kd/Tk3 = ki*Tem1 = 0setclock(period)startclock()
while (TRUE) {waitfortick()r = getinput()y = getoutput()e = r – yie = ie + eif (ie > iemax) ie = iemaxif (ie < -iemax) ie = -iemaxu = k1*e – k2*em1 + k3*ieif (u > umax) u = umaxif (u < -umax) u = -umaxsendcmd(u)em1 = e
See Dlab code for example
3/8/2010 ME 8243 LECTURE NOTES 45
Search
• uspto.gov• Google Patents
• Search by class• Read the claims• Keywords may not be obvious
Tips
3/8/2010 ME 8243 LECTURE NOTES 46
IP Steps
• Invention disclosure• Provision Patent Application• Utility Patent Application• Issued Patent
http://www.research.umn.edu/techcomm/index.htm
http://www.uspto.gov/web/offices/pac/provapp.htm
3/8/2010 ME 8243 LECTURE NOTES 47
A PRACTICAL INTRODUCTION TO WIRELESS COMMUNICATION
FOR SMART PRODUCTS
3/8/2010 ME 8243 LECTURE NOTES 48
Key Specifications
• Transmission distance• Power required (Xmt & Rcv)• Uni or bidirectional• Data rate (bits or bytes per sec)• Error rate (reliability)• Antenna logistics• Communication band• Physical size• Ease of use• Cost
RADIORADIO
3/8/2010 ME 8243 LECTURE NOTES 49
Main Types
• RF (radio frequency)• Infrared• Light beam• Ultrasound
3/8/2010 ME 8243 LECTURE NOTES 50
Networks
• Single path– 1-way– 2-way
• Multiple nodes– Star– Bus– Ring– Mesh
RADIORADIO RADIORADIORADIORADIO
Wikipedia: Network Topologies
3/8/2010 ME 8243 LECTURE NOTES 51
Infrared• Lowest cost wireless• Line of sight• 40 KHz modulated signal• Data protocol varies by
manufacturer• Control your device with a TV
remote
Sharp GP1UM28YK00F
www.sbprojects.com/knowledge/ir/ir.htm
users.telenet.be/davshomepage/
en.wikipedia.org/wiki/Consumer_IR
3/8/2010 ME 8243 LECTURE NOTES 52
RF Wireless• Industrial, scientific and medical (ISM) radio bands
– Cordless phones, RFID tags, Bluetooth, Zigbee, WiFi– No license if low-power
• Wireless link without protocol• Wireless link with protocol
– Wi-Fi (802.11)• High data rate, high power• Full-scale, Local Area Network (LAN)• Setup and configuration takes computational horsepower
– Bluetooth (802.15.1)• Short range, lower power• 2.4 GHz, 1 Mb/s• Class 1: 100 mW, 300 ft; Class 2: 2.5 mW, 30 ft, Class 3: 1 mW, 3 ft• Part of Wireless Personal Area Networks (WPAN)• For connecting peripherals (“the wireless serial port”), “pairing”
– Zigbee (802.15.4)• Short range, low power, low cost applications• 2.4 GHz, 250 Kb/s• Star or mesh networks, self-organizing• WPAN applications
– Ultra-wideband• High data rate, time-of-flight measures
– RFID• Very short range, passive tag, low data rate
3/8/2010 ME 8243 LECTURE NOTES 54
Digital Coding
• Amplitude-shift keying (ASK)– Absence of carrier = 0, carrier
= 1– Also called OOSK (On-Off Shift
Keying), OOK (On-Off Keying) and CPCA (Carrier-Present Carrier-Absent)
– Low cost, low power, low data rate, poor noise immunity
• Frequency-shift keying (FSK)– Space frequency = 1, mark
frequency = 0– Higher data rate, better noise
immunity, higher power, higher cost
Linx AN 130
3/8/2010 ME 8243 LECTURE NOTES 57
Error Detection
• Parity Check– Add all the 1’s, determine if sum even or odd,
check against parity bit– Example: data = 10101010, send = 101010101,
receive = 001010101, error so discard– Can’t catch dual errors
• Checksum– Add all bytes in the data frame, send sum as final
checksum byte
• Cyclic Redundancy Check– Like checksum but more reliable
Ref: Linx AN 160
3/8/2010 ME 8243 LECTURE NOTES 60
315, 418, 433.92 MHz Transmitter/Receiver Pairs
• Serial at 2400, 4800 baud
• One-way• No error checking, no
protocol• ASK transmission• Simple and low cost• laipac.com via
sparkfun.com
3/8/2010 ME 8243 LECTURE NOTES 61
Linx LT Series Transceiver
• 315, 418, 433 MHz
• 3,000 ft• Two-way
• Transmit 12 mA, receive 6.1 mA
Parallax 433 MHz Transceiver(Linx TRM-433-LT)1200-9600 bps250 ft.Transmit 12 mA, receive 6.1 mA$40
3/8/2010 ME 8243 LECTURE NOTES 62
Linx Transmitter/Receiver With Encoder/Decoder
• 315, 418, 433 Mhz
• 8 switch channels• 3,000 ft
• 1.5 mA transmit
3/8/2010 ME 8243 LECTURE NOTES 65
TI MSP430 + Radio
• MSP430 low-power microcontroller
• CC2500 RF transceiver– 2.4 GHz ISM band– 250 Kbps– RCV 18 mA– XMT 21 mA
• $50
3/8/2010 ME 8243 LECTURE NOTES 66
Microchip MRF24J40 Radio
• 2.4 GHz• 802.15.4 compliant• ZigBee, MiWi (Microchip simplified
802.15.4)
Microchip.com
3/8/2010 ME 8243 LECTURE NOTES 67
Comparing RF Solutions
50
35
6.1
3.5
RCV Power (ma)
45
65
12
11
XMTPower (ma)
WiFi
$38100250KXBee(Parallax)
Zigbee
$683302MRN41 (Sparkfun)
Bluetooth
$34
($80)
2509600Linx LT series (Parallax)
Plain Link
$105004800Laipacseries
Plain Link
Cost per link
Distance (ft)
Data Rate (bps)
ProductTechnology
3/8/2010 ME 8243 LECTURE NOTES 68
Implementation Tips
• Look for solutions that appear as a serial port on the application side
• For testing, transmit a counter and monitor the received data
• FCC regulations – See “FCC Regulation Guide” at
linxtechnologies.com
3/8/2010 ME 8243 LECTURE NOTES 69
References
• Linx Technologies App Notes– 100, RF 101 Information for the RF Challenged
– 160, Considerations For Sending Data Over a Wireless Link– 130, Modulation Techniques For Low-Cost RF Data Links
– 500, Antennas: Design, Application, and Performance
www.linxtechnologies.com