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 FRDM-TFC is a convenient "shield" that can drive up to two DC motors (5A per channel), two servos and I/O for the Freescale cup line scan camera and Hall effect sensors.  This board mates with the KL25Z Freedom board for primary usage with a Freescale Cup car. Features: 2 channel Motor Driver ICs (MC33887APVW) 2 channel servo Outputs Dual Linescan Camera interfaces Two inputs for speed sensors Two potentiometers for user functions Two push buttons for user functions 4 Position DIP Switch for user function 4 LEDs (green) for battery indicator or user functions Design Files Rev A is attached to this document. Rev B is attached to this document Code Examples Codewarrior "Bare Metal" Example Code: All Codewarrior based code examples for the FRDM-TFC are hosted on in a Subversion repository on Google Code: frdm-tfc -   Example code for the FRDM-TFC Shield - Google Project Hosting You can check out the code with your favorite SVN client.   Static releases are available in the attachments section of this page.  The current release is "R1.0" mbed.org Example Code: https://mbed.org/components/Freescale-Cup-with-FRDM-KL25Z/ Videos FRDM TFC EXAMPLE CODE GETTING STARTED FRDM-TFC_DEMO 0 and 1 FRDM-TFC_DEMO 2 and 3
View full article
Welcome to the NXP Cup!  The following pages are designed to introduce students to the concepts of robotics and the components of the NXP Cup Car. Programming microcontrollers is challenging, and the content here is developed to facilitate the process of becoming a successful embedded programmer. General Information Marketplace Special offers from our Global Sponsors History of the NXP Cup Where to buy a racetrack? Mathworks Support for The NXP Cup Race Track Information Community created accessories FAQ's Assembly Directions Keil Software Offer Rules Cameras Regulations Teams' Technical Reports Hardware Concepts Embedded Systems Concepts Real world usage (Practical) Line Scan Camera MCU 101 Tutorials Kinetis FRDM-KL25Z Servo Motor NXP Cup related video series by Prof. Eli Hughes https://community.nxp.com/docs/DOC-1096 Drive (DC) Motors MathWorks basic model for using wide angle lenses on The NXP Cup Car The NXP Cup Technical Reports https://community.nxp.com/docs/DOC-1283 Motor Driver (H-Bridge) https://community.nxp.com/docs/DOC-1057 Battery New Supply location for NXP Cup kits and replacement parts with global delivery possibilities: www.landzo.com CCD sensor: http://www.landzo.com/?product-52.html CCD camera: http://www.landzo.com/?product-51.html Power Motor control unit: http://www.landzo.com/?product-50.html Car kit without Electronics: http://www.landzo.com/?product-49.html In case of any questions or issues, please contact Bella at 汪瑞 <wangrui@landzo.cn> Connect with teams in your region! Brazil EMEA Malaysia Mexico North America Taiwan
View full article
All results of the NXP CUP survey can be found here.
View full article
One option for mounting the FRDM-KL25Z Freescale Freedom board to the car chassis. [no audio] Important Note:  Secure the wires coming from your motors!!  (I used a zip tie in the video)  If they are allowed to flex at the joint where the wire connects to the motor, it will eventually fail.
View full article
For details on how to use the Motors, visit theDC Motor Tutorial Images Boards before 2013 Current Board Rev. 0 Rev. 1 Technical Details Revision 1 (Schematics, design files, sample code, instructional videos) Revision 0 (Schematics) H-Bridge Specifications Freescale MC33931 Datasheet Pro Tips: #1 - Electro-Magnetic Interfence (EMI) This has been mitigated in the rev. 1 board. In many cases the dc drive motors give off much EM interference causing poor data from the camera, and decreasing the servo motor performance substantially. In most cases around a PWM value of 20-25 duty cycle at the drive motors, caused detrimental problems. This problem was remedied in two ways, (1) connecting capacitors between the motor leads, the closer to the drive motor the better; (2) There is a way to connect the camera directly to the kwikstik and bypass the motor board. #2 - Rev. 0 Board workaround to Enable Braking This has been fixed in the rev. 1 board. In order to go forward AND backwards, you have to have control over IN1 and IN2 (see table below). If you look at the schematic, you can see that IN1 is directly connected to GND. In order to enable breaking you need to lift pin 43, solder a wire to it and control it properly. Tutorials General Tutorial on the DC Motor Control Qorivva: DC Motor Tutorial Kinetis Tower: DC Motor Tutorial Design evolution of motor board prior to 2010 - Freescale Cup Cars utilized the MC33932EVB 2010~2012 - Freescale Cup teams migrated to the current Interface/Motor board featuring Dual H-Bridges [Not manufactured] Tower and Trak Compatible Interface/Motor Control Board (Design files if you want to make one!) 2013+ - FRDM-KL25Z shield
View full article
This year we are launching the inaugural Global Freescale Cup challenge.  Teams from 9 regions of the world will be competing to see who the best-of-the-best is. Regional student champions will be working hard to create the most intelligent race car to win Global challenge on August 22-24, 2013, held at the Harbin Institute of Technology in China. The challenge will feature Freescale’s 32-bit microprocessors either ARM-based or Power Architecture-based. Important Information 2013 Global Rules Team Registration (closed) Click "Receive email updates" from right navigation to stay informed of changes. Add your own questions below in the comments section. View this page as a PDF - To print Meet the Teams Brazil - Escola Politecnica da Universidade de Sao Paulo China - (Semi-finalist*) University of Science and Technology China - (Semi-finalist*) South-Center University for Nationalities Slovakia - Slovak University of Technology India - Bannari Amman Institute of Technology Japan - The University of Tokyo Malaysia - Swinburne University of Technology Mexico - Instituto Politecnico Nacional Taiwan - National Taiwan University of Science and Technology United States - University of California Berkeley - Team Jolt *Semifinalist teams to compete prior to the global challenge to determine which team will represent the region. Event Agenda (Subject to Change.  All listed times are local time) August 21st Team Arrivals. Transportation arranged for all teams from Airport to Hotel. Look for The Freescale Cup sign. Arrival times provided. August 22nd 07:30 - 12:00 Team Tour - Sun Island 12:00 -13:00 Team Lunch Practice Track A Track B 12:55 - 13:15 University of Science and Technology Beijing South Center University for Nationalities 13:15 - 13:45 Mandatory Team Meeting & Rule Review 13:45 - 14:05 The University of Tokyo National Taiwan University of Science and Technology 14:10 - 14:30 UC Berkeley Swinburne University of Technology 14:35 - 14:55 Bannari Anman Institute of Technology Escola Politecnica da Universidade de Sao Paulo 15:00-15:20 South Center University for Nationalities University of Science and Technology Beijing 15:25 - 15:45 Instituto Politecnico Nacional Slovak University of Technology 15:55 - 16:10 National Taiwan University of Science and Technology The University of Tokyo 16:15 - 16:35 Swinburne University of Technology UC Berkeley 16:40 - 17:00 Escola Politecnica da Universidade de Sao Paulo Bannari Anman Institute of Technology 17:05 - 17:25 Slovak University of Technology Instituto Politecnico Nacional 18:00 - 19:00 Team Dinner August 23rd 8:00 - 8:30 Opening Ceremony 8:30 - 9:00 Final Race China Semi-finalists 9:10 - 9:30 Practice Track C - Slovak University of Technology 9:35 - 9:55 Practice Track C - The University of Tokyo 10:00 - 10:20 Practice Track C - UC Berkeley 10:00 - 10:45 Practice Track C - Bannari Anman Institute of Technology 10:50 - 11:10 Practice Track C - Instituto Politecnico Nacional 12:00 - 13:00 Team Lunch 13:20 - 13:40 Practice Track C - National Taiwan University of Science and Technology 13:45 - 14:05 Practice Track C - Swinburne University of Technology 14:10 - 14:30 Practice Track C - Escola Politecnica da Universidade de Sao Paulo 14:35 - 14:55 Practice Track C - Winner of China Semi-finals 4:00p - 4:30p Track Change 4:30p - 5:30p Final Race 5:30p - 6:00p Awards Ceremony 6:00p - 7:00p Team Dinner August 24th Teams to observe the finals of the China regional. 8:00  - 11:00 China Regional - Final Speed Race 11:00 - 12:00 China Regional - Final Innovation Competition 12:00 - 12:30 China Regional - Awards Ceremony 12:30 - 17:00 Free Time 17:00 - 18:00 Team Dinner Event Hotel Harbin Sinoway Hotel Address: No.2 Yiyuan Street. Harbin China. Contact: Xiaodan Liu Mobile Phone: 15904611007 Current Weather Conditions Link will re-direct to weather.com Race Location Harbin Institute of Technology August 22-24, 2013 Contributing Sponsors    
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
This tutorial covers the specific details of obtaining data from the line scan camera on the Qorivva TRK-MPC5604B board. This tutorial will help students familiarize themselves with how to interface the camera with the microcontroller, how to configure GPIO pins to create clock signals and also how to utilize the microcontroller's ADC to read the data from the camera. Outside of control algorithms, configuring the camera is one of the more complex tasks necessary to create a Freescale Cup Vehicle. 1. Overview 2. Hardware 3. Set up the Hardware: Line Scan Camera/Microcontroller Hardware Setup 4. Build the Code 5. Download/Debug/Run 6. Learning Step Functions Calling the Function Variables Setting threshold. (This can give you a simple view of what your camera sees without connecting it to a scope) Sample Code Download Link Alternative Examples Other Qorivva Tutorials: Links External 1. Overview In this exercise students will access the line scan camera, create a clock signal and create the initialization pulse which tells the camera to begin the exposure period. This tutorial will not describe line recognition or line following algorithms - these concepts are beyond its scope. Students will: Open the example file using Codewarrior Build a project Download the code to the board connect the microcontroller to the camera via the motor control board Run the program view the camera data, clock and Si pulse on an oscilloscope To successfully complete this exercise, students will need the following board and development environment: TRK-MPC5604B Motor Drive Board Version A Freescale Cup TRK-MPC5604B compatible Car Kit CodeWarrior for Microcontrollers v 2.8 P&E Micro Toolkit Freescale Line Scan Camera USB Cord Knowledge of how Pointers and arrays are utilized in C 2. Hardware   Read the Obtain Data From Line Scan Camera overview article for general information on the camera, ADC, and GPIO microcontroller configuration settings. Connect the sensors, motor drive board and microcontroller of your car according to the TRK-MPC5604B chassis build instructions 3. Set up the Hardware: Line Scan Camera/Microcontroller Hardware Setup It is crucial for an engineer to have the proper test equipment and tools for the job. In this case, without an oscilloscope, students will not be able to verify whether the proper signals are being sent to the camera, or that the camera is working properly. 4. Build the Code If there is more than one project in your project view, make sure the proper project is the focus. The most reliable way to do this is to right click the project and choose Build Project as shown below. You can also go to the Project menu and choose the same command. If errors are encountered, look in the Problems view and resolve them. For now ignore any warnings. 5. Download/Debug/Run Download the code to your board, once this process is complete resume the project so that the code runs. 6. Learning Step What will happen: the function ImageCapture() is called in main.c with a pointer to the first element in the array. This function completes the processes necessary to capture images using the camera. To become more familiar with Pointers and Arrays - navigate to the C Programming Tutorial. Knowledge of Pointers and Arrays is a pre-requisite for understanding the Camera Code. Functions void CAMERA(void) {   TransmitData("****Line Sensor Test****\n\r");   SIU.PCR[27].R = 0x0200; /* Program the Sensor read start pin as output*/   SIU.PCR[29].R = 0x0200; /* Program the Sensor Clock pin as output*/   for(j=0;j<2;j++)   //for(;;)   {   SIU.PCR[27].R = 0x0200; /* Program the Sensor read start pin as output*/   SIU.PCR[29].R = 0x0200; /* Program the Sensor Clock pin as output*/   SIU.PGPDO[0].R &= ~0x00000014; /* All port line low */   SIU.PGPDO[0].R |= 0x00000010; /* Sensor read start High */   Delay();   SIU.PGPDO[0].R |= 0x00000004; /* Sensor Clock High */   Delay();   SIU.PGPDO[0].R &= ~0x00000010; /* Sensor read start Low */   Delay();   SIU.PGPDO[0].R &= ~0x00000004; /* Sensor Clock Low */   Delay();   for (i=0;i<128;i++)   {   Delay();   SIU.PGPDO[0].R |= 0x00000004; /* Sensor Clock High */   ADC.MCR.B.NSTART=1; /* Trigger normal conversions for ADC0 */   while (ADC.MCR.B.NSTART == 1) {};   adcdata = ADC.CDR[0].B.CDATA;   Delay();   SIU.PGPDO[0].R &= ~0x00000004; /* Sensor Clock Low */   Result[i] = (uint8_t)(adcdata >> 2);    }   Delaycamera();   //printlistall();   }   printlistall(); } Calling the Function within the main for loop in main.c, call the camera function using the following code: for (;;)   {   CAMERA();   } Variables Creates an 128x1 array for camera data information volatile uint8_t Result[128]; /* Read converstion result from ADC input ANS0 */   Setting threshold. (This can give you a simple view of what your camera sees without connecting it to a scope) #define THRESHOLD (2.0 /*volts*/ / 0.03125) // 8-bit A/D = 31.25mV/bit CAMERA(); // read line sensor, 128x1 pixel result returned in Result[128] array // print result for (i = 16; i < 112; ++i) // ignore the first and last 16 bits in the camera frame   if (Result[i] < THRESHOLD)   TransmitCharacter('1'); // black (low intensity)   else   TransmitCharacter('0'); // white (high intensity) Sample Code Download Link Qorivva Sample Code Download Link Alternative Examples Application Note 4244 and Software. Other Qorivva Tutorials: 1. Qorivva: Blink LED 2. Qorivva: Drive DC Motor Tutorial 3. Qorivva: Turning A Servo 4. Qorivva: Line Scan Camera Tutorial Links Qorivva Overview https://community.nxp.com/docs/DOC-1019 External TRK-MPC5064B Freescale Webpage TRK-MPC5064B Freescale Reference Manual TRK-MPC5064B Freescale Schematic
View full article
Overview This document has links to videos to give tutorials on how to getting started *from scratch* with the freedom board.    In these tutorials we build projects with bare metal code to see how things work!   It includes the basics on how to get clocks running,  lights blinking and interrupts firing *from scratch*. For more code/peripheral examples that use a "bare metal" approach,  check out the page on the FRDM-TFC board. ERRATA!!!   While working with a large number of Freedom boards in a course,  it was observed that the InitClockRoutines would *sometimes* not work.    *Some* of the crystals on the freedom boards do NOT like "HIGH_GAIN" mode.   The new code is uploaded to this page but you could also change the code yourself:   pll_init(8000000, HIGH_GAIN, CRYSTAL, 4, 24, MCGOUT); to   pll_init(8000000, LOW_POWER, CRYSTAL, 4, 24, MCGOUT); Projects From Scratch for the Freedom Board with Codewarrior 10.3 Projects From Scratch - Part 2 - Importing other projects Using the Freescale Header Files and Blinking the LED Source code for video (Codewarrior 10.3) is in the attached files at the bottom of this document. Clock Distribution Source Code for the Clock Distribution video is in the attached files at the bottom of this document. Interrupts Part 1 - Background Interrupts Part 2 - ARM Systick Timer Source Code for the ARM Systick Timer video is in the attached files at the bottom of this document. Interrupts Part 3 - TPM (Timer Pulse Width Modulator) Overflow Source Code for the TPM Overflow Interrupts video is in the attached files at the bottom of this document
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
The Freescale linescan camera is based upon the TSL1401CL sensor from TAOS Inc. Design Files Schematic & 3D Render (Courtesy of eli_hughes) Images (Lens removed) Freescale Linescan Camera Specifications 128-pixel linear image sensor (TSL1401CL) Focusable imaging lens 5-pin physical interface on PCB on .100" grid Simple three-pin MCU interface with analog pixel output Lens: 7.9mm focal length, f2.4 fixed aperture, manual focus, 12mm x 0.5mm thread Exposure Time: 267µS to 68mS Resolution: 128 pixels Built-In amplifier stage to improve white/black differentiation. The lense used on the board: Alaud Optical     8.0mm f.l. Lens w/IR filter = Part Num: AB0825C        M12x.05 Lens Holder = #9 or #10 Useful links AMS TSL1401 Product Page Line Scan Camera Use Freescale App Note: Line Scan Camera
View full article
Some typical variations: Report Requirements Specific Components Usage Additional Tiers of Competition 2017 Rules per Region EMEA University Challenge 2016-2017 2016 Rules per Region Americas, Malaysia and Taiwan.​ EMEA University Program Challenge EMEA High School Challenge 2015 Rules per Region Worldwide Challenge Rules EMEA 2014 Rules per Region EMEA Worldwide Challenge Rules USA [ARCHIVE] 2013 Rules per Region Malaysia Latin America Latin America - Advanced USA Global Championship
View full article
How to install a servo horn.  More specifically for the Freescale Cup kit. [no audio]
View full article
One option for mounting the camera on the Freescale Cup car.  The only additional components you need are two zip ties. [no audio]
View full article
In this training video we will decompose an NTSC video signal to gaining understanding of how to capture video data from a "analog" camera.
View full article
The Kwikstik board is a great board for use in a Freescale Cup car! This page has some videos and example code to get you up and running quickly. For novice embedded developers it is recommended you use the FRDM-KL25Z for your Freescale Cup car. Board Tips The General Purpose TWRPI socket on the Kwikstik K40 board 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 Kwikstik User's Manual, but the user manual does not describe how to order a connector. Soldering and directly connecting to the pins on the socket itself is very risky and not recommended. When browsing for connectors that interface with the TWRPI sockets you have two main options. 1. The first is a surface mount chip, that is a female connector to connect with the male pins on the board. There are surface mount lead on the top of the chip which will be easier to solder to. The part number is: SFC-110-T2-L-D-A 2. The second option is a female connector which mates with the male connection on the board and is then terminated with a wire for each pin. This option can greatly simplify your wiring challenges on your car as any additional lengths or wires can easily be trimmed off. The part number is: SFSD-10-28-G-12.00-S Image of the SFSD-10-28-G-12.00-S with corresponding Kwikstik TWRPI socket. Connectors can be ordered from Samtec as samples at this website: [http://www.samtec.com/suddenservice/samples/samples.aspx] Useful Videos:   Creating a new baremetal project for a Freescale KwikStik http://www.youtube.com/watch?v=P8X079Qs7cg&feature=g-upl&context=G2f166b6AUAAAAAAADAA   Debugging a bare metal project on the Freescale Kwikstik. http://www.youtube.com/watch?v=nQhhfNJZL_o&feature=g-upl&context=G2dcfcd5AUAAAAAAAEAA   Importing projects and merging code. http://www.youtube.com/watch?v=A_h9W-QRHp8&feature=g-upl&context=G2354416AUAAAAAAACAA   A discussion of the header files (and how to use them!) for Kinetis Devices in Codewarrior V10. This is the first of 2 videos. I had to split them up as I cannot upload videos greater than 15 minutes in length. http://www.youtube.com/watch?v=EP2FydCX9tY&feature=g-upl&context=G2fdf3fcAUAAAAAAABAA   Second part of the Kinetis Header file discussion http://www.youtube.com/watch?v=ygjx-OkJuS4&feature=g-upl&context=G2792e97AUAAAAAAAAAA   Discussion on getting the Clock setup on the Kwikstik http://www.youtube.com/watch?v=_FQzXhLDP2w&feature=youtu.be   How to setup GPIO on the Kinetis. Includes discussion on enabled clocks to peripherals and setting up the pin control registers. http://www.youtube.com/watch?v=GXjRpsGJJt4&feature=youtu.be   How to use the SysTick peripheral in the Cortex core with interrupts http://youtu.be/8SRqlDkJwGU   Discussion of how to setup interrupts on the NVIC. The Flex timer is used as an example http://www.youtube.com/watch?v=_mClHzxm0Wk&feature=youtu.be   Example Programs: All of the programs are bare metal examples for CodeWarrior 10.1 that can be used on the Kwikstik board. Make sure to read all of the comments in the C files! How to Load Programs In CodeWarrior: Copy only the source files and header files into a new folder. Import that new folder into CodeWarrior to avoid debug problems.   ClockSetup - Systick This example will demonstrates how to enable the 4MHz Crystal on the Kwikstik. Early versions of the Kinetis silicon had bug in which the device could crash if the clock dividers are changed while executing from FLASH (errata e2448). This code places clock initialization code in RAM. The clock code is based upon routines from Kinetis Peripheral Module Quick Reference (Freescale document KQRUG.pdf). It also shows how to enable the SysTick module in the Cortex Core. The SysTick is used to provide a delay Function. ClockSetup - SysTick.zip     FlexTimer_NVIC_IRQ This code shows how to use the NVIC in the Cortex Core. The Flex Timer module is used to generate a periodic interrupt (similar to the SysTick example). FlexTimer_NVIC_IRQ.zip   LCD_Example This code will turn on segments on the LCD on the Kwikstik. The LCD driver code is derived from the MQX based example on the Kwikstik page. LCD_Example.zip   PWM_Test This code shows how to setup the flex timers to generate different styles of PWM. Note: One of the examples sets up the flex timer for pseudo-complementary PWM. It DOES NOT use the hardware based complementary mode. It writes 2 individual registers in a software routine. One should use this a starting point to enable full hardware based complementary mode. PWM_Test.zip   CameraTest This example is a basic example on how to interface to the Freescale Linescan Camera. It will display a rough approximation of the output on the LCD. CameraTest.zip Note: The code does not run with the camera by default. This is because the AOUT is set to the pin with the pull up resistor (J15 pin 4). Once changed it will work smoothly.
View full article
All information can be found in this document
View full article
1. Overview 2. Hardware 3. Set up the Hardware: Line Scan Camera/Microcontroller Hardware Setup 4. Build the Code 5. Download/Debug/Run 6.Example Code Functions ImageCapture(); ReadADCChannel() Initialize the ADC Header File Definitions Initialize the GPIO Other Tutorials: This tutorial covers the details of obtaining data from the line scan camera on the Kinetis K40 using the TWR-K40X256-KIT evaluation board. General details of the line scan camera not related to the Kinetis can be found in the general Line Scan Camera Theory article. This tutorial will help students familiarize themselves with how to interface the camera with the microcontroller, how to configure GPIO pins to create clock signals and also how to utilize the microcontroller's ADC to read the data from the camera. Outside of control algorithms, configuring the camera is one of the more complex tasks necessary to create a Freescale Cup Vehicle. 1.  Overview In this exercise students will access the line scan camera, create a clock signal and create the initialization pulse which tells the camera to begin the exposure period. This tutorial will not describe line recognition or line following algorithms - these concepts are beyond its scope. Students will: Create the code using Codewarrior Build a project Download the code to the board connect the microcontroller to the camera. Run the program view the camera data, clock and Si pulse on an oscilloscope view the data from the camera in the CodeWarrior Debugger for verification purposes   To successfully complete this exercise, the following software and hardware are required: The K40 Tower card, TWR-K40x256 CodeWarrior for Microcontrollers Freescale Line Scan Camera Motor Board Tower Prototyping board Soldering Iron Solder Tower Elevators USB Cord 2. Hardware   Read the Line Scan Camera Overview article for general information on the camera, ADC, and GPIO microcontroller configuration settings. 3. Set up the Hardware: Line Scan Camera/Microcontroller Hardware Setup It is crucial for an engineer to have the proper test equipment and tools for the job. In this case, without an oscilloscope, students will not be able to verify whether the proper signals are being sent to the camera. 4. Build the Code If there is more than one project in your project view, make sure the proper project is the focus. The most reliable way to do this is to right click the project and choose Build Project as shown below. You can also go to the Project menu and choose the same command. If errors are encountered, look in the Problems view and resolve them. For now ignore any warnings. 5. Download/Debug/Run Download the code to your board, once this process is complete resume the project so that the code runs. If you want more information on how to complete this step see the download debug run section of the Kinetis Blinking Led tutorial. 6.Example Code What will happen: the function ImageCapture() is called in main.c with a pointer to the first element in the array. This function completes the processes necessary to capture images using the camera. To become more familiar with Pointers and Arrays - navigate to the C Programming Tutorial. Knowledge of Pointers and Arrays is a pre-requisite for understanding the Camera Code. Functions The camera code utilizes the following function: within main.c ImageCapture(&Line.RawCameraData[0]); is called to initiate the step of capturing an image into the first position of the array. ImageCapture(); from Camerainterface.c This function captures the images by creating the SI Pulse, and clock signals, capturing the data into an Array using the ADC features of the K40. It calls the function ReadADCChannel() at the proper time which then inputs data from the camera AO line. void ImageCapture(int * ImageData){//this is a pointer to a single character in memory   unsigned char i;   TAOS_SI_HIGH;   TAOS_EXPOSURE_DELAY;   TAOS_CLK_HIGH;   TAOS_EXPOSURE_DELAY;   TAOS_SI_LOW;   TAOS_EXPOSURE_DELAY;   ImageData[0] = (int)ReadADCChannel(19);// inputs data from camera (first pixel)   TAOS_CLK_LOW;   for(i=1;i<128;i++)   {   TAOS_EXPOSURE_DELAY;   TAOS_EXPOSURE_DELAY;   TAOS_CLK_HIGH;   TAOS_EXPOSURE_DELAY;   TAOS_EXPOSURE_DELAY;   ImageData[i] = (int)ReadADCChannel(19); // inputs data from camera (one pixel each time through loop)   TAOS_CLK_LOW;   }   TAOS_EXPOSURE_DELAY;   TAOS_EXPOSURE_DELAY;   TAOS_CLK_HIGH;   TAOS_EXPOSURE_DELAY;   TAOS_EXPOSURE_DELAY;   TAOS_CLK_LOW;  } ReadADCChannel() from readADC.c this function does the analog to digital conversion and returns a value between 0 and 255. It takes the proper ADC channel, in this case 19. Channel 19 corresponds to analog input pin ADC1_DM0 (see page 117 in the K40 Sub-Family Reference Manual). unsigned char ReadADCChannel(unsigned char Channel)   {   ADC1_SC1A = Channel;   while((ADC1_SC1A & ADC_SC1_COCO_MASK) == 0)   {   }   return ADC1_RA;    } Initialize the ADC Before utilizing the ADC it must be calibrated and initialized. The details for how to do this can be found in Chapter 19 Using Peripheral Delay Block (PDB) to Schedule Analog to Digital Converter (ADC) Conversions of the Kinetis Peripheral Module Quick Reference manual. The PDB portions of the code have been removed for the Cup Car Demo Code. Header File Definitions from k40_TOWER_BOARD_SUPPORT.h The following code enables the GPIO on the two pins: #define TAOS_CLK_LOC (1<<28) #define TAOS_SI_LOC (1<<18) Initialize the GPIO From K40_TOWER_BOARD_SUPPORT.c The InitK40GPIO Function sets up the ports for use: Relevant code SIM_SCGC5 = SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK; //CLK and SI signal PORTC_PCR18 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK; PORTE_PCR28 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK; //Make Sure the GPIO is setup to be an output GPIOC_PDDR |= LED_E1_LOC | LED_E2_LOC | LED_E3_LOC | TAOS_SI_LOC; GPIOE_PDDR |= TAOS_CLK_LOC; GPIOB_PDDR |= LED_E4_LOC; Other Tutorials: K40:Blinking LED Tutorial K40:Drive DC Motor Tutorial K40:Turning a Servo Tutorial   
View full article
This page will guide you through the attachment of the servo to the Freescale Cup chassis.   The servo steers the vehicle and is controlled using Pulse-width modulation . Video Tutorial (no sound): Step-by-Step: (Click any image to enlarge) Servo Plate Inside the kit are various mounting options for different servo manufacturers. Look for the bushing of the servo that you are using. You will need the three pieces shown below. You will screw this into the servo. Pieces are notched, so assembly is straight forward. Remove the screw and black servo plate. Mount the yellow servo plate assembly to the servo as shown below. Make sure to add the small yellow washer (pictured below) in between the servo plate and the screw. Tighten well, a servo produces a good amount of torque and will slip if not tight. Steering Bar Assembly Assemble the short arm. Assemble the long arm.   Putting the Two Together Attach the short arm to the yellow bracket. First, insert the bearing into the control arm. This allows the joint to flex and move. Screw this assembly into the servo plate. Attach the long arm to the yellow bracket. Mounting the Servo Motor Attach the motor mount blocks to the back of the servo on both sides. Screw in the attachment blocks from the bottom of the car. Words of Wisdom Be sure to have servo motor in the 0 degree position before securing the control arms. Failure to do so will result in not being utilize the full range of motion. Do not change the position of the steering servomotor by hand. The position of the steering servomotor should be changed through electrical input only. Don’t move the steering servo motor beyond the maximum limit of the movement and this will damage the servo motor
View full article
Here is a simple example developed at Politecnico di Torino, to show how the NXP CUP car can be managed using Simulink-generated code. The Simulink model is intended to move the car forward and backward for 20 seconds, or until an obstacle is found. Any comment is welcome.
View full article