Kart

(Difference between revisions)
Jump to: navigation, search
(Distributed boards)
(FPGA Design)
(18 intermediate revisions by one user not shown)
Line 19: Line 19:
 
The kart is controlled by a smartphone via Bluetooth.
 
The kart is controlled by a smartphone via Bluetooth.
  
=== Distributed boards ===
+
=== Hardware ===
 +
The electronic is composed of an [[Kart/Daughterboard|FPGA daughterboard]] mounted on a dedicated [[Kart/Motherboard|motherboard]].
 +
 
 +
An Honor10 Lite running Android acts as the interface for the user.
 +
 
 +
=== Distributed controls ===
  
 
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.
 
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.
Line 25: Line 30:
  
 
The design is separated over four different modules:
 
The design is separated over four different modules:
* A [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.
+
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.
* A [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.
+
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.
* A [[Kart/sensor board|sensor controller]] manages I/O comprising '''hall sensors''' (to retrieve the driving speed), LEDs, buttons, and a '''range finder''' (to get the distance from an obstacle).
+
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).
* A [[Kart/serial_link#Hardware_control_register|control registers manager]] retrieve various information of the Kart and can play test sequences.
+
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).
  
 
== Tasks ==
 
== Tasks ==
Line 37: Line 42:
 
* [https://www.android.com Android] application development for the remote control
 
* [https://www.android.com 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.
+
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.
This allows to start the development either with the FPGA design or the Android application development.
+
This allows to start the development either with the FPGA design or the Android application.
  
 
=== FPGA Design ===
 
=== FPGA Design ===
Line 44: Line 49:
 
==== Design environment ====
 
==== Design environment ====
  
A [https://classroom.github.com/g/Gvzsxsu_ FPGA design environment] is available, based on:
+
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:
 
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry
 
* [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.mentor.com/products/fv/modelsim/ ModelSim] for simulation
Line 50: Line 55:
  
 
{{TaskBox|content=
 
{{TaskBox|content=
clone the Git repository or download the corresponding <code>zip</code> and install it,
+
For the smoothest experience, you can use Git directly by cloning the repository.
preferably to your personal drive (<code>U:\</code>).
+
 
 +
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 on your drive !
 
}}
 
}}
 
{{WarningBox|content=
 
{{WarningBox|content=
Make sure that there is no space character in the path to ELN_kart.
+
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 [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]
 
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 case during the [[Main_Page#Semester_1|previous semester's]] labs and project.
+
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].
 
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].
  
==== Board designs ====
+
==== Modules designs ====
  
With this, the following designs have to be completed:
+
Three of the different modules must be completed:
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor
+
* 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#FPGA design|stepper motor controller FPGA]] has to generate the 4&nbsp;phases to turn the steering wheels to the desired angle
+
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.
+
* 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 ===
Line 88: Line 103:
  
 
==== Virtual Kart ====
 
==== 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 [[Media:Kart USB-RS232 board.pdf|board]].
+
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|dongle]] directly in a USB port.
  
 
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]
 
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]
Line 97: Line 112:
 
=== Power supply ===
 
=== Power supply ===
  
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.
+
The main power is drawn from two 6 V / 2400 mAh battery packs in series
This is generated from two 6&nbsp;V battery packs.
+
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.
  
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].
+
{{WarningBox|content=
 +
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.
 +
 
 +
The charge rate should be of around 0.05C => 120mA here.
 +
}}
  
=== FPGA boards ===
+
The 12V is reduced to a 5V rail through a buck converter.
  
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.
+
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.
  
They hold daughterboards which drive different parts of the Kart.
+
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.
The motherboards are interconnected via an [[kart/I2C link|I2C link]].
+
  
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.
+
=== FPGA board ===
  
=== FPGA daughterboards ===
+
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 rooted to the FPGA from a 10 MHz quartz.
  
Existing daughterboards are:
+
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.
* 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 ===
 
=== Sensors ===
  
The sensors connected to the I/O board are:
+
The sensors connected to the I/Os of the motherboard are:
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]
+
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]
+
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]
+
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch
* 1 [[Kart/sensor board|end of turn]] contact switch
+
* 1 to 8 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]
 +
* 1 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 ==

Revision as of 11:49, 4 July 2022

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.

Demo Kart

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 electronic is composed of an FPGA daughterboard mounted on a dedicated motherboard.

An Honor10 Lite running Android acts as the interface for the user.

Distributed controls

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 over four different modules:

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 the FPGA board preprogrammed with a functional solution and Android phones with a demo application. This allows to start the development either with the FPGA design or the Android application.

FPGA Design

Design environment

A FPGA design environment is available, based on:


View-pim-tasks.png

For the smoothest experience, you can use Git directly by cloning the repository.

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 on your drive !

Dialog-warning.png

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.

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.

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 dongle directly in a USB port.

  • Windows version here
  • macOS version here

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 of 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 rooted 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.

Sensors

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

Additional Information

Personal tools
Namespaces
Variants
Actions
Navigation
Modules / Projects
Browse
Toolbox