University Programs Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

University Programs Knowledge Base

Labels

Discussions

Sort by:
  Overview: The NXP Cup is a global competition where student teams build, program, and race a model car around a track for speed. The fastest car to complete the track without derailing, wins. The creation of this autonomous car requires: Embedded software programming and basic circuit creation using NXP parts included in the entry kit Students to create motor control hardware and software to propel and steer their intelligent car Students must also interface to a camera to navigate the car through the race course by following the guide line. This competition lends itself well to use in senior design/capstone project courses.  The contest time frame can fit within the average 3-4 month semester.  Most development work can be done easily within that timeline. History: The NXP Cup Challenge is a collaborative, competitive, and hands-on way for students to learn about embedded systems and control. The NXP Cup, formerly known as the Smart Car Race began in 2003 in Korea at Hanyang University hosting 80 teams of students. Since that time the competition has spread to China, India, Malaysia, Latin America, North America, and most recently Europe in 2012, impacting more than 500 schools and 15,000 students a year. In 2010 it took the name of the Freescale Cup followed by NXP Cup after the most recent merger in December 2015.
View full article
TFC2015 UCDavis Team The One Final Report Thanks for sharing Lance Halste
View full article
The TRK-MPC560xB: MPC560xB StarterTRAK (Development Kit) is a Freescale evaluation board powered by the qorivva chip. The Qorivva microcontrollers family is a set of 32 bit Power Architecture chips. Which Chip do you have? The chipset mounted on the boards for the Freescale Cup can vary. Always validate your chipset to know it's full capabilities. MPC560xB Product Information Page Difference Highlights: 5604B = 512MB Code Flash; no DMA 5606B = 1MB Code Flash; Has 16-Channel DMA 5607B = 1.5Mb Code Flash; Has 16-Channel DMA TRK-MPC5604B Hardware Setup There are several main hardware configuration steps. After installing the battery, once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. TRK-MPC5604B Hardware Setup Instructions Lectures: The Freescale Cup – Lecture 5: MPC5607B Overview Overview Slides from lecture Overview Slides from Lecture (PDF) other Lectures from the Freescale Cup Lecture Series Other Qorivva Tutorials: qorivva-blink-led qorivva-drive-dc-motor qorivva-turn-a-servo qorivva-line-scan-camera Board Tips Important Documents TRK-MPC5604B User's Manual TRK-MPC5604BQuick Reference Guide TRK-MPC5604B Schematics Reference manual External Links TRK-MPC5604B Webpage [Qorivva Freescale Hosted Kinetis Discussion Forum] [ ???? Community Website]
View full article
This article serves you as an introduction of Kinetis TWR K40 microcontroller. At the end of this part, you shall be able to answer some basic questions such as: what is Kinetis K40, and what is a Tower System. 2. Kinetis K40 32-bit Kinetis MCUs represent the most scalable portfolio of ARM® Cortex™-M4 MCUs in the industry. Enabled by innovative 90nm Thin Film Storage (TFS) flash technology with unique FlexMemory (configurable embedded EEPROM), Kinetis features the latest low-power innovations and high performance, high precision mixed-signal capability. For the Freescale Cup Challenge, we have provided several tutorials, example code and projects based on the twr-k40x256-kit. This board is part of the Freescale tower-system, a modular, reusable development platform that allows engineers to quickly prototype new designs. The K40 chip is a 144 pin package with 512KB of Flash, 245Kb of Program Flash, 4KB of EEProm, and 64KB of SRAM.      Important Documents:           Kinetis K40 Reference Manual           Besides the Reference manual and the Datasheet, the most useful document for learning to program the K40 chip is the:           Kinetis Peripheral Module Quick Reference           Data sheet           Errata      External Links           Freescale's Kinetis K40 Product Page (You can find all the information you want about Kinetis K40 over here) 3. TWR-K40X256 Kit The TWR-K40X256 Kit is a Freescale evaluation board powered by the Kinetis K40 microcontroller. The Kinetis microcontroller family is a set of 32 bit ARM Cortex M4 chips which feature flexible storage, lower power usage, high performance and optional Floating Point Unit with many useful peripherals. For more information on the Kinetis family see Freescale's Kinetis website. The Tower System is a prototyping platform with interchangeable and reusable modules along with open source design files. Freescale K40 MCU Tower Module: TWR K40X256 Hardware Setup There are several main hardware configuration steps. After installing the battery, once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. TWR K40X246 Hardware Setup Instructions Board Tips The TWR-K40X256 features a socket that can accept a variety of different Tower Plug-in modules featuring sensors, RF transceivers, and more. The General Purpose TWRPI socket provides access to I2C, SPI, IRQs, GPIOs, timers, analog conversion signals, TWRPI ID signals, reset, and voltage supplies. The pinout for the TWRPI Socket is defined in Table 3 of the TWR-K40X256 User's Manual, but the user manual does not describe how to order a connector. A Samtec connector, part number: SFC-110-T2-L-D-A is the proper female mating connector for the TWR-K40X256 TWRPI socket. SIDE A/SIDE B White DOTS for counting Pins Solder Wire to GND, and to MCU VDD Pin for testing purposes      Important Documents           TWR-K40X256 User's Manual           TWR-K40X256 Schematics      External Links           TWR-K40X256-KIT Webpage           Kinetis Discussion Forum           Tower Geeks Community Website           Tower Geeks Freescale Cup Group .
View full article
Model provided by the Mathworks Academic support team to manage wide angle lenses on the default Freescale Cup car camera.
View full article
Instructions There are several main hardware configuration steps. Once the USB cable has been connected between the evaluation board and PC, it may be necessary to update the chip firmware which requires moving a jumper pin on the evaluation board. Then, connect one end of the USB cable to the PC and the other end to the Power/OSJTAG mini-B connector on the TWRK60N512 module. Allow the PC to automatically configure the USB drivers if needed. Before updating the firmware, it is necessary to start a CodeWarrior Project. In this case, the easiest way to do this is to actually navigate to the sample project and click on the Sample.mcp file. This will open CodeWarior 2.8. Selection Project->Build Configurations->MK40X256VMD100_INTERNAL_FLASH Project-»Build All Run->Debug Configurations—> Use the Codewarrior download Filter and Select "PROJECTNAME_MK40XD256VMD100_INTERNAL_FLASH_PnE_OSJTAG" Additional step is required if the firmware is out of date: Firmware Upgrade Instructions (if needed)   Firmware may change after an evaluation board has been manufactured and shipped. As a result, an alert will be displayed during the first attempt to download software to the board. Follow the instructions carefully. 1.     Unplug the USB cable.   2.     Look for the jumper (On the REV B Board) labeled "OSBDM_IRQ" - it is jumper 35. It will be found between the on/off switch and to the right of the the white "Lin" connectors. Remove one of the "LED Enable" jumpers for this if you don't have a   header jumper handy and put the jumper on the OSBDM_IRQ header These LED Jumpers are just above the blue potentiometer knob and marked as "J27."   3.    Reconnect the USB cable and click OK.   4.     Wait for the new firmware to download. 5.     A new dialog will appear when the process is complete.  6.    Unplug the cable, remove the jumper, return it to the location it was "borrowed from" and reconnect the cable. 7.    Then click OK.
View full article
There are several programs on the market which are freely available. Below is a list of the more popular [free] ones.  Eagle PCB 123
View full article
This document is addressed to the participants and visitors that will join us for The Freescale Cup 2015 Worldwide Finals 2015 The Freescale Cup 2015 Worldwide Finals will be held on 14-15 September 2015 at the Fraunhofer Institute for Integrated Circuits (Fraunhofer IIS) in Erlangen, Germany. Full address is: Fraunhofer IIS Am Wolfsmantel 33 91058 Erlangen Germany Google Maps location The attendees official guide is now online at https://community.nxp.com/docs/DOC-106164 Agenda of the event for the participants (subject to change): Sunday September 13th: Arrival at Hotels Get together in the evening (approximate time 18:00) at A&O Hostel Monday September 14th: 8:30: Departure from Hotel for City Tour 11:30: Prepare for departure for Fraunhofer IIS 12:00: Buses depart for Fraunhofer IIS 13:00: Lunch 14:00: Opening session 15:00: Start of Practice 17:30: High School and Innovation Challenge Demos 18:00: End of Practice - Start of the evening event 21:00: End of evening event - boarding buses for return to hotel Tuesday September 15th: 8:00: Buses depart for Fraunhofer IIS 9:00: Practice 13:00: Technical Inspection & Lunch 14:30: Final Race 16:00: Awards Ceremony 17:30: Buses depart for Awards Dinner 20:30: Buses depart for Hotel The event will be presented via LiveCast by the Fraunhofer IIS. URL is http://www2.iis.fraunhofer.de/freescale/  Hotel information: Students Hotel: Nuremberg Hostel - Stay at the A&O Hostel & Hotel Nuremberg  Google Maps Location Professors and Press Hotel: NH Nürnberg City Center hotel in Nuremberg Bahnhofstr. 17-19 | NH Hotel Group Google Maps Location Freescale will cover the cost of travel, accommodation and meals for the event for all Freescale Cup qualified teams and one faculty advisor per the rules in place. For Visa invitation letters, please contact marion.thierry@freescale.com or flavio.stiffan@freescale.com Travel booking will be organized by your regional Freescale University Program contact. Please have your faculty advisor get in touch with them for more information
View full article
Pulse-width modulation (PWM), is a technique utilized in robotics for controlling motors and servos. Through the use of internal counters, the microcontroller modulates the duty cycle of a square wave to control the amount of power delivered to a device. The Duty Cycle referes to the porportion of time the square wave is 'on' as compared to the repeating signal period. The higher the duty cycle the higher the power carried in the signal. Duty cycle is expressed as a percentage of time the signal is 'on', with 100% being consistently on.  overview-create-a-pwm-signal Once you feel comfortable that you understand the concepts behind a duty cycle signal, return to Reference Manual: Timer Information portion of the Drive A DC Motor Tutorial
View full article
Official rules of the Global Freescale Cup! New in 2014 - Roll-out of leagues: Depending on region there will now be three leagues.  The Global race will only be stock league vehicles. Stock League - Racing using approved components, less customization allowed Custom League - Racing with less restrictions and custom hardware Innovation League - More than just racing.  Complete an objective or task to score points and win. Notes You can view this document in PDF format using the Action Menu bar. This rule set is for the Worldwide challenge.  Find your regional rules here The Worldwide challenge is only open to the stock (unmodified) challengers at this time. If you have ANY questions about these rules, post them in the comments section below.  If you have questions about regional rules, ask in your regional group. Section 1: Team Requirements A regional championship team must run a “stock” (unmodified) league to qualify. Four person maximum team size. A team may have only one graduate student. Cars will be designed and constructed by students ONLY.  Participants, advisers, and audience are expected to exhibit good sportsmanship. Any inappropriate behavior or cheating may result in disqualification. Section 2: Event Registration Entrants into the worldwide challenge are by invitation only. One invitation is extended to each regional champion team. One person from the regional champion team must register the entire team for the worldwide challenge within two weeks after the conclusion of the regional final.  Section 3: Equipment Requirements Each team shall use the same basic kit of parts as described below.  The following requirements are in place to keep the playing field level.  You must use one of the approved controller and motor driver boards.  If any standard component of the car model is damaged, then the same replacement component should be used. Mechanical The original and unaltered equipment must be used in the entry.  Outer tire treads and rim Drive - DC motors Transmission Ratio of Drive Motor Servo Motor Allowed modifications and restrictions: You may not change the wheel base (distance between wheels) No part of the car shall exceed dimensions of 250mm/9.85in (W) x 400mm/15.75in (L)x 305mm/12in.(H) You may drill holes and mount auxiliary pieces on the chassis assuming it is contained within the above dimensions. You may change the orientation of the servo motor and related linkages. You may add a "skin" to the car but it must be removable during inspection. You may adjust or remove springs, linkages, and other non-essential pieces. You may adhere the tread to the rim.   Electrical Battery (purchase separately) 7.2V, <=3000mAh, rechargeable NiCd or NiMH  Only one (1) battery at a time may be used to power the vehicle and any attached hardware You must use one of the approved boards below to control your car. Control System FRDM- series of boards The FRDM-KL25Z is included but not mandatory to use. TRK- series Kinetis based TWR- series High Voltage Motor Control and Interface TFC-SHIELD The TFC-SHIELD is included but not mandatory to use. The Dual Motor Control Board from Landzo technologies. Allowed modifications and restrictions: One processor - No auxiliary processor or other programmable device is allowed.  The car must use a optical sensor to navigate DC-DC boost circuit may not exceed battery voltage. Total capacity of all capacitors should not exceed 2000 uF. Sensor Limits You may use additional cameras.  Maximum of sixteen (16) sensors Examples of sensor count:  IR Transmitter/Receiver pair is 1 sensor A CCD sensor is 1 sensor The provided Line Scan Camera is 1 sensor A hall effect sensor on two rear wheels is 2 sensors An encoder mounted on one wheel is 1 sensor A display (is allowed) does not count as a sensor Section 4: Vehicle Inspection Before the race, the judges will perform a technical inspection of all entries. This includes vehicle specifications, dimensions, and equipment requirements listed in Section 3. All cars must be placed in the Inspection area on or before the designated time. Once in the Inspection Area, you may not touch car until you are called to race! In the event of any violations, the organizing committee may disqualify the corresponding team. Section 5: Timed Race Procedure Race order will be determined by a random drawing. When your team is called you may remove your car  from inspection area.  You will have two (2) minutes to prepare the car. Approved Adjustments - You may: Configure parameters via on-board interfaces. (Switches, Knobs, etc.) Alter the angle of your camera Change batteries  Disallowed Adjustments -You may not: Reprogram your processor Configure parameters via wired or wireless communications. There shall be only one team member on the track at any given time. (excludes testing times) Before the 2 minute expires you must signal “Ready” to the referee before starting car. After the referee confirms “Ready”, the vehicle should leave the starting area within 30 seconds. Teams have THREE attempts to complete ONE lap.  The FIRST (not the best) completed time will be recorded. Example: Attempt 1 – Vehicle goes to fast around a curve and goes off track.  Time is not recorded. Attempt 2 – Vehicle makes it around track successfully.  Time is recorded. Attempt 3 – Is forfeit because FIRST time (Attempt 2) has been recorded. After each attempt you have two minutes to make approved (see above) adjustments to vehicle. After the attempts, the team shall return the vehicle to inspection area. Event displays will post the times after each team races. Section 6: Race Day Schedule Practice Time - Prior to final race, a test track will be available. Final calibration may be made at this time.  This will be organized with team slots and/or “free-time”.   2. Reconfigure practice track to final track. Vehicle Inspection (see section 4) Timed Race Awards Ceremony Section 7: Event Personnel Organizing committee – A committee of senior judges and Freescale event organizers.  Will coordinate event day activities and mediate and resolve any disputes. Referees -  Responsible for on-track activities. This includes race track management such as starting and stopping vehicles, as well as timing and scorekeeping. Comprise up of of faculty, student, and/or Freescale and industry employees. Judges  - Interpret and enforce rule compliance.  This will be comprised of Freescale employees and members of contributing industry sponsors. Event Personnel shall not aid any one specific team. Communication shall be open to all teams and shall not disclose any information that might compromise the fairness of the competition. Section 8: Fouls, Failure and Disqualifications The rules will be interpreted by Freescale and the organizing committee of the event.             Foul, is a minor infraction, which results in time penalties. Failure, results in the current attempt time not being recorded. Subsequent attempts are allowed. Disqualification is a major infraction which results all times not being recorded. Referee will determine whether the racing car ran out of the race track and assign time penalties. Any of the following conditions will be considered a foul and will result in time penalty added: The race car fails to leave the starting area within 30 seconds after beginning of the race [+1 second]. The race car fails to stop 2 meters/6 feet or leaves the track after crossing the finish line [+1 second]. Any of the following conditions will be considered a failure and no time will be given: Three or more wheels leave the race surface. The racing team fails to get prepared for the attempt within the two (2) minutes allotment. The player touches the race car after the technical inspection without consent of the referee. The race car fails to finish within 120 seconds after leaving the starting area. Touching the car at any time between start and finish. "Start" - Once the vehicle crosses the starting line. "Finish" - Once the vehicle crosses the finish line. Any of the following conditions will be considered a disqualification:   Any off track equipment or behavior that may influence or impede cars.   Doing a Disallowed Modification anytime after Inspection. More than one team member in the playing field. Any cheating during the competition. Failure to pass the technical inspection. Equality and fairness will be ensured as much as possible on the condition of actual feasibility.  Disputes will be resolved by a vote of Freescale, members of the organizing committee, and judges. Section 9: Timing/Scoring Time will be captured using an electronic gate and/or handheld timer. Time starts and ends when the first part of the racing car breaks the start/finish line. Fouls will result in the time addition to the car’s lap time. Disqualifications and Failures will result in no score. Section 10: Parameters of the Racing Track A test track made from the same material as the final track will be made available on the day prior to the final race for calibration and design modifications. The actual layout of the final racing track will be unknown to competitors until competition day. Width of the racing track shall not be less than 600mm/23.65in. Material and dimensional specifications can be found on the community. Surface of the racing track is matte white, with a continuous black line (25mm/1in wide) on each edge of the track. The racing track can intersect with a crossing angle of 90°. The racing track can have inclines, declines,  and tunnels. The rules and conditions are subject to change by Freescale if necessary. Freescale reserves the right in their sole discretion to cancel, suspend and/or modify The Freescale Cup race at any time. These official rules are drawn up in the English language. If these official rules are provided in any other language and there is a conflict in the text, the English language text shall prevail. Freescale and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc. in the U.S. and other countries. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2014
View full article
Recommend accessories or post your own designs.  For the community by the community! Add your contributions in the comments section below.  As I filter through them I will move them up into this main document, so it is easier to browse. TFC Camera Mounts Designed by Wave Number Print these on demand via Shapeways.com Base Board Hinge Two Position Tower Elevator TWR-ELEV-2 — Wavenumber LLC - Link to the Store
View full article
CW_MERGE_PROJECTS.wmv
View full article
2013 Global Freescale Cup Participant: Malaysia Car Specs: -Freescale Freedom FRDM-KL25Z
View full article
Lecture 1: Introduction and Motor Basics  This training module presented by Professor L. Umanand of CEDT, Indian Institute of Science, Bangalore provides an overview of the Freescale Cup – 2011. It introduces to the challenge describing the various components of the intelligent car tracker. Lecture 2: Pulse Width Modulation  This lecture provides an overview of Pulse Width Modulation Lecture 3: Control Design  This lecture describes controller design and PID control Lecture 4: Speed and Position  This Lecture discusses integrating your PID with sensor data Lecture 5: MPC5607B Overview  This training module provides an overview of the 32-bit Qorivva MPC5607B Processor. The course is targeted towards beginners in order to enable them to quick start the development of software on the MPC5607B.
View full article
Depending on which MCU Devlopment board you have chosen, you will need to figure out a way to mount this to the chassis. I have seen everything from cardboard, to aluminum, to wood. Below is a template complete with CAD drawings to mount the Qorivva TRK-MPC5604B board and the Motor Board onto the chassis. We use plexiglass for ours, but any other millable material is appropriate. The large hole in the middle is for cables from the servo. We attach the board to the car using the plastic standoffs (you will need them 55 mm long, so in our case, we used the combination of 40 + 15 mm) - see an example (SOS code 10260). To attach both the processor and interface boards the simillar 5mm plastic standoffs were used. Preview (.pdf) CAD file (.dxf)
View full article
Features General Tower card Form Factor Connections to allow use with a TRK-MPC5604B Board Camera Interfaces 1. 5-pin header to connect directly to Freescale Line Scan Camera 2. Header for 2nd linescan camera (optional) 3. RCA Camera Interface. Includes an LMH1981 Sync Extraction chip and connectors to MCU to allow for low resolution (32x32) decoding of signals Servo Outputs 3-pin Header to connector directly to steering Servo 1 Extra Servo header. Power Accepts direct Battery Power – Onboard Switching regulator 5-18v Tower Card will source power to other tower modules. All circuitry except for motor controller can be optionally powered over USB Connector Battery Input and motor Outputs will be a Tyco (TE Connectivity) TE Connectivity Screw Terminal http://search.digikey.com/us/en/products/1776275-2/A98036-ND/1826899 Motor Driver 2x MC33887APVW : Dual, Independent 5A Motor Driving Circuit Supports forward, reverse and braking. Current Feedback to MCU ADC to allow for closed loop torque control Programming Integrated Kinetis MK20DN512ZVLL10MCU with OSJTAG Can be used stand-alone or be used as a peripheral in the tower system. Additional I/O Extra signals from K40 routed to tower edge card connector. Signals for H-bridge, camera and servo can be routed to Tower Edge connector to be driven by another MCU card. Each can be disconnected via jumper. - We will need to crosscheck the signals to all other CPU modules. Would it be easier to just have a version that doesn't have the K40 populated and OSJTAG populated? Also, we may not need jumpers. Simply configure the Kinets I/O to inputs. Some basic I/O for debugging. 4-poistion DIP Switch + 4 LEDs. Inputs for Tach Signal/Speed Sensor Design Files Rev Alpha Schematics (Sent to MyRO on 4.4.2012) - Includes 3d view Assembly Prints (For Reference) PCB Fabrication Notes Bill of Materials Rev A Errata: Pins 4 & 5 for the camera (Gnd and +3.3v) got swapped on the PCB. You will need to swap the wires in the cable. You can pop the contacts out of the connector housing with tweezers. POT0 has a jumper wire to pin 26 (ADC1_SE18 . This was done to put all signals *except* the NTSC video onto ADC1 to simplify software. Future versions will have this change in the artwork Some components interfere with the tower connector. It can be mated to about 95%. Will work fine. Future versions will fix this issue Rev Beta Schematics, Assembly Prints, BOM, etc. - Includes 3d view Rev B Errata: None known! Google Code repository for the Example Code: https://code.google.com/p/tfc-twr/ This code works with Rev B of the board (and Rev A). All major interfaces & peripherals have been tested. At some point we will make a video going through the code. By default the Linescan camera code is enabled. The code in Main.c is pretty easy to follow. There is also code for the NTSC camera but must enabled in the TFC_Config.h file via a pre-processor directive. There is also code used for teh OSTAG interface, Labview demo applications and drivers for the USB Pictures Just verified the OSJTAG. Test Project to blink the battery LED's was downloaded into the K20 Videos Testing the Servo circuits….. Testing the pots, servos, H-bridges and K20 USB port Linescan Camera Bringup with Labview NTSC Camera Bringup with Labview 1.) This is a basic demo of an NTSC camera being brought in using the a Combo of the ADC, port interrupts and DMA transfers. 2.) I *ahem* overclock the ADC to 24MHz to get some extra resolution for a 64x64 pixel image (the first 6 columns are junk as they contain color burst data*) 3.) I decimate the images to a few frames per second to send over the WIFI (the booster pack card I made) to a Labview program. The Kinetis can bring the data in a the same frame rate of the camera, I just need to send much slower as there is some overhead in my communications scheme (ASCII text) and the WIFI is driven via a UART. 4.) In reality, I can get a 64 x 480 pixel image in memory as I pull in all the lines. I just decimate the rows to get a 64x64 result on the labview display. 5.) DMA does most of the work freeing up the CPU to do algorithms in the foreground.
View full article
First and foremost, be creative!! Below are just a few inspirational ideas. Option #1 - I cut-down (miter saw) a 4-position TWR-ELEVATOR to make this 2-position design. With the intent of having two boards mounted 1) TWR-PROTO and 2) MCU of choice (K40). If cutting PCB's with power tools is not your thing, you can buy a 2-position Tower Elevator here: http://wavenumber.net/twr-elev-2/ I just marked the holes on the back supportand drilled holes into the TWR-PROTO, a few stand-offs and viola! Option #2 - This option requires the removal of the rear spring. I am not sure how much value that spring honestly provides since most of the track is nice and flat. If you have a newer TWR-ELEVATOR you usually find some way to mount it to the screw holes with some form of L-Bracket. If you have an older TWR-ELEVATOR you can drill a hole in the Secondary Elevator (less PCB traces to worry about) and then mount it to the chassis with a L-Bracket. Option #3 - Check out this gallery of images: https://plus.google.com/u/0/photos/106056936857240793028/albums/5598207628299505201
View full article
Getting Started with the Freescale Cup How to achieve the goal of creating an autonomous vehicle that quickly navigates around a track? Before continuing with this tutorial, students should take the time to choose which Freescale Microcontroller your team is going to use. The Introduction to Freescale Cup Training article has some details about how to choose your microcontroller. Although the concepts and end results are similar no matter which microcontroller you decide to utilize, much of the software implementation details will differ. What is a Microcontroller? For information on what a microcontroller is head to the microcontrollers article. Getting Started - Learn to Program a microcontroller First off, you are going to need to know C programming. For a crash-course head to c-programming-for-embedded-systems. The classic first application to learn how to program a microcontroller is to get through the process of Blinking an LED. This wiki contains a tutorial for each of the Cup microprocessors which simplifies the process of setting up the evaluation board, installing the Integrated Development Environment, and programming the board with a simple set of software which blinks a LED. The Blink a LED tutorial is the first of 4 tutorials designed to familiarize students with the process of designing a cup car. These four tutorials will introduce students to many of the fundamentals of robotics, the software used to control the locomotion and sensors on an autonomous line following vehicle, and provide example code which help simplify the process of creating a competitive entry in the Freescale Cup. Here is an outline of the Basic Microcontroller Programming Tutorial: Read the microcontroller article Choose a microcontroller Set up the development environment Set up the microcontroller evaluation board Program A LED move to the next tutorial…
View full article
The line scan camera module consists of a CMOS linear sensor array of 128 pixels and an adjustable lens. This camera has a 1x128 resolution. Line Scan Camera Board Details Schematics, BOM, and datasheets: Line Scan Camera featuring TAOS 1401 Mounting Options You will likely want to mount the camera on a mast or boom above the car to ensure the greatest field of view. Determining the angle of orientation about the pivot at the top of the boom will change the “look ahead” distance of the camera and enable more efficient steering algorithms DIY Camera Mounts Solution Overview One method of implementation is to take the entire readout of the camera and store it in the memory. Then a line detection algorithm can be used to locate the position of the black line. Due to varying lighting conditions, some level of pixel thresholding may be necessary as the intensity differences across the data may not always produce a clear indication of the line location. A good approach is to use an algorithm that looks for changes in the magnitude of voltage from one portion of the array to another, since the camera’s AO magnitude is directly related to the brightness the pixel array senses. If the microcontroller finds a significant decrease in magnitude followed by large increase in magnitude this would give us a good indication of the location of the line. For this a derivative function can be utilized. Once we have successfully determined the position of the black line, immediately adjust the wheels to adjust the direction of the car so that the black line will remain in the center of the camera’s view. Sample camera output (for illustrative purposes only) The camera outputs an analog signal from 0 to 5V depending on the grey-scale value of the image. to simplify our sample we will assume that we have set limits for the line and have transformed the data to digital bits using a threshold value. 0’s are high intensity (non-line locations), 1’s are low intensity (black or line locations) 10000000000000000000000000000000001111101000000000000000000010000000000000000 Since the camera provides a 128x1 bit picture, and the camera will be pointing down at the track which is a fixed width. A control algorithm should be developed to line up the 1’s in the center of the 128 bits. The center of the field of view will be require calibration and testing, but it is assumed that the camera will remain in a fixed location pointing down the center of the forward looking axis of rotation. Signals For normal operation of the camera, the following signals must be produced and processed: CK (clock) - latches SI and clocks pixels out (low to high) continuous signal SI (serial input to sensor) begins a scan / exposure discrete pulses, pulse must go low before rising edge of next clock pulse AO (analog output) - Analog pixel input from the sensor (0-Vdd) or or tri-stated The CK and SI signals are simple ON/OFF signals which can be produce using a GPIO Pin, setting the pin high and low corresponding to the desired exposure time of the camera. The only other requirement is to read the Analog Output of the camera which requires the initialization of the Analog Module and setting it to the proper pinout. Acutal camera output image: Yellow = SI, Green = Camera Signal, Purple = clock More camera waveforms and information (Power Point) available here This link shows a video of the camera connected to the oscilloscope http://www.youtube.com/watch?v=YOAd3ERnXiQ To obtain this signal, connect channel 1, 2 and 3 of an oscilloscope to the SI pulse (Trigger off this signal), CLK, and AO signals. Timing The timing for creation and read of the signals is crucial and is detailed in the diagram below. This information can also be found in the Line Scan Datasheet. Analog Read: The Analog Output (AO) signal from the camera needs to be processed and read by the microcontroller's Analog to Digital Converter (ADC). This ADC device converts a continuous signal into a discrete number which is proportional to the signal voltage. An 8 bit ADC has 256 discrete levels (2^8). If a analog signal between 0 and 5 volts is sampled, a digital discrete number of 0 would correspond to zero volts, and a digital discrete number of 255 would correspond to 5 volts. A number such as 145w would correspond to about 2.8 volts. The maximum signal sample rate is limited by the microcontroller. Proper configuration of the ADC peripheral and the multiplexer of the chip will configure a pin to read in an analog signal when calling the function. More details on analog to digital converters can be found on the wikipedia site here. Read/Write In write mode, the GPIO pin can be set, cleared, or toggled via software initiated register settings. Microcontroller Reference Manual: Analog to Digital Converter You will find high level information about GPIO usage in several different areas of a reference manual. See the reference-manual article for more general information. Relevant Chapters: (see GPIO chapters for clock and SI Creation) Introduction: System Modules: System Integration Modules (SIM) - provides system control and chip configuration registers Chip Configuration: Signal Multiplexing: Port control and interrupts Focusing the camera: Once the sensor is perfectly working the next step is to find the best position of the lens that will generate the clearest images. The best way to do it is using an oscilloscope: Connect the SI and AO signals to the oscilloscope Set the SI pulse so that it can be clearly seen and then trig the AO signal with the SI signal using the trig function Fix the camera looking at a sheet of paper with a black line in the center The image of the black line will appear on the oscilloscope screen Screw the camera until you find the position where the line seems the clearest Camera Circuit   5 wires must be connected ground power SI CLK AO Camera Limitations   According to the datasheet:   " The sensor consists of 128 photodiodes arranged in a linear array. Light energy impinging on a photodiode generates photocurrent, which is integrated by the active integration circuitry associated with that pixel. During the intergration period, a sampling capacitor connects to the output of the integrator through an analog swith. The amount of charge accumulated at each pixel is directly proportional to the light intensity and the integration time." Integration Time: T T = (1/fmax)*(n-18)pixels + 20us, where n is the number of pixels Minimum integration time: 33.75us Maximum integration time: capacitors will saturate if exceeding 100ms frequency range 5 Khz - 8 Mhz (8 Mhz is fmax in equation above) The integration time is the following: It occurs between the 19th CLK cycle and the next SI pulse. The CLK frequency itself has little to do with the integration time. One each rising edge, the clock outputs one of the previously sampled intensity values. This means that integration time should be set by varying the time between SI pulses, not changing the clock frequency. Make the CLK frequency high, and have as much time as needed between the two SI pulses to obtain the desired intensity value. Pro Tips: #1 - Avoid Light Noise Light can be transmitted through the pcb on the back of the camera. This unwanted extra light shining on the CMOS linear sensor can induce significant errors into your signals received. A shroud or housing for the camera unit can easily eliminate this problem. One of the easiest solutions is to place a piece of electrical tape across the back of the camera in the highlighted area indicated in the picture below. #2 - Know your Settings When testing the car on the track or transporting it, it is not uncommon for the focus on the camera to loosen or change. Therefore it is recommended that after adjusting your camera focus for maximum performance you make mark (ex. metallic sharpie) between the lens and its body so you can realign the camera lens to it's proper position easily if it does shift. #3 - Know your Zone When hooking up the linescan camera, regardless of position or focus there is a drop off at each end of the image data. This is easily viewed with an oscilloscope. This effect is undesirable, particularly when you are finding your line position utilizing a derivative approach. These fallouts cause erroneous derivative values, and hence a poor line position solution. Two solutions we found useful were: (1) Ignoring the first 10-15 pixels and last 10-15 pixels of the image data array, and then determining the line position; (2) Often when making decisions in the code as to where the line was at it was found useful to use a threshold value for the difference in the derivative position, and secondly a binary threshold on the camera data. Note that the falloff depends on camera focus, position, etc. Therefore, these threshold values and pixels in which to ignore are relative to a specific instance. The problem however is common to the camera. #4 - Buffer Data Since the camera can read the line very quickly while the servo can only update every 20ms, there are multiple camera reads before the servo can update, if you are reading the camera fast and then overriding without saving them in some form then those camera reads are being wasted and are better off not having occurred. What can help is to create some sort of filter by bringing new values into an array with previous values and preforming some sort of averaging. The following code will take the new line position value and place it in a 1xA array where A is defined by CAMERA_AVG. NO AVERAGING IS OCCURRING HERE all that is happening is the camera values are being saved in a simple array, what is done with them is up to you. The way this works is that it shifts the entire array so the oldest data point is discarded in order to make room for the new line position at the other end of the array. It will only adds the new value if there is one available if not it copies the previous first position value to the new first position value. CAMERA_AVG => an integer value for how long the averaging length will occur gfpLineAverage => global floating point array of camera center line values fpLinePos => returned from read camera this is the center line position ReadCamera() => is the read camera function call returns a floating point value of fpLinePos // this will shift the values up and throw away the oldest value // then add a new reading for (i=CAMERA_AVG;i>0;i—) { gfpLineAverage[i]=gfpLineAverage[i-1]; } // if no line was detected the previous camera value will be passed on if (fpLinePos=ReadCamera()) { gfpLineAverage[0]= fpLinePos; } For example an array of of center line position values ranging from 0-127 could look like. Initial values [51 50 52 54 58 55] New position of 45 read [45 51 50 52 54 58] New position of 44 read [44 45 51 50 52 58] No value read [44 44 45 51 50 52] No value read [44 44 44 45 51 50] New position of 50 read [50 44 44 44 45 51] Program Exercise Specifics of how to configure the K40 ADC, to create the delay code is covered in the K40: Line Scan Camera Tutorial. Additional Training Resources Freescale Motor Control Tutorial Freescale Lecture 1: Introduction and Motor Basics Freescale Lecture 2: Pulse Width Modulaiton Freescale Lecture 3: Control Design Freesacle Lecture 4: Speed and Position Freescale Lecture 5: MPC5607B Overview Additional Resources Freescale app note on interfacing with a linescan camera Freescale app note on interfacing with an RCA camera
View full article
There are three types of memory in a typical Micrcontroller  FLASH - where your programs are stored RAM - for manipulating variables during runtime EEPROM - stores long term information
View full article