Kart

(Difference between revisions)
Jump to: navigation, search
m (Setup)
(Virtual Kart)
(68 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:Kart.jpg|600px|Demo Kart]]
+
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.
 +
 
 +
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]-->
 +
 
 +
<gallery>
 +
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart
 +
File:SummerSchool_17.jpg|Summer School '17
 +
File:SummerSchool_15.jpg|Summer School '15<br>[https://www.youtube.com/tv#/watch?v=i8vwEgQDNDM -> Video by Baptiste Cavin]<!--[[Media:Kart_Teaser.wmv|-> Video by Baptiste Cavin]]]]-->
 +
File:SummerSchool_13.jpg|Summer School '13
 +
File:SummerSchool_12.jpg|Summer School '12
 +
File:SummerSchool_09.jpg|Summer School '09
 +
File:SummerSchool_05.jpg|Summer School '05
 +
File:SummerSchool_04.jpg|Summer School '04
 +
</gallery>
  
 
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
 
* analysis of the motor driver circuits (DC and stepper)
 
* analysis of the motor driver circuits (DC and stepper)
* configuring the controlling FPGAs
+
* configuration of the controlling FPGAs
* completing and extending the GUI on the smart-phone
+
* completion and extension of the control GUI on the smartphone
 
+
[[File:SummerSchool_12.jpg|thumb|Summer School '12]]
+
[[File:SummerSchool_13.jpg|thumb|Summer School '13]]
+
  
 
== System Architecture ==
 
== System Architecture ==
Line 20: Line 30:
  
 
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.
 
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.
 +
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]]:
+
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].
* An I2C master receives RS232 controls, stores them in a set of registers and dispatches them at a regular interval on the I2C. The master also reads data values from the I2C, stores them into a second set of registers and sends the corresponding information at a regular rate over the RS232.
+
These base boards each hold a slave function board:
 +
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|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/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/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.
 
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.
 +
== Tasks ==
  
=== Bluetooth communication ===
+
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.
A Bluetooth communication transfers serial port data.
+
They comprise:
A receiver chip creates the RS232 signals for the FPGA.
+
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors
The [[kart/serial link#Serial link protocol|protocol]] defines how the [[kart/serial link#Registers|registers]] are accessed.
+
* [https://www.android.com Android] application development for the remote control
  
== Components ==
+
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.
 +
This allows to start the development either with the FPGA design or the Android application development.
  
=== FPGA Boards ===
+
=== FPGA Design ===
The FPGA motherboards are equipped with an AGL125 [http://www.microsemi.com/products/fpga-soc/fpga/igloo-overview IGLOO] in a VQ100 package.
+
They connect to daughterboards which drive different parts of the Kart.
+
The motherboards are interconnected via an [[kart/I2C link|I2C link]].
+
  
Existing daughterboards are:
+
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:
* the [[Kart/RS232 board| serial interface board]] or the [[Kart/Bluetooth Bluetooth interface board]]
+
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry
* a [[Kart/DC motor controller|DC motor controller]]
+
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation
* a [[Kart/stepper motor controller|stepper motor controller]]
+
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming
* an [[Kart/sensor board|I/O board]]
+
  
=== Sensors ===
+
{{TaskBox|content=
 +
clone the Git repository or download the corresponding <code>zip</code> and install it,
 +
preferably to your personal drive (<code>U:\</code>).
 +
}}
 +
{{WarningBox|content=
 +
Make sure that there is no space character in the path to ELN_kart.
 +
}}
  
The sensors connected to the I/O board are:
+
With this, the following designs have to be completed:
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]
+
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]
+
* the [[Kart/stepper motor controller#FPGA design|stepper motor controller FPGA]] has to generate the 4&nbsp;phases to turn the steering wheels to the desired angle
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]
+
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.
* 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]].
+
=== Android App ===
 +
One goal is to implement an Android application that controls and monitors the kart.
  
== Tasks ==
+
==== Introduction ====
  
=== FPGA Design ===
+
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]
You'll get the FPGAs preprogrammed with a functional solution.
+
  
In addition you'll get HDL-Designer projects prepared to complete.
+
==== Starting point ====
  
==== Setup ====
+
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]
{{TaskBox|content=
+
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...
Download the file [[ELN_kart.zip]] and unpack it to your ''U:\'' drive.}}
+
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]
{{WarningBox|content=
+
* 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>.
Make sure that there is no space character in the path to ELN_kart.}}
+
* 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(...)).
  
=== Android App ===
+
==== Common Problems ====
One goal is to implement an Android application that controls and monitors to the kart.
+
* 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.
  
==== Introduction ====
+
==== Virtual Kart ====
 +
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 presentation [[File:Programming_Introduction.pdf]] should give you an overview about the structure of the software/hardware and your tasks.
+
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]
 +
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]
  
The installable package of the (or rather a) solution can be found here: [[File:Kart.apk]]
+
== Components ==
  
==== Android ====
+
=== Power supply ===
  
An introduction to Android can be found here: [[File:Android_Introduction.pdf]]
+
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.
 +
This is generated from two 6&nbsp;V battery packs.
  
Another sample project to learn how to create vertical seek bars: [[File:VerticalSeekBarExample.zip]]
+
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].
  
==== Starting point ====
+
=== FPGA boards ===
  
You can download the Kart eclipse project with the basic interface here: [[File:Kart.zip]]
+
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. The clock passed to the FPGA comes from a 10 MHz quartz.
  
You can find the instructions how to import that archive into Eclipse in the "Programming Indtroduction" presentation...
+
They hold daughterboards which drive different parts of the Kart.
 +
The motherboards are interconnected via an [[kart/I2C link|I2C link]].
  
== Getting started ==
+
The FPGA motherboards can be tested with the help of a dedicated [[Kart/FPGA_board#Test|test board]] which runs a signal from one I/O pin to the next.
In order to start the projects you should do the following:
+
 
* Read carefully the specifications above
+
=== FPGA daughterboards ===
* Consult the [[kart/students|student's guide]] for the first steps
+
 
* When preparing the labs, follow the [[kart/setup|setup guide]]
+
Existing daughterboards are:
 +
* a [[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]] for the sensors
 +
* an [[Kart/FPGA_board#Test|FPGA test]] board
 +
 
 +
=== Sensors ===
 +
 
 +
The sensors connected to the I/O board are:
 +
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]
 +
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]
 +
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]
 +
* 1 [[Kart/sensor board|end of turn]] contact switch
  
 
== Additional Information ==
 
== Additional Information ==
Line 100: Line 134:
 
* [[kart/toDo|To do list]]
 
* [[kart/toDo|To do list]]
 
* When preparing the labs, follow the [[kart/setup|setup guide]]
 
* When preparing the labs, follow the [[kart/setup|setup guide]]
 +
  
 
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]
 
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]

Revision as of 14:42, 22 August 2019

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.


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

  • design and assembly of the chassis
  • analysis of the motor driver circuits (DC and stepper)
  • configuration of the controlling FPGAs
  • completion and extension of the control GUI on the smartphone

System Architecture

The kart is controlled by a smartphone via Bluetooth.

Distributed boards

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 a 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 base boards each hold a slave function board:

Tasks

The programming introduction gives an overview about 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 FPGA boards preprogrammed with a functional solution and androïd phones with a demo application. This allows to start the development either with the FPGA design or the Android application development.

FPGA Design

A FPGA design environment is available, based on:


View-pim-tasks.png

clone the Git repository or download the corresponding zip and install it, preferably to your personal drive (U:\).

Dialog-warning.png

Make sure that there is no space character in the path to ELN_kart.

With this, the following designs have to be completed:

Android App

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

Introduction

The installable package of the (or rather a) solution can be found here: Kart.apk

Starting point

  • You can download the Kart project with the minimal interface here: Kart.zip
  • You can find the instructions 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(...)).

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.

Virtual Kart

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.

  • Windows version here
  • macOS version here

Components

Power supply

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.

FPGA boards

The FPGA motherboards are equipped with an AGL125 IGLOO in a VQ100 package. The clock passed to the FPGA comes from a 10 MHz quartz.

They hold daughterboards which 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.

FPGA daughterboards

Existing daughterboards are:

Sensors

The sensors connected to the I/O board are:

Additional Information

Personal tools
Namespaces
Variants
Actions
Navigation
Modules / Projects
Browse
Toolbox