Kart

From FSI
(Difference between revisions)
Jump to: navigation, search
(FPGA Boards)
(Design environment)
 
(96 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{TOC right}}
 
{{TOC right}}
The Kart module (214_Pr1) is a Summer School module for students between 2. and 3. semester. It's a home-made car remotely controlled by a smart-phone.
 
  
[[File:SummerSchool_13.jpg|thumb|Summer School '13]]
+
The Kart module (214_Pr1) is a Summer School module for students
[[File:SummerSchool_12.jpg|thumb|Summer School '12]]
+
between the 2nd and the 3rd semester.
[[File:SummerSchool_09.jpg|thumb|Summer School '09]]
+
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.
[[File:SummerSchool_05.jpg|thumb|Summer School '05]]
+
[[File:SummerSchool_04.jpg|thumb|Summer School '04]]
+
  
[[File:Kart I2C.jpg|600px|Demo Kart]]
+
<!--
 +
[[File:Kart I2C.jpg|150px|center|Demo Kart]]
 +
-->
 +
[[File:Kart_batmobile.gif|center|Batmobile 2018]]
  
 
The work of the students can be summarized in four main tasks:
 
The work of the students can be summarized in four main tasks:
* design and assembly of the chassis
+
* design and assembly of the chassis and the body
* analysis of the motor driver circuits (DC and stepper)
+
* analysis of the DC motor
* configuration of the controlling FPGAs
+
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]
* completion and extension of the control GUI on the smartphone
+
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]
  
== System Architecture ==
+
Take a look at the [[kart/gallery|karts gallery]]!
  
 +
== System Architecture ==
 
The kart is controlled by a smartphone via Bluetooth.
 
The kart is controlled by a smartphone via Bluetooth.
  
=== Distributed boards ===
+
=== Hardware ===
 +
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]
 +
mounted on a dedicated [[Kart/Motherboard|motherboard]]
 +
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].
  
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.
+
An Honor10 Lite smartphone running Android acts as the interface for the user.
This board stores the control values in a set of [[kart/serial link#Registers|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 a second set of registers and sends the corresponding information at a regular pace over the RS232 with a very simple [[kart/serial link#Serial link protocol|protocol]].
+
  
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].
+
=== Bluetooth control ===
These base boards each hold a slave function board:
+
* A Bluetooth RS232 modem sits on the I2C master FPGA
+
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.
+
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.
+
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.
+
  
== Components ==
+
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.
 +
The control values are stored in a set of [[kart/serial link#Registers|registers]] accessed through a simple [[kart/serial link#Serial link protocol|protocol]].
  
=== FPGA Boards ===
+
The design is separated into four different modules:
The [[Kart/FPGA board|FPGA motherboards]] are equipped with an AGL125 [http://www.microsemi.com/products/fpga-soc/fpga/igloo-overview IGLOO] in a VQ100 package.
+
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.
They hold daughterboards which drive different parts of the Kart.
+
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.
The motherboards are interconnected via an [[kart/I2C link|I2C link]].
+
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).
 +
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (Bluetooth connection, hardware directions ...).
  
Existing daughterboards are:
+
== Tasks ==
* the [[Kart/RS232 board|serial interface board]] or the [[Kart/Bluetooth|Bluetooth interface board]]
+
* a [[Kart/DC motor controller|DC motor controller]]
+
* a [[Kart/stepper motor controller|stepper motor controller]]
+
* an [[Kart/sensor board|I/O board]]
+
  
=== Sensors ===
+
The [[Media:Programming_Introduction.pdf|RC Car introduction]] gives an overview of the structure of the software/hardware and the students' tasks.
  
The sensors connected to the I/O board are:
+
They comprise:
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]
+
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]
+
* [https://www.android.com Android] application development for the remote control
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]
+
* 1 [[Kart/sensor board|end of turn]] contact switch
+
  
Additionally, the power supply board comprises an ADC which provides the [[kart/battery level|battery level]].
+
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.
== Tasks ==
+
 
+
The presentation [[Media:Programming_Introduction.pdf|Programming Introduction]] gives you an overview about the structure of the software/hardware and your tasks.
+
  
 
=== FPGA Design ===
 
=== FPGA Design ===
You'll get the FPGAs preprogrammed with a functional solution.
 
  
In addition you'll get a HDL-Designer projects, which you have to complete or adapt.
+
==== Design environment ====
 +
 
 +
The followings are required:
 +
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry
 +
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation
 +
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming
 +
* The design, to download either:
 +
** [https://classroom.github.com/a/8pDuBWSQ With Github]
 +
** [https://github.com/hei-synd-did/did-kart-ebs3/archive/refs/heads/main.zip As a ZIP]
  
==== Setup ====
 
 
{{TaskBox|content=
 
{{TaskBox|content=
Download the [[Media:ELN_kart.zip|ELN_kart.zip]] and unpack it to your ''U:\'' drive.}}
+
For the smoothest experience, and if you know how to, prefer using Git.
 +
 
 +
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).
 +
While working on the project, it may be preferable to copy it locally for a quicker experience.
 +
 
 +
Do not forget to either commit and push your modifications to your Git repository, or save the modified files back on your <code>U:\</code> drive!
 +
}}
 
{{WarningBox|content=
 
{{WarningBox|content=
Make sure that there is no space character in the path to ELN_kart.}}
+
Make sure there is no space character in the full projects path.
 +
 
 +
HDL may hang while booting or files not load/save correctly otherwise.
 +
}}
 +
 
 +
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]
 +
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.
 +
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].
 +
 
 +
==== Modules designs ====
 +
 
 +
Three of the different modules must be completed:
 +
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.
 +
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.
 +
* The [[Kart/Sensors|sensor controller]] manages I/O comprising '''hall sensors''' (to retrieve the driving speed) and a '''range finder''' (to get the distance from an obstacle).
 +
 
 +
==== Testing ====
 +
 
 +
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.
  
 
=== Android App ===
 
=== Android App ===
 
One goal is to implement an Android application that controls and monitors the kart.
 
One goal is to implement an Android application that controls and monitors the kart.
  
==== Introduction ====
+
==== Starting point ====
  
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]
+
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]
 +
* You can find the instructions on how to open the project in Android Studio in the [[http://kart-javadoc.hevs.ch/RC%20Car%20Introduction.pdf RC Car introduction]] presentation.
 +
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]
 +
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]
 +
* If you need timers, please do not use Java standard Timer and TimerTask, we provide a dedicated Timer class in the package <b>ch.hevs.utils.Timer</b>.
 +
* 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(...)).
  
==== Android ====
+
==== Common Problems ====
 +
* 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.
  
An introduction to Android can be found here: [[Media:Android_Introduction.pdf|Android Introduction]]
+
== Components ==
  
Another sample project to learn how to create vertical seek bars: [[Media:VerticalSeekBarExample.zip|Vertical SeekBar Example]]
+
=== Power supply ===
  
==== Starting point ====
+
The main power is drawn from two 6 V / 2400 mAh battery packs in series
 +
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.
 +
 
 +
{{WarningBox|content=
 +
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 [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.
 +
 
 +
Finally, an ADC converter provides the [[kart/Motherboard#Power state|battery level]] as both the battery voltage and consumed current can be read from it.
 +
 
 +
=== FPGA board ===
 +
 
 +
The [[Kart/Daughterboard|daughterboard]] is equipped with an [https://www.mouser.ch/datasheet/2/268/Microsemi_DS0110_IGLOO_nano_Low_Power_Flash_FPGAs_-1592764.pdf 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.
 +
 
 +
=== Pmods ===
  
You can download the Kart eclipse project with the basic interface here: [[Media:Kart.zip|Kart.zip]]
+
Motor drivers and sensors are connected to the motherboard via [[kart/Motherboard#PMOD|Pmods]].
  
You can find the instructions how to import that archive into Eclipse in the "Programming Indtroduction" presentation...
+
The sensors connected to the I/Os of the motherboard are:
 +
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]
 +
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]
 +
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch
 +
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]
 +
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]
 +
<!--
 +
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]
 +
-->
  
 
== Additional Information ==
 
== Additional Information ==

Latest revision as of 12:56, 28 August 2023

Contents

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.

Batmobile 2018

The work of the students can be summarized in four main tasks:

Take a look at the karts gallery!

System Architecture

The kart is controlled by a smartphone via Bluetooth.

Hardware

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.

Bluetooth control

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:

Tasks

The RC Car introduction gives an overview of the structure of the software/hardware and the students' tasks.

They comprise:

  • 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.

FPGA Design

Design environment

The followings are required:


View-pim-tasks.png

For the smoothest experience, and if you know how to, prefer using Git.

Otherwise, it is possible to download directly the corresponding zip and store it in you personal drive (U:\). While working on the project, it may be preferable to copy it locally for a quicker experience.

Do not forget to either commit and push your modifications to your Git repository, or save the modified files back on your U:\ drive!

Dialog-warning.png

Make sure there is no space character in the full projects path.

HDL may hang while booting or files not load/save correctly otherwise.

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.

Modules designs

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).

Testing

In addition to the tests explained in the different modules, an overall tester is available to test the whole board.

Android App

One goal is to implement an Android application that controls and monitors the kart.

Starting point

  • 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(...)).

Common Problems

  • 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.

Components

Power supply

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.

Dialog-warning.png

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.

FPGA board

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.

Pmods

Motor drivers and sensors are connected to the motherboard via Pmods.

The sensors connected to the I/Os of the motherboard are:

Additional Information

Personal tools
Namespaces
Variants
Actions
Navigation
Modules / Projects
Browse
Toolbox