SlideShare a Scribd company logo
1 of 97
Download to read offline
U n i v e r s i d a d d e N a v a r r a
N a f a r r o a k o U n i b e r t s i t a t e a
E s c u e l a S u p e r i o r d e I n g e n i e r o s
I n g e n i a r i e n G o i M a i l a k o E s k o l a
CAMPUS TECNOLÓGICO DE LA UNIVERSIDAD DE NAVARRA. NAFARROAKO UNIBERTSITATEKO CAMPUS TEKNOLOGIKOA
Paseo de Manuel Lardizábal 13. 20018 Donostia-San Sebastián. Tel.: 943 219 877 Fax: 943 311 442 www.tecnun.es informacion@tecnun.es
End of degree project
ELECTRONIC COMMUNICATIONS ENGINEER
FSAE ELECTRIC CAR´S ECU (ENGINE CONTROL UNIT)
MODULES CONFIGURATION FOR AIM MXL PISTA DATA
ACQUISITION SYSTEM
The student: Unai Huete Beloki
San Sebastián, June 2015
Unai Huete Beloki MXL Pista datalogger for FSAE
2
Table of Contents
1. Introduction ............................................................................................................................................9
1.1. Tecnun Seed Racing ........................................................................................... 9
1.2. Formula Student (Formula SAE).........................................................................10
1.3. Importance of dash in Formula SAE electric car .................................................11
1.4. ECUs & Dash configuration ................................................................................12
1.5. Installation ..........................................................................................................13
2. Objectives...........................................................................................................................................14
3. State of the art ...................................................................................................................................15
3.1 MyChron 4...........................................................................................................15
3.2. Acewell 5859 ......................................................................................................16
3.3 Starlane Athon GPS Pro Data Acquisition System...............................................17
3.4. AIM MXL Pista....................................................................................................20
3.4.1. ECU connection via CAN connector.............................................................21
3.4.2. Configurable display and LED shift lights .....................................................21
3.4.3. Race Studio 2 ..............................................................................................22
3.4.4. AIM GPS05 GPS module.............................................................................23
3.4.5. MXL Pista kit................................................................................................25
4. Software related configuration.....................................................................................................26
4.1. GPS Manager.....................................................................................................26
4.1.1. How to add a new track to the PC database ................................................27
4.1.2. How to read, write and delete tracks from GPS05 GPS module...................29
4.1.3. Configuring the lap beacon through MXL .....................................................30
4.4. Race Studio 2 .....................................................................................................31
4.4.1. Select Configuration layer ............................................................................33
4.4.2. Channels layer.............................................................................................34
4.4.3. System Configuration...................................................................................36
4.4.4. Online option................................................................................................37
5. How to receive data from ECU (Engine Control Unit) via CAN..........................................38
5.1. Introduction.........................................................................................................38
5.2. How to program the PIC18F4680 microcontroller ...............................................39
5.2.1. MikroC PRO.................................................................................................39
5.2.2. MPLAB IDE v8.90 , PICKit 3 and Microchip programming module...............40
5.3. CAN Bus.............................................................................................................42
5.4. Specify a commercial ECU for the MXL Pista dash.............................................44
5.5. Rear control module............................................................................................46
Unai Huete Beloki MXL Pista datalogger for FSAE
3
5.5.1. Rear module hardware.................................................................................46
5.5.2. “Rear.c” file ..................................................................................................48
5.5.3. “Rear.c” implementation in PIC18F4680 microcontroller ..............................60
5.6. Front module.......................................................................................................61
5.6.1. Front module hardware ................................................................................61
5.6.2. “Front.c” file..................................................................................................64
5.6.4. “Front.c” implementation in PIC18F4680 microcontroller..............................77
5.7. Table with Bosch MS4.3 protocol and used TSR messages for MXL Pista.........77
6. AIM MXL Pista (Quick Guide).......................................................................................................79
6.1. Keyboards function .............................................................................................79
6.1.1 Recall recorded data.....................................................................................80
6.1.2 Other functions..............................................................................................80
6.2. Connections........................................................................................................80
6.2.1. Harness .......................................................................................................81
1.1.1 6.2.2. GPS module .....................................................................................82
7. Race Studio Analysis: Download, save & analyze test values..........................................83
7.1. Race Studio Analysis: Download and save test values .......................................83
7.2. Race Studio Analysis: How to use it....................................................................84
7.2.1. How to plot measures graphs.......................................................................85
7.2.2. How to plot measure graph vs GPS position ................................................86
8. Project budget....................................................................................................................................89
9. Conclusions ........................................................................................................................................90
Appendix...................................................................................................................................................91
Appendix 1: AIM software installation (GPS manager, Race Studio 2 y Race Studio
Analysis) and driver .....................................................................................................91
Appendix 2: Google Earth program installation.........................................................93
Appendix 3: MXL Pista dash installation template......................................................94
Appendix 4: MXL Pista technical characteristics........................................................96
Unai Huete Beloki MXL Pista datalogger for FSAE
4
Table of Figures
Figure 1. Tecnun Seed Racing Formula SAE team logo................................................... 9
Figure 2. Tecnun Seed Racing departments....................................................................10
Figure 3. Components distribution. ..................................................................................12
Figure 4. Dashboard. .......................................................................................................13
Figure 5. MyChron 4 dash...............................................................................................15
Figure 6. Acewell 5859 dash............................................................................................16
Figure 7. Starlane Athon GPS Pro dash..........................................................................17
Figure 8. AIM MXL Pista dash. ........................................................................................20
Figure 9. Configurable display possible settings. .............................................................21
Figure 10. Race Studio 2 analysis software. ....................................................................22
Figure 11. AIM GPS05 GPS module................................................................................23
Figure 12. GPS manager software...................................................................................24
Figure 13. GPS Speed and position information example. ...............................................24
Figure 15. MXL Pista kit...................................................................................................25
Figure 14. Exporting information to Google Earth. ...........................................................25
Figure 16. "GPS Manager " software. ..............................................................................26
Figure 17. "Cirrcuito Olaberria " track in "Google Earth"...................................................27
Figure 18. New track settings...........................................................................................28
Figure 19. GPS manager software with (MXL Pista + GPS module) connected...............29
Figure 20. Select "Set GPS beacon" step. .......................................................................30
Figure 21. Start/finish line setting step. ............................................................................31
Figure 22. Split line setting step. ......................................................................................31
Figure 23. Race Studio 2. ................................................................................................32
Figure 24. Race Studio 2, Select configuration layer........................................................34
Figure 25. Race Studio 2, Channels layer........................................................................35
Figure 26. Race Studio 2, System configuration. .............................................................36
Figure 27. Race Studio 2, Online window. .......................................................................37
Figure 28. PIC18F4680 microcontroller............................................................................38
Figure 29. MCP2551 transceiver......................................................................................38
Figure 30. MikroC PRO software. ....................................................................................40
Figure 31. Microchip PICkit 3 & programming module. ....................................................41
Figure 32. MPLAB IDE v8.90 software.............................................................................42
Figure 33. CAN bus network in a commercial car. ...........................................................43
Figure 34. CAN message structure..................................................................................44
Figure 35. Rear Module. ..................................................................................................46
Figure 36. PIC18F4680 inputs/outputs.............................................................................47
Figure 37. TSR´15 components distribution.....................................................................48
Figure 38. Definition of "OSCCON variable taken from PIC18F4680 datasheet...............50
Figure 39. Clock diagram taken from PIC18F4680 datasheet..........................................50
Figure 40. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).51
Figure 41. Necessary message for RPM valu taken from BAMOCAR CAN bus datasheet.
.................................................................................................................................53
Figure 42. Torque reference definition taken from BAMOCAR datasheet. .......................54
Figure 43. BAMOCAR inverter RPM data sending format taken from datasheet..............55
Figure 44. Front module (red box) and Dashboard with AIM MXL Pista...........................61
Figure 45. Dashboard of the TSR´15. ..............................................................................62
Figure 46. Top and lateral view of Front module box........................................................62
Figure 47. PIC18F4680 ports configuration (RDB_LED_ACT and BMS_LED_ACT ports
are interchanged).....................................................................................................63
Unai Huete Beloki MXL Pista datalogger for FSAE
5
Figure 48. Definition of "OSCCON variable taken from PIC18F4680 datasheet...............65
Figure 49. Clock diagram taken from PIC18F4680 datasheet..........................................65
Figure 50. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).67
Figure 51. MXL Pista dash/datalogger. ............................................................................79
Figure 52. MXL Pista dash/datalogger. ............................................................................81
Figure 53. AIM MXL Pista harness...................................................................................81
Figure 54. GPS05 GPS module. ......................................................................................82
Figure 55. "Test database and lap manager" window. .....................................................84
Figure 56. Race Studio Analysis: "GPS_Speed" vs Time.................................................85
Figure 57. Race Studio Analysis: "GPS_LatAcc" vs GPS position. .................................86
Figure 58. GPS graph zoomed in.....................................................................................87
Figure 59. GPS data exported to Google Earth................................................................88
Figure 60. Window after CD-ROM insertion.....................................................................91
Figure 62. "Race Studio 2" and "Race Studio Analysis" icons..........................................92
Figure 63. "GPS Manager" icon. ......................................................................................92
Figure 61. Internet Explorer window.................................................................................92
Unai Huete Beloki MXL Pista datalogger for FSAE
6
Table of Codes
Code 1. "Rear.c"........................................................................................................................................49
Code 2. "Rear.c"........................................................................................................................................49
Code 3. "Rear.c"........................................................................................................................................51
Code 4 . "Rear.c". .....................................................................................................................................52
Code 5 . "Rear.c" . ....................................................................................................................................52
Code 6 . "Rear.c". .....................................................................................................................................54
Code 7. "Rear.c"........................................................................................................................................55
Code 8. "Rear.c"........................................................................................................................................56
Code 9. "Rear.c"........................................................................................................................................56
Code 10. "Rear.c".....................................................................................................................................57
Code 11. "Rear.c".....................................................................................................................................58
Code 12. "Rear.c".....................................................................................................................................58
Code 13. "Rear.c".....................................................................................................................................59
Code 14. "Rear.c".....................................................................................................................................60
Code 15. "Front.c"...................................................................................................................................64
Code 16. "Front.c"...................................................................................................................................64
Code 17. "Front.c"...................................................................................................................................66
Code 18. "Front.c"...................................................................................................................................67
Code 19. "Front.c"...................................................................................................................................68
Code 20. "Front.c"...................................................................................................................................68
Code 21. "Front.c"...................................................................................................................................69
Code 22. "Front.c"...................................................................................................................................69
Code 23. "Front.c"...................................................................................................................................70
Code 24. "Front.c"...................................................................................................................................71
Code 25. "Front.c"...................................................................................................................................72
Code 26. "Front.c"...................................................................................................................................73
Code 27. "Front.c"...................................................................................................................................74
Code 28. "Front.c"...................................................................................................................................74
Code 29. "Front.c"...................................................................................................................................75
Code 30. "Front.c"...................................................................................................................................76
Code 31. "Front.c"...................................................................................................................................77
Table of Tables
Table 1 . Comparison of diffrerent dataloggers. ........................................................................19
Table 2. BOSCH MS4.3 ECU configuration.....................................................................................45
See the necessary “Row” values (data 0) and the data bytes positions in the Bosch
MS4.3 protocol table (Table 3 in 5.4)....................................................................................70
Table 4. CAN messages sent to MXL Pista logger. ......................................................................78
Table 5. Project Budget.........................................................................................................................89
Unai Huete Beloki MXL Pista datalogger for FSAE
7
ACKNOWLEDGEMENTS
I am grateful to my family for their support during my whole life and especially
during these last four years. Thanks for helping me in each step I have taken, without
them i would not have arrived to where I am now.
I would also like to express my gratitude to Tecnun Seed Racing members for
making this project possible and helping me whenever I needed.
Finally, I would like to thank Dr. Iñigo Gutierrez , whose generous guidance and
support made it possible for me to work on a topic that was of great interest to me.
Unai Huete Beloki MXL Pista datalogger for FSAE
8
Unai Huete Beloki MXL Pista datalogger for FSAE
9
1. Introduction
1.1. Tecnun Seed Racing
Tecnun Seed Racing is Formula Student Electric team formed by 63 students
from Tecnun, University of Navarra. It all started in 2010, when a group of students who
cared about sustainability energetic and the renewable energies decided to create a group
called Tecnun Seed Group. One of the projects was to build Formula Student Electric car.
Students from the university found this project really interesting and started working in the
project. That is why they decided to create Tecnun Seed Racing Formula SAE team,
exclusively dedicated to the design, fabrication, implementation and optimization of the
electric car.
Figure 1. Tecnun Seed Racing Formula SAE team logo.
Tecnun Seed Racing has been the first Spanish team to participate in the
Formula Student Electric. Last year ranked 14th
overall position at Formula ATA Italy
2014. This year, the objective is to build a new car (TSR’15) and participate in Formula
Spain 2015 in Montmelo, Barcelona. The TSR’15 is the 3rd
electric racing car that will be
manufactured by Tecnun Seed Racing.
Unai Huete Beloki MXL Pista datalogger for FSAE
10
Figure 2. Tecnun Seed Racing departments.
Tecnun Seed Racing team has 3 main working groups divided. This project is
focused in the electrical/electronics group, as we are going to work with electrical
components, for example sensors, inverters or battery cells and we will also have to work
with electronic components, such as, microcontrollers that will be programmed in order to
transmit electrical component’s information.
1.2. Formula Student (Formula SAE)
Formula Student, also known as Formula SAE, is a worldwide competition
between universities that design, build and develop a small single racing car. The
University of Texas organized the first Formula SAE competition. Only 6 teams (40
students) participated in that event.
Nowadays, Formula SAE competitions are organized all over the world, for
example, in Germany, Japan, Brazil, Australia and so on. All these events use the original
norm of Formula SAE and have about 120 teams (2000 students) participating in it. All the
competition results are used to make a worldwide ranking.
Unai Huete Beloki MXL Pista datalogger for FSAE
11
In Formula SAE events, industry specialists on the following criteria judge the
cars:
• Static events:
o Engineering Design (150 points).
o Cost & Sustainability Analysis (100 points).
o Business Presentation (75 points).
o Technical Inspection (6 tests): Safety, Chassis, Noise, Tilt, Brake and Tech
(no points). Participation in dynamic events depends on Technical
inspection.
• Dynamic Events:
o Skid pan (50 points).
o 1 km Autocross/Sprint (100 points).
o Acceleration (75 points).
o 22km endurance (300 points) and fuel economy (100 points).
The winner of the event is the team with the highest number of points out of a
maximum of 1000.
1.3. Importance of dash in Formula SAE electric car
The dashboard is the control panel of the car, composed by several buttons for
the control of different functions and the dash, which shows and saves the information
available from components/sensors of the car. The control commands/buttons are located
in front of the driver. The most important part of the dashboard is the dash or display,
which in our case is also a datalogger.
Through the dash the driver can see the important information of the car in real
time, and modify the driving technique depending on it. For example, for our electric car,
the battery cells information is really important to know if the car is going to be able to run
until the end of the largest events in the competitions.
The dash can also be configured to show the possible errors in the car to notify
the driver that something is going wrong. In our case, as it will be explained in the project,
the dash will be connected to GPS module that will provide as information as speed or
lap/split times, showing best lap times and laps forecast in the display. The driver will
know how fast he is driving and every lap improvement.
Unai Huete Beloki MXL Pista datalogger for FSAE
12
Furthermore, as the dash is also a datalogger, we will be able to study the
recorded data after every test to improve the car and driver’s performance.
1.4. ECUs & Dash configuration
The ECUs (Engine Control Units) are the modules that control the components
from the car connected to them. In our case, the TSR´15 has three modules: Relay, Rear
and Front modules. For the dash configuration we will configure the Rear and Front
modules.
Figure 3. Components distribution.
The data is going to be received in the dash via CAN Bus. The information from
different components and sensors will be written in the CAN Bus by programming the
microcontrollers (connected to transceivers) placed in the Rear and Front module. One of
the harder parts of the project will be to find the necessary code implementation for the
microcontrollers.
The chosen dash, AIM MXL Pista, only has the possibility to read information
from commercial ECUs via CAN. So we will have to find a public ECU protocol in order to
Unai Huete Beloki MXL Pista datalogger for FSAE
13
choose the messages formats that we are going to send through the CAN bus to the
dash.
The confirmation of the dash is going to be done using the provided software.
The dash also has an analysis program for the saved data. Both programs are going to be
explained in the project.
1.5. Installation
The objective is related to the hardware implementation. The dash will be placed
in front the driver´s position in the middle of the dashboard (as it is shown in figure 4). The
dash has to be correctly powered and connected to the CAN Bus using the specific wires
provided with the harness of the MXL Pista.
The dashboard will be connected to the CAN bus through the Front modules
CAN connection. We can also use some sensors provided with the MXL Pista that can be
connected directly to the harness wires of the MXL Pista. We will also have to fix it
correctly to the dashboard since it must not fall while driving the car.
Figure 4. Dashboard.
Unai Huete Beloki MXL Pista datalogger for FSAE
14
2. Objectives
The most important objective of the project is to be able to save and show in real
time important information from electrical components and sensors of the TSR’15 in the
dashboard, showing alarm messages in case of danger or undesired values from
components.
Firstly, we will have to study the possible gadgets in the market and requirements
for our final decision. The TSR´15 uses a CAN Bus to transmit information between
different components and control modules, so having a CAN Bus message receiver will
one of the most important characteristics for our future dash.
We would like to have a datalogger that saves all the data from the sensors and
components of the car. Some dashes also include this feature. We will look for one that
includes this characteristic and has an adequate internal memory capacity. Some of these
gadgets also include analysis software to analyze the data for possible improvements in
the car. The chosen gadget has to able to connect to a PC, download the recorded data
and include software for data analysis.
Finally, it is also interesting to have a lap timer, through infrared
transmitter/receivers or GPS data (preferable) in order to be able to record the lap/split
times of different tests.
Unai Huete Beloki MXL Pista datalogger for FSAE
15
3. State of the art
There are different types of dashes available for Formula Student car. In this
section we will analyze some of this gadgets and compare in order to choose an
appropriate one for the Tecnun Seed Racing Formula Student electric car.
We will base our decision according to characteristics of the compared dashes:
• Lap timer.
• Internal memory.
• Availability to connect different sensors.
• Connection to the ECU (Engine Control Unit) via CAN, so that we can get the
information about different components of the car that are connected to the ECU.
• USB download to PC, for archiving and analysis of data.
• Weight and size.
3.1 MyChron 4
Figure 5. MyChron 4 dash.
The MYchron4 is a data acquisition gauge for racing.
Unai Huete Beloki MXL Pista datalogger for FSAE
16
Includes:
• Tachometer (RPM counter).
• Lap timer (infrared receiver).
• Data logger.
• Temperature input for exhaust gas, cylinder or water sensors.
• Internal 9V battery.
• 1MB of memory for data logging.
• Configurable alarm lights.
• USB connection to PC and analysis software Race Studio.
• PRICE: 374 €. (http://www.ebay.es/itm/Kart-Mychron-4-Timing-Karting-Brand-
New-Black-Buttons-Inc-Water-Temp-Sensor-
/380577825429?pt=LH_DefaultDomain_3&hash=item589c34c295).
The MyChron 4 dash is quite complete. It includes almost all the characteristics
we were trying to find, but it does not have the most important one: the possibility to
connect to the ECU (Engine Control Unit), so we will not able to collect all the important
data from the components that are connected to it.
3.2. Acewell 5859
Figure 6. Acewell 5859 dash.
These are the most important features of the Acewell 5859 dash:
• Air temperature sensor.
• Tachometer (RPM counter) with a selectable scale of 10.000rpm or 20.000rpm.
• IR receivers and IR transmitter for automated lap timing.
• Includes RPM sensing wire, speed sensor, temperature sensor, wiring harness
and wires remote control switch.
• Water resistance.
• PRICE: 283.99 € (http://www.quadtech.co.uk/Acewell%20Speedometers/ACE-
5xxx/ACE-5859.htm?action=full&id=210).
As we can see the Acewell dash is a very simple gadget. It does not have any via
CAN connection to the ECU and the possibility to connect it to the PC thought USB.
Unai Huete Beloki MXL Pista datalogger for FSAE
17
3.3 Starlane Athon GPS Pro Data Acquisition System
Figure 7. Starlane Athon GPS Pro dash.
Most important features of the Starlane Athon Pro are:
• CAN BUS data line for connection with expansion modules.
• GPS receiver and antenna built into the instrument.
o Detect lap time through GPS system.
o Manage finish line and 3 splits.
o Speed measurement through GPS system.
• Best lap LED.
• Engine speed indicator RPM (with settable LED BAR and shift light).
• Wireless data download by Bluetooth.
• Supplied with the Digirace-Pro software.
• 999 lap memory.
• Motor RPM acquisition + wheel speed + gear indicator + water temperature +
exhaust gas or oil temperature with thermocouple K + battery voltage + 3 general
analog channels.
• Storage of the custom finish line coordinates of the tracks.
• Waterproof.
• PRICE: 1480 € (http://www.motosport.com/starlane-athon-gps-pro-data-
acquisition-system).
As we can see, the Athon GPS Pro data acquisition system gathers all the
features we were trying to find for our Formula Student electric car. It could be the chosen
gadget, but we are going to search for similar dash in order to take our final decision. We
can also see that the possibility to receive information from the car´s ECU via CAN
increases the dash’s price, but it is also considered one of the most important
Unai Huete Beloki MXL Pista datalogger for FSAE
18
characteristic, as we had mentioned before, the ECU manages information from the most
important electronic/electric components of the car.
The table shown below (table 1), resumes the last 3 dashes explained previously
and the chosen one.
Unai Huete Beloki MXL Pista datalogger for FSAE
19
Table 1 . Comparison of different dataloggers.
Unai Huete Beloki MXL Pista datalogger for FSAE
20
3.4. AIM MXL Pista
Figure 8. AIM MXL Pista dash.
The AIM MXL Pista is a data acquisition system for car/ bike racing. The dash
provides:
• A fully configurable display and six configurable LED lights.
• A logger that records the vehicles performances in detail.
• RPM input.
• CAN/serial ECU connector.
• Internal lateral G sensor.
• Lap timer.
• USB connector.
• Infrared lap timer (possibility to measure by GPS coordinates, connecting the GPS
Module to the dash).
• 8MB of non-volatile RAM internal memory.
• Race Studio 2 software for data analysis.
• 8 analog inputs.
• Price: 1700€.
Some of the most important characteristics are going to be briefly described.
Unai Huete Beloki MXL Pista datalogger for FSAE
21
3.4.1. ECU connection via CAN connector
The MXL dash can be interfaced with the ECU (Engine Control Unit) using an
RS232 serial cable or CAN cable. In our case, the CAN cable is going to be used in order
to sample data out coming from the ECU.
3.4.2. Configurable display and LED shift lights
Figure 9. Configurable display possible settings.
As we can see in the figure 9, the MXL Pista gives us the opportunity to set up
the display in several different ways, depending on the information we want to see. The 10
configurable shift lights in the upper part of the dash are used to represent the RPM signal
status. The other alarm LED lights are going to be used to warn the driver when some
values of the sensors implemented in the car are higher or lower than expected.
The configuration of the display is done from the Race Studio 2 program, but we
can also change some display views using the buttons in the lower part of the gadget.
Unai Huete Beloki MXL Pista datalogger for FSAE
22
The lower part of the display will also show, apart from the channels information,
when a “Best lap” is done, showing the improvement in respect to the previous one. The
MXL Pista also includes an algorithm that measures the Lap Forecast and Split times.
3.4.3. Race Studio 2
Using the USB connector and the Race Studio 2 software we can download the
data stored in the dash’s non-volatile 8 MB memory and give the configuration we want for
the display.
The MXL Pista a data logger that acquires data from different sensors, 1-500
times per second, depending on the input type. All these information can be analyzed with
the Race Studio 2 software to improve the car’s performance. For example, the lateral G
sensor information lets us create a map of the track with the help of the software and we
can know all the information in the exact position of the track (temperature, speed, RPM,
Lap time, etc.). All this information can be used to improve different components behavior
and it can also help the drive to see which driving technique is the fastest for the specific
track.
Figure 10. Race Studio 2 analysis software.
Unai Huete Beloki MXL Pista datalogger for FSAE
23
3.4.4. AIM GPS05 GPS module
Figure 11. AIM GPS05 GPS module.
The AIM’s GPS module allows us to immediately get lap times and data we need
for engine tuning and improving driving technique. It includes GPS Manager Software to
manage the recorded tracks in the internal memory. Lightweight and waterproof, the GPS
module is connected to AIM loggers via CAN cable.
GPS Manager Software allows setting track start/finish lines and downloading a
comprehensive track database.
Unai Huete Beloki MXL Pista datalogger for FSAE
24
Figure 12. GPS manager software.
Connecting the GPS module to the MXL Pista we can get this information:
• GPS Speed: Speed obtained from GPS signal.
• GPS Nsat: Number of satellites connected.
• GPS LAtAcc: lateral acceleration toward the direction of the movement.
• GPS LonAcc: longitude acceleration in the direction of the movement.
• GPS Slope: slope of the movement.
• GPS Heading: direction of the vehicle in degrees toward the North.
• GPS Giro: vehicle´s yaw in degrees/sec.
• GPS Pacc: precision accuracy.
Figure 13. GPS Speed and
position information example.
Unai Huete Beloki MXL Pista datalogger for FSAE
25
Finally, we can also review our driving performance through real images, by
exporting all the data into “Google Earth” program (Figure 14).
3.4.5. MXL Pista kit
In figure 15 we can see what MXL Pista package includes.
Figure 15. MXL Pista kit.
Figure 14. Exporting information to Google Earth.
Unai Huete Beloki MXL Pista datalogger for FSAE
26
4. Software related configuration
4.1. GPS Manager
GPS Manager is the software that allows updating, modifying, reading and writing
lap and split beacons of a track in the “GPS05” GPS module.
This is how the GPS manager software looks like when there is no data logger
connected to the PC:
Figure 16. "GPS Manager " software.
On the left column we have the list of tracks provided by AIM manufacturer,
organized depending upon the country in which they are. Track shape and information
about the typology of the track (karts, cars or bikes) are provided.
Unai Huete Beloki MXL Pista datalogger for FSAE
27
4.1.1. How to add a new track to the PC database
GPS Manager offers this possibility in case they do not have a track yo want in
the database. In our case, Tecnun Seed Racing team, we always test our car
performance in a circuit called “Circuito Olaberria Karting”. This circuit was not in the
database, which is why we will explain how to add a new track with this example.
The first thing we need in the coordinates of the lap line, and split beacons we
want to add to our new track called “Circuito Olaberria”. This information can be taken
from “Google Earth”.
Figure 17. "Circuito Olaberria " track in "Google Earth".
Unai Huete Beloki MXL Pista datalogger for FSAE
28
In the image above we can see how we defined the coordinates for the track
“Circuito Olaberria”.
• Start /Finish line Latitude: 43.030556º/ Longitude: 2.215556º.
• Split 1 Latitude: 43.030277º/ Longitude: 2.216111º.
• Split 2 Latitude: 43.031667º/ Longitude: 2.214444º.
Know that we have the necessary information we proceed to add the track in the
“GPS Manager”.
1) Press New.
2) Insert Track name
3) Fill the fields: country, type of track (closed track, Oval, point to point) , type
of surface (asphalt, dirt, ice, water), type of vehicle and finally, the
coordinates. Below we show the configuration for the track “Circuito
Olaberria”.
4) Load shape: we will be able to load the shape after driving the car in
“Circuito Olaberria”. The track shape can be downloaded from the GPS
module using AIM software “Race Studio 2”.
5) Finally, we press “OK” button.
If we want to change the configuration of the track, we can modify the data by
pressing the “settings” button in the right part of each track, and the window shown in
above will appear again.
Figure 18. New track settings.
Unai Huete Beloki MXL Pista datalogger for FSAE
29
4.1.2. How to read, write and delete tracks from GPS05 GPS module
Firstly, the MXL Pista has to be connected to a 9-15V Power supply. Then, we
have to connect our system, composed by the dash and the GPS module to the PC
through the USB connector.
Figure 19. GPS manager software with (MXL Pista + GPS module) connected.
In the figure 19 we can see how the software looks like when we connect our
system to the PC. In the upper right part of the program we can see if our system is
detected, the identification number and the tracks recorded in the GPS05 module. In the
case above we only have one list of tracks, but we could also have another one. These
are the two possible track lists:
Unai Huete Beloki MXL Pista datalogger for FSAE
30
• “Not in PC list”: will show the tracks recorded in the GPS module that were not
previously recorded, new tracks.
• “Identical in PC list”: will show the tracks that were pre-recorded in GPS module
from the PC.
If a track is saved in the GPS module, this gadget will automatically detect the
track in which the car is running and it will use the settings defined in the GPS for the
specific track (split line, start/finish line). We can also define the start/finish line and split
line of a non-recorded track directly through the MXL (explained in 5.3.3).
To move a default (the ones that are given by AIM) or a recorded track from the
PC to the GPS module we will select the track and click on “>” symbol. For the opposite
move we will click on the other arrow.
4.1.3. Configuring the lap beacon through MXL
If we are going to use the car in a new track that was not recorded in the GPS
module, we must follow this procedure to set start/ finish line and split positions on our
GPS05.
• Ensure GPS05 module is correctly connected to MXL and the MXL is correctly
powered.
• Press “MENU” button on MXL.
• Select “Set GPS beacon” using “>>/<<” buttons.
Figure 20. Select "Set GPS beacon" step.
• Press “OK” button to start setting the desired lines.
• The MXL display will show the message in the figure below. Reach the point to be
considered as start/finish line and press “OK” button.
Unai Huete Beloki MXL Pista datalogger for FSAE
31
Figure 21. Start/finish line setting step.
• If the system is configured to capture splits, the MXL will show the message shown
in the following figure. Reach the point to be considered split line and press
“OK”button.
Figure 22. Split line setting step.
• Once the configuration is over, the system will show the start page and it will be
ready to record times.
4.4. Race Studio 2
The only way to configure the MXL Pista dash is using the Race Studio 2
software provided by AIM manufacturer. It is designed to configure the logger and analyze
their data using a PC. It is made up of two programs: Race Studio 2 and Race Studio
Analysis.
The first step is to install the programs and necessary drivers for the configuration
(see Annex 1). After installing the programs, double click on Race Studio 2 icon to open it.
Unai Huete Beloki MXL Pista datalogger for FSAE
32
Figure 23. Race Studio 2.
In the following description we will show the configuration done for our TSR´15
car in order to explain how to configure the MXL Pista. Choose Device Configuration and
MXL option to open the configuration window. If we are configuring the MXL for the first
time, New Configuration window will appear. Choose the following options:
• Logger: MXL Pista.
• ECU Manufacturer: BOSCH.
• ECU: MS43_GA.
• Installation Name: TSR.
• Vehicle Name: TECNUN SEED RACING.
• Speed, Temperature measure unit: km/h and ºC.
System Manager window will appear. It will show a table with the configurations
done for the MXL Pista (Select configuration layer). We can create new configurations
from this layer. We have to choose the one we are going to modify (highlighted in yellow) .
Unai Huete Beloki MXL Pista datalogger for FSAE
33
In the top of the window we will also see two pushbuttons that allows us to
transmit the configuration to the logger “Transmit” and or detect an unknown configuration
in the logger and store it, “Receive”.
The remaining part of the window is made up of four layers:
• Select configuration (the one explained previously).
• Channels.
• System Configuration.
• CAN-Expansions configuration (will not be used in our case as we are not using
any expansion module).
4.4.1. Select Configuration layer
As it is described previously, it manages the configurations done by the user for
the MXl Pista. It shows 4 pushbuttons:
• “New” button to create a configuration.
• “Delete” button.
• “Clone” button to create a copy.
• “Import” button to import a configuration from the database.
• “Export” button to export a configuration from this database and be able to use it in
other PC.
Unai Huete Beloki MXL Pista datalogger for FSAE
34
Figure 24. Race Studio 2, Select configuration layer.
4.4.2. Channels layer
The channel layer is shown in figure 24. Channels are different from one ECU
model to another. In our case we chose the BOSCH MS4.3 ECU public protocol as it is
explained in 5.4.
Unai Huete Beloki MXL Pista datalogger for FSAE
35
Figure 25. Race Studio 2, Channels layer.
The layer gives the opportunity to change the names to the ECU channels. We
have chosen the names depending on the CAN messages send to the MXL Pista (see
table 4 in 5.7).
Every change in the configuration can be transmitted to the MXL Pista
(connecting the dash through USB cable and powering it to 9-15Vdc) by using the
“Transmit” pushbutton.
• Channel identifier: identifies each channel.
o ECU: messages from Engine Control Unit.
o CH: from the sensors connected to the harness of the MXL Pista.
o ACC_1, LOG_TMP, BATT; CAL_GEAR: internal sensors of the MXL Pista.
• Enable/Disable option
• Channel name: allows changing the desired name. In our case the new names are
shown in 5.7.
• Sampling: allows choosing each channel´s sampling frequency.
• Sensor type: shows sensor type and allows choosing it in CH channels.
• Measure unit: allows changing the measure unit (decimals included).
• Lower and upper bound.
Unai Huete Beloki MXL Pista datalogger for FSAE
36
4.4.3. System Configuration
The figure 26 shows how the System Configuration window looks like. These are
the possible configurable options.
Figure 26. Race Studio 2, System configuration.
• Rpm: we can choose between receiving the RPM value from the sensor included
in the MXL Pista kit (see 3.4.5) or taken the value from the ECU´s rpm CAN
message. In our case we receive it through the CAN Bus (see 5.5.2).
• Gear sensor: we will not use it as the TSR´15 electric car does not have gearbox.
• Shift lights: we can set up the RPM values to switch on the shift LED lights.
• Speed: we will configure the MXL Pista to show the speed taken from the GPS
module, “GPS speed”.
• Lap: we can do a lap configuration in case the track is not recorded in the GPS
module (explained in 4.1).
• Channel for alarm: we can choose the alarm values to switch on the alarm LED
lights in case something is going wrong in the TSR´15. In case one parameter is
Unai Huete Beloki MXL Pista datalogger for FSAE
37
higher or lower than specified, the chosen alarm LED light will switch on and we
will see a message in the lower part of the display.
o Condition enabling checked alarms: we can choose a condition to make
the alarms work or not.
• Measure boxes: we can choose the variables we want to see in the display. This
does not mean that the display is static, for example, it will show different
messages when an alarm switches on or when we do a “BEST LAP”.
• Enable static string: we can write a static message (not strictly static, as it is
explained previously) instead of showing three channel messages in the lower part
of the display.
4.4.4. Online option
In the upper part of the System manager window, or the configuration window,
there is a button called “Online”. It is an interesting feature of the Race Studio 2 program.
Using this option we can see the signals and ECU CAN messages that the dash is
receiving online to check receiving errors.
Figure 27. Race Studio 2, Online window.
To use it, ensure that the MXL is powered on, connected to a PC and connected
to the ECU/GPS module/sensors that we want to receive information from.
Unai Huete Beloki MXL Pista datalogger for FSAE
38
5. How to receive data from ECU (Engine Control Unit) via
CAN
5.1. Introduction
Our FSE (Formula Student Electric) car is controlled by three ECUs (Engine
Control Units): Rear, Front and Relay modules. Each of them controls components
distributed in the rear part of the car or the front part of the car. In our case we will work
with the Front and Rear module. Both of them collect information from several sensors
and components that are monitored by a PIC18F4680 microcontroller (along with the
MCP2551 transceiver) that is programmed to receive information from components and
write the information in the CAN bus.
Figure 28. PIC18F4680 microcontroller.
Figure 29. MCP2551 transceiver.
Unai Huete Beloki MXL Pista datalogger for FSAE
39
The MCP2551 is a high-speed CAN transceiver, that serves as the interface
between a CAN protocol controller and the physical bus.
In this chapter of the project, I will explain how to program the PIC in order to
receive the information and send it to the MXL Pista dash, so that we can save all this
information and be able to analyse it to improve the car performance.
5.2. How to program the PIC18F4680 microcontroller
5.2.1. MikroC PRO
MikroC PRO will be the program used for the modification and compilation of the
“.c” file that will characterize the behaviour of the PIC.
We will create a new project by clicking on “New Project..” and selecting the
desired PIC microcontroller. The program will create a new folder for the project with a
blank “.c” file.
Unai Huete Beloki MXL Pista datalogger for FSAE
40
Figure 30. MikroC PRO software.
After finishing the “.c” file, we will click on “Build” button and see if the file is
correct. If everything is fine, the program will have created a “.hex” file, which will be used
for programming the PIC microcontroller.
5.2.2. MPLAB IDE v8.90 , PICKit 3 and Microchip programming module
MPLAB IDE v8.90 is the software used for the programming of the PIC. We also
need the Microchip PICKit 3 and the programming module.
Unai Huete Beloki MXL Pista datalogger for FSAE
41
.
Figure 31. Microchip PICkit 3 & programming module
As we can see in the figure 31, the PIC18F4680 is placed in the programming
module and the PICKit 3 is connected through USB to the PC.
These are the steps we have to follow in the MPLAB IDE v8.90 program in order
to program the PIC18F4680 microcontroller:
• Programmer > Select programmer > PICKit 3. We select the programmer we are
going to use, in our case, the PICKit 3.
• Programmer > Setting > Power > ✓ Power target circuit from PICKit 3 > OK.
Necessary setting in order to power the programming module. After this step the
software will recognise the connected PIC18F4680, showing the ID of the
microcontroller.
• Programmer > Erase Flash Device. We erase the previous programming.
• File > Import. We will chose the “.hex” file created from the “.c” file created for the
characterization of the microcontroller.
• Programmer> Program. It will show a “Programming/Verify complete” message if
everything if correct.
This is how the program messages should look like after following these previous
steps.
Unai Huete Beloki MXL Pista datalogger for FSAE
42
Figure 32. MPLAB IDE v8.90 software.
5.3. CAN Bus
CAN (Controlled Area Network) is a communication protocol developed by Bosch
company. It was designed to allow microcontrollers and devices to communicate between
them without a host computer. It is a message-based protocol, originally designed for
automotive applications.
Unai Huete Beloki MXL Pista datalogger for FSAE
43
Figure 33. CAN bus network in a commercial car.
Nowadays, most cars use CAN bus protocol for transmission/reception for the
easy exchange of data across the array of computers and sensors scattered around the
car. CAN bus networks improve reliability and let vehicles self-diagnose problems.
In our case, the PIC18F4680 microcontroller along with the MCP2551
transceiver, will be connected to the CAN bus. The MCP2551 device serves as the
interface between a CAN protocol and the physical bus. The microcontroller decides what
the received messages mean and what messages it wants to transmit. Sensors and other
components are going to be connected to the microprocessor directly to one pin or via
CAN bus.
Unai Huete Beloki MXL Pista datalogger for FSAE
44
A CAN message has the following structure:
• ID: identification number consists of 11 bits.
• Data: 8 bytes (64 bits) for data transmission/reception (Data 0-7). Depending on
the message, a component could use two bytes to transmit the information or only
one.
• Row: Sometimes, Data 0 byte is used to select which information is going to send
when two components use the same ID and data byte number. For example:
o A temperature sensor, using ID=0x210 and Data 7 for information
transmission, with Row Data 0=0x00.
o A voltage sensor, using the same ID=0x210 and Data 7 for information
transmission, but in this case Row is different, Data 0=0x03.
ID Data 0
(Row)
Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7
Figure 34. CAN message structure.
5.4. Specify a commercial ECU for the MXL Pista dash
One of the problems we faced when we start trying to send CAN messages to the
MXL Pista dash was that the device was only able to collect CAN information from
commercial ECUs (Engine Control Units). The Dash is prepared to be connected to a
preconfigured car´s ECU and start working correctly.
We found that the Bosch MS4.3 ECU configuration was included in Race Studio
2 and that is it is a publicly documented. We can find the MS4.3 ECU integration
document in the following website:http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_g
a_continental_tire_series_ms43_system_integration_info_r14_en_de.pdf.
As a resume, we provide a table with all the possible CAN messages for the
Bosch MS4.3 ECU configuration.
Unai Huete Beloki MXL Pista datalogger for FSAE
45
Table 2. BOSCH MS4.3 ECU configuration.
Unai Huete Beloki MXL Pista datalogger for FSAE
46
5.5. Rear control module
The rear control module is the one in charge of controlling the BAMOCAR
inverters, the ones that give the necessary current to the vehicle’s engine. The Front
module takes information from the potentiometer, sends it to the Rear module. The Real
module controls the inverters depending on the received information from the Front
module.
5.5.1. Rear module hardware
In the figure 35 we can see how the rear module looks like. This module was
created by components of the electric/electronic staff of Tecnun Seed Racing team.
Figure 35. Rear Module.
The components related with the programming of the microcontroller are
numbered in the figure 35.
• 1 PIC18f4680 microcontroller (datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf).
• 2 MCP2551 transceiver (datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/21667f.pdf).
Unai Huete Beloki MXL Pista datalogger for FSAE
47
• 3, 4, 5, 7, 8 and 9 CAN bus connections (CAN_H & CAN_L). The BAMOCAR
inverters (datasheet: http://www.unitek-online.de/pdf/download/Antriebe-
Drive/Servo-Digital/E-DS-CAN.pdf) are going to connected via CAN.
• 7 AD22100 Voltage output temperature sensor, used for water temperature
measurement (datasheet: http://www.analog.com/media/en/technical-
documentation/data-sheets/AD22100.pdf).
• 6 5V and GND connection.
• 10 15V and GND connection.
• 8 ADXL335 3 axis accelerometer (datasheet:
https://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf).
• The CFPX-104 crystal oscillator set up to 40 MHz (datasheet:
http://www.iqdfrequencyproducts.com/products/details/cfpx-104-9-05.pdf) is placed
in the other part of the module, connected to ports 13 and 14, as we can see in
figure 35.
• 11 ADXRS652 Gyroscope (http://www.analog.com/media/en/technical-
documentation/data-sheets/ADXRS652.pdf), for Yaw Rate information.
The most important component of the module is the PIC18F4680 microcontroller,
as we have mentioned before, is the one that controls the CAN bus along with the
MCP2551 transceiver. Our aim is to take the information from the components connected
to this module and write them in a specific format in order to be able to read and collect
the information in the AIM MXL Pista dash. Some of the information will also be modified
to control the behaviour of other components. For example, the water temperature sensor
will be used to switch on/off the water pump of refrigeration part of the electric car.
In figure 36 we can see the inputs and outputs of the PIC18F4680
microcontroller. From the sensors shown above, the ones that are going to be sent to the
MXL Pista are: Water temperature, Yaw rate and Inverter Speed (this one is received via
CAN, port 36 in microcontroller). We will not send the 3 axis accelerometer sensor’s
Figure 36. PIC18F4680 inputs/outputs.
Unai Huete Beloki MXL Pista datalogger for FSAE
48
information to the Dash as we have that information with the GPS module. “V_bus” and
“I_bus” shows the voltage and current in the car´s batteries. It is better to take these both
data from the BMS (Battery management system) since it is more accurate.
An important component placed in the Rear module is the CFPX-104 40 MHz
crystal, which is used to increment the bit rate of the CAN bus to 1Mbps, because the
MXL Pista works at that bit rate. Our module previous worked at 250Kbps at that
difference made the bus drop.
Using the crystal we incremented the bit rate to make the CAN bus work. The
MCP2551 also supports 1 Mbps operation, so the problem was solved.
Figure 37. TSR´15 components distribution.
In Figure 37 we can see the position of the Rear module. It is located inside the
Electronic Box (red box).
5.5.2. “Rear.c” file
The “Rear.c” file is the “.c” file used for compiling and creating the “Rear.hex” file,
the one used for programming the PIC18F4680 (as explained in 5.2.2).
Unai Huete Beloki MXL Pista datalogger for FSAE
49
Code 1. "Rear.c".
In the first lines of the code we define the constant and variables that are going to
be used during the “Rear.c” file.
Code 2. "Rear.c".
In the second part of the code, we define the ports of the PIC18F4680
microcontroller as inputs or outputs. We also set the microcontroller´s clock frequency by
giving a specific value to the variable “OSCCON”.
Unai Huete Beloki MXL Pista datalogger for FSAE
50
Figure 38. Definition of "OSCCON variable taken from PIC18F4680 datasheet.
Figure 39. Clock diagram taken from PIC18F4680 datasheet.
As we can see in code 2, we are giving a value “01110000” to “OSCCON”
variable. The two least significant bits are set to “00”, means that we are using the primary
oscillator (figure 38). From figure 39 we can see that the primary oscillator is related with
Unai Huete Beloki MXL Pista datalogger for FSAE
51
the component connected in ports OSC2 and OSC1 (port number 13 and 14), in our case
that is the CFPX-104 40 MHz crystal.
Code 3. "Rear.c".
In the third part of the code we continue with the settings for the microcontroller.
We disable PSP ports (see page 142 in PIC18F46801
datasheet), reset CCP1 module
(see page 165 in PIC18F46801
datasheet) and disable comparators (see page 259 in
PIC18F46801
datasheet). The most important part of these code lines is the definition of
ADCON1 variable.
Figure 40. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).
1 PIC18F4680 microcontroller datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
Unai Huete Beloki MXL Pista datalogger for FSAE
52
As we can see in figure 40 and code 3, we set the ANx ports as analog ports.
This ports are going to be connected this different sensors which will give a certain analog
value depending on the sensor and its parameters.
Code 4 . "Rear.c".
Code 4 describes the configuration of the PIC18F4680 for the CAN bus. The
CAN bus timing parameters are taken in order to have a bit rate of 1Mbps (see point 23.9
in PIC18F46802
datasheet). Some parameters were taken from a CAN bit rate calculator
(http://www.kvaser.com/support/calculators/bit-timing-calculator).
We use the functions shown in code 4 to initialize, set the operation mode and
set masks for advanced filtering of messages.
Code 5 . "Rear.c" .
2 PIC18F4680 microcontroller datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
Unai Huete Beloki MXL Pista datalogger for FSAE
53
“CANSetFilter” function in code 5 sets a message filter for a message with the
specified ID. It is necessary to define the filters before the program loop in order to be able
to receive messages from the chosen ID.
The BAMOCAR3
inverters need to receive a message to start sending the RPM
value permanently to the Rear module.
Figure 41. Necessary message for RPM valu taken from BAMOCAR CAN bus datasheet.
The message format specified in figure 41 is different from the one in the code.
Data 1 in the BAMOCAR3
will be Data 0 in the code. Same for the rest of data bytes,
always one number inferior. The message has the following structure as we can see in
Code 5:
• ID: 0x210.
• DLC: 3, specified in the function “CANWrite” (third parameter).
• Data 0: 0x3d.
• Data 1: 0x30.
• Data 2: 0x01. We can see in figure 34 that Data 3 is 0x64 (100 in decimal format).
In our case we choose 0x01 (1 in decimal) for a repetition timing of 1ms.
This message is specified before the program loop because the inverter only
needs to receive this message once.
3 BAMOCAR CAN bus datasheet (http://www.unitek-online.de/pdf/download/Antriebe-
Drive/Servo-Digital/E-DS-CAN.pdf).
Unai Huete Beloki MXL Pista datalogger for FSAE
54
Code 6 . "Rear.c".
With Code 6 part we start with the program loop of the “Rear.c” file. In this part of
the code we receive the CAN message send by the Front module. This message has an
ID=0x100 and is send in BIG ENDIAN format. We convert the message data into a
variable (accel1).
Figure 42. Torque reference definition taken from BAMOCAR datasheet.
As we can see in figure 42, we have to send the acceleration (torque reference)
information with an ID=0x210, Data 0=0x90 and Data 1-2 for “accel1” information in
LITTLE ENDIAN format.
Unai Huete Beloki MXL Pista datalogger for FSAE
55
Code 7. "Rear.c".
Code 7 part shows how we read the inverters speed (RPM) information from the
CAN.
The message is received in LITTLE ENDIAN format and we convert the two data
bytes into a variable called “speed”.
Figure 43. BAMOCAR inverter RPM data sending format taken from datasheet.
As we can see in figure 43, the BAMOCAR4
CAN datasheet specifies that the
ID=0x190 and Data 0=0x30, we use this information to convert the message into the
variable under these conditions.
In the end of the code 7 part, we multiply the “speed” by 4 to show this value
correctly in the MXL Pista dash:
4 BAMOCAR CAN bus datasheet (http://www.unitek-online.de/pdf/download/Antriebe-
Drive/Servo-Digital/E-DS-CAN.pdf).
Unai Huete Beloki MXL Pista datalogger for FSAE
56
• The theoretical range for the inverter RPM data bytes value is
0<RPM<65535 (0xFFFF), as it uses two bytes, but it will never arrive to
more than 5000. This means that the quantization is 1 rpm/bit.
• The Bosch MS4.35
has a range of 0<RPM< 16383.75 for the RPM
message (see table 2, ECU_1), which gives a quantization of 0.25 rpm/bit.
Code 8. "Rear.c".
Code 8 just reads the gyroscope´s voltage value (port 10, AN7) that will give us
the Yaw rate value.
Code 9. "Rear.c".
Code 9 part is related with the data from the water temperature sensor connected
to port 34 (AN8). “WT” variable takes the digital voltage value from the sensor and we use
the variable for a temperature value. The conversion is done using the equation given in
5 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf).
Unai Huete Beloki MXL Pista datalogger for FSAE
57
AD221006
datasheet and modifying it because of an offset respect to the analog voltage
value in port 34 (using the polimeter) and the value given by the ADC converter.
• PIC18F46807
has a 10 bit ADC converter (page 249 in datasheet).
• 1.375V (0ºC) correspond to 282 integer in the code.
• (WT-88) gives the correct voltage value. “88” is the offset explained previously,
that corresponds to a difference of 0.42V. This value depends on the battery we
are using to power the Rear module.
Code 10. "Rear.c".
Code 10 part explains how we are going to send the information to the MXL
Pista. We will use 3 messages taken from Table 2 to send speed (RMP), Yaw rate and
Water Temperature data.
• Speed (RPM): will use “MS43_RPM” message configuration: ID=0x770 and Data 1&2.
• Water Temperature: we will use “MS43_ECT” message configuration: ID=0x770, Data 0
(Row)=0x03 and Data 7. It is modified in the last lines of Code 9, in order to save it
correctly in the MXL Pista.
o The important range in this value will be around the value 30ºC, as we are
going to use it to switch on/off the water pump. So it is enough to take the 8
LSB for this value.
o “MS43_RPM” message has a range of -40ºC to 215Cº and a quantization
of 1ºC/ bit.
o A TempP=0x00, 0ºC will be a -40ºC in the MXL Pista. This is the reason for
adding 40 to TempP variable in the last lines of code 9.
• Yaw rate: will use “MS43_SPEED” message configuration: ID=0x770 and Data
3&4. This data will not be shown in the display, as it does not represent the real
value. We will send it in this format to collect the Yaw Rate data.
To represent the real value we will do the following conversion after
downloading the data from the MXL Pista:
6 AD22100 datasheet: http://www.analog.com/media/en/technical-documentation/data-
sheets/AD22100.pdf.
Unai Huete Beloki MXL Pista datalogger for FSAE
58
Yaw_rate=abs (512-(MS43_SPEED*128,2))/1.435
Code 11. "Rear.c".
The Code 11 part shows the conversion of the voltage value (digital from ADC)
taken from the ADXRS6528
gyroscope to the real value of the Yaw Rate, through
equations taken from the datasheet. The message with ID=0x1E0 is written in the CAN
bus but it is not shown in the display (Yaw rate for the display shown in Code 8 and 10).
This one writes the real value directly in the CAN bus in BIG ENDIAN format and will be
used for the traction control in future implementations.
Code 12. "Rear.c".
7 PIC18F4680 microcontroller datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
8 ADXRS652 Gyroscope datasheet: http://www.analog.com/media/en/technical-
documentation/data-sheets/ADXRS652.pdf.
Unai Huete Beloki MXL Pista datalogger for FSAE
59
Code 13. "Rear.c".
Code 12 and 13 shows how the 3 axis accelerations are taken from the
ADXL3359
and written in the CAN Bus. The conversion done from the digitally converted
voltage value to the real acceleration value is taken from the ADXL3359
datasheet.
This information will be used for the future implementation of the traction control
of our SAE Formula Student electric car.
9 ADXL335 3 axis accelerometer (datasheet:
https://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf).
Unai Huete Beloki MXL Pista datalogger for FSAE
60
Code 14. "Rear.c".
The last part of the code takes the analog values of V_bus and I_bus by using
the function “Adc_Get_Sample” and writes them in the same message with ID=0x118.
This both values will be taken from the BMS (Battery Management System) in the Front
module via CAN, as it is has more accuracy than the sensors mentioned before.
To conclude the code, the rear right wheel speed and left wheel speed
information is taken in a similar way to the previous sensors. “ADC_Read” function reads
the digital value of the voltage given by the connected sensor. Both wheel speeds are
written in the same message ID=0x530.
5.5.3. “Rear.c” implementation in PIC18F4680 microcontroller
For the implementation of the “Rear.c” file follow the steps in 5.2.1 and 5.2.2.
Unai Huete Beloki MXL Pista datalogger for FSAE
61
5.6. Front module
The Front module is the one that controls the starting process of the TSR´15
electric car, and controls and receives information from the components placed in the front
part of the car. It is connected to the Dashboard of the car, where all the control buttons
are placed. The most important characteristics of the front module is that it takes the
acceleration pedals value in order to ask for an specific current to the inverters that will
make the car to start running.
5.6.1. Front module hardware
In the figure 44 we can see the Front module position and the dashboard. The
Front module was created by the electric/electronic members of Tecnun Seed Racing
team.
Figure 44. Front module (red box) and Dashboard with AIM MXL Pista.
Unai Huete Beloki MXL Pista datalogger for FSAE
62
Figure 45. Dashboard of the TSR´15.
Figure 45 shows how the dashboard looks like (the final one will be fabricated in
carbon fiber). Every button and led function will be explained in the code implementation.
Figure 46. Top and lateral view of Front module box.
The components related with the programming of the PIC18F4680
microcontroller are numbered in the figure 46:
DMSRDBADT IMD ledARS BMS ledTV
Unai Huete Beloki MXL Pista datalogger for FSAE
63
• 1 PIC18f4680 microcontroller (datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf).
• 2 MCP2551 transceiver (datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/21667f.pdf).
• 3 & 4 through the cables shown in figure 40, several components (dashboard
buttons, dashboard LEDs, acceleration potentiometers, CAN bus, etc.) are
connected from the exterior of the Front module box. Those components are
connected through inputs as the ones shown in the lateral view of figure.
The most important component is the PIC18F4680 microcontroller, along with the
MCP2551 transceiver, they control the messages written and read in the CAN bus. In the
figure 46 we can see the inputs and output of the PIC18F4680 microcontroller. Some
information will the taken directly from the sensors (converting the analog voltage value
into digital) or will be read from the CAN Bus.
As in the Rear module, we had to use a CFPX-10410
crystal oscillator set up to
40MHz to increment the bit rate of the CAN Bus to 1Mbps, because the AIM MXL Pista
works at that bit rate and it drops if the bit rate is lower. Both the PIC18F4680
microcontroller and the MCP2551 transceiver support a bit rate of 1Mbps.
10 CFPX-104 crystal oscillator (datasheet:
http://www.iqdfrequencyproducts.com/products/details/cfpx-104-9-05.pdf)
Figure 47. PIC18F4680 ports configuration (RDB_LED_ACT and BMS_LED_ACT ports are
interchanged).
Unai Huete Beloki MXL Pista datalogger for FSAE
64
5.6.2. “Front.c” file
The “Front.c” file is the “.c” file used for compiling and creating the “Rear.hex” file,
the one used for programming the PIC18F4680 (as explained in 5.2.2).
Code 15. "Front.c".
The first lines of the code define the constants and variables that are going to be
used during the “Front.c”. The ports are defined with the names of the dashboard´s
buttons connected to them.
Code 16. "Front.c".
In the second part of the code, we define the ports of the PIC18F4680
microcontroller as inputs or outputs (1 or 0). We also set the microcontroller´s clock
Unai Huete Beloki MXL Pista datalogger for FSAE
65
frequency by giving a specific value to the variable “OSCCON” to use the primary
oscillator (CFPX-104 40MHz crystal).
Figure 48. Definition of "OSCCON variable taken from PIC18F4680 datasheet.
Figure 49. Clock diagram taken from PIC18F4680 datasheet.
Unai Huete Beloki MXL Pista datalogger for FSAE
66
As we can see in code 16, we are giving a value “01110000” to “OSCCON”
variable. The two least significant bits are set to “00”, means that we are using the primary
oscillator (figure 43). From figure 49 we can see that the primary oscillator is related with
the component connected in ports OSC2 and OSC1 (port number 13 and 14), in our case
that is the CFPX-104 40 MHz crystal.
Code 17. "Front.c".
In the third part of the code we continue with the settings for the microcontroller.
We disable PSP ports (see page 142 in PIC18F468011
datasheet), reset CCP1 module
(see page 165 in PIC18F468011
datasheet) and disable comparators (see page 259 in
PIC18F468011
datasheet). The most important part of these code lines is the definition of
ADCON1 variable.
11 PIC18F4680 microcontroller datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
Unai Huete Beloki MXL Pista datalogger for FSAE
67
Figure 50. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).
As we can see in figure 50 and code 3, we set the ANx ports as analog ports.
This ports are going to be connected this different sensors which will give a certain analog
value depending on the sensor and its parameters.
Code 18. "Front.c".
Code 18 describes the configuration of the PIC18F4680 for the CAN bus. The
CAN bus timing parameters are taken in order to have a bit rate of 1Mbps (see point 23.9
Unai Huete Beloki MXL Pista datalogger for FSAE
68
in PIC18F468012
datasheet). Some parameters were taken from a CAN bit rate calculator
(http://www.kvaser.com/support/calculators/bit-timing-calculator).
We use the functions shown in code 18 to initialize, set the operation mode and
set masks for advanced filtering of messages.
Code 19. "Front.c".
“CANSetFilter” function in code 19 sets a message filter for a message with the
specified ID. It is necessary to define the filters before the program loop in order to be able
to receive messages from the chosen ID. We also set the operation mode for the CAN
messages.
Code 20. "Front.c".
With the code 20 part we start with the program loop. In this first part of the code,
we detect the state of the DMS (Driver Master Switch, the one with a “start” word written in
the dashboard). It will send the following message to start with the precharge period:
12 PIC18F4680 microcontroller datasheet
Unai Huete Beloki MXL Pista datalogger for FSAE
69
• Id=0x180.
• Data 0: 0xFF.
• Delay_ms(4000): we leave the necessary time for the precharge.
• Dms= 0x09: this variable will be send to the MXL Pista datalogger. We will use the
“MS43_EXH_T2” message in the Bosch MS4.313
protocol. It will show a “5” we it is
switched on, we will use this value to show a message in lower part of the display.
Code 21. "Front.c".
Code 21 part, will check if the inverters are enabled (“rdb_check”) and just in
case they are enabled and the RDB (Ready to Drive Button) is switched on, it will send a
message to enable the inverters with the following structure:
• Id=0x150.
• Data 0: 0xFF.
• Rdb= 0x09: will be sent to the dash once the DRB is switched on. We will use the
“MS43_EXH_T1” message in the Bosch MS4.313
protocol. It will show a “5” we it is
switched on, we will use this value to show a message in lower part of the display.
Code 22. "Front.c".
Code 22 shows one of the most important parts, in order to be able to move the
electric car. To get the desired acceleration, we use two potentiometers. These two
potentiometers will give a analog voltage value, depending on the accelerating pedal
position.
http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
13 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
70
The PIC18F4680 will read the analog voltage value and convert it to a digital
value using its internal 10 bits ADC converter. These both acceleration values will be
multiplied by the “ars” variable. The “ars” variable will have two values depending on the
ARS (Activate Regulation Speed) button position (on/off). The ARS value will be defined
in the following code lines.
Finally we will write both acceleration values in the CAN Bus with the following
BIG ENDIAN format shown in the code 22. This CAN message will be read in the Rear
module, as we explained in 5.5.2, to ask for the necessary current to the inverters.
Code 23. "Front.c".
Code 23 describes how to write the CAN messages in order to receive the
“Accel2” information and RDB/DMS status in the MXL Pista dash.
• RDB: uses “MS43_EXH_T1” message format in Bosch MS4.314
protocol.
• DMS: uses “MS43_EXH_T1” message format in Bosch MS4.314
protocol.
• Accel2: uses “MS43_MAP_BE_T2” message format in Bosch MS4.314
protocol.
See the necessary “Row” values (data 0) and the data bytes positions in the
Bosch MS4.3 protocol table (Table 3 in 5.4).
14 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
71
Code 24. "Front.c".
Code 24 explains how to check status of the TV button. It also writes “accel1” and
“tv” messages in the CAN Bus, each one with his Row (data 0) number:
• “tv” uses “MS43_WATER_P” message format in the Bosch MS4.315
protocol. It will
send a tv=0x14 (20 in decimal) when the TV button is switched on. This value
corresponds to a 0x01 (1 decimal) in the MXL Pista when the button is on and a
0x00 (decimal 0) when the button is off.
• “accel1” uses “MS43_MAP_AF_T1” message format in the Bosch MS4.315
protocol.
TV button status will be used in the future to activate/deactivate the traction
control that will be implemented in the Rear module.
15 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
72
Code 25. "Front.c".
Code 25 shows how to check the status of ARS (Activate Regulation Speed) and
ADT (Activate Data Transmission) switch buttons:
• “ars” variable is used to change the value of “accel1” and “accel2” variables. The
driver has the opportunity choose between a maximum torque demand of 100% or
choosing a 50% if the batteries are not able to give enough power for a long
period.
It uses “MS43_LAMBDA_CTR2” message format in the Bosch MS4.316
protocol. It will send an ars=0x80 (128 in decimal) when the TV button is switched
on. This value corresponds to a 0x01 (1 decimal) in the MXL Pista when the button
is on and a 0x00 (decimal 0) when the button is off.
• “adt” uses “MS43_LAMBDA_CTR1” message format in the Bosch MS4.316
protocol. It will send an adt=0x80 (128 in decimal) when the TV button is switched
on. This value corresponds to a 0x01 (1 decimal) in the MXL Pista when the button
is on and a 0x00 (decimal 0) when the button is off.
Finally both values are written in the CAN message, as “MS43_LAMBDA_CTR2”
and “MS43_LAMBDA_CTR1” messages use the same identifier, row number and different
data bytes.
16 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
73
Code 26. "Front.c".
Code 26 describes how to take information from the brake potentiometer and
brake pressure sensors. The potentiometer placed in the brake pedal of the TSR´15 will
give a certain voltage value depending on the pedal position.
Both brake pressure have a conversion in order to be able to see them correctly
in the MXL Pista dash:
• “Brake_Press1” uses “MS43_MAP_BE_T1” message format in the Bosch MS4.317
protocol. The MXL Pista will consider that we are sending in “mbar” unit, but we
have to interpret it as “bar” unit.
17 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
74
• “Brake_Press1” uses “MS43_MAP_AF_T1” message format in the Bosch MS4.317
protocol. The MXL Pista will consider that we are sending in “mbar” unit, but we
have to interpret it as “bar” unit.
The conversion for the Race Technology Brake Sensor18
is taken from the
datasheet.
Code 27. "Front.c".
Code 27 shows how to read front right/left wheel speeds. We will have to
implement the conversion for the voltage values when get the sensors.
Code 28. "Front.c".
18 Race Technology Brake Sensor datasheet:http://www.race-
technology.com/wiki/index.php/PressureSensors/BrakePressure .
Unai Huete Beloki MXL Pista datalogger for FSAE
75
In code 28 part, we start reading messages from the CAN Bus. The identifiers of
these messages were previously defined to be filtered before the program loop (CAN
settings in the beginning of the code). The first message is the BMS (Battery Manage
System) failure, a general failure in the battery system. In case we have a failure a LED
will switch on in the dashboard and it will appear a “BMS_FAILURE” message in the MXL
Pista.
• “bms” uses “MS43_OIL_T” message format in the Bosch MS4.319
protocol. When
the alarm message is received, bms=0x29 (decimal 41) that corresponds to a 1 in
the MXL Pista.
Code 29. "Front.c".
Code 29 describes how to switch on a LED and write a message in the CAN Bus
in case we receive an IMD (Insulation Monitor Device) failure, which means that there is a
power loss in the car that could be dangerous. It measured with a resistance between
GND a positive pole from HV (High voltage).
• “imd” uses “MS43_FUEL_T” message format in the Bosch MS4.320
protocol. When
the alarm message is received, imd=0x29 (decimal 41) that corresponds to a 1 in
the MXL Pista.
19 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
20 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
76
Code 30. "Front.c".
Code 30 explains how to receive battery cells current from a CAN message and
send it to the MXL Pista. It is really useful information for the driver. He could control the
power given by the inverters and run slower/faster depending on the status of the battery
cells (current/voltage). In this code part we show how to receive the current information
from the BMS (Battery Management System) via CAN Bus.
• “current” uses “MS43_AIR_T” message format in the Bosch MS4.321
protocol. A
conversion is done in order to receive the correct value of the current in Amperes
in the MXL Pista.
21 Bosch MS4.3 ECU configuration (http://www.bosch-
motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin
ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
Unai Huete Beloki MXL Pista datalogger for FSAE
77
Code 31. "Front.c".
Code 31 shows the last part of “Front.c” file. In this part of the code we read the
battery cells total voltage from the BMS (Battery Management System) via CAN. As we
previously explained, it is useful information for the TSR´15 driver.
• “BatteryV” uses “MS43_FUEL_USED” message format in the Bosch MS4.321
protocol.
5.6.4. “Front.c” implementation in PIC18F4680 microcontroller
For the implementation of the “Front.c” file follow the steps in 5.2.1 and 5.2.2.
5.7. Table with Bosch MS4.3 protocol and used TSR messages for
MXL Pista
In the next table we can see resume of the available messages in the Bosch
MS4.321
protocol, the sensor/information assigned to the message and the new TSR
name given to the message.
Unai Huete Beloki MXL Pista datalogger for FSAE
78
Table 4. CAN messages sent to MXL Pista logger.
Unai Huete Beloki MXL Pista datalogger for FSAE
79
6. AIM MXL Pista (Quick Guide)
6.1. Keyboards function
Through the MXL keyboard we can see all the information stored in the dash.
These are some available options that we have using the keyboard:
• Recall recorded data.
• Enable/disable night vision.
• Several settings: Shift lights, beacon and splits for GPS Laptimer (explained in
4.1.3), date and time, etc.
Figure 51. MXL Pista dash/datalogger.
In the figure 51 we can see the keyboard of the MXL Pista:
• 1 “MENU/<<” button.
• 2 “>>” button.
• 3 “ok/MEM” button.
• 4 “quit/VIEW” button.
Unai Huete Beloki MXL Pista datalogger for FSAE
80
6.1.1 Recall recorded data
When a test session is finished we can see the recorded data using our MXL
keyboard. To recall recorded data:
• Push “MEM” button display shows best lap time (rpm and speed max values)
• Using “<</>>” buttons we can scroll all the laps and split times (with rpm and
speed max values).
6.1.2 Other functions
• How to enable disable backlight.
o “MENU” ”OK/MEM” for on/off “Quit/VIEW”.
• Set GPS beacons and splits
o See 4.1.3.
• View/clear total running
o “MENU” twice total run (distance and time).
o “OK” “OK” cleared.
• Odometer
o “MENU” three times odometer in km.
• Set date and time
o “MENU” four times “OK” and “<</>>” set hour “OK” and “<</>>” set
minute “OK” and “<</>>” set year “OK” and “<</>>” set month
“OK” and “<</>>” set day “OK” and “<</>>” set weekday “OK” and
“Quit/view” button.
• Set shift lights
o “MENU” six times shift light “OK” Insert RPM value “<</>>”
second RPM value … “Quit/VIEW”.
• System information
o “MENU” seven times Firmware version and logger serial number.
6.2. Connections
Figure 52 shows how the dash looks like from the back part. The connections are
going to be briefly explained.
Unai Huete Beloki MXL Pista datalogger for FSAE
81
Figure 52. MXL Pista dash/datalogger.
6.2.1. Harness
The harness wiring provided with the MXL Pista Kit (see 3.4.5). It has to be
connected in the back of the MXL Pista dash.
Figure 53. AIM MXL Pista harness.
The harness includes CAN interface wiring, power related wiring and 8 channels
for different AIM sensors. It has to be connected to AMP 28C connector (see Appendix 3).
CAN+ and CAN- will be connected to the CAN Bus through the Front module CAN high
(CAN +) and CAN low (CAN -) inputs.
Unai Huete Beloki MXL Pista datalogger for FSAE
82
6.2.2. GPS module
The GPS05 GPS module explained in 3.4.4 ha to be connected in the back of the
MXL Pista dash to the Binder 712-5C connector (see Appendix 3).
Figure 54. GPS05 GPS module.
Unai Huete Beloki MXL Pista datalogger for FSAE
83
7. Race Studio Analysis: Download, save & analyze test
values
Race Studio 2 is data analysis software designed specifically to download and
process the data from AIM MXL Pista. The results can be viewed and presented in many
different ways in other to analyze the data in the way you need. It is a powerful instrument
to analyze and improve vehicle and driver´s performances.
7.1. Race Studio Analysis: Download and save test values
Once you have end a test sessions, we can download data stored in the MXL
Pista memory and store it. Firstly, we have to open Race Studio Analysis program
(installation explained in Appendix 1).
To download the data follow these steps:
• Run Race Studio 2 software.
• Connected the MXL Pista to USB port and power it.
• Click on “Download” button (green arrow) on top toolbar.
• Choose name and different options for the test data.
• We can choose to clear the datalogger once we have downloaded the information.
• Click on Save.
We can also import a test from a USB drive clicking on “Import test” button.
Unai Huete Beloki MXL Pista datalogger for FSAE
84
7.2. Race Studio Analysis: How to use it.
After downloading some data, or if we have already downloaded data before, we
will see the events list in “Test database and lap manager” window (see figure 55).
Figure 55. "Test database and lap manager" window.
The following analysing methods will be explained with a test done in TSR’14
electric car, just recording with the GPS module and MXL Pista internal sensors data (not
TSR’14 ECUs), as the TSR’15 is not ready to run yet.
To open a test, double click on the desired test, in our case “Primera prueba
infineon”.
Unai Huete Beloki MXL Pista datalogger for FSAE
85
7.2.1. How to plot measures graphs
With Race Studio Analysis, we can plot the recorded laps and sampled data
versus time, distance and frequency.
As an example we will show the “GPS_Speed” data saved during “Primera
prueba Infineon” test. Figure 56 shows the “GPS_Speed” vs Time plot. This plot is useful,
for example, to know how fast the TSR’15 could do the SAE acceleration test.
Figure 56. Race Studio Analysis: "GPS_Speed" vs Time.
In figure 56 we can see that the TSR’14 could do the acceleration test in 5
seconds, with a maximum speed of 84,3 Km/h. To see this graph we followed these steps:
• Click on “Plot measures in a graph” button in the left-upper part of the “Measure
graph” window.
• Choose the desired channel in the left toolbar.
• We can change from Time to Distance with the button “Time/Distance” in the
upper-right part of the plot.
Unai Huete Beloki MXL Pista datalogger for FSAE
86
All the plots can be exported to Excel files by clicking on File>Data export in
Excel. In the lower part of the window we can select the lap we want to draw in the graph.
Different channels and laps can be selected for the same graph.
7.2.2. How to plot measure graph vs GPS position
Race Studio 2 also offers the possibility to draw the sampled data according the
GPS position in each sampling time. Figure 57 shows the GPS module’s lateral
acceleration (GPS_LatAcc) in each position of the track, in this case taken from a test
done in a commercial car in Miramón, San Sebastian.
Figure 57. Race Studio Analysis: "GPS_LatAcc" vs GPS position.
The GPS based graphs can also be used to see which driving technique is the
fastest one for each track. Drawing all the laps and selecting the fastest one, we can see
how we have to turn in each curve to go faster.
Unai Huete Beloki MXL Pista datalogger for FSAE
87
Figure 58. GPS graph zoomed in.
We also have the option to see the lap replay clicking on “Show lap replay
analysis” button in the upper toolbar. Furthermore, another interesting characteristic of
Race Studio 2 program is that we can see the GPS tracking in the real position exporting
the GPS data to Google Earth program (see Appendix 2 for installation).
We can see GPS data in Google following these steps: File>Export KML file for
Google Earth. Double click on the saved file.
Unai Huete Beloki MXL Pista datalogger for FSAE
88
Figure 59. GPS data exported to Google Earth.
Unai Huete Beloki MXL Pista datalogger for FSAE
89
8. Project budget
Table 5. Project Budget.
Unai Huete Beloki MXL Pista datalogger for FSAE
90
9. Conclusions
• The main problem was that the MXL Pista dash is prepared to be connected to
commercial ECUs (Engine Control Units) and do not need any other
configurations. To connect our ECU modules to the dash, we had to modify
modules with and external oscillator and take off one of the CAN Bus 120Ω
termination resistances, as the MXL Pista works at 1MBps (previous bit rate
250KHZ) and has an internal 120Ω termination. AIM manufacturer helped us
solving these problems.
• A public ECU configuration protocol was necessary because, as we previously
explained, the MXL Pista dash is prepared to be connected to commercial ECUs.
We used the Bosch MS4.3 ECU protocol.
• It will be easier to detect failures in the TSR’15 electric car. The MXL Pista will
record information from components that can be analysed to see what is going
wrong. The car will be stopped if an alarm message is shown in the dash.
• The TSR’15 driver will have really useful information shown in the display. For
example, the driver will be able to change the driving technique depending on the
battery cells status.
• The GPS05 GPS module will be helpful for lap timings and other internal sensors
information.
• The Race Studio 2 and Race Studio Analysis programs will help to improve the
driver and car’s performance.
Unai Huete Beloki MXL Pista datalogger for FSAE
91
Appendix
Appendix 1: AIM software installation (GPS manager, Race Studio
2 y Race Studio Analysis) and driver
MXL Pista has been designed to connect with a PC through an USB cable. It can
only be configured throught Race Studio 2 software, provided by AIM along with the MXL
Pista.
In the package we can find the software CD-ROM and USB cable. The
configuration is only possible after the installation of the software and USB driver in our
PC.
AIM software programs had been designed to work in Windows operative
systems. In this case I will show how we can install the necessary programs to configure
the MXL Pista in a PC with Windows 7 I operative system.
To install “Race Studio 2” and “GPS Manager” follow the directions as detailed
below:
• Close all applications and if MXL is connected to the PC, unplug it.
• Insert the CD-ROM in the PC and the following window will appear. Press “Run
index.htm”.
Figure 60. Window after CD-ROM insertion.
Unai Huete Beloki MXL Pista datalogger for FSAE
92
• An Internet Explorer window will appear. Choose the language for the software
(Italian or English).
• In the next window we will choose the programs we want to install,” Race Studio 2”
for the configuration of the MXL Pista and “GPS Manager” for the configuration of
the GPS module).
• We will start with the downloaded file called “RS2Setup.exe”. Follow the directions
shown below:
o Press “Next” button.
o Press “Finish” button.
• The following icons will appear in the desktop of our PC.
Figure 62. "Race Studio 2" and "Race Studio Analysis" icons.
• Finally we will install the software for the GPS module. Execute the file
“GPSMAnagerSetup.exe”.
o Press “Next” button.
o Press “Finish” button.
• The following icon will appear in our desktop.
Figure 63. "GPS Manager" icon.
Figure 61. Internet Explorer window.
Unai Huete Beloki MXL Pista datalogger for FSAE
93
Appendix 2: Google Earth program
installation
“Google Earth” program will be really helpful to configure our GPS module. With
this program, for example, we will be able to show the tracks done by our car or define
tracks/circuit coordinates, so that the GPS module can measure lap times or split times in
the defined track.
To install “Google Earth” follow the directions as detailed below:
• Enter in the following link: https://www.google.es/intl/es/earth/index.html.
• Press “Descargar Google Earth” button.
• Press “Aceptar y Descargar” button.
• Execute the following file: “GoogleEarthSetup.exe”.
• Press “Run” button.
Unai Huete Beloki MXL Pista datalogger for FSAE
94
Appendix 3: MXL Pista dash installation template
Unai Huete Beloki MXL Pista datalogger for FSAE
95
Unai Huete Beloki MXL Pista datalogger for FSAE
96
Appendix 4: MXL Pista technical characteristics
Unai Huete Beloki MXL Pista datalogger for FSAE
97

More Related Content

What's hot

2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways
2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways
2011 GMC Savana Upfitting Wisconsin - Full Size Vans & CutawaysZimbrick Buick/GMC West
 
Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideAdvantec Distribution
 
Case ih dx18 e tractor service repair manual
Case ih dx18 e tractor service repair manualCase ih dx18 e tractor service repair manual
Case ih dx18 e tractor service repair manualfusjefjjskekmem
 
Unigraphics Full.......
Unigraphics Full.......Unigraphics Full.......
Unigraphics Full.......Adesh C
 
Ug recording excelmacros
Ug recording excelmacrosUg recording excelmacros
Ug recording excelmacrosHarry Adnan
 
Mazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners ManualMazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners ManualNaples Mazda
 
New holland td60 tractor service repair manual
New holland td60 tractor service repair manualNew holland td60 tractor service repair manual
New holland td60 tractor service repair manualujfjdjkskemme
 

What's hot (10)

2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways
2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways
2011 GMC Savana Upfitting Wisconsin - Full Size Vans & Cutaways
 
Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guide
 
An introduction-to-tkinter
An introduction-to-tkinterAn introduction-to-tkinter
An introduction-to-tkinter
 
Cms user manual
Cms user manualCms user manual
Cms user manual
 
Case ih dx18 e tractor service repair manual
Case ih dx18 e tractor service repair manualCase ih dx18 e tractor service repair manual
Case ih dx18 e tractor service repair manual
 
Gemini Manual
Gemini ManualGemini Manual
Gemini Manual
 
Unigraphics Full.......
Unigraphics Full.......Unigraphics Full.......
Unigraphics Full.......
 
Ug recording excelmacros
Ug recording excelmacrosUg recording excelmacros
Ug recording excelmacros
 
Mazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners ManualMazda 2013-2014 Navigation Owners Manual
Mazda 2013-2014 Navigation Owners Manual
 
New holland td60 tractor service repair manual
New holland td60 tractor service repair manualNew holland td60 tractor service repair manual
New holland td60 tractor service repair manual
 

Viewers also liked

Signals and systems with matlab applications orchard publications
Signals and systems with matlab applications   orchard publicationsSignals and systems with matlab applications   orchard publications
Signals and systems with matlab applications orchard publicationsMuhammad Salah
 
Mi oppenheim - signals and systems 2ed solucionario
Mi oppenheim - signals and systems 2ed solucionarioMi oppenheim - signals and systems 2ed solucionario
Mi oppenheim - signals and systems 2ed solucionarioBureau Veritas
 
Signals and systems( chapter 1)
Signals and systems( chapter 1)Signals and systems( chapter 1)
Signals and systems( chapter 1)Fariza Zahari
 
Señales y sistemas 2da edición - Alan V. Oppenheim & Alan s. Willsky
Señales y sistemas   2da edición - Alan V. Oppenheim & Alan s. WillskySeñales y sistemas   2da edición - Alan V. Oppenheim & Alan s. Willsky
Señales y sistemas 2da edición - Alan V. Oppenheim & Alan s. Willskynecromaniack
 

Viewers also liked (6)

Signals and systems with matlab applications orchard publications
Signals and systems with matlab applications   orchard publicationsSignals and systems with matlab applications   orchard publications
Signals and systems with matlab applications orchard publications
 
Signals and Systems Notes
Signals and Systems Notes Signals and Systems Notes
Signals and Systems Notes
 
Mi oppenheim - signals and systems 2ed solucionario
Mi oppenheim - signals and systems 2ed solucionarioMi oppenheim - signals and systems 2ed solucionario
Mi oppenheim - signals and systems 2ed solucionario
 
Signals and systems( chapter 1)
Signals and systems( chapter 1)Signals and systems( chapter 1)
Signals and systems( chapter 1)
 
Solved problems
Solved problemsSolved problems
Solved problems
 
Señales y sistemas 2da edición - Alan V. Oppenheim & Alan s. Willsky
Señales y sistemas   2da edición - Alan V. Oppenheim & Alan s. WillskySeñales y sistemas   2da edición - Alan V. Oppenheim & Alan s. Willsky
Señales y sistemas 2da edición - Alan V. Oppenheim & Alan s. Willsky
 

Similar to MXL_Pista_Datalogger_for_FSAE-3

Tap watch 22 user manual-03253d
Tap watch 22 user manual-03253dTap watch 22 user manual-03253d
Tap watch 22 user manual-03253dczimet
 
1640 99 004 6 18.04.2011 tattoo-star usermanual
1640 99 004 6 18.04.2011 tattoo-star usermanual1640 99 004 6 18.04.2011 tattoo-star usermanual
1640 99 004 6 18.04.2011 tattoo-star usermanualgalex85
 
ExTreM Expense Report Software
ExTreM Expense Report SoftwareExTreM Expense Report Software
ExTreM Expense Report SoftwareLantech-Soft
 
Win plc engine-en
Win plc engine-enWin plc engine-en
Win plc engine-endreamtech2
 
Report on flood hazard model
Report on flood hazard modelReport on flood hazard model
Report on flood hazard modelCIRM
 
I teva software manual operators manual
I teva software manual operators manualI teva software manual operators manual
I teva software manual operators manualmaurogalvao
 
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATION
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATIONE-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATION
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATIONPIYUSH Dubey
 
Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideAdvantec Distribution
 
Soa In The Real World
Soa In The Real WorldSoa In The Real World
Soa In The Real Worldssiliveri
 
software-eng.pdf
software-eng.pdfsoftware-eng.pdf
software-eng.pdffellahi1
 
Nx 8-eur ins e ge 020706
Nx 8-eur ins e ge 020706Nx 8-eur ins e ge 020706
Nx 8-eur ins e ge 020706gzebel
 
Fanuc pmc programming manual
Fanuc pmc programming manualFanuc pmc programming manual
Fanuc pmc programming manualAntonio J
 

Similar to MXL_Pista_Datalogger_for_FSAE-3 (20)

2226 v3 rev_a
2226 v3 rev_a2226 v3 rev_a
2226 v3 rev_a
 
Icp
IcpIcp
Icp
 
It project development fundamentals
It project development fundamentalsIt project development fundamentals
It project development fundamentals
 
Tap watch 22 user manual-03253d
Tap watch 22 user manual-03253dTap watch 22 user manual-03253d
Tap watch 22 user manual-03253d
 
1640 99 004 6 18.04.2011 tattoo-star usermanual
1640 99 004 6 18.04.2011 tattoo-star usermanual1640 99 004 6 18.04.2011 tattoo-star usermanual
1640 99 004 6 18.04.2011 tattoo-star usermanual
 
Tx16 wx user manual
Tx16 wx user manualTx16 wx user manual
Tx16 wx user manual
 
ExTreM Expense Report Software
ExTreM Expense Report SoftwareExTreM Expense Report Software
ExTreM Expense Report Software
 
Win plc engine-en
Win plc engine-enWin plc engine-en
Win plc engine-en
 
Mach3 Turn 1.84
Mach3 Turn 1.84Mach3 Turn 1.84
Mach3 Turn 1.84
 
Report on flood hazard model
Report on flood hazard modelReport on flood hazard model
Report on flood hazard model
 
01
0101
01
 
I teva software manual operators manual
I teva software manual operators manualI teva software manual operators manual
I teva software manual operators manual
 
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATION
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATIONE-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATION
E-FREELANCING - MAJOR/FINAL YEAR PROJECT DOCUMENTATION
 
Motorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guideMotorola air defense mobile 6.1 user guide
Motorola air defense mobile 6.1 user guide
 
Soa In The Real World
Soa In The Real WorldSoa In The Real World
Soa In The Real World
 
software-eng.pdf
software-eng.pdfsoftware-eng.pdf
software-eng.pdf
 
Nx 8-eur ins e ge 020706
Nx 8-eur ins e ge 020706Nx 8-eur ins e ge 020706
Nx 8-eur ins e ge 020706
 
Fanuc pmc programming manual
Fanuc pmc programming manualFanuc pmc programming manual
Fanuc pmc programming manual
 
Bucher lift control guide
Bucher lift control guideBucher lift control guide
Bucher lift control guide
 
Expert_Programming_manual.pdf
Expert_Programming_manual.pdfExpert_Programming_manual.pdf
Expert_Programming_manual.pdf
 

MXL_Pista_Datalogger_for_FSAE-3

  • 1. U n i v e r s i d a d d e N a v a r r a N a f a r r o a k o U n i b e r t s i t a t e a E s c u e l a S u p e r i o r d e I n g e n i e r o s I n g e n i a r i e n G o i M a i l a k o E s k o l a CAMPUS TECNOLÓGICO DE LA UNIVERSIDAD DE NAVARRA. NAFARROAKO UNIBERTSITATEKO CAMPUS TEKNOLOGIKOA Paseo de Manuel Lardizábal 13. 20018 Donostia-San Sebastián. Tel.: 943 219 877 Fax: 943 311 442 www.tecnun.es informacion@tecnun.es End of degree project ELECTRONIC COMMUNICATIONS ENGINEER FSAE ELECTRIC CAR´S ECU (ENGINE CONTROL UNIT) MODULES CONFIGURATION FOR AIM MXL PISTA DATA ACQUISITION SYSTEM The student: Unai Huete Beloki San Sebastián, June 2015
  • 2. Unai Huete Beloki MXL Pista datalogger for FSAE 2 Table of Contents 1. Introduction ............................................................................................................................................9 1.1. Tecnun Seed Racing ........................................................................................... 9 1.2. Formula Student (Formula SAE).........................................................................10 1.3. Importance of dash in Formula SAE electric car .................................................11 1.4. ECUs & Dash configuration ................................................................................12 1.5. Installation ..........................................................................................................13 2. Objectives...........................................................................................................................................14 3. State of the art ...................................................................................................................................15 3.1 MyChron 4...........................................................................................................15 3.2. Acewell 5859 ......................................................................................................16 3.3 Starlane Athon GPS Pro Data Acquisition System...............................................17 3.4. AIM MXL Pista....................................................................................................20 3.4.1. ECU connection via CAN connector.............................................................21 3.4.2. Configurable display and LED shift lights .....................................................21 3.4.3. Race Studio 2 ..............................................................................................22 3.4.4. AIM GPS05 GPS module.............................................................................23 3.4.5. MXL Pista kit................................................................................................25 4. Software related configuration.....................................................................................................26 4.1. GPS Manager.....................................................................................................26 4.1.1. How to add a new track to the PC database ................................................27 4.1.2. How to read, write and delete tracks from GPS05 GPS module...................29 4.1.3. Configuring the lap beacon through MXL .....................................................30 4.4. Race Studio 2 .....................................................................................................31 4.4.1. Select Configuration layer ............................................................................33 4.4.2. Channels layer.............................................................................................34 4.4.3. System Configuration...................................................................................36 4.4.4. Online option................................................................................................37 5. How to receive data from ECU (Engine Control Unit) via CAN..........................................38 5.1. Introduction.........................................................................................................38 5.2. How to program the PIC18F4680 microcontroller ...............................................39 5.2.1. MikroC PRO.................................................................................................39 5.2.2. MPLAB IDE v8.90 , PICKit 3 and Microchip programming module...............40 5.3. CAN Bus.............................................................................................................42 5.4. Specify a commercial ECU for the MXL Pista dash.............................................44 5.5. Rear control module............................................................................................46
  • 3. Unai Huete Beloki MXL Pista datalogger for FSAE 3 5.5.1. Rear module hardware.................................................................................46 5.5.2. “Rear.c” file ..................................................................................................48 5.5.3. “Rear.c” implementation in PIC18F4680 microcontroller ..............................60 5.6. Front module.......................................................................................................61 5.6.1. Front module hardware ................................................................................61 5.6.2. “Front.c” file..................................................................................................64 5.6.4. “Front.c” implementation in PIC18F4680 microcontroller..............................77 5.7. Table with Bosch MS4.3 protocol and used TSR messages for MXL Pista.........77 6. AIM MXL Pista (Quick Guide).......................................................................................................79 6.1. Keyboards function .............................................................................................79 6.1.1 Recall recorded data.....................................................................................80 6.1.2 Other functions..............................................................................................80 6.2. Connections........................................................................................................80 6.2.1. Harness .......................................................................................................81 1.1.1 6.2.2. GPS module .....................................................................................82 7. Race Studio Analysis: Download, save & analyze test values..........................................83 7.1. Race Studio Analysis: Download and save test values .......................................83 7.2. Race Studio Analysis: How to use it....................................................................84 7.2.1. How to plot measures graphs.......................................................................85 7.2.2. How to plot measure graph vs GPS position ................................................86 8. Project budget....................................................................................................................................89 9. Conclusions ........................................................................................................................................90 Appendix...................................................................................................................................................91 Appendix 1: AIM software installation (GPS manager, Race Studio 2 y Race Studio Analysis) and driver .....................................................................................................91 Appendix 2: Google Earth program installation.........................................................93 Appendix 3: MXL Pista dash installation template......................................................94 Appendix 4: MXL Pista technical characteristics........................................................96
  • 4. Unai Huete Beloki MXL Pista datalogger for FSAE 4 Table of Figures Figure 1. Tecnun Seed Racing Formula SAE team logo................................................... 9 Figure 2. Tecnun Seed Racing departments....................................................................10 Figure 3. Components distribution. ..................................................................................12 Figure 4. Dashboard. .......................................................................................................13 Figure 5. MyChron 4 dash...............................................................................................15 Figure 6. Acewell 5859 dash............................................................................................16 Figure 7. Starlane Athon GPS Pro dash..........................................................................17 Figure 8. AIM MXL Pista dash. ........................................................................................20 Figure 9. Configurable display possible settings. .............................................................21 Figure 10. Race Studio 2 analysis software. ....................................................................22 Figure 11. AIM GPS05 GPS module................................................................................23 Figure 12. GPS manager software...................................................................................24 Figure 13. GPS Speed and position information example. ...............................................24 Figure 15. MXL Pista kit...................................................................................................25 Figure 14. Exporting information to Google Earth. ...........................................................25 Figure 16. "GPS Manager " software. ..............................................................................26 Figure 17. "Cirrcuito Olaberria " track in "Google Earth"...................................................27 Figure 18. New track settings...........................................................................................28 Figure 19. GPS manager software with (MXL Pista + GPS module) connected...............29 Figure 20. Select "Set GPS beacon" step. .......................................................................30 Figure 21. Start/finish line setting step. ............................................................................31 Figure 22. Split line setting step. ......................................................................................31 Figure 23. Race Studio 2. ................................................................................................32 Figure 24. Race Studio 2, Select configuration layer........................................................34 Figure 25. Race Studio 2, Channels layer........................................................................35 Figure 26. Race Studio 2, System configuration. .............................................................36 Figure 27. Race Studio 2, Online window. .......................................................................37 Figure 28. PIC18F4680 microcontroller............................................................................38 Figure 29. MCP2551 transceiver......................................................................................38 Figure 30. MikroC PRO software. ....................................................................................40 Figure 31. Microchip PICkit 3 & programming module. ....................................................41 Figure 32. MPLAB IDE v8.90 software.............................................................................42 Figure 33. CAN bus network in a commercial car. ...........................................................43 Figure 34. CAN message structure..................................................................................44 Figure 35. Rear Module. ..................................................................................................46 Figure 36. PIC18F4680 inputs/outputs.............................................................................47 Figure 37. TSR´15 components distribution.....................................................................48 Figure 38. Definition of "OSCCON variable taken from PIC18F4680 datasheet...............50 Figure 39. Clock diagram taken from PIC18F4680 datasheet..........................................50 Figure 40. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).51 Figure 41. Necessary message for RPM valu taken from BAMOCAR CAN bus datasheet. .................................................................................................................................53 Figure 42. Torque reference definition taken from BAMOCAR datasheet. .......................54 Figure 43. BAMOCAR inverter RPM data sending format taken from datasheet..............55 Figure 44. Front module (red box) and Dashboard with AIM MXL Pista...........................61 Figure 45. Dashboard of the TSR´15. ..............................................................................62 Figure 46. Top and lateral view of Front module box........................................................62 Figure 47. PIC18F4680 ports configuration (RDB_LED_ACT and BMS_LED_ACT ports are interchanged).....................................................................................................63
  • 5. Unai Huete Beloki MXL Pista datalogger for FSAE 5 Figure 48. Definition of "OSCCON variable taken from PIC18F4680 datasheet...............65 Figure 49. Clock diagram taken from PIC18F4680 datasheet..........................................65 Figure 50. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250).67 Figure 51. MXL Pista dash/datalogger. ............................................................................79 Figure 52. MXL Pista dash/datalogger. ............................................................................81 Figure 53. AIM MXL Pista harness...................................................................................81 Figure 54. GPS05 GPS module. ......................................................................................82 Figure 55. "Test database and lap manager" window. .....................................................84 Figure 56. Race Studio Analysis: "GPS_Speed" vs Time.................................................85 Figure 57. Race Studio Analysis: "GPS_LatAcc" vs GPS position. .................................86 Figure 58. GPS graph zoomed in.....................................................................................87 Figure 59. GPS data exported to Google Earth................................................................88 Figure 60. Window after CD-ROM insertion.....................................................................91 Figure 62. "Race Studio 2" and "Race Studio Analysis" icons..........................................92 Figure 63. "GPS Manager" icon. ......................................................................................92 Figure 61. Internet Explorer window.................................................................................92
  • 6. Unai Huete Beloki MXL Pista datalogger for FSAE 6 Table of Codes Code 1. "Rear.c"........................................................................................................................................49 Code 2. "Rear.c"........................................................................................................................................49 Code 3. "Rear.c"........................................................................................................................................51 Code 4 . "Rear.c". .....................................................................................................................................52 Code 5 . "Rear.c" . ....................................................................................................................................52 Code 6 . "Rear.c". .....................................................................................................................................54 Code 7. "Rear.c"........................................................................................................................................55 Code 8. "Rear.c"........................................................................................................................................56 Code 9. "Rear.c"........................................................................................................................................56 Code 10. "Rear.c".....................................................................................................................................57 Code 11. "Rear.c".....................................................................................................................................58 Code 12. "Rear.c".....................................................................................................................................58 Code 13. "Rear.c".....................................................................................................................................59 Code 14. "Rear.c".....................................................................................................................................60 Code 15. "Front.c"...................................................................................................................................64 Code 16. "Front.c"...................................................................................................................................64 Code 17. "Front.c"...................................................................................................................................66 Code 18. "Front.c"...................................................................................................................................67 Code 19. "Front.c"...................................................................................................................................68 Code 20. "Front.c"...................................................................................................................................68 Code 21. "Front.c"...................................................................................................................................69 Code 22. "Front.c"...................................................................................................................................69 Code 23. "Front.c"...................................................................................................................................70 Code 24. "Front.c"...................................................................................................................................71 Code 25. "Front.c"...................................................................................................................................72 Code 26. "Front.c"...................................................................................................................................73 Code 27. "Front.c"...................................................................................................................................74 Code 28. "Front.c"...................................................................................................................................74 Code 29. "Front.c"...................................................................................................................................75 Code 30. "Front.c"...................................................................................................................................76 Code 31. "Front.c"...................................................................................................................................77 Table of Tables Table 1 . Comparison of diffrerent dataloggers. ........................................................................19 Table 2. BOSCH MS4.3 ECU configuration.....................................................................................45 See the necessary “Row” values (data 0) and the data bytes positions in the Bosch MS4.3 protocol table (Table 3 in 5.4)....................................................................................70 Table 4. CAN messages sent to MXL Pista logger. ......................................................................78 Table 5. Project Budget.........................................................................................................................89
  • 7. Unai Huete Beloki MXL Pista datalogger for FSAE 7 ACKNOWLEDGEMENTS I am grateful to my family for their support during my whole life and especially during these last four years. Thanks for helping me in each step I have taken, without them i would not have arrived to where I am now. I would also like to express my gratitude to Tecnun Seed Racing members for making this project possible and helping me whenever I needed. Finally, I would like to thank Dr. Iñigo Gutierrez , whose generous guidance and support made it possible for me to work on a topic that was of great interest to me.
  • 8. Unai Huete Beloki MXL Pista datalogger for FSAE 8
  • 9. Unai Huete Beloki MXL Pista datalogger for FSAE 9 1. Introduction 1.1. Tecnun Seed Racing Tecnun Seed Racing is Formula Student Electric team formed by 63 students from Tecnun, University of Navarra. It all started in 2010, when a group of students who cared about sustainability energetic and the renewable energies decided to create a group called Tecnun Seed Group. One of the projects was to build Formula Student Electric car. Students from the university found this project really interesting and started working in the project. That is why they decided to create Tecnun Seed Racing Formula SAE team, exclusively dedicated to the design, fabrication, implementation and optimization of the electric car. Figure 1. Tecnun Seed Racing Formula SAE team logo. Tecnun Seed Racing has been the first Spanish team to participate in the Formula Student Electric. Last year ranked 14th overall position at Formula ATA Italy 2014. This year, the objective is to build a new car (TSR’15) and participate in Formula Spain 2015 in Montmelo, Barcelona. The TSR’15 is the 3rd electric racing car that will be manufactured by Tecnun Seed Racing.
  • 10. Unai Huete Beloki MXL Pista datalogger for FSAE 10 Figure 2. Tecnun Seed Racing departments. Tecnun Seed Racing team has 3 main working groups divided. This project is focused in the electrical/electronics group, as we are going to work with electrical components, for example sensors, inverters or battery cells and we will also have to work with electronic components, such as, microcontrollers that will be programmed in order to transmit electrical component’s information. 1.2. Formula Student (Formula SAE) Formula Student, also known as Formula SAE, is a worldwide competition between universities that design, build and develop a small single racing car. The University of Texas organized the first Formula SAE competition. Only 6 teams (40 students) participated in that event. Nowadays, Formula SAE competitions are organized all over the world, for example, in Germany, Japan, Brazil, Australia and so on. All these events use the original norm of Formula SAE and have about 120 teams (2000 students) participating in it. All the competition results are used to make a worldwide ranking.
  • 11. Unai Huete Beloki MXL Pista datalogger for FSAE 11 In Formula SAE events, industry specialists on the following criteria judge the cars: • Static events: o Engineering Design (150 points). o Cost & Sustainability Analysis (100 points). o Business Presentation (75 points). o Technical Inspection (6 tests): Safety, Chassis, Noise, Tilt, Brake and Tech (no points). Participation in dynamic events depends on Technical inspection. • Dynamic Events: o Skid pan (50 points). o 1 km Autocross/Sprint (100 points). o Acceleration (75 points). o 22km endurance (300 points) and fuel economy (100 points). The winner of the event is the team with the highest number of points out of a maximum of 1000. 1.3. Importance of dash in Formula SAE electric car The dashboard is the control panel of the car, composed by several buttons for the control of different functions and the dash, which shows and saves the information available from components/sensors of the car. The control commands/buttons are located in front of the driver. The most important part of the dashboard is the dash or display, which in our case is also a datalogger. Through the dash the driver can see the important information of the car in real time, and modify the driving technique depending on it. For example, for our electric car, the battery cells information is really important to know if the car is going to be able to run until the end of the largest events in the competitions. The dash can also be configured to show the possible errors in the car to notify the driver that something is going wrong. In our case, as it will be explained in the project, the dash will be connected to GPS module that will provide as information as speed or lap/split times, showing best lap times and laps forecast in the display. The driver will know how fast he is driving and every lap improvement.
  • 12. Unai Huete Beloki MXL Pista datalogger for FSAE 12 Furthermore, as the dash is also a datalogger, we will be able to study the recorded data after every test to improve the car and driver’s performance. 1.4. ECUs & Dash configuration The ECUs (Engine Control Units) are the modules that control the components from the car connected to them. In our case, the TSR´15 has three modules: Relay, Rear and Front modules. For the dash configuration we will configure the Rear and Front modules. Figure 3. Components distribution. The data is going to be received in the dash via CAN Bus. The information from different components and sensors will be written in the CAN Bus by programming the microcontrollers (connected to transceivers) placed in the Rear and Front module. One of the harder parts of the project will be to find the necessary code implementation for the microcontrollers. The chosen dash, AIM MXL Pista, only has the possibility to read information from commercial ECUs via CAN. So we will have to find a public ECU protocol in order to
  • 13. Unai Huete Beloki MXL Pista datalogger for FSAE 13 choose the messages formats that we are going to send through the CAN bus to the dash. The confirmation of the dash is going to be done using the provided software. The dash also has an analysis program for the saved data. Both programs are going to be explained in the project. 1.5. Installation The objective is related to the hardware implementation. The dash will be placed in front the driver´s position in the middle of the dashboard (as it is shown in figure 4). The dash has to be correctly powered and connected to the CAN Bus using the specific wires provided with the harness of the MXL Pista. The dashboard will be connected to the CAN bus through the Front modules CAN connection. We can also use some sensors provided with the MXL Pista that can be connected directly to the harness wires of the MXL Pista. We will also have to fix it correctly to the dashboard since it must not fall while driving the car. Figure 4. Dashboard.
  • 14. Unai Huete Beloki MXL Pista datalogger for FSAE 14 2. Objectives The most important objective of the project is to be able to save and show in real time important information from electrical components and sensors of the TSR’15 in the dashboard, showing alarm messages in case of danger or undesired values from components. Firstly, we will have to study the possible gadgets in the market and requirements for our final decision. The TSR´15 uses a CAN Bus to transmit information between different components and control modules, so having a CAN Bus message receiver will one of the most important characteristics for our future dash. We would like to have a datalogger that saves all the data from the sensors and components of the car. Some dashes also include this feature. We will look for one that includes this characteristic and has an adequate internal memory capacity. Some of these gadgets also include analysis software to analyze the data for possible improvements in the car. The chosen gadget has to able to connect to a PC, download the recorded data and include software for data analysis. Finally, it is also interesting to have a lap timer, through infrared transmitter/receivers or GPS data (preferable) in order to be able to record the lap/split times of different tests.
  • 15. Unai Huete Beloki MXL Pista datalogger for FSAE 15 3. State of the art There are different types of dashes available for Formula Student car. In this section we will analyze some of this gadgets and compare in order to choose an appropriate one for the Tecnun Seed Racing Formula Student electric car. We will base our decision according to characteristics of the compared dashes: • Lap timer. • Internal memory. • Availability to connect different sensors. • Connection to the ECU (Engine Control Unit) via CAN, so that we can get the information about different components of the car that are connected to the ECU. • USB download to PC, for archiving and analysis of data. • Weight and size. 3.1 MyChron 4 Figure 5. MyChron 4 dash. The MYchron4 is a data acquisition gauge for racing.
  • 16. Unai Huete Beloki MXL Pista datalogger for FSAE 16 Includes: • Tachometer (RPM counter). • Lap timer (infrared receiver). • Data logger. • Temperature input for exhaust gas, cylinder or water sensors. • Internal 9V battery. • 1MB of memory for data logging. • Configurable alarm lights. • USB connection to PC and analysis software Race Studio. • PRICE: 374 €. (http://www.ebay.es/itm/Kart-Mychron-4-Timing-Karting-Brand- New-Black-Buttons-Inc-Water-Temp-Sensor- /380577825429?pt=LH_DefaultDomain_3&hash=item589c34c295). The MyChron 4 dash is quite complete. It includes almost all the characteristics we were trying to find, but it does not have the most important one: the possibility to connect to the ECU (Engine Control Unit), so we will not able to collect all the important data from the components that are connected to it. 3.2. Acewell 5859 Figure 6. Acewell 5859 dash. These are the most important features of the Acewell 5859 dash: • Air temperature sensor. • Tachometer (RPM counter) with a selectable scale of 10.000rpm or 20.000rpm. • IR receivers and IR transmitter for automated lap timing. • Includes RPM sensing wire, speed sensor, temperature sensor, wiring harness and wires remote control switch. • Water resistance. • PRICE: 283.99 € (http://www.quadtech.co.uk/Acewell%20Speedometers/ACE- 5xxx/ACE-5859.htm?action=full&id=210). As we can see the Acewell dash is a very simple gadget. It does not have any via CAN connection to the ECU and the possibility to connect it to the PC thought USB.
  • 17. Unai Huete Beloki MXL Pista datalogger for FSAE 17 3.3 Starlane Athon GPS Pro Data Acquisition System Figure 7. Starlane Athon GPS Pro dash. Most important features of the Starlane Athon Pro are: • CAN BUS data line for connection with expansion modules. • GPS receiver and antenna built into the instrument. o Detect lap time through GPS system. o Manage finish line and 3 splits. o Speed measurement through GPS system. • Best lap LED. • Engine speed indicator RPM (with settable LED BAR and shift light). • Wireless data download by Bluetooth. • Supplied with the Digirace-Pro software. • 999 lap memory. • Motor RPM acquisition + wheel speed + gear indicator + water temperature + exhaust gas or oil temperature with thermocouple K + battery voltage + 3 general analog channels. • Storage of the custom finish line coordinates of the tracks. • Waterproof. • PRICE: 1480 € (http://www.motosport.com/starlane-athon-gps-pro-data- acquisition-system). As we can see, the Athon GPS Pro data acquisition system gathers all the features we were trying to find for our Formula Student electric car. It could be the chosen gadget, but we are going to search for similar dash in order to take our final decision. We can also see that the possibility to receive information from the car´s ECU via CAN increases the dash’s price, but it is also considered one of the most important
  • 18. Unai Huete Beloki MXL Pista datalogger for FSAE 18 characteristic, as we had mentioned before, the ECU manages information from the most important electronic/electric components of the car. The table shown below (table 1), resumes the last 3 dashes explained previously and the chosen one.
  • 19. Unai Huete Beloki MXL Pista datalogger for FSAE 19 Table 1 . Comparison of different dataloggers.
  • 20. Unai Huete Beloki MXL Pista datalogger for FSAE 20 3.4. AIM MXL Pista Figure 8. AIM MXL Pista dash. The AIM MXL Pista is a data acquisition system for car/ bike racing. The dash provides: • A fully configurable display and six configurable LED lights. • A logger that records the vehicles performances in detail. • RPM input. • CAN/serial ECU connector. • Internal lateral G sensor. • Lap timer. • USB connector. • Infrared lap timer (possibility to measure by GPS coordinates, connecting the GPS Module to the dash). • 8MB of non-volatile RAM internal memory. • Race Studio 2 software for data analysis. • 8 analog inputs. • Price: 1700€. Some of the most important characteristics are going to be briefly described.
  • 21. Unai Huete Beloki MXL Pista datalogger for FSAE 21 3.4.1. ECU connection via CAN connector The MXL dash can be interfaced with the ECU (Engine Control Unit) using an RS232 serial cable or CAN cable. In our case, the CAN cable is going to be used in order to sample data out coming from the ECU. 3.4.2. Configurable display and LED shift lights Figure 9. Configurable display possible settings. As we can see in the figure 9, the MXL Pista gives us the opportunity to set up the display in several different ways, depending on the information we want to see. The 10 configurable shift lights in the upper part of the dash are used to represent the RPM signal status. The other alarm LED lights are going to be used to warn the driver when some values of the sensors implemented in the car are higher or lower than expected. The configuration of the display is done from the Race Studio 2 program, but we can also change some display views using the buttons in the lower part of the gadget.
  • 22. Unai Huete Beloki MXL Pista datalogger for FSAE 22 The lower part of the display will also show, apart from the channels information, when a “Best lap” is done, showing the improvement in respect to the previous one. The MXL Pista also includes an algorithm that measures the Lap Forecast and Split times. 3.4.3. Race Studio 2 Using the USB connector and the Race Studio 2 software we can download the data stored in the dash’s non-volatile 8 MB memory and give the configuration we want for the display. The MXL Pista a data logger that acquires data from different sensors, 1-500 times per second, depending on the input type. All these information can be analyzed with the Race Studio 2 software to improve the car’s performance. For example, the lateral G sensor information lets us create a map of the track with the help of the software and we can know all the information in the exact position of the track (temperature, speed, RPM, Lap time, etc.). All this information can be used to improve different components behavior and it can also help the drive to see which driving technique is the fastest for the specific track. Figure 10. Race Studio 2 analysis software.
  • 23. Unai Huete Beloki MXL Pista datalogger for FSAE 23 3.4.4. AIM GPS05 GPS module Figure 11. AIM GPS05 GPS module. The AIM’s GPS module allows us to immediately get lap times and data we need for engine tuning and improving driving technique. It includes GPS Manager Software to manage the recorded tracks in the internal memory. Lightweight and waterproof, the GPS module is connected to AIM loggers via CAN cable. GPS Manager Software allows setting track start/finish lines and downloading a comprehensive track database.
  • 24. Unai Huete Beloki MXL Pista datalogger for FSAE 24 Figure 12. GPS manager software. Connecting the GPS module to the MXL Pista we can get this information: • GPS Speed: Speed obtained from GPS signal. • GPS Nsat: Number of satellites connected. • GPS LAtAcc: lateral acceleration toward the direction of the movement. • GPS LonAcc: longitude acceleration in the direction of the movement. • GPS Slope: slope of the movement. • GPS Heading: direction of the vehicle in degrees toward the North. • GPS Giro: vehicle´s yaw in degrees/sec. • GPS Pacc: precision accuracy. Figure 13. GPS Speed and position information example.
  • 25. Unai Huete Beloki MXL Pista datalogger for FSAE 25 Finally, we can also review our driving performance through real images, by exporting all the data into “Google Earth” program (Figure 14). 3.4.5. MXL Pista kit In figure 15 we can see what MXL Pista package includes. Figure 15. MXL Pista kit. Figure 14. Exporting information to Google Earth.
  • 26. Unai Huete Beloki MXL Pista datalogger for FSAE 26 4. Software related configuration 4.1. GPS Manager GPS Manager is the software that allows updating, modifying, reading and writing lap and split beacons of a track in the “GPS05” GPS module. This is how the GPS manager software looks like when there is no data logger connected to the PC: Figure 16. "GPS Manager " software. On the left column we have the list of tracks provided by AIM manufacturer, organized depending upon the country in which they are. Track shape and information about the typology of the track (karts, cars or bikes) are provided.
  • 27. Unai Huete Beloki MXL Pista datalogger for FSAE 27 4.1.1. How to add a new track to the PC database GPS Manager offers this possibility in case they do not have a track yo want in the database. In our case, Tecnun Seed Racing team, we always test our car performance in a circuit called “Circuito Olaberria Karting”. This circuit was not in the database, which is why we will explain how to add a new track with this example. The first thing we need in the coordinates of the lap line, and split beacons we want to add to our new track called “Circuito Olaberria”. This information can be taken from “Google Earth”. Figure 17. "Circuito Olaberria " track in "Google Earth".
  • 28. Unai Huete Beloki MXL Pista datalogger for FSAE 28 In the image above we can see how we defined the coordinates for the track “Circuito Olaberria”. • Start /Finish line Latitude: 43.030556º/ Longitude: 2.215556º. • Split 1 Latitude: 43.030277º/ Longitude: 2.216111º. • Split 2 Latitude: 43.031667º/ Longitude: 2.214444º. Know that we have the necessary information we proceed to add the track in the “GPS Manager”. 1) Press New. 2) Insert Track name 3) Fill the fields: country, type of track (closed track, Oval, point to point) , type of surface (asphalt, dirt, ice, water), type of vehicle and finally, the coordinates. Below we show the configuration for the track “Circuito Olaberria”. 4) Load shape: we will be able to load the shape after driving the car in “Circuito Olaberria”. The track shape can be downloaded from the GPS module using AIM software “Race Studio 2”. 5) Finally, we press “OK” button. If we want to change the configuration of the track, we can modify the data by pressing the “settings” button in the right part of each track, and the window shown in above will appear again. Figure 18. New track settings.
  • 29. Unai Huete Beloki MXL Pista datalogger for FSAE 29 4.1.2. How to read, write and delete tracks from GPS05 GPS module Firstly, the MXL Pista has to be connected to a 9-15V Power supply. Then, we have to connect our system, composed by the dash and the GPS module to the PC through the USB connector. Figure 19. GPS manager software with (MXL Pista + GPS module) connected. In the figure 19 we can see how the software looks like when we connect our system to the PC. In the upper right part of the program we can see if our system is detected, the identification number and the tracks recorded in the GPS05 module. In the case above we only have one list of tracks, but we could also have another one. These are the two possible track lists:
  • 30. Unai Huete Beloki MXL Pista datalogger for FSAE 30 • “Not in PC list”: will show the tracks recorded in the GPS module that were not previously recorded, new tracks. • “Identical in PC list”: will show the tracks that were pre-recorded in GPS module from the PC. If a track is saved in the GPS module, this gadget will automatically detect the track in which the car is running and it will use the settings defined in the GPS for the specific track (split line, start/finish line). We can also define the start/finish line and split line of a non-recorded track directly through the MXL (explained in 5.3.3). To move a default (the ones that are given by AIM) or a recorded track from the PC to the GPS module we will select the track and click on “>” symbol. For the opposite move we will click on the other arrow. 4.1.3. Configuring the lap beacon through MXL If we are going to use the car in a new track that was not recorded in the GPS module, we must follow this procedure to set start/ finish line and split positions on our GPS05. • Ensure GPS05 module is correctly connected to MXL and the MXL is correctly powered. • Press “MENU” button on MXL. • Select “Set GPS beacon” using “>>/<<” buttons. Figure 20. Select "Set GPS beacon" step. • Press “OK” button to start setting the desired lines. • The MXL display will show the message in the figure below. Reach the point to be considered as start/finish line and press “OK” button.
  • 31. Unai Huete Beloki MXL Pista datalogger for FSAE 31 Figure 21. Start/finish line setting step. • If the system is configured to capture splits, the MXL will show the message shown in the following figure. Reach the point to be considered split line and press “OK”button. Figure 22. Split line setting step. • Once the configuration is over, the system will show the start page and it will be ready to record times. 4.4. Race Studio 2 The only way to configure the MXL Pista dash is using the Race Studio 2 software provided by AIM manufacturer. It is designed to configure the logger and analyze their data using a PC. It is made up of two programs: Race Studio 2 and Race Studio Analysis. The first step is to install the programs and necessary drivers for the configuration (see Annex 1). After installing the programs, double click on Race Studio 2 icon to open it.
  • 32. Unai Huete Beloki MXL Pista datalogger for FSAE 32 Figure 23. Race Studio 2. In the following description we will show the configuration done for our TSR´15 car in order to explain how to configure the MXL Pista. Choose Device Configuration and MXL option to open the configuration window. If we are configuring the MXL for the first time, New Configuration window will appear. Choose the following options: • Logger: MXL Pista. • ECU Manufacturer: BOSCH. • ECU: MS43_GA. • Installation Name: TSR. • Vehicle Name: TECNUN SEED RACING. • Speed, Temperature measure unit: km/h and ºC. System Manager window will appear. It will show a table with the configurations done for the MXL Pista (Select configuration layer). We can create new configurations from this layer. We have to choose the one we are going to modify (highlighted in yellow) .
  • 33. Unai Huete Beloki MXL Pista datalogger for FSAE 33 In the top of the window we will also see two pushbuttons that allows us to transmit the configuration to the logger “Transmit” and or detect an unknown configuration in the logger and store it, “Receive”. The remaining part of the window is made up of four layers: • Select configuration (the one explained previously). • Channels. • System Configuration. • CAN-Expansions configuration (will not be used in our case as we are not using any expansion module). 4.4.1. Select Configuration layer As it is described previously, it manages the configurations done by the user for the MXl Pista. It shows 4 pushbuttons: • “New” button to create a configuration. • “Delete” button. • “Clone” button to create a copy. • “Import” button to import a configuration from the database. • “Export” button to export a configuration from this database and be able to use it in other PC.
  • 34. Unai Huete Beloki MXL Pista datalogger for FSAE 34 Figure 24. Race Studio 2, Select configuration layer. 4.4.2. Channels layer The channel layer is shown in figure 24. Channels are different from one ECU model to another. In our case we chose the BOSCH MS4.3 ECU public protocol as it is explained in 5.4.
  • 35. Unai Huete Beloki MXL Pista datalogger for FSAE 35 Figure 25. Race Studio 2, Channels layer. The layer gives the opportunity to change the names to the ECU channels. We have chosen the names depending on the CAN messages send to the MXL Pista (see table 4 in 5.7). Every change in the configuration can be transmitted to the MXL Pista (connecting the dash through USB cable and powering it to 9-15Vdc) by using the “Transmit” pushbutton. • Channel identifier: identifies each channel. o ECU: messages from Engine Control Unit. o CH: from the sensors connected to the harness of the MXL Pista. o ACC_1, LOG_TMP, BATT; CAL_GEAR: internal sensors of the MXL Pista. • Enable/Disable option • Channel name: allows changing the desired name. In our case the new names are shown in 5.7. • Sampling: allows choosing each channel´s sampling frequency. • Sensor type: shows sensor type and allows choosing it in CH channels. • Measure unit: allows changing the measure unit (decimals included). • Lower and upper bound.
  • 36. Unai Huete Beloki MXL Pista datalogger for FSAE 36 4.4.3. System Configuration The figure 26 shows how the System Configuration window looks like. These are the possible configurable options. Figure 26. Race Studio 2, System configuration. • Rpm: we can choose between receiving the RPM value from the sensor included in the MXL Pista kit (see 3.4.5) or taken the value from the ECU´s rpm CAN message. In our case we receive it through the CAN Bus (see 5.5.2). • Gear sensor: we will not use it as the TSR´15 electric car does not have gearbox. • Shift lights: we can set up the RPM values to switch on the shift LED lights. • Speed: we will configure the MXL Pista to show the speed taken from the GPS module, “GPS speed”. • Lap: we can do a lap configuration in case the track is not recorded in the GPS module (explained in 4.1). • Channel for alarm: we can choose the alarm values to switch on the alarm LED lights in case something is going wrong in the TSR´15. In case one parameter is
  • 37. Unai Huete Beloki MXL Pista datalogger for FSAE 37 higher or lower than specified, the chosen alarm LED light will switch on and we will see a message in the lower part of the display. o Condition enabling checked alarms: we can choose a condition to make the alarms work or not. • Measure boxes: we can choose the variables we want to see in the display. This does not mean that the display is static, for example, it will show different messages when an alarm switches on or when we do a “BEST LAP”. • Enable static string: we can write a static message (not strictly static, as it is explained previously) instead of showing three channel messages in the lower part of the display. 4.4.4. Online option In the upper part of the System manager window, or the configuration window, there is a button called “Online”. It is an interesting feature of the Race Studio 2 program. Using this option we can see the signals and ECU CAN messages that the dash is receiving online to check receiving errors. Figure 27. Race Studio 2, Online window. To use it, ensure that the MXL is powered on, connected to a PC and connected to the ECU/GPS module/sensors that we want to receive information from.
  • 38. Unai Huete Beloki MXL Pista datalogger for FSAE 38 5. How to receive data from ECU (Engine Control Unit) via CAN 5.1. Introduction Our FSE (Formula Student Electric) car is controlled by three ECUs (Engine Control Units): Rear, Front and Relay modules. Each of them controls components distributed in the rear part of the car or the front part of the car. In our case we will work with the Front and Rear module. Both of them collect information from several sensors and components that are monitored by a PIC18F4680 microcontroller (along with the MCP2551 transceiver) that is programmed to receive information from components and write the information in the CAN bus. Figure 28. PIC18F4680 microcontroller. Figure 29. MCP2551 transceiver.
  • 39. Unai Huete Beloki MXL Pista datalogger for FSAE 39 The MCP2551 is a high-speed CAN transceiver, that serves as the interface between a CAN protocol controller and the physical bus. In this chapter of the project, I will explain how to program the PIC in order to receive the information and send it to the MXL Pista dash, so that we can save all this information and be able to analyse it to improve the car performance. 5.2. How to program the PIC18F4680 microcontroller 5.2.1. MikroC PRO MikroC PRO will be the program used for the modification and compilation of the “.c” file that will characterize the behaviour of the PIC. We will create a new project by clicking on “New Project..” and selecting the desired PIC microcontroller. The program will create a new folder for the project with a blank “.c” file.
  • 40. Unai Huete Beloki MXL Pista datalogger for FSAE 40 Figure 30. MikroC PRO software. After finishing the “.c” file, we will click on “Build” button and see if the file is correct. If everything is fine, the program will have created a “.hex” file, which will be used for programming the PIC microcontroller. 5.2.2. MPLAB IDE v8.90 , PICKit 3 and Microchip programming module MPLAB IDE v8.90 is the software used for the programming of the PIC. We also need the Microchip PICKit 3 and the programming module.
  • 41. Unai Huete Beloki MXL Pista datalogger for FSAE 41 . Figure 31. Microchip PICkit 3 & programming module As we can see in the figure 31, the PIC18F4680 is placed in the programming module and the PICKit 3 is connected through USB to the PC. These are the steps we have to follow in the MPLAB IDE v8.90 program in order to program the PIC18F4680 microcontroller: • Programmer > Select programmer > PICKit 3. We select the programmer we are going to use, in our case, the PICKit 3. • Programmer > Setting > Power > ✓ Power target circuit from PICKit 3 > OK. Necessary setting in order to power the programming module. After this step the software will recognise the connected PIC18F4680, showing the ID of the microcontroller. • Programmer > Erase Flash Device. We erase the previous programming. • File > Import. We will chose the “.hex” file created from the “.c” file created for the characterization of the microcontroller. • Programmer> Program. It will show a “Programming/Verify complete” message if everything if correct. This is how the program messages should look like after following these previous steps.
  • 42. Unai Huete Beloki MXL Pista datalogger for FSAE 42 Figure 32. MPLAB IDE v8.90 software. 5.3. CAN Bus CAN (Controlled Area Network) is a communication protocol developed by Bosch company. It was designed to allow microcontrollers and devices to communicate between them without a host computer. It is a message-based protocol, originally designed for automotive applications.
  • 43. Unai Huete Beloki MXL Pista datalogger for FSAE 43 Figure 33. CAN bus network in a commercial car. Nowadays, most cars use CAN bus protocol for transmission/reception for the easy exchange of data across the array of computers and sensors scattered around the car. CAN bus networks improve reliability and let vehicles self-diagnose problems. In our case, the PIC18F4680 microcontroller along with the MCP2551 transceiver, will be connected to the CAN bus. The MCP2551 device serves as the interface between a CAN protocol and the physical bus. The microcontroller decides what the received messages mean and what messages it wants to transmit. Sensors and other components are going to be connected to the microprocessor directly to one pin or via CAN bus.
  • 44. Unai Huete Beloki MXL Pista datalogger for FSAE 44 A CAN message has the following structure: • ID: identification number consists of 11 bits. • Data: 8 bytes (64 bits) for data transmission/reception (Data 0-7). Depending on the message, a component could use two bytes to transmit the information or only one. • Row: Sometimes, Data 0 byte is used to select which information is going to send when two components use the same ID and data byte number. For example: o A temperature sensor, using ID=0x210 and Data 7 for information transmission, with Row Data 0=0x00. o A voltage sensor, using the same ID=0x210 and Data 7 for information transmission, but in this case Row is different, Data 0=0x03. ID Data 0 (Row) Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 Figure 34. CAN message structure. 5.4. Specify a commercial ECU for the MXL Pista dash One of the problems we faced when we start trying to send CAN messages to the MXL Pista dash was that the device was only able to collect CAN information from commercial ECUs (Engine Control Units). The Dash is prepared to be connected to a preconfigured car´s ECU and start working correctly. We found that the Bosch MS4.3 ECU configuration was included in Race Studio 2 and that is it is a publicly documented. We can find the MS4.3 ECU integration document in the following website:http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_g a_continental_tire_series_ms43_system_integration_info_r14_en_de.pdf. As a resume, we provide a table with all the possible CAN messages for the Bosch MS4.3 ECU configuration.
  • 45. Unai Huete Beloki MXL Pista datalogger for FSAE 45 Table 2. BOSCH MS4.3 ECU configuration.
  • 46. Unai Huete Beloki MXL Pista datalogger for FSAE 46 5.5. Rear control module The rear control module is the one in charge of controlling the BAMOCAR inverters, the ones that give the necessary current to the vehicle’s engine. The Front module takes information from the potentiometer, sends it to the Rear module. The Real module controls the inverters depending on the received information from the Front module. 5.5.1. Rear module hardware In the figure 35 we can see how the rear module looks like. This module was created by components of the electric/electronic staff of Tecnun Seed Racing team. Figure 35. Rear Module. The components related with the programming of the microcontroller are numbered in the figure 35. • 1 PIC18f4680 microcontroller (datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf). • 2 MCP2551 transceiver (datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21667f.pdf).
  • 47. Unai Huete Beloki MXL Pista datalogger for FSAE 47 • 3, 4, 5, 7, 8 and 9 CAN bus connections (CAN_H & CAN_L). The BAMOCAR inverters (datasheet: http://www.unitek-online.de/pdf/download/Antriebe- Drive/Servo-Digital/E-DS-CAN.pdf) are going to connected via CAN. • 7 AD22100 Voltage output temperature sensor, used for water temperature measurement (datasheet: http://www.analog.com/media/en/technical- documentation/data-sheets/AD22100.pdf). • 6 5V and GND connection. • 10 15V and GND connection. • 8 ADXL335 3 axis accelerometer (datasheet: https://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf). • The CFPX-104 crystal oscillator set up to 40 MHz (datasheet: http://www.iqdfrequencyproducts.com/products/details/cfpx-104-9-05.pdf) is placed in the other part of the module, connected to ports 13 and 14, as we can see in figure 35. • 11 ADXRS652 Gyroscope (http://www.analog.com/media/en/technical- documentation/data-sheets/ADXRS652.pdf), for Yaw Rate information. The most important component of the module is the PIC18F4680 microcontroller, as we have mentioned before, is the one that controls the CAN bus along with the MCP2551 transceiver. Our aim is to take the information from the components connected to this module and write them in a specific format in order to be able to read and collect the information in the AIM MXL Pista dash. Some of the information will also be modified to control the behaviour of other components. For example, the water temperature sensor will be used to switch on/off the water pump of refrigeration part of the electric car. In figure 36 we can see the inputs and outputs of the PIC18F4680 microcontroller. From the sensors shown above, the ones that are going to be sent to the MXL Pista are: Water temperature, Yaw rate and Inverter Speed (this one is received via CAN, port 36 in microcontroller). We will not send the 3 axis accelerometer sensor’s Figure 36. PIC18F4680 inputs/outputs.
  • 48. Unai Huete Beloki MXL Pista datalogger for FSAE 48 information to the Dash as we have that information with the GPS module. “V_bus” and “I_bus” shows the voltage and current in the car´s batteries. It is better to take these both data from the BMS (Battery management system) since it is more accurate. An important component placed in the Rear module is the CFPX-104 40 MHz crystal, which is used to increment the bit rate of the CAN bus to 1Mbps, because the MXL Pista works at that bit rate. Our module previous worked at 250Kbps at that difference made the bus drop. Using the crystal we incremented the bit rate to make the CAN bus work. The MCP2551 also supports 1 Mbps operation, so the problem was solved. Figure 37. TSR´15 components distribution. In Figure 37 we can see the position of the Rear module. It is located inside the Electronic Box (red box). 5.5.2. “Rear.c” file The “Rear.c” file is the “.c” file used for compiling and creating the “Rear.hex” file, the one used for programming the PIC18F4680 (as explained in 5.2.2).
  • 49. Unai Huete Beloki MXL Pista datalogger for FSAE 49 Code 1. "Rear.c". In the first lines of the code we define the constant and variables that are going to be used during the “Rear.c” file. Code 2. "Rear.c". In the second part of the code, we define the ports of the PIC18F4680 microcontroller as inputs or outputs. We also set the microcontroller´s clock frequency by giving a specific value to the variable “OSCCON”.
  • 50. Unai Huete Beloki MXL Pista datalogger for FSAE 50 Figure 38. Definition of "OSCCON variable taken from PIC18F4680 datasheet. Figure 39. Clock diagram taken from PIC18F4680 datasheet. As we can see in code 2, we are giving a value “01110000” to “OSCCON” variable. The two least significant bits are set to “00”, means that we are using the primary oscillator (figure 38). From figure 39 we can see that the primary oscillator is related with
  • 51. Unai Huete Beloki MXL Pista datalogger for FSAE 51 the component connected in ports OSC2 and OSC1 (port number 13 and 14), in our case that is the CFPX-104 40 MHz crystal. Code 3. "Rear.c". In the third part of the code we continue with the settings for the microcontroller. We disable PSP ports (see page 142 in PIC18F46801 datasheet), reset CCP1 module (see page 165 in PIC18F46801 datasheet) and disable comparators (see page 259 in PIC18F46801 datasheet). The most important part of these code lines is the definition of ADCON1 variable. Figure 40. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250). 1 PIC18F4680 microcontroller datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
  • 52. Unai Huete Beloki MXL Pista datalogger for FSAE 52 As we can see in figure 40 and code 3, we set the ANx ports as analog ports. This ports are going to be connected this different sensors which will give a certain analog value depending on the sensor and its parameters. Code 4 . "Rear.c". Code 4 describes the configuration of the PIC18F4680 for the CAN bus. The CAN bus timing parameters are taken in order to have a bit rate of 1Mbps (see point 23.9 in PIC18F46802 datasheet). Some parameters were taken from a CAN bit rate calculator (http://www.kvaser.com/support/calculators/bit-timing-calculator). We use the functions shown in code 4 to initialize, set the operation mode and set masks for advanced filtering of messages. Code 5 . "Rear.c" . 2 PIC18F4680 microcontroller datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
  • 53. Unai Huete Beloki MXL Pista datalogger for FSAE 53 “CANSetFilter” function in code 5 sets a message filter for a message with the specified ID. It is necessary to define the filters before the program loop in order to be able to receive messages from the chosen ID. The BAMOCAR3 inverters need to receive a message to start sending the RPM value permanently to the Rear module. Figure 41. Necessary message for RPM valu taken from BAMOCAR CAN bus datasheet. The message format specified in figure 41 is different from the one in the code. Data 1 in the BAMOCAR3 will be Data 0 in the code. Same for the rest of data bytes, always one number inferior. The message has the following structure as we can see in Code 5: • ID: 0x210. • DLC: 3, specified in the function “CANWrite” (third parameter). • Data 0: 0x3d. • Data 1: 0x30. • Data 2: 0x01. We can see in figure 34 that Data 3 is 0x64 (100 in decimal format). In our case we choose 0x01 (1 in decimal) for a repetition timing of 1ms. This message is specified before the program loop because the inverter only needs to receive this message once. 3 BAMOCAR CAN bus datasheet (http://www.unitek-online.de/pdf/download/Antriebe- Drive/Servo-Digital/E-DS-CAN.pdf).
  • 54. Unai Huete Beloki MXL Pista datalogger for FSAE 54 Code 6 . "Rear.c". With Code 6 part we start with the program loop of the “Rear.c” file. In this part of the code we receive the CAN message send by the Front module. This message has an ID=0x100 and is send in BIG ENDIAN format. We convert the message data into a variable (accel1). Figure 42. Torque reference definition taken from BAMOCAR datasheet. As we can see in figure 42, we have to send the acceleration (torque reference) information with an ID=0x210, Data 0=0x90 and Data 1-2 for “accel1” information in LITTLE ENDIAN format.
  • 55. Unai Huete Beloki MXL Pista datalogger for FSAE 55 Code 7. "Rear.c". Code 7 part shows how we read the inverters speed (RPM) information from the CAN. The message is received in LITTLE ENDIAN format and we convert the two data bytes into a variable called “speed”. Figure 43. BAMOCAR inverter RPM data sending format taken from datasheet. As we can see in figure 43, the BAMOCAR4 CAN datasheet specifies that the ID=0x190 and Data 0=0x30, we use this information to convert the message into the variable under these conditions. In the end of the code 7 part, we multiply the “speed” by 4 to show this value correctly in the MXL Pista dash: 4 BAMOCAR CAN bus datasheet (http://www.unitek-online.de/pdf/download/Antriebe- Drive/Servo-Digital/E-DS-CAN.pdf).
  • 56. Unai Huete Beloki MXL Pista datalogger for FSAE 56 • The theoretical range for the inverter RPM data bytes value is 0<RPM<65535 (0xFFFF), as it uses two bytes, but it will never arrive to more than 5000. This means that the quantization is 1 rpm/bit. • The Bosch MS4.35 has a range of 0<RPM< 16383.75 for the RPM message (see table 2, ECU_1), which gives a quantization of 0.25 rpm/bit. Code 8. "Rear.c". Code 8 just reads the gyroscope´s voltage value (port 10, AN7) that will give us the Yaw rate value. Code 9. "Rear.c". Code 9 part is related with the data from the water temperature sensor connected to port 34 (AN8). “WT” variable takes the digital voltage value from the sensor and we use the variable for a temperature value. The conversion is done using the equation given in 5 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf).
  • 57. Unai Huete Beloki MXL Pista datalogger for FSAE 57 AD221006 datasheet and modifying it because of an offset respect to the analog voltage value in port 34 (using the polimeter) and the value given by the ADC converter. • PIC18F46807 has a 10 bit ADC converter (page 249 in datasheet). • 1.375V (0ºC) correspond to 282 integer in the code. • (WT-88) gives the correct voltage value. “88” is the offset explained previously, that corresponds to a difference of 0.42V. This value depends on the battery we are using to power the Rear module. Code 10. "Rear.c". Code 10 part explains how we are going to send the information to the MXL Pista. We will use 3 messages taken from Table 2 to send speed (RMP), Yaw rate and Water Temperature data. • Speed (RPM): will use “MS43_RPM” message configuration: ID=0x770 and Data 1&2. • Water Temperature: we will use “MS43_ECT” message configuration: ID=0x770, Data 0 (Row)=0x03 and Data 7. It is modified in the last lines of Code 9, in order to save it correctly in the MXL Pista. o The important range in this value will be around the value 30ºC, as we are going to use it to switch on/off the water pump. So it is enough to take the 8 LSB for this value. o “MS43_RPM” message has a range of -40ºC to 215Cº and a quantization of 1ºC/ bit. o A TempP=0x00, 0ºC will be a -40ºC in the MXL Pista. This is the reason for adding 40 to TempP variable in the last lines of code 9. • Yaw rate: will use “MS43_SPEED” message configuration: ID=0x770 and Data 3&4. This data will not be shown in the display, as it does not represent the real value. We will send it in this format to collect the Yaw Rate data. To represent the real value we will do the following conversion after downloading the data from the MXL Pista: 6 AD22100 datasheet: http://www.analog.com/media/en/technical-documentation/data- sheets/AD22100.pdf.
  • 58. Unai Huete Beloki MXL Pista datalogger for FSAE 58 Yaw_rate=abs (512-(MS43_SPEED*128,2))/1.435 Code 11. "Rear.c". The Code 11 part shows the conversion of the voltage value (digital from ADC) taken from the ADXRS6528 gyroscope to the real value of the Yaw Rate, through equations taken from the datasheet. The message with ID=0x1E0 is written in the CAN bus but it is not shown in the display (Yaw rate for the display shown in Code 8 and 10). This one writes the real value directly in the CAN bus in BIG ENDIAN format and will be used for the traction control in future implementations. Code 12. "Rear.c". 7 PIC18F4680 microcontroller datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf 8 ADXRS652 Gyroscope datasheet: http://www.analog.com/media/en/technical- documentation/data-sheets/ADXRS652.pdf.
  • 59. Unai Huete Beloki MXL Pista datalogger for FSAE 59 Code 13. "Rear.c". Code 12 and 13 shows how the 3 axis accelerations are taken from the ADXL3359 and written in the CAN Bus. The conversion done from the digitally converted voltage value to the real acceleration value is taken from the ADXL3359 datasheet. This information will be used for the future implementation of the traction control of our SAE Formula Student electric car. 9 ADXL335 3 axis accelerometer (datasheet: https://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf).
  • 60. Unai Huete Beloki MXL Pista datalogger for FSAE 60 Code 14. "Rear.c". The last part of the code takes the analog values of V_bus and I_bus by using the function “Adc_Get_Sample” and writes them in the same message with ID=0x118. This both values will be taken from the BMS (Battery Management System) in the Front module via CAN, as it is has more accuracy than the sensors mentioned before. To conclude the code, the rear right wheel speed and left wheel speed information is taken in a similar way to the previous sensors. “ADC_Read” function reads the digital value of the voltage given by the connected sensor. Both wheel speeds are written in the same message ID=0x530. 5.5.3. “Rear.c” implementation in PIC18F4680 microcontroller For the implementation of the “Rear.c” file follow the steps in 5.2.1 and 5.2.2.
  • 61. Unai Huete Beloki MXL Pista datalogger for FSAE 61 5.6. Front module The Front module is the one that controls the starting process of the TSR´15 electric car, and controls and receives information from the components placed in the front part of the car. It is connected to the Dashboard of the car, where all the control buttons are placed. The most important characteristics of the front module is that it takes the acceleration pedals value in order to ask for an specific current to the inverters that will make the car to start running. 5.6.1. Front module hardware In the figure 44 we can see the Front module position and the dashboard. The Front module was created by the electric/electronic members of Tecnun Seed Racing team. Figure 44. Front module (red box) and Dashboard with AIM MXL Pista.
  • 62. Unai Huete Beloki MXL Pista datalogger for FSAE 62 Figure 45. Dashboard of the TSR´15. Figure 45 shows how the dashboard looks like (the final one will be fabricated in carbon fiber). Every button and led function will be explained in the code implementation. Figure 46. Top and lateral view of Front module box. The components related with the programming of the PIC18F4680 microcontroller are numbered in the figure 46: DMSRDBADT IMD ledARS BMS ledTV
  • 63. Unai Huete Beloki MXL Pista datalogger for FSAE 63 • 1 PIC18f4680 microcontroller (datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf). • 2 MCP2551 transceiver (datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21667f.pdf). • 3 & 4 through the cables shown in figure 40, several components (dashboard buttons, dashboard LEDs, acceleration potentiometers, CAN bus, etc.) are connected from the exterior of the Front module box. Those components are connected through inputs as the ones shown in the lateral view of figure. The most important component is the PIC18F4680 microcontroller, along with the MCP2551 transceiver, they control the messages written and read in the CAN bus. In the figure 46 we can see the inputs and output of the PIC18F4680 microcontroller. Some information will the taken directly from the sensors (converting the analog voltage value into digital) or will be read from the CAN Bus. As in the Rear module, we had to use a CFPX-10410 crystal oscillator set up to 40MHz to increment the bit rate of the CAN Bus to 1Mbps, because the AIM MXL Pista works at that bit rate and it drops if the bit rate is lower. Both the PIC18F4680 microcontroller and the MCP2551 transceiver support a bit rate of 1Mbps. 10 CFPX-104 crystal oscillator (datasheet: http://www.iqdfrequencyproducts.com/products/details/cfpx-104-9-05.pdf) Figure 47. PIC18F4680 ports configuration (RDB_LED_ACT and BMS_LED_ACT ports are interchanged).
  • 64. Unai Huete Beloki MXL Pista datalogger for FSAE 64 5.6.2. “Front.c” file The “Front.c” file is the “.c” file used for compiling and creating the “Rear.hex” file, the one used for programming the PIC18F4680 (as explained in 5.2.2). Code 15. "Front.c". The first lines of the code define the constants and variables that are going to be used during the “Front.c”. The ports are defined with the names of the dashboard´s buttons connected to them. Code 16. "Front.c". In the second part of the code, we define the ports of the PIC18F4680 microcontroller as inputs or outputs (1 or 0). We also set the microcontroller´s clock
  • 65. Unai Huete Beloki MXL Pista datalogger for FSAE 65 frequency by giving a specific value to the variable “OSCCON” to use the primary oscillator (CFPX-104 40MHz crystal). Figure 48. Definition of "OSCCON variable taken from PIC18F4680 datasheet. Figure 49. Clock diagram taken from PIC18F4680 datasheet.
  • 66. Unai Huete Beloki MXL Pista datalogger for FSAE 66 As we can see in code 16, we are giving a value “01110000” to “OSCCON” variable. The two least significant bits are set to “00”, means that we are using the primary oscillator (figure 43). From figure 49 we can see that the primary oscillator is related with the component connected in ports OSC2 and OSC1 (port number 13 and 14), in our case that is the CFPX-104 40 MHz crystal. Code 17. "Front.c". In the third part of the code we continue with the settings for the microcontroller. We disable PSP ports (see page 142 in PIC18F468011 datasheet), reset CCP1 module (see page 165 in PIC18F468011 datasheet) and disable comparators (see page 259 in PIC18F468011 datasheet). The most important part of these code lines is the definition of ADCON1 variable. 11 PIC18F4680 microcontroller datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf
  • 67. Unai Huete Beloki MXL Pista datalogger for FSAE 67 Figure 50. "ADCON1" variable definition taken from PIC18F4680 datasheet (page 250). As we can see in figure 50 and code 3, we set the ANx ports as analog ports. This ports are going to be connected this different sensors which will give a certain analog value depending on the sensor and its parameters. Code 18. "Front.c". Code 18 describes the configuration of the PIC18F4680 for the CAN bus. The CAN bus timing parameters are taken in order to have a bit rate of 1Mbps (see point 23.9
  • 68. Unai Huete Beloki MXL Pista datalogger for FSAE 68 in PIC18F468012 datasheet). Some parameters were taken from a CAN bit rate calculator (http://www.kvaser.com/support/calculators/bit-timing-calculator). We use the functions shown in code 18 to initialize, set the operation mode and set masks for advanced filtering of messages. Code 19. "Front.c". “CANSetFilter” function in code 19 sets a message filter for a message with the specified ID. It is necessary to define the filters before the program loop in order to be able to receive messages from the chosen ID. We also set the operation mode for the CAN messages. Code 20. "Front.c". With the code 20 part we start with the program loop. In this first part of the code, we detect the state of the DMS (Driver Master Switch, the one with a “start” word written in the dashboard). It will send the following message to start with the precharge period: 12 PIC18F4680 microcontroller datasheet
  • 69. Unai Huete Beloki MXL Pista datalogger for FSAE 69 • Id=0x180. • Data 0: 0xFF. • Delay_ms(4000): we leave the necessary time for the precharge. • Dms= 0x09: this variable will be send to the MXL Pista datalogger. We will use the “MS43_EXH_T2” message in the Bosch MS4.313 protocol. It will show a “5” we it is switched on, we will use this value to show a message in lower part of the display. Code 21. "Front.c". Code 21 part, will check if the inverters are enabled (“rdb_check”) and just in case they are enabled and the RDB (Ready to Drive Button) is switched on, it will send a message to enable the inverters with the following structure: • Id=0x150. • Data 0: 0xFF. • Rdb= 0x09: will be sent to the dash once the DRB is switched on. We will use the “MS43_EXH_T1” message in the Bosch MS4.313 protocol. It will show a “5” we it is switched on, we will use this value to show a message in lower part of the display. Code 22. "Front.c". Code 22 shows one of the most important parts, in order to be able to move the electric car. To get the desired acceleration, we use two potentiometers. These two potentiometers will give a analog voltage value, depending on the accelerating pedal position. http://ww1.microchip.com/downloads/en/DeviceDoc/39625c.pdf 13 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 70. Unai Huete Beloki MXL Pista datalogger for FSAE 70 The PIC18F4680 will read the analog voltage value and convert it to a digital value using its internal 10 bits ADC converter. These both acceleration values will be multiplied by the “ars” variable. The “ars” variable will have two values depending on the ARS (Activate Regulation Speed) button position (on/off). The ARS value will be defined in the following code lines. Finally we will write both acceleration values in the CAN Bus with the following BIG ENDIAN format shown in the code 22. This CAN message will be read in the Rear module, as we explained in 5.5.2, to ask for the necessary current to the inverters. Code 23. "Front.c". Code 23 describes how to write the CAN messages in order to receive the “Accel2” information and RDB/DMS status in the MXL Pista dash. • RDB: uses “MS43_EXH_T1” message format in Bosch MS4.314 protocol. • DMS: uses “MS43_EXH_T1” message format in Bosch MS4.314 protocol. • Accel2: uses “MS43_MAP_BE_T2” message format in Bosch MS4.314 protocol. See the necessary “Row” values (data 0) and the data bytes positions in the Bosch MS4.3 protocol table (Table 3 in 5.4). 14 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 71. Unai Huete Beloki MXL Pista datalogger for FSAE 71 Code 24. "Front.c". Code 24 explains how to check status of the TV button. It also writes “accel1” and “tv” messages in the CAN Bus, each one with his Row (data 0) number: • “tv” uses “MS43_WATER_P” message format in the Bosch MS4.315 protocol. It will send a tv=0x14 (20 in decimal) when the TV button is switched on. This value corresponds to a 0x01 (1 decimal) in the MXL Pista when the button is on and a 0x00 (decimal 0) when the button is off. • “accel1” uses “MS43_MAP_AF_T1” message format in the Bosch MS4.315 protocol. TV button status will be used in the future to activate/deactivate the traction control that will be implemented in the Rear module. 15 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 72. Unai Huete Beloki MXL Pista datalogger for FSAE 72 Code 25. "Front.c". Code 25 shows how to check the status of ARS (Activate Regulation Speed) and ADT (Activate Data Transmission) switch buttons: • “ars” variable is used to change the value of “accel1” and “accel2” variables. The driver has the opportunity choose between a maximum torque demand of 100% or choosing a 50% if the batteries are not able to give enough power for a long period. It uses “MS43_LAMBDA_CTR2” message format in the Bosch MS4.316 protocol. It will send an ars=0x80 (128 in decimal) when the TV button is switched on. This value corresponds to a 0x01 (1 decimal) in the MXL Pista when the button is on and a 0x00 (decimal 0) when the button is off. • “adt” uses “MS43_LAMBDA_CTR1” message format in the Bosch MS4.316 protocol. It will send an adt=0x80 (128 in decimal) when the TV button is switched on. This value corresponds to a 0x01 (1 decimal) in the MXL Pista when the button is on and a 0x00 (decimal 0) when the button is off. Finally both values are written in the CAN message, as “MS43_LAMBDA_CTR2” and “MS43_LAMBDA_CTR1” messages use the same identifier, row number and different data bytes. 16 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 73. Unai Huete Beloki MXL Pista datalogger for FSAE 73 Code 26. "Front.c". Code 26 describes how to take information from the brake potentiometer and brake pressure sensors. The potentiometer placed in the brake pedal of the TSR´15 will give a certain voltage value depending on the pedal position. Both brake pressure have a conversion in order to be able to see them correctly in the MXL Pista dash: • “Brake_Press1” uses “MS43_MAP_BE_T1” message format in the Bosch MS4.317 protocol. The MXL Pista will consider that we are sending in “mbar” unit, but we have to interpret it as “bar” unit. 17 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 74. Unai Huete Beloki MXL Pista datalogger for FSAE 74 • “Brake_Press1” uses “MS43_MAP_AF_T1” message format in the Bosch MS4.317 protocol. The MXL Pista will consider that we are sending in “mbar” unit, but we have to interpret it as “bar” unit. The conversion for the Race Technology Brake Sensor18 is taken from the datasheet. Code 27. "Front.c". Code 27 shows how to read front right/left wheel speeds. We will have to implement the conversion for the voltage values when get the sensors. Code 28. "Front.c". 18 Race Technology Brake Sensor datasheet:http://www.race- technology.com/wiki/index.php/PressureSensors/BrakePressure .
  • 75. Unai Huete Beloki MXL Pista datalogger for FSAE 75 In code 28 part, we start reading messages from the CAN Bus. The identifiers of these messages were previously defined to be filtered before the program loop (CAN settings in the beginning of the code). The first message is the BMS (Battery Manage System) failure, a general failure in the battery system. In case we have a failure a LED will switch on in the dashboard and it will appear a “BMS_FAILURE” message in the MXL Pista. • “bms” uses “MS43_OIL_T” message format in the Bosch MS4.319 protocol. When the alarm message is received, bms=0x29 (decimal 41) that corresponds to a 1 in the MXL Pista. Code 29. "Front.c". Code 29 describes how to switch on a LED and write a message in the CAN Bus in case we receive an IMD (Insulation Monitor Device) failure, which means that there is a power loss in the car that could be dangerous. It measured with a resistance between GND a positive pole from HV (High voltage). • “imd” uses “MS43_FUEL_T” message format in the Bosch MS4.320 protocol. When the alarm message is received, imd=0x29 (decimal 41) that corresponds to a 1 in the MXL Pista. 19 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) . 20 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 76. Unai Huete Beloki MXL Pista datalogger for FSAE 76 Code 30. "Front.c". Code 30 explains how to receive battery cells current from a CAN message and send it to the MXL Pista. It is really useful information for the driver. He could control the power given by the inverters and run slower/faster depending on the status of the battery cells (current/voltage). In this code part we show how to receive the current information from the BMS (Battery Management System) via CAN Bus. • “current” uses “MS43_AIR_T” message format in the Bosch MS4.321 protocol. A conversion is done in order to receive the correct value of the current in Amperes in the MXL Pista. 21 Bosch MS4.3 ECU configuration (http://www.bosch- motorsport.de/media/msd/downloads/spezifische_rennserieninformation/grandam/2013_ga_contin ental_tire_series_ms43_system_integration_info_r14_en_de.pdf) .
  • 77. Unai Huete Beloki MXL Pista datalogger for FSAE 77 Code 31. "Front.c". Code 31 shows the last part of “Front.c” file. In this part of the code we read the battery cells total voltage from the BMS (Battery Management System) via CAN. As we previously explained, it is useful information for the TSR´15 driver. • “BatteryV” uses “MS43_FUEL_USED” message format in the Bosch MS4.321 protocol. 5.6.4. “Front.c” implementation in PIC18F4680 microcontroller For the implementation of the “Front.c” file follow the steps in 5.2.1 and 5.2.2. 5.7. Table with Bosch MS4.3 protocol and used TSR messages for MXL Pista In the next table we can see resume of the available messages in the Bosch MS4.321 protocol, the sensor/information assigned to the message and the new TSR name given to the message.
  • 78. Unai Huete Beloki MXL Pista datalogger for FSAE 78 Table 4. CAN messages sent to MXL Pista logger.
  • 79. Unai Huete Beloki MXL Pista datalogger for FSAE 79 6. AIM MXL Pista (Quick Guide) 6.1. Keyboards function Through the MXL keyboard we can see all the information stored in the dash. These are some available options that we have using the keyboard: • Recall recorded data. • Enable/disable night vision. • Several settings: Shift lights, beacon and splits for GPS Laptimer (explained in 4.1.3), date and time, etc. Figure 51. MXL Pista dash/datalogger. In the figure 51 we can see the keyboard of the MXL Pista: • 1 “MENU/<<” button. • 2 “>>” button. • 3 “ok/MEM” button. • 4 “quit/VIEW” button.
  • 80. Unai Huete Beloki MXL Pista datalogger for FSAE 80 6.1.1 Recall recorded data When a test session is finished we can see the recorded data using our MXL keyboard. To recall recorded data: • Push “MEM” button display shows best lap time (rpm and speed max values) • Using “<</>>” buttons we can scroll all the laps and split times (with rpm and speed max values). 6.1.2 Other functions • How to enable disable backlight. o “MENU” ”OK/MEM” for on/off “Quit/VIEW”. • Set GPS beacons and splits o See 4.1.3. • View/clear total running o “MENU” twice total run (distance and time). o “OK” “OK” cleared. • Odometer o “MENU” three times odometer in km. • Set date and time o “MENU” four times “OK” and “<</>>” set hour “OK” and “<</>>” set minute “OK” and “<</>>” set year “OK” and “<</>>” set month “OK” and “<</>>” set day “OK” and “<</>>” set weekday “OK” and “Quit/view” button. • Set shift lights o “MENU” six times shift light “OK” Insert RPM value “<</>>” second RPM value … “Quit/VIEW”. • System information o “MENU” seven times Firmware version and logger serial number. 6.2. Connections Figure 52 shows how the dash looks like from the back part. The connections are going to be briefly explained.
  • 81. Unai Huete Beloki MXL Pista datalogger for FSAE 81 Figure 52. MXL Pista dash/datalogger. 6.2.1. Harness The harness wiring provided with the MXL Pista Kit (see 3.4.5). It has to be connected in the back of the MXL Pista dash. Figure 53. AIM MXL Pista harness. The harness includes CAN interface wiring, power related wiring and 8 channels for different AIM sensors. It has to be connected to AMP 28C connector (see Appendix 3). CAN+ and CAN- will be connected to the CAN Bus through the Front module CAN high (CAN +) and CAN low (CAN -) inputs.
  • 82. Unai Huete Beloki MXL Pista datalogger for FSAE 82 6.2.2. GPS module The GPS05 GPS module explained in 3.4.4 ha to be connected in the back of the MXL Pista dash to the Binder 712-5C connector (see Appendix 3). Figure 54. GPS05 GPS module.
  • 83. Unai Huete Beloki MXL Pista datalogger for FSAE 83 7. Race Studio Analysis: Download, save & analyze test values Race Studio 2 is data analysis software designed specifically to download and process the data from AIM MXL Pista. The results can be viewed and presented in many different ways in other to analyze the data in the way you need. It is a powerful instrument to analyze and improve vehicle and driver´s performances. 7.1. Race Studio Analysis: Download and save test values Once you have end a test sessions, we can download data stored in the MXL Pista memory and store it. Firstly, we have to open Race Studio Analysis program (installation explained in Appendix 1). To download the data follow these steps: • Run Race Studio 2 software. • Connected the MXL Pista to USB port and power it. • Click on “Download” button (green arrow) on top toolbar. • Choose name and different options for the test data. • We can choose to clear the datalogger once we have downloaded the information. • Click on Save. We can also import a test from a USB drive clicking on “Import test” button.
  • 84. Unai Huete Beloki MXL Pista datalogger for FSAE 84 7.2. Race Studio Analysis: How to use it. After downloading some data, or if we have already downloaded data before, we will see the events list in “Test database and lap manager” window (see figure 55). Figure 55. "Test database and lap manager" window. The following analysing methods will be explained with a test done in TSR’14 electric car, just recording with the GPS module and MXL Pista internal sensors data (not TSR’14 ECUs), as the TSR’15 is not ready to run yet. To open a test, double click on the desired test, in our case “Primera prueba infineon”.
  • 85. Unai Huete Beloki MXL Pista datalogger for FSAE 85 7.2.1. How to plot measures graphs With Race Studio Analysis, we can plot the recorded laps and sampled data versus time, distance and frequency. As an example we will show the “GPS_Speed” data saved during “Primera prueba Infineon” test. Figure 56 shows the “GPS_Speed” vs Time plot. This plot is useful, for example, to know how fast the TSR’15 could do the SAE acceleration test. Figure 56. Race Studio Analysis: "GPS_Speed" vs Time. In figure 56 we can see that the TSR’14 could do the acceleration test in 5 seconds, with a maximum speed of 84,3 Km/h. To see this graph we followed these steps: • Click on “Plot measures in a graph” button in the left-upper part of the “Measure graph” window. • Choose the desired channel in the left toolbar. • We can change from Time to Distance with the button “Time/Distance” in the upper-right part of the plot.
  • 86. Unai Huete Beloki MXL Pista datalogger for FSAE 86 All the plots can be exported to Excel files by clicking on File>Data export in Excel. In the lower part of the window we can select the lap we want to draw in the graph. Different channels and laps can be selected for the same graph. 7.2.2. How to plot measure graph vs GPS position Race Studio 2 also offers the possibility to draw the sampled data according the GPS position in each sampling time. Figure 57 shows the GPS module’s lateral acceleration (GPS_LatAcc) in each position of the track, in this case taken from a test done in a commercial car in Miramón, San Sebastian. Figure 57. Race Studio Analysis: "GPS_LatAcc" vs GPS position. The GPS based graphs can also be used to see which driving technique is the fastest one for each track. Drawing all the laps and selecting the fastest one, we can see how we have to turn in each curve to go faster.
  • 87. Unai Huete Beloki MXL Pista datalogger for FSAE 87 Figure 58. GPS graph zoomed in. We also have the option to see the lap replay clicking on “Show lap replay analysis” button in the upper toolbar. Furthermore, another interesting characteristic of Race Studio 2 program is that we can see the GPS tracking in the real position exporting the GPS data to Google Earth program (see Appendix 2 for installation). We can see GPS data in Google following these steps: File>Export KML file for Google Earth. Double click on the saved file.
  • 88. Unai Huete Beloki MXL Pista datalogger for FSAE 88 Figure 59. GPS data exported to Google Earth.
  • 89. Unai Huete Beloki MXL Pista datalogger for FSAE 89 8. Project budget Table 5. Project Budget.
  • 90. Unai Huete Beloki MXL Pista datalogger for FSAE 90 9. Conclusions • The main problem was that the MXL Pista dash is prepared to be connected to commercial ECUs (Engine Control Units) and do not need any other configurations. To connect our ECU modules to the dash, we had to modify modules with and external oscillator and take off one of the CAN Bus 120Ω termination resistances, as the MXL Pista works at 1MBps (previous bit rate 250KHZ) and has an internal 120Ω termination. AIM manufacturer helped us solving these problems. • A public ECU configuration protocol was necessary because, as we previously explained, the MXL Pista dash is prepared to be connected to commercial ECUs. We used the Bosch MS4.3 ECU protocol. • It will be easier to detect failures in the TSR’15 electric car. The MXL Pista will record information from components that can be analysed to see what is going wrong. The car will be stopped if an alarm message is shown in the dash. • The TSR’15 driver will have really useful information shown in the display. For example, the driver will be able to change the driving technique depending on the battery cells status. • The GPS05 GPS module will be helpful for lap timings and other internal sensors information. • The Race Studio 2 and Race Studio Analysis programs will help to improve the driver and car’s performance.
  • 91. Unai Huete Beloki MXL Pista datalogger for FSAE 91 Appendix Appendix 1: AIM software installation (GPS manager, Race Studio 2 y Race Studio Analysis) and driver MXL Pista has been designed to connect with a PC through an USB cable. It can only be configured throught Race Studio 2 software, provided by AIM along with the MXL Pista. In the package we can find the software CD-ROM and USB cable. The configuration is only possible after the installation of the software and USB driver in our PC. AIM software programs had been designed to work in Windows operative systems. In this case I will show how we can install the necessary programs to configure the MXL Pista in a PC with Windows 7 I operative system. To install “Race Studio 2” and “GPS Manager” follow the directions as detailed below: • Close all applications and if MXL is connected to the PC, unplug it. • Insert the CD-ROM in the PC and the following window will appear. Press “Run index.htm”. Figure 60. Window after CD-ROM insertion.
  • 92. Unai Huete Beloki MXL Pista datalogger for FSAE 92 • An Internet Explorer window will appear. Choose the language for the software (Italian or English). • In the next window we will choose the programs we want to install,” Race Studio 2” for the configuration of the MXL Pista and “GPS Manager” for the configuration of the GPS module). • We will start with the downloaded file called “RS2Setup.exe”. Follow the directions shown below: o Press “Next” button. o Press “Finish” button. • The following icons will appear in the desktop of our PC. Figure 62. "Race Studio 2" and "Race Studio Analysis" icons. • Finally we will install the software for the GPS module. Execute the file “GPSMAnagerSetup.exe”. o Press “Next” button. o Press “Finish” button. • The following icon will appear in our desktop. Figure 63. "GPS Manager" icon. Figure 61. Internet Explorer window.
  • 93. Unai Huete Beloki MXL Pista datalogger for FSAE 93 Appendix 2: Google Earth program installation “Google Earth” program will be really helpful to configure our GPS module. With this program, for example, we will be able to show the tracks done by our car or define tracks/circuit coordinates, so that the GPS module can measure lap times or split times in the defined track. To install “Google Earth” follow the directions as detailed below: • Enter in the following link: https://www.google.es/intl/es/earth/index.html. • Press “Descargar Google Earth” button. • Press “Aceptar y Descargar” button. • Execute the following file: “GoogleEarthSetup.exe”. • Press “Run” button.
  • 94. Unai Huete Beloki MXL Pista datalogger for FSAE 94 Appendix 3: MXL Pista dash installation template
  • 95. Unai Huete Beloki MXL Pista datalogger for FSAE 95
  • 96. Unai Huete Beloki MXL Pista datalogger for FSAE 96 Appendix 4: MXL Pista technical characteristics
  • 97. Unai Huete Beloki MXL Pista datalogger for FSAE 97