freescale race challenge 2010 - nxp …€¢ to develop the best control algorithm that will drive...

38
TM Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. Freescale Race Challenge 2010 Ioana Neacsu – HR Specialist Freescale Semiconductor Romania

Upload: duongdieu

Post on 29-Aug-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

TM

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

Freescale Race Challenge 2010Ioana Neacsu – HR Specialist

Freescale Semiconductor Romania

TM

2

Freescale Race Challenge 2010► Introduction► Organization► Competition Timeline► Qualifications for Universities Finals► Communication ► Slot Car Equipment► Slot Car Intelligence ► Q & A

TM

3

Organization►Organizer: Freescale Semiconductor Romania and

Freescale Semiconductor Czech

►Partner: Carrera (ConQuest entertainment a.s.)• www.carrera-toys.com, www.autodrahy.cz

►Universities - local organizational support

• Polytechnic University of Bucharest (RO) – AC & ET• Brno University of Technology (CZ)• Technical University of Ostrava (CZ)• University of Žilina (SK)• Slovak University of Technology in Bratislava (SK)• University of West Bohemia in Pilsen (CZ)• Czech Technical University in Prague (CZ)

TM

TM

4

Learn. Meet. Compete► International University student competition based on slot car racing

► Romania will be represented by Polytechnic University from Bucharest with 2 departments:

- Electronics, Telecommunications and Information Technology - 23 teams- Automatic Control and Computer Science - 23 teams

► The Goals are:

• To develop the best control algorithm that will drive the slot car on an unknown track without student interfacing.

• To achieve the best time for 10+10 laps without dropping out of the track.

► The Objective is:

• Map the track shape during the first lap and use it to achieve a maximum speed in the following laps.

► How can the car map the track? Accelerometer measures centrifugal forces.

► With the support provided by Freescale and Carrera, it's easy to go for it! • Populate the provided PCB• Build it into the provided slot car• Create the slot car intelligence (development tools provided)• Test it on the provided track

TM

5

DevelopmentPhase

Competition Timeline - Romania

2009 2010

International Grand FInal• April 30, 2010, Brno

Competition Announcement• November, 2009

Registration• November 16 to 27, 2009

University Finals• April 1, 2010 - Bucharest• April 2, 2010 - Bucharest

Country FInal• April 9, 2010• Bucharest

Apr May JunMarFebJanDecNovOct

1st Phase Building the

software application

Qualifications for University Finals 23 slot cars

TM

6

Every participant

who finishes the racewill geta prize!

RacesCzech And Slovak Republic

►7 University Finals• Brno 2x, Ostrava, Žilina,

Bratislava, Pilsen, Prague

►Country Final CZ&SK• Rožnov pod Radhoštěm

• 1st prize = 600 €

Romania

►2 University Finals• Bucharest 2x

►Country Final RO• Bucharest

• 1st prize = gift at a value of 600 €

►International Grand Final• Brno, 30-April-2010

TM

7

Qualification for University Finals

► Participants : all teams validated after registration, present on the 9th

December meeting

► Each participant team will have send by e-mail the finalized software application for a standard slot car until 10th of January 2010 – 23:00 p.m

► Each participant team have to send the software application by e-mail to [email protected]

Mail subject: Faculty Name FRC2010 ( Electronica FRC 2010 or Automatica&Calculatoare FRC 2010)Mail body: team name and team number

►Freescale will provide for each faculty lab a track and 5 standard slot cars to test the software application.

TM

8

Regulamentul etapei de calificari

1. Fiecare echipa inscrisa in concurs primeste un identificator unic derivat din pozitia sa pe lista inscrierilor in concurs.

2. Pana la data 10 Ianuarie 2010 ora 23:00 - fiecare echipa trimite organizatorilor atat proiectul sursa cat si binarul aplicatiei cu care doresc sa intre in competitie. Proiectul impreuna cu binarul vor fi trimise sub forma unui director arhivat zip la adresa de e-mail [email protected]

3. In cazul in care organizatorii identifica proiecte identice de la doua sau mai multe echipe acestea vor fi descalificate din concurs.

4. La data de 11 Ianuarie, fiecare echipa se va prezenta in laboratorul facultatii de care apartine (veti primi pe e-mail notificarea cu ora competitie)

TM

9

Regulamentul etapei de calificari

5. Toti concurentii vor folosi in concurs aceeasi masinuta, aleasa aleator de organizatori din cele 10 pe care echipele le-au avut la dispozitie pentru testarea aplicatiilor lor. Configuratia traseului pe care se va desfasura competitia nu va fi cunoscuta decat in ziua concursului. Tot atunci organizatorii vor hotari care e pista care va fi folosita pentru concurs (cea din stanga sau cea din dreapta) si care e sensul de parcurgere al traseului (orar sau anti-orar).

6. Organizatorii vor chema pe rand cate o echipa, in ordinea crescatoare a identificatorilor, cu alte cuvinte in ordinea inscrierii initiale in concurs.

7. Organizatorii vor incarca imaginea binara trimisa anterior de echipa respectiva in masinuta folosita pentru concurs, dupa care masinuta va fi inmanata membrilor echipei.

TM

10

Regulamentul etapei de calificari

Faza I - Etapa de invatare a traseului

► Etapa de invatare a traseului, are ca singur scop ‘familiarizarea’ masinutei cu traseul pe care urmeaza sa concureze. Aceasta etapa nu se cronometreaza dar poate fi eliminatorie.

► Organizatorii opresc alimentarea pistei.► Masinuta va fi asezata de echipa concurenta in orice punct de pe traseu, dar pe

pista stanga/dreapta si in sensul orar/anti-orar hotarate de organizatori pentru toti participantii concursului.

► In momentul in care echipa concurenta considera ca este gata de start, organizatorii alimenteaza pista.

► Dupa efectuarea unui singur tur complet de pista, in cazul in care masinuta nu are implementat nici un fel de algoritm pentru a se opri singura, echipajul concurent poate cere organizatorilor sa intrerupa alimentarea pistei.

► In cazul in care masinuta cade de pe pista pe parcursul turului de invatare, echipa concurenta va avea dreptul sa repuna masina pe circuit inca o singura data.

TM

11

Regulamentul etapei de calificariFaza II – etapa de concurs contra-timp

► Alimentarea pistei este oprita.► Echipa concurenta va aseza masinuta oriunde pe pista, stanga/dreapta si in sensul orar/anti-

orar hotarate de organizatori pentru toti participantii concursului. ► Cronometrarea celor 10 ture de pista va incepe la prima trecere prin dreptul contorului.► In momentul in care echipa concurenta considera ca este gata de start, organizatorii vor porni

alimentarea pistei.► Masinuta trebuie sa parcurga un numar de 10 tururi de pista. Este cronometrat timpul total in

care se parcurg cele 10 tururi de pista.► In cazul in care masinuta paraseste pista, ea poate fi asezata inapoi pe traseu, cu

urmatoarele precizari: masinuta va fi intotdeauna asezata pe pista in spatele pozitiei din care a parasit pista dar nu mai in spate de linia de start/stop. Cronomentrul nu va fi oprit ci va continua sa numere timpul scurs din momentul in care masina a pornit in cursa.

► Dupa efectuarea celor 10 tururi complete de pista, in cazul in care masinuta nu are implementat nici un fel de algoritm pentru a se opri singura, echipajul concurent poate cere organizatorilor sa intrerupa alimentarea pistei.

► Atentie: Masinuta este dotata cu un switch cu doua pozitii, care poate fi folosit pentru comutarea intre modul ‘invatare’ si modul ‘cursa contra-timp’.

► Intre etapa ‘invatare’ si cea ‘cursa contra-timp’ echipei concurente nu i se permite nici un fel de interventie asupra masinutei, a componentelor hardware sau software din interiorul acesteia. Singura actiune acceptata este comutarea switch-ului din pozitia ‘mod invatare’ in pozitia ‘mod cursa contra-timp’. – rearanjare perii contact si cauciucuri

TM

12

Qualification for University Finals

► After the Qualification sessions Freescale representatives willannounce the first 23rd teams that will participate for each faculty in the University Finals

► On the 13th of January each team qualified for University Finals will receive an Participant Package: slot car, unpopulated PCB and components to start building a slot car for the finals.

► Between 13th of January and 31st of March each team will have to• Populate the provided PCB• Build it into the provided slot car• Modify if necessary the slot car intelligence (development tools

provided)• Test it on the provided track

TM

13

Communication

► Electronics, Telecommunications and Information Technology

Mihnea Udrea - [email protected] Cucu - [email protected]

► Automatic Control and Computer Science

Dan Tudose - [email protected]

► Freescale Semiconductor Romania – www.freescale.ro

Ioana Neacsu – [email protected] Cutas – [email protected]

TM

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

Slot Car Equipment Ion Simion – Software Engineer

Freescale Semiconductor Romania

TM

15

FRC2010 – Slot Car Features

►Reference design slot car features• 3-axis acceleration measurement

using accelerometer MMA7361 • 4-quadrant DC motor control

using monolithic H-bridge MC33931 • USB connection – miniUSB connector

slot car connected to the PC behaves as a mass storage devicecopy .S19 file in to program your application into Flashno debugger provided (although BDM port available on extension header)

• microSD card slotruntime storage of data (microSD card not provided)easy transfer to PC for analysis and algorithm development

• 4 LEDs control using PWMoriginal Carrera Audi R8 head and bread LEDs

• changeover detection

TM

16

►Every registered FRC2010 participant obtains:• Slot car Carrera Audi R8

• Unpopulated PCB

• DevicesMicrocontroller MCF51JM64Accelerometer MMA7361H-Bridge MC33931miniUSB connectormicroSD card slot8.000MHz Crystal1A Bridge Rectifier DB106S3.3V Linear Voltage Regulator LP2951

FRC2010 Participant Package

TM

17

►PCB design files (Eagle 5.1.0) (see contest webpage) ►Populate the provided PCB

• resistors, capacitors and diodes are not provided• use line filter from the

original car PCB

Slot Car Electronic Equipment - PCB

line filter

TM

18

►Bill Of Materials

Slot Car Electronic Equipment - PCB

Self-Driven Slot Car v2.1 BOM--------------------------------------------------------------------------------Part Value Package Source--------------------------------------------------------------------------------IC4 MCF51JM64VLH LQFP64 Freescale http://www.freescale.com/files/32bit/doc/data_sheet/MCF51JM128.pdfIC3 MMA7361LR1 LGA14 Freescale http://www.freescale.com/files/sensors/doc/data_sheet/MMA7361L.pdfIC2 MC33931VW HSOP44 Freescale http://www.freescale.com/files/analog/doc/data_sheet/MC33931.pdfIC1 LP2951CDM-3.3R2G MICRO8 ON Semi http://www.onsemi.com/pub/Collateral/LP2950-D.PDFIC5 MICRO_SD microSD http://www.gme.cz/cz/index.php?product=823-036CON8 MINI-USB-SCHIELD 32005-301 http://www.gme.cz/cz/index.php?product=832-177B1 DB106S DBS http://www.gme.cz/cz/index.php?product=924-009Q1 8MHz HC49UP http://www.gme.cz/cz/index.php?product=970-023L1 SF0905 DB-1S line filter from the original Carrera Audi R8 PCB--------------------------------------------------------------------------------JP1 JUMPER JP2D1,D2 MBRS130LT3G SMBD3,D4 1N4148 MICROMELF-WR1,R2 62k R0603R3,R4 12k R0603R5,R9,R12,R17 10k R0603R6 270R R0603R7 1M R0603R8 0R R0603R10,R11 220R R0603R13,R14 33R R0603R15,R16 27R R0603R18 330k R0603C1 100uF SMC_CC2,C3 1uF SMC_AC4,C5 (100nF)? C0603C6 100nF C0603C7 1uF SMC_AC8 33nF C0603C9,C10 5pF C0603C11,C12,C13 100nF C0603C14 4.7uF SMC_AC15 0.47uF C0805C16 100nF C1206C17 100nF C0603C18,C19,C20 3n3 C0603

provided

not provided

TM

19

1. Remove the traction magnets – they are not allowed

Slot Car Electronic Equipment - Installation

TM

20

2. Dismount the bodywork from the chassis

Slot Car Electronic Equipment - Installation

TM

21

3. Unplug all connectors4. Remove the original PCB

Slot Car Electronic Equipment - Installation

Line Filter – to be used on the new PCB

TM

22

5. Use a knife to cut out two protrusions

Slot Car Electronic Equipment - Installation

TM

23

6. Install the populated PCB in, use the original screw

Slot Car Electronic Equipment - Installation

TM

24

9. Connect original LEDs, motor, power and external capacitor

Slot Car Electronic Equipment - Installation

TM

25

8. Connect external capacitor (prevents from MCU reset on changeovers)

Slot Car Electronic Equipment - Installation

TM

26

9. Make holes in the body for miniUSB connector and microSD card

Slot Car Electronic Equipment - Installation

TM

27

Slot Car Electronic Equipment – Schematic

TM

28

►Datasheets• Microcontroller MCF51JM64

http://www.freescale.com/files/32bit/doc/ref_manual/MCF51JM128RM.pdf• Accelerometer MMA7361

http://www.freescale.com/files/sensors/doc/data_sheet/MMA7361L.pdf• H-Bridge MC33931

http://www.freescale.com/files/analog/doc/data_sheet/MC33931.pdf• miniUSB connector

http://www.gme.cz/_dokumentace/dokumenty/832/832-177/dsh.832-177.1.pdf• microSD card slot

http://www.soselectronic.com/a_info/resource/f/2900_serie.pdf• 8.000MHz Crystal

http://www.gme.cz/_dokumentace/dokumenty/970/970-023/dsh.970-023.1.pdf• 1A Bridge Rectifier DB106S

http://www.gme.cz/_dokumentace/dokumenty/924/924-009/dsh.924-009.1.pdf• 3.3V Linear Voltage Regulator LP2950

http://www.onsemi.com/pub_link/Collateral/LP2950-D.PDF

Slot Car Electronic Equipment - Datasheets

TM

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.

Slot Car Intelligence Ionut Frujina – Software Engineer

Freescale Semiconductor Romania

TM

30

►Development Tools• Compiler

Freescale Code Warrior for Microcontrollers Special Suite (free)– http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MICROCONTROLLERS– editor– compiler & linker– simulator

• Debuggerno hardware debugger provided, useUSB Bootloader to program your application into the MCU

►Trainings• Introduction to CodeWarrior

http://www.freescale.com/webapp/sps/site/training_information.jsp?code=WBT_24571• Learn Programming with C

http://www.freescale.com/webapp/sps/site/training_information.jsp?code=TP_C_PROGRAMMING

Control Algorithm Development

TM

31

► Enables to program MCU flash memory via USB• preflashed to every MCF51JM64

provided with the participant package1. Connect car to PC via USB

Mass Storage Device and new diskletter appearscontains READY.TXT (0 bytes) file

2. Copy your application .S19 file inThe bootloader programs it to flash

3. Disconnect, put car on track

Control Algorithm Development – USB Bootloader

TM

32

► After reset, based on the power source, either the Bootloader or the User Application is started:

• USB power – Bootloader runs• Track power – User Application runs

► Coexistance of Bootloader and User Application1. Use the provided Linker Command File (.lcf)

to keep the memory limits for the user application:

2. Redirect Interrupt Vectors into RAM, because Interrupt Vector Table in Flash is occupied by the Bootloader – use the provided routine:

3. Include interrupt handlers into a table in ramvector.c,include its prototype in ramvector.h

MEMORY {bootcode (RX) : ORIGIN = 0x00000410, LENGTH = 0x000033F0code (RX) : ORIGIN = 0x00003A00, LENGTH = 0x0000C600vectorram (RWX) : ORIGIN = 0x00800000, LENGTH = 0x00000200userram (RWX) : ORIGIN = 0x00800200, LENGTH = 0x00003E00

}

Slot Car Application – Working in Bootloader Framework

UserApplication

(51kB)

Bootloader(13kB)

FlashBootloader Interrupt Table

Applicationusage(15.5kB)

RAMApplication Interrupt Table

0x0000

0x39FF0x3A00

0xFFFF

0x0410

RedirectInterruptVectorsToRAM();

TM

33

►Slot car embedded application quick start template• Available for download at contest web page.• Created under USB Bootloader framework• Include

MCU and slot car hardware initializationSimple application: car runs, all analog values and measured and logged on SD card

– X and Y accelerations are filtered by two different filter types (suitable or not?).– Head lights indicate the detection of a right or a left curve, based on simple thresholding of X-acceleration. – Break lights indicate detection of a curve beginning, based on a simple thresholding of Y-acceleration.

4 interrupts:– 0.5 ms TPM interrupt to update PWM duty cycle and start conversion of all analog inputs– ADC interrupt to handle sequence of conversions– 10 ms periodic RTC interrupt for data logging– KBI interrupt can be used to check power outage on crossover track piece

Macros– SET_LED_xy_ON/OFF – control LEDs– GET_SWITCH_STATE – read switch position– MOTOR_ENABLE/DISABLE, SET_MOTOR_VOLTAGE(x) – control the motor– START_CONV(channel), READ_ADC_SAMPLE – use the ADC– and more

SD card driver supporting SD/SDHC, FAT/FAT32, using f_open, f_printf, f_close, etc.– port of ChaN’s FAT File System Module to ColdFire v1

Slot Car Application – Quick Start Template

TM

34

►Quick Start Application logs all analog inputs into a CSV file, which can be opened in Excel

►Files names are automatically incremented numbers

►File dates are fixed

Slot Car Application – Analyzing logged data in Excel

f_printf(&file,"%d;%d;%d;%d;%d;%d\n", timeCounter, accXFilt, accYFilt, accZ, trackVoltage, motorCurrent);

TM

35

►Use Matlab CSV Import Wizard

Slot Car Application – Analyzing logged data in Matlab

1.

2.

3.

>> plot(timeCounter, [accXFilt accYFilt accZ]);

TM

36

A car tire is not perfect, is excentric. The rules says: the original tires must be used. What can I

do to fix it?

You can grind the tire. Use the motor to keep the wheel rotating and grind it.

TM

37

Can I exchange or put in a microSD card between the first and the second round of the Main Race?

No. You can change only the switch position (jumper) between the first and the second round.

TM

Q & A