1 / 18

CET 360 Smart Car Steering

CET 360 Smart Car Steering. Team: “TBD” Lead: Tyler Wilt Hardware: Tom Kowalski Software: Daniel Meighan Assistant: Zach Rockwell. Outline. Problem Statement / Theory Hardware System Overview Components Software ColdFire MCF51JM128 Functionality

shiela
Télécharger la présentation

CET 360 Smart Car Steering

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. CET 360Smart Car Steering Team: “TBD” Lead: Tyler Wilt Hardware: Tom Kowalski Software: Daniel Meighan Assistant: Zach Rockwell

  2. Outline • Problem Statement / Theory • Hardware • System Overview • Components • Software • ColdFire MCF51JM128 Functionality • Required registers and C Code • Q & A

  3. Problem Statement Steering - Mechanism used in guiding a vehicle to a desired position through the manipulation of wheels

  4. Problem Statement • Take input from line-sensing array to determine degree of wheel turn needed Firebird-32 Steering servo motor

  5. Steering Output • Steering output signal will be in the form of a pulse using the on-board Timer/PWM Module and a corresponding port pin ColdFire Firebird32

  6. Hardware Futaba FUTM 0043

  7. Hardware – Servo Motor • Standard High Torque Analog Servo Motor • Power Supply: between 4.8V and 7.4V DC • Capable of drawing up to 2 Amps • Striving for 1 to 2 millisecond signal pulse to avoid linkage problems Futaba FUTM0043

  8. Hardware - Linkage

  9. Hardware – Coldfire Timer / PWM Module • Up to 8 separate channels • Channels can be set as input capture, output compare, or edge aligned PWM • We will be utilizing the edge aligned PWM mode of operation

  10. Hardware – TPM Location • PWM outputs can be configured at locations: - TPM1 • Port F: CH 2-5 • Port E: CH 0-1 - TPM2 • Port F: CH 0-1

  11. Hardware - Servo Connection • Black - Ground • Red - Power • White - Input Signal

  12. Software - Registers • 16-bit Modulo Register (plus 1) sets the period for the PWM output signal • (TPMxMODH:TPMxMODL) • Channel Value Register sets the duty cycle of the PWM output signal • (TPMxCnVH:TPMxCnVL) • The time between the modulus register overflow and the output compare of the value register is the pulse width (duty cycle).

  13. Software – Pulse Width • Pulse width will ideally stay between 1 and 2 milliseconds • Pulse width for center position will vary slightly between each individual servo motor

  14. MCG Initialization • voidMCGinit() • { • MCGC1 = 0x1c; // set RDIV = 12MHz/8 = 1.5MHz • MCGC2 = 0x64; // BDIV=2, enable ExtRef and Hi Range • MCGC3 = 0x48; // select PLL source and VDIV= x32 • // VCO is now going to 48 MHz • MCGC1_IREFS = 0; // turn off IREFS • while (!MCGSC_LOCK) {} // wait for OSC initialization to complete • // MCGOUT=24Mhz, Busclk=12MHz • } • voidinitalizeMCU() • { MCGinit(); • // I/O initialize • PTFDD |= PTFDD_PTFDD4_MASK;; // make PTF4 an output port • // initialize MCG module to use external crystal • PTFDD = 7; • SOPT1_COPT = 0; //disable COP • SOPT2_CLKOUT_EN = 1; • // RTC initialize • RTCSC = 0x08; // 1ms period from 1kHz clock • RTCMOD = 9; // RTIF every 10ms

  15. TPM Initialzation • // TPM1 initialization • TPM1SC = &00100000 // select bus clock • + 2; // divide by-4 (12MHz / 4 = 3MHz) • // configure TPM2 for servo output pulse • TPM2SC = TPM2SC_CLKSA_MASK // select bus clock • + 2; // divide by 4 prescaler (3MHz) • TPM2MOD = 3*20000 - 1; // set period to 20ms (50Hz) • // set channel 0 to high-true edge-aligned PWM mode (output on PTF4) • TPM2C0SC = 00000110 // PWM mode • + TPM2C0SC_ELS0B_MASK; // high-true output pulse • TPM2C0V = 3 * 1500; // 1500us = servo pulse width • EnableInterrupts; • }

  16. Summary • Problem Statement / Theory • Hardware • System Overview • Components • Software • ColdFire MCF51JM128 Functionality • Required registers and C Code

  17. References • MCF51JM128 ColdFire Integrated Microcontroller Reference Manual. 2. Freescale Semiconductor, Inc., 2009. Web.<http://www.aet.calu.edu/ftp/cet/360/resources/Coldfire/MCF51JM128-RefManual-v2.pdf>. • Sumey, Jeff. “CET Microprocessor Engineering.” California University of Pennsylvania. Web. 25 Feb 2014. <http://aet.calu.edu/~jsumey>. • “Futaba Analog Servos.” Web. 25 Feb 2014. <http://www.futaba-rc.com/servos/analog.html>.

  18. Questions?

More Related