1 / 21

Operating on Engineers

Operating on Engineers. Five surgeons were taking a coffee break and were discussing their work. The first said, "I think accountants are the easiest to operate on. You open them up and everything inside is numbered.“

trent
Download Presentation

Operating on Engineers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating on Engineers Five surgeons were taking a coffee break and were discussing their work. The first said, "I think accountants are the easiest to operate on. You open them up and everything inside is numbered.“ The second said, "I think librarians are the easiest to operate on. You open them up and everything inside is in alphabetical order.“ The third said, "I like to operate on electricians. You open them up and everything inside is color-coded.“ The fourth one said, "I like to operate on lawyers. They're heartless spineless, gutless, and their heads and their ass are interchangeable.“ The fifth surgeon says "I like engineers . They always understand when you have a few parts left over at the end."

  2. Servomotor Speed Measurement Microprocessor Interfacing

  3. Overview • Background • Tasks • Prelab – Frequency-to-Voltage Converter Design • Task 1 Speed to Voltage Characteristics • Task 2 Step Response • Task 3 Speed Display

  4. Magnetism Permanent Magnet Electromagnet

  5. Two-Pole DC Motor Electromagnet Permanent Magnets

  6. DC Servomotor Motor Input Tachometer Output Surplus 5 ¼ inch full-height floppy disk spindle drive motor

  7. Tachometer Output N = 120•f/P P = 16 N = 7.5•f

  8. Prelab: LM2907 – 8-Pin DIP • Select proper values for I2  180 uA @ 3.3 VDC • R1 • R2 • C2 • In Task 1 select proper values for • Ra • Rb • So that Ra + Rb  10 kΩ • Place electrolytic cap across +5 VCC to GND on PICTail Plus to quite supply Some groups have N-8 (8 pin DIP) package and other groups have N (14 pin DIP) package

  9. Task 1: Speed to Voltage Characteristics1 Saturation N = 120f/P = 7.5•f 1 October 2005

  10. DEC2HEX Worksheet Function 1. Open Add-Ins 2. Select Analysis ToolPak

  11. Task 2: Step Response 1/A • Use Voltage Cursor to find 63% • Use Time Cursor to find 1/A

  12. Task 2 • Record Motor Number • Accurate measurement of A important to next laboratory exercise • Accurate measurement of B important to next laboratory exercise

  13. Task 3 • Read Speed on AN3/RB3 • Connect RB3 to LM2907 Pin 4 • Add to initADC(0x03) if not already there • TRISBbits.TRISB3=1; • ADC1PCFGbits.PCFG3=0; • Initialize PMP and then LCD for channel 3 • initLCD(0) so there is no cursor

  14. 1234 RPM Task 3: Speed Display • printf(“. . . . . RPM\r”); • printf(“%04d\r”); • Use write function in peripherals.c that reacts properly to ‘\r’ • printf uses 2048 bytes of heap (see linker)

  15. Write unsigned int write(int handle, void *buffer, unsigned int len){ int cnt; char ch; static unsigned char virtualCursor=0x80; switch(handle){ case 0: //standard-in not yet implemented len=0; break;

  16. Write case 1: //standard out for(cnt=len;cnt >0; --cnt){ ch=*((char *)buffer++); switch(ch) { case '\n' : // if the virtualCursor less than 0x90, then set // virtualCursor to 0xC0 //else virctualCursor is 0x80. //send virtualCursor to display break;

  17. Write case '\t' : //use bit manipulation to force virtualCursor to every fourth // position //send virtualCursor to display break; case '\v' : //use bit manipulation to force virtualCursor up or down // a line, whichever is appropriate //send virtualCursor to display break;

  18. Write case '\b' //if virtualCursor is at start of first line, then set // virtualCursor to 0x80 //else if virtualCursor is at start of second line, then set // virtualCursor to 0xC0; //else subtract one from virtualCursor, send virtualCursor to // display, sent blank character to display, again send // virtualCursor to display. break;

  19. Write case '\r' //use bit manipulation to force virtualCursor to start or // current line //send virtualCursor to display break; case '\f' : //clear LCD and set virtualCursor to 0x80 break; default : //increment virtualCursor and send character to display; } }

  20. Write break; case 2: //standard error not yet implemented len = 0; break; default: len = 0; } return(len); }

  21. Bit Manipulation • AND – No Change or Clear • OR – No Change or Set • NOT – Invert • XOR – No Change or Toggle

More Related