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.
The work of the students can be summarized in four main tasks:
- design and assembly of the chassis and the body
- analysis of the DC motor
- configuration of the controlling FPGA
- completion and extension of the control GUI on the smartphone
Take a look at the karts gallery!
The kart is controlled by a smartphone via Bluetooth.
The electronics is composed of a general purpose FPGA daughterboard mounted on a dedicated motherboard with 8 PMOD connectors.
An Honor10 Lite smartphone running Android acts as the interface for the user.
A Bluetooth - USB dongle on the kart communicates via an UART serial link with the FPGA. The control values are stored in a set of registers accessed through a simple protocol.
The design is separated into four different modules:
- A DC motor controller is controlling the propulsion motor.
- A stepper motor controller is responsible for the Kart to turn.
- A sensor controller controls various I/Os (LEDs, buttons, range finder, hall sensors ...).
- A control registers manager retrieve and control various status information (Bluetooth connection, hardware directions ...).
The RC Car introduction gives an overview of the structure of the software/hardware and the students' tasks.
- FPGA design for driving the hardware and reading the sensors
- Android application development for the remote control
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application. This allows starting the development either with the FPGA design or the Android application.
A FPGA design environment is available, based on:
- HDL designer for graphical design entry
- ModelSim for simulation
- Libero IDE for synthesis and programming
Make sure that there is no space character in the full path to the project files.
HDL may hang while booting or files not loading/saving correctly.
The design is made using HDL Designer as it was the case during the previous semester's labs and project. The FPGAs are configured using the Libero IDE.
Three of the different modules must be completed:
- The DC motor controller receives a prescaler and a speed value to build the corresponding PWM and direction signals.
- The stepper motor controller receives a prescaler and the desired angle and builds the coil controls signals.
- The sensor controller manages I/O comprising hall sensors (to retrieve the driving speed) and a range finder (to get the distance from an obstacle).
In addition to the tests explained in the different modules, an overall tester is available to test the whole board.
One goal is to implement an Android application that controls and monitors the kart.
- You can download the Kart template project with the minimal interface here: [Kart.zip]
- You can find the instructions on how to open the project in Android Studio in the [RC Car introduction] presentation.
- The online documentation of all Java classes that are at your disposition is [here]
- The installable package of the (or rather a) solution can be found here: [KartSolution.apk]
- 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 sensor has a new value or a register is modified by the kart (i.e. the hall sensor counter value has changed), your application has to implement the KartListener interface. Don't forget to register your listener to the Kart (kart.addKartListener(...)).
- 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.
The main power is drawn from two 6 V / 2400 mAh battery packs in series The motherboard provides two connectors for the batteries, along with an extra one to wire an NiMh charger.
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.
The charge rate should be around 0.05C => 120mA here.
The 12V is reduced to a 5V rail through a buck converter.
The daughterboard is then fed with the 5V to provide an extra 3.3V rail.
Finally, an ADC converter provides the battery level as both the battery voltage and consumed current can be read from it.
The daughterboard is equipped with an Igloo AGLN250 FPGA in a VQ100 package. The clock is routed to the FPGA from a 10 MHz quartz.
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.
Motor drivers and sensors are connected to the motherboard via Pmods.
The sensors connected to the I/Os of the motherboard are:
- 1 to 2 hall sensor(s)
- 1 ultrasound ranger
- 1 end of turn contact switch
- up to 4 LEDs or digital outputs
- up to 16 buttons or digital inputs
- Additional informations for collaborators
- To do list
- When preparing the labs, follow the setup guide