The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester. It is a home-made model car remotely controlled by a smartphone.
Summer School '15
Youtube teaser movie
The work of the students can be summarized in three main tasks:
- design and assembly of the chassis
- completion and extension of the control GUI on the smartphone
The kart is controlled by a smartphone via Bluetooth.
A Bluetooth receiver on the kart communicates via an RS232 serial link with the FPGA control board. This board stores the control values in a set of registers and dispatches them at a regular interval on an I2C link. The master also reads data values from the slave boards, stores them into the second set of registers, and sends the corresponding information at a regular pace over the RS232 with a very simple protocol.
The control is distributed over several FPGA boards connected together via I2C. These baseboards each hold a slave function board:
- A Bluetooth RS232 modem sits on the I2C master FPGA
- A DC motor controller receives a speed value and builds a PWM and direction control.
- A stepper motor controller receives the desired angle and builds the coil controls signals.
- A sensor board manages I/O comprising proximity sensors, hall sensors (for the driving speed), and LEDs.
The programming introduction gives an overview of the structure of the software and the students' tasks. They comprise:
- Android application development for the remote control
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.
One goal is to implement an Android application that controls and monitors the kart.
The installable package of the (or rather a) solution can be found here: Kart.apk
- You can download the Kart project with the minimal interface here: Kart.zip
- Update for the Kart lib: kartlib-release.aar, copy this into Kart/app/libs.
- You can find the instructions on how to open the project in Android Studio in the programming introduction presentation...
- The online documentation of all Java classes that are at your disposition is [here]
- If you need timers, please do not use Java standard Timer and TimerTask, we provide a dedicated Timer class in the package ch.hevs.utils.Timer.
- To be informed when a register is modified by the kart (i.e. the hall sensor counter value has changed), your application has to implement the KartStatusRegisterListener interface. This will force your application to have a method (statusRegisterHasChanged) that will be called when a register value has changed. Don't forget to register your listener to the Kart (kart.addStatusRegisterListener(...)).
- Don't block the main thread with an infinite loop
- Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.
If you need to test your Android application against a Kart and your Kart is either not build yet or not available at the moment, you can install the Virtual Kart application and use the Kart Bluetooth to USB adapter.
The power supply board provides the 5 V and the 3.3 V to the other boards. This is generated from two 6 V battery packs.
The power supply board also comprises an ADC which provides the battery level.
They hold daughterboards that drive different parts of the Kart. The motherboards are interconnected via an I2C link.
The FPGA motherboards can be tested with the help of a dedicated test board which runs a signal from one I/O pin to the next.
Existing daughterboards are:
- a Bluetooth interface board
- a DC motor controller
- a stepper motor controller
- an I/O board for the sensors
- an FPGA test board
The sensors connected to the I/O board are:
- 1 to 4 VCNL4000 I2C Distance/Ambience Light Sensor
- 1 to 2 SS311PT Hall Sensor
- 1 ultrasound ranger
- 1 end of turn contact switch