https://wiki.hevs.ch/fsi/api.php5?action=feedcontributions&user=Michael.clausen&feedformat=atomFSI - User contributions [en]2024-03-29T14:31:02ZUser contributionsMediaWiki 1.18.1https://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-30T05:53:52Z<p>Michael.clausen: /* Tasks */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]]!<br />
<br />
== System Architecture ==<br />
[[File:Kart_batmobile.gif|right|Batmobile 2018]]<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated into four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (Bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[http://kart-javadoc.hevs.ch/RC%20Car%20Introduction.pdf RC Car introduction]] gives an overview of the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows starting the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive!<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* 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.<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-30T05:53:36Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]]!<br />
<br />
== System Architecture ==<br />
[[File:Kart_batmobile.gif|right|Batmobile 2018]]<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated into four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (Bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview of the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows starting the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive!<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* 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.<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-30T05:53:03Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]]!<br />
<br />
== System Architecture ==<br />
[[File:Kart_batmobile.gif|right|Batmobile 2018]]<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated into four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (Bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview of the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows starting the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive!<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* 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 programming introduction]] presentation.<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-30T05:52:48Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]]!<br />
<br />
== System Architecture ==<br />
[[File:Kart_batmobile.gif|right|Batmobile 2018]]<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated into four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (Bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview of the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows starting the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive!<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* 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 programming introduction]] presentation.<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-22T15:27:29Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[http://kart-javadoc.hevs.ch/Programming%20Introduction.pdf programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-22T15:26:56Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[http://kart-javadoc.hevs.ch/Programming%20Instruction.pdf programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-22T15:21:52Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[http://kart-javadoc.hevs.ch/Kart.zip Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-22T12:48:19Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-22T12:47:53Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGA]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronics is composed of a general purpose [[Kart/Daughterboard|FPGA daughterboard]]<br />
mounted on a dedicated [[Kart/Motherboard|motherboard]]<br />
with 8&nbsp;[https://wiki.hevs.ch/fsi/index.php5/Kart/Motherboard#PMOD PMOD connectors].<br />
<br />
An Honor10 Lite smartphone running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart template project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
- The installable package of the (or rather a) solution can be found here: [[http://kart-javadoc.hevs.ch/KartSolution.apk KartSolution.apk]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* up to 4 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* up to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
<!--<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
--><br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart/serial_linkKart/serial link2022-08-22T08:57:26Z<p>Michael.clausen: /* Sensors */</p>
<hr />
<div>{{TOC right}}<br />
== Serial link protocol ==<br />
<br />
This section defines the serial link protocol used to communicate between the Kart and the BLE module / PC / Android Smartphone.<br />
<br />
=== General principle ===<br />
The system is using a [[Kart/Bluetooth|BLE]] module.<br />
<br />
To avoid congesting the line, data are sent from the Kart to the User on specific '''events''' or if '''requested''' by the User.<br />
<br />
=== Serial port===<br />
<br />
Communication is done with:<br />
* Resting state : HIGH<br />
* Data bits : 8<br />
* Parity : none<br />
* Stop bits : 1<br />
* Handshake : none<br />
* Baudrate : 115'200<br />
<br />
=== Message Format ===<br />
<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data (2 bytes)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| UINT8<br />
| UINT16/INT16/VECTOR16 (MSB first)<br />
| [https://crccalc.com/ CRC8/ITU]<br />
|}<br />
<br />
The address is decomposed as follows: 0bMMWRRRRR<br />
* MM : targeted module<br />
** 0b00 : DC Motor<br />
** 0b01 : Stepper Motor<br />
** 0b10 : Sensors<br />
** 0b11 : Control Registers<br />
* W : defines if the data is saved to ('1') or read from ('0') the FPGA<br />
** The FPGA will '''respond to a request''' with the exact same address when W = '0'<br />
** The FPGA will '''save incoming data in the targeted register''' when W = '1'<br />
** The FPGA will '''send data on predefined events''' with the W bit set to '0'<br />
* RRRRR : targeted register<br />
<br />
==== Frame example ====<br />
<br />
For the BLE module to light LED1 with it changing each 500 ms, the following frame is sent:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10100001<br />
| 0b10000001<br />
| 0b11110100<br />
| 0x74<br />
|}<br />
<br />
If the BLE module wants to read the current battery voltage, supposing we have 4 LEDs, the frame is such as:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10000101<br />
| Any<br />
| Any<br />
| CRC<br />
|}<br />
<br />
== Registers ==<br />
<br />
=== DC Motor ===<br />
<br />
Reading range : 0x00 to 0x1F<br />
<br />
Writing range : 0x20 to 0x3F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| DC PWM frequency, as fclk / (PWMsteps * prescaler) = 10M / (16 * prescaler)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Speed<br />
| Int5<br />
| Desired speed, from -15 (0xFFF1) to 15 (0x000F) (negative = backward)<br />
| Smartphone -> Kart<br />
| <br />
|}<br />
<br />
<br />
=== Stepper Motor ===<br />
<br />
Reading range : 0x40 to 0x5F<br />
<br />
Writing range : 0x60 to 0x7F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| Stepper switching frequency, as 100k / prescaler<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Target angle<br />
| Uint16<br />
| Desired steering angle, in motor steps (0 = end switch)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 2<br />
| Actual angle<br />
| Uint16<br />
| Actual steering angle, in motor steps (0 = end switch)<br />
| Kart -> Smartphone<br />
| When a delta of at least STP_ANGLE_DELTA_DEG (3°) from the last registered value happens<br />
|-<br />
| 3<br />
| Stepper HW<br />
| Uint14 + Vector2<br />
| Bit 0: stepper end<br />
Bit 1: position reached<br />
<br />
Bits 15 - 2 : actual steering angle<br />
| Kart -> Smartphone<br />
| Sent when stepper end is pressed (rising edge) or position reached (rising edge)<br />
|}<br />
<br />
=== Sensors ===<br />
<br />
Reading range : 0x80 to 0x9F<br />
<br />
Writing range : 0xA0 to 0xBF<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| LED1<br />
| Bit + Uint15<br />
| Bit 15: on / off/<br />
Bits 14 -> 0: half-period in ms (if 0, led status = bit 15)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| ...<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| 7<br />
| LED8<br />
| Bit + Uint15<br />
| ''See LED1''<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 8<br />
| Voltage<br />
| Uint16<br />
| Battery voltage, U = register * 250*e-6 * 7.8 [V]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_BATT_DELTA_MV (50) from the last registered value happens<br />
|-<br />
| 9<br />
| Current<br />
| Uint16<br />
| Consumed current, I = register * 250*10*e-6 / (100 * 5*10*e-3) [A]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_CURR_DELTA_MA (50) from the last registered value happens<br />
|-<br />
| A<br />
| Range finder<br />
| Uint16<br />
| Distance to sensor, register * 25.4 / (147*10*e-6 * (10M / 10)) [mm]<br />
Register zeroed if less than 152 mm (sensor min distance) or greater than 1500 mm (arbitrary max distance), event not sent in such case<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_RANGEFNDR_MM (60) from the last registered value happens<br />
|-<br />
| B<br />
| End switches<br />
| Vector(16)<br />
| Sensors current values, right justified (sensor 1 is bit 0)<br />
| Kart -> Smartphone<br />
| On any edge change of any sensor<br />
|-<br />
| C<br />
| Hall1<br />
| Uint16<br />
| Hall pulses count, zeroed on overflow of the register<br />
| Kart -> Smartphone<br />
| Each 100 ms if value changed from last time<br />
|-<br />
| D<br />
| Hall2<br />
| Uint16<br />
| ''See Hall1''<br />
| Kart -> Smartphone<br />
| Each 101 ms if value changed from last time<br />
|}<br />
<br />
=== Control Registers ===<br />
<br />
Reading range : 0xC0 to 0xDF<br />
<br />
Writing range : 0xE0 to 0xFF<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Comment<br />
|-<br />
| 0<br />
| Hardware Control<br />
| Vector6<br />
| Bit 0: when '0', the Kart goes backwards when the motor turns foward<br />
Bit 1: when '1', the Kart turns to the right as the stepper coils go from 1 to 4<br />
<br />
Bit 2: when '1', the angles are measured clockwise<br />
<br />
Bit 3: emulates the end switch contact for the stepper motor<br />
<br />
Bit 4: restart the stepperMotor module, stops the DC motor while '1'<br />
| Smartphone -> Kart<br />
| The end sensor always defines angle 0. Angles are always positive numbers in registers.<br />
If bits 1 and 2 are different, the stepper motor phase sequence has to be inverted.<br />
If the Bluetooth connection is lost, the DC motor has to be stopped.<br />
|-<br />
| 1<br />
| BT Status<br />
| Vector1<br />
| Bit 0: when '0', the smartphone is disconnected<br />
| NRF -> Kart<br />
| The register is set by the NRF itself, since it is not possible to foresee the disconnection.<br />
|}<br />
<br />
== Kart init ==<br />
<br />
To init the Kart, the following sequence should be sent to the Kart:<br />
* Write '''DC Motor | Prescaler''' to '''31''' (around 21 kHz PWM frequency)<br />
* Write '''Stepper Motor | Prescaler''' to '''400''' (250 Hz coil switching frequency)<br />
* Tell the smartphone is connected by writing '''Control Registers | BT status''' to 1<br />
* Write '''Control Registers | Hardware Control''' to restart the system (0b10xxx)<br />
** The stepper should turn until hitting the end switch, except if already on it<br />
* Read '''Stepper Motor | Stepper HW''' and check the last bit<br />
** If is '1', it means we are already zeroed<br />
** If not, wait for an event from this register to tell the reset is complete<br />
* Write '''Control Registers | Hardware Control''' to deassert the reset (0b00xxx)<br />
<br />
The Kart is now ready to function !<br />
<br />
== Testing through USB ==<br />
[[File:Kart_kci.jpg|450px|right|Kart Command Interpreter]]<br />
To test the Kart from a PC directly, one can do as follows:<br />
* Remove the [[Kart/Bluetooth|BLE]] from the [[Kart/Motherboard|motherboard]] (or, at least, do not connect to a smartphone)<br />
* Power the [[Kart/Motherboard|motherboard]] with a DC voltage regulator (+12V)<br />
* Wire the USB-C present on the daughterboard to your PC<br />
** Two new COM ports should be detected<br />
* Download and open the '''Kart Command Interpreter''' utility (available in the VHDL project -> CommandInterpreter)<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_WIN.exe Windows 10]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_LIN Linux]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/commandInterpreter.py Source code]<br />
* In the top menu '''Serial -> Port''', select the correct COM port (should be the biggest of the two new ports)<br />
** You can also change the baudrate, by default '''115'200''' (the correct one if it was not modified)<br />
<br />
To test the connection, click the '''Read''' button. The '''Tx''' and '''Rx''' values should change, and a text added to the text area.<br />
<br />
=== Simple operation ===<br />
The simplest way to test both motors are the three button at the bottom.<br />
<br />
* '''Init Kart''' button<br />
** Will set the DC prescaler, stepper prescaler, and execute the restart sequence. '''Must be clicked first.'''<br />
** Answer the 4 prompts following your hardware configuration.<br />
* '''DC Motor''' button<br />
** Will set the DC speed to full for 2s, quickly 0, then reversed full speed for 2s<br />
* '''Stepper Motor''' button<br />
** Will set the stepper to 400 (30°) then 0<br />
<br />
=== Custom operation ===<br />
Each register can be read and/or written by hand following their [[Kart/serial_link#Registers|data description]].<br />
<br />
For this, select the '''Module''' first, then which '''Register'''.<br />
<br />
==== Read ====<br />
To read, simply click the '''Read''' button. Successful read will be shown in green (CRC is ok) and logged, with extra info (e.g. for the DC prescaler, will give the motor frequency).<br />
<br />
==== Write ====<br />
To write, enter a value in the value box such as:<br />
* Direct integer (only DC speed should be negative)<br />
* '''0b'''xxxx binary values<br />
* '''0x'''xxxx hexadecimal values<br />
* ''Other values will throw an error''<br />
<br />
Then click on the '''Write''' button.<br />
<br />
=== Reset ===<br />
In case of problem, you can simply power-cycle the FPGA board to reset the registers.<br />
<br />
[[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart/serial_linkKart/serial link2022-08-16T12:33:27Z<p>Michael.clausen: Not true, it is multiple frames with an MTU up to 500 bytes each connection interval. So plenty if throughput.</p>
<hr />
<div>{{TOC right}}<br />
== Serial link protocol ==<br />
<br />
This section defines the serial link protocol used to communicate between the Kart and the BLE module / PC / Android Smartphone.<br />
<br />
=== General principle ===<br />
The system is using a [[Kart/Bluetooth|BLE]] module.<br />
<br />
To avoid congesting the line, data are sent from the Kart to the User on specific '''events''' or if '''requested''' by the User.<br />
<br />
=== Serial port===<br />
<br />
Communication is done with:<br />
* Resting state : HIGH<br />
* Data bits : 8<br />
* Parity : none<br />
* Stop bits : 1<br />
* Handshake : none<br />
* Baudrate : 115'200<br />
<br />
=== Message Format ===<br />
<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data (2 bytes)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| UINT8<br />
| UINT16/INT16/VECTOR16 (MSB first)<br />
| [https://crccalc.com/ CRC8/ITU]<br />
|}<br />
<br />
The address is decomposed as follows: 0bMMWRRRRR<br />
* MM : targeted module<br />
** 0b00 : DC Motor<br />
** 0b01 : Stepper Motor<br />
** 0b10 : Sensors<br />
** 0b11 : Control Registers<br />
* W : defines if the data is saved to ('1') or read from ('0') the FPGA<br />
** The FPGA will '''respond to a request''' with the exact same address when W = '0'<br />
** The FPGA will '''save incoming data in the targeted register''' when W = '1'<br />
** The FPGA will '''send data on predefined events''' with the W bit set to '1'<br />
* RRRRR : targeted register<br />
<br />
==== Frame example ====<br />
<br />
For the BLE module to light LED1 with it changing each 500 ms, the following frame is sent:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10100001<br />
| 0b10000001<br />
| 0b11110100<br />
| 0x74<br />
|}<br />
<br />
<br />
When the stepper end switch is pressed, imagining that the desired position is reached in the meantime, the FPGA will send the following:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b01100011<br />
| 0b00000000<br />
| 0b00000011<br />
| 0x47<br />
|}<br />
<br />
<br />
If the BLE module wants to read the current battery voltage, supposing we have 4 LEDs, the frame is such as:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10000101<br />
| Any<br />
| Any<br />
| CRC<br />
|}<br />
The FPGA will then respond with something like (for a 11.998V reading):<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10000101<br />
| 0x18<br />
| 0x09<br />
| 0x3D<br />
|}<br />
<br />
<br />
== Registers ==<br />
<br />
=== DC Motor ===<br />
<br />
Reading range : 0x00 to 0x1F<br />
<br />
Writing range : 0x20 to 0x3F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| DC PWM frequency, as fclk / (PWMsteps * prescaler) = 10M / (16 * prescaler)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Speed<br />
| Int5<br />
| Desired speed, from -15 (0xFFF1) to 15 (0x000F) (negative = backward)<br />
| Smartphone -> Kart<br />
| <br />
|}<br />
<br />
<br />
=== Stepper Motor ===<br />
<br />
Reading range : 0x40 to 0x5F<br />
<br />
Writing range : 0x60 to 0x7F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| Stepper switching frequency, as 100k / prescaler<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Target angle<br />
| Uint16<br />
| Desired steering angle, in motor steps (0 = end switch)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 2<br />
| Actual angle<br />
| Uint16<br />
| Actual steering angle, in motor steps (0 = end switch)<br />
| Kart -> Smartphone<br />
| When a delta of at least STP_ANGLE_DELTA_DEG (10°) from the last registered value happens<br />
|-<br />
| 3<br />
| Stepper HW<br />
| Uint14 + Vector2<br />
| Bit 0: stepper end<br />
Bit 1: position reached<br />
<br />
Bits 15 - 2 : actual steering angle<br />
| Kart -> Smartphone<br />
| Sent when stepper end is pressed (rising edge) or position reached (rising edge)<br />
|}<br />
<br />
=== Sensors ===<br />
<br />
Reading range : 0x80 to 0x9F<br />
<br />
Writing range : 0xA0 to 0xBF<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| LED1<br />
| Bit + Uint15<br />
| Bit 15: on / off/<br />
Bits 14 -> 0: half-period in ms (if 0, led status = bit 15)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| ...<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| 3<br />
| LED4<br />
| Bit + Uint15<br />
| ''See LED1''<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 4<br />
| Voltage<br />
| Uint16<br />
| Battery voltage, U = register * 250*e-6 * 7.8 [V]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_BATT_DELTA_MV (100) from the last registered value happens<br />
|-<br />
| 5<br />
| Current<br />
| Uint16<br />
| Consumed current, I = register * 250*10*e-6 / (100 * 5*10*e-3) [A]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_CURR_DELTA_MA (50) from the last registered value happens<br />
|-<br />
| 6<br />
| Range finder<br />
| Uint16<br />
| Distance to sensor, register * 25.4 / (147*10*e-6 * (10M / 10)) [mm]<br />
Register zeroed if less than 152 mm (sensor min distance) or greater than 1500 mm (arbitrary max distance), event not sent in such case<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_RANGEFNDR_MM (100) from the last registered value happens<br />
|-<br />
| 7<br />
| End switches<br />
| Vector(16)<br />
| Sensors current values, right justified (sensor 1 is bit 0)<br />
| Kart -> Smartphone<br />
| On any edge change of any sensor<br />
|-<br />
| 8<br />
| Hall1<br />
| Uint16<br />
| Hall pulses count, zeroed on overflow of the register<br />
| Kart -> Smartphone<br />
| Each 100 ms if value changed from last time<br />
|-<br />
| 9<br />
| Hall2<br />
| Uint16<br />
| ''See Hall1''<br />
| Kart -> Smartphone<br />
| ''See Hall1''<br />
|}<br />
<br />
=== Control Registers ===<br />
<br />
Reading range : 0xC0 to 0xDF<br />
<br />
Writing range : 0xE0 to 0xFF<br />
{{WarningBox|content=<br />
The control registers module is '''WRITE ONLY''' for now !<br />
}}<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Hardware Control<br />
| Vector6<br />
| Bit 0: when '0', the Kart goes backwards when the motor turns foward<br />
Bit 1: when '1', the Kart turns to the right as the stepper coils go from 1 to 4<br />
<br />
Bit 2: when '1', the angles are measured clockwise<br />
<br />
Bit 3: emulates the end switch contact for the stepper motor<br />
<br />
Bit 4: restart the stepperMotor module, stops the DC motor while '1'<br />
<br />
Bit 5: when '1', the BLE connection has been established (otherwise, the Kart should not be able to move)<br />
| Smartphone -> Kart<br />
| The end sensor always defines angle 0. Angles are always positive numbers in registers.<br />
If bits 1 and 2 are different, the stepper motor phase sequence has to be inverted.<br />
If the Bluetooth connection is lost, the DC motor has to be stopped.<br />
|}<br />
<br />
<br />
<br />
<br />
==== Sequence control register ====<br />
<br />
''The sequence control register is not yet re-implemented.<br />
The old behavior, kept for reference, is the following:''<br />
<br />
The sequence control register is used to load a new sequence from start of memory as well as to start and stop a sequence.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Bit<br />
! Meaning<br />
! Description<br />
|-<br />
| 0<br />
| Reset sequence<br />
| sets the sequence RAM write and read addresses back to 0<br />
|-<br />
| 1<br />
| Run / stop<br />
| starts or stops a sequence<br />
|}<br />
<br />
===== Sequence operations register =====<br />
<br />
The sequence memory is made out of 16-bit controls and the sequence can range up to 2<sup>10</sup> operations.<br />
From the communication point of view, the sequence memory is seen as a FIFO&nbsp;:<br />
the sequence operations are pushed one after the other into the sequence register,<br />
starting at the first one of the list after the <code>reset sequence</code> bit<br />
has been set in the [[#Control register|control register]]<br />
<br />
The sequence operations are split into 2&nbsp;parts: a 4-bit command and optional parameters.<br />
A sequence register has been defined in order to build loops:<br />
the <code>goto</code> operation is only carried out if the register is not zero.<br />
The register is initialised with all bits to&nbsp;'1'.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
|<br />
! colspan = "2" | command<br />
! parameter<br />
| comment<br />
|-<br />
| Bits<br />
! colspan = "2" | 15 ÷ 12<br />
! 11 ÷ 0<br />
|<br />
|-<br />
| rowspan = "13" | || 0 || nop || ||<br />
|-<br />
| 1 || set speed || speed || set the propulsion motor speed<br />
|-<br />
| 2 || set angle || angle || set the direction motor angle<br />
|-<br />
| 3 || drive LEDs || pattern || specify a given pattern for turning the LEDs on or off<br />
|-<br />
| 4 || set LEDs || mask || set bits from '1's of mask<br />
|-<br />
| 5 || clear LEDs || mask || clear bits from '1's of mask<br />
|-<br />
| 6 || blink LEDs || period, mask || ''not implemented yet''<br />
|-<br />
| 8 || run distance || hall ticks || run until the Hall counter has augmented by at least a given tick number<br />
|-<br />
| 9 || run for || milliseconds || run for a specified time span<br />
|-<br />
| A || run until || event || ''not implemented yet''<br />
|-<br />
| D || modify register || operation, operand || bits 11÷10 : 00 = set, 10 = add, 11 = sub / bits 9÷0 : operand<br />
|-<br />
| E || goto nz || address || jumps to the specified sequence step as long as the register is not zero<br />
|-<br />
| F || end || || the sequence controller in the FPGA stops and the <code>running</code> status bit is cleared, announcing that the sequence is terminated<br />
|}<br />
<br />
===== Sequence status register =====<br />
<br />
The sequence status register tells what operation is currently active.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Bit<br />
! Meaning<br />
! Description<br />
|-<br />
| 15 ÷ 12<br />
| Current command<br />
| indicates which command is currently being processed<br />
|-<br />
| 0<br />
| Running<br />
| indicates that a sequence is currently running<br />
|}<br />
<br />
== Kart init ==<br />
<br />
To init the Kart, the following sequence should be sent to the Kart:<br />
* Write '''DC Motor | Prescaler''' to '''31''' (around 21 kHz PWM frequency)<br />
* Write '''Stepper Motor | Prescaler''' to '''400''' (250 Hz coil switching frequency)<br />
* Write '''Control Registers | Hardware Control''' to restart the system while telling the BLE client is connected (0b110xxx)<br />
** The stepper should turn until hitting the end switch, except if already on it<br />
* Read '''Stepper Motor | Stepper HW''' and check the last bit<br />
** If is '1', it means we are already zeroed<br />
** If not, wait for an event from this register to tell the reset is complete<br />
* Write '''Control Registers | Hardware Control''' to deassert the reset (0b100xxx)<br />
<br />
The Kart is now ready to function !<br />
<br />
== Testing through USB ==<br />
[[File:Kart_kci.jpg|450px|right|Kart Command Interpreter]]<br />
To test the Kart from a PC directly, one can do as follows:<br />
* Remove the [[Kart/Bluetooth|BLE]] from the [[Kart/Motherboard|motherboard]]<br />
* Power the [[Kart/Motherboard|motherboard]] with a DC voltage regulator (+12V)<br />
* Wire the USB-C present on the daughterboard to your PC<br />
** Two new COM ports should be detected<br />
* Download and open the '''Kart Command Interpreter''' utility (available in the VHDL project -> CommandInterpreter)<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_WIN.exe Windows 10]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_MAC macOS (ARM64/Apple Silicon)]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_MAC_amd64 macOS (AMD64/Intel)]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_LIN Linux]<br />
* In the top menu '''Serial -> Port''', select the correct COM port (should be the biggest of the two new ports)<br />
** You can also change the baudrate, by default '''115'200''' (the correct one if it was not modified in the VHDL '''Kart_pkg.vhd'''<br />
<br />
To test the connection, click the '''Read''' button. The '''Tx''' and '''Rx''' values should change, and a text added to the text area.<br />
<br />
=== Simple operation ===<br />
The simplest way to test both motors are the three button at the bottom.<br />
<br />
* '''Init Kart''' button<br />
** Will set the DC prescaler, stepper prescaler, and execute the restart sequence. '''Must be clicked first.'''<br />
** You may need to modifiy the [[Kart/serial_link#Control_Registers|'''CReg -> HW Control''']] register to correspond to your Kart design. Only change x in the following value: '''0b100xxx'''<br />
* '''DC Motor''' button<br />
** Will set the DC speed to full for 2s, quickly 0, then reversed full speed for 2s<br />
* '''Stepper Motor''' button<br />
** Will set the stepper to 400 (30°) then 0<br />
<br />
=== Custom operation ===<br />
Each register can be read and/or written by hand following their [[Kart/serial_link#Registers|data description]].<br />
<br />
For this, select the '''Module''' first, then which '''Register'''.<br />
<br />
==== Read ====<br />
To read, simply click the '''Read''' button. Successful read will be shown in green (CRC is ok) and logged, with extra info (e.g. for the DC prescaler, will give the motor frequency).<br />
<br />
==== Write ====<br />
To write, enter a value in the value box such as:<br />
* Direct integer (only DC speed should be negative)<br />
* '''0b'''xxxx binary values<br />
* '''0x'''xxxx hexadecimal values<br />
* ''Other values will throw an error''<br />
<br />
Then click on the '''Write''' button.<br />
<br />
=== Reset ===<br />
In case of problem, you can simply power-cycle the FPGA board to reset the registers.<br />
<br />
[[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart/serial_linkKart/serial link2022-08-16T12:31:49Z<p>Michael.clausen: /* Testing through USB */</p>
<hr />
<div>{{TOC right}}<br />
== Serial link protocol ==<br />
<br />
This section defines the serial link protocol used to communicate between the Kart and the BLE module / PC.<br />
<br />
=== General principle ===<br />
The system using a [[Kart/Bluetooth|BLE]] module, the throughput is limited by design to a payload of 27 bytes each connection interval (from 7.5 ms to 4 s).<br />
<br />
To avoid congesting the line, data are sent from the Kart to the User on specific '''events''' or if '''requested''' by the User.<br />
<br />
=== Serial port===<br />
<br />
Communication is done with:<br />
* Resting state : HIGH<br />
* Data bits : 8<br />
* Parity : none<br />
* Stop bits : 1<br />
* Handshake : none<br />
* Baudrate : 115'200<br />
<br />
=== Message Format ===<br />
<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data (2 bytes)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| UINT8<br />
| UINT16/INT16/VECTOR16 (MSB first)<br />
| [https://crccalc.com/ CRC8/ITU]<br />
|}<br />
<br />
The address is decomposed as follows: 0bMMWRRRRR<br />
* MM : targeted module<br />
** 0b00 : DC Motor<br />
** 0b01 : Stepper Motor<br />
** 0b10 : Sensors<br />
** 0b11 : Control Registers<br />
* W : defines if the data is saved to ('1') or read from ('0') the FPGA<br />
** The FPGA will '''respond to a request''' with the exact same address when W = '0'<br />
** The FPGA will '''save incoming data in the targeted register''' when W = '1'<br />
** The FPGA will '''send data on predefined events''' with the W bit set to '1'<br />
* RRRRR : targeted register<br />
<br />
==== Frame example ====<br />
<br />
For the BLE module to light LED1 with it changing each 500 ms, the following frame is sent:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10100001<br />
| 0b10000001<br />
| 0b11110100<br />
| 0x74<br />
|}<br />
<br />
<br />
When the stepper end switch is pressed, imagining that the desired position is reached in the meantime, the FPGA will send the following:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b01100011<br />
| 0b00000000<br />
| 0b00000011<br />
| 0x47<br />
|}<br />
<br />
<br />
If the BLE module wants to read the current battery voltage, supposing we have 4 LEDs, the frame is such as:<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10000101<br />
| Any<br />
| Any<br />
| CRC<br />
|}<br />
The FPGA will then respond with something like (for a 11.998V reading):<br />
{| cellpadding="8" cellspacing="0" border="1"<br />
! SoF (1 byte)<br />
! Address (1 byte)<br />
! Data High (1 byte)<br />
! Data Low (1 byte)<br />
! EoF (1 byte)<br />
|-<br />
| 0xAA<br />
| 0b10000101<br />
| 0x18<br />
| 0x09<br />
| 0x3D<br />
|}<br />
<br />
<br />
== Registers ==<br />
<br />
=== DC Motor ===<br />
<br />
Reading range : 0x00 to 0x1F<br />
<br />
Writing range : 0x20 to 0x3F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| DC PWM frequency, as fclk / (PWMsteps * prescaler) = 10M / (16 * prescaler)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Speed<br />
| Int5<br />
| Desired speed, from -15 (0xFFF1) to 15 (0x000F) (negative = backward)<br />
| Smartphone -> Kart<br />
| <br />
|}<br />
<br />
<br />
=== Stepper Motor ===<br />
<br />
Reading range : 0x40 to 0x5F<br />
<br />
Writing range : 0x60 to 0x7F<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Prescaler<br />
| Uint16<br />
| Stepper switching frequency, as 100k / prescaler<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 1<br />
| Target angle<br />
| Uint16<br />
| Desired steering angle, in motor steps (0 = end switch)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 2<br />
| Actual angle<br />
| Uint16<br />
| Actual steering angle, in motor steps (0 = end switch)<br />
| Kart -> Smartphone<br />
| When a delta of at least STP_ANGLE_DELTA_DEG (10°) from the last registered value happens<br />
|-<br />
| 3<br />
| Stepper HW<br />
| Uint14 + Vector2<br />
| Bit 0: stepper end<br />
Bit 1: position reached<br />
<br />
Bits 15 - 2 : actual steering angle<br />
| Kart -> Smartphone<br />
| Sent when stepper end is pressed (rising edge) or position reached (rising edge)<br />
|}<br />
<br />
=== Sensors ===<br />
<br />
Reading range : 0x80 to 0x9F<br />
<br />
Writing range : 0xA0 to 0xBF<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| LED1<br />
| Bit + Uint15<br />
| Bit 15: on / off/<br />
Bits 14 -> 0: half-period in ms (if 0, led status = bit 15)<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| ...<br />
| <br />
| <br />
| <br />
| <br />
| <br />
|-<br />
| 3<br />
| LED4<br />
| Bit + Uint15<br />
| ''See LED1''<br />
| Smartphone -> Kart<br />
| <br />
|-<br />
| 4<br />
| Voltage<br />
| Uint16<br />
| Battery voltage, U = register * 250*e-6 * 7.8 [V]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_BATT_DELTA_MV (100) from the last registered value happens<br />
|-<br />
| 5<br />
| Current<br />
| Uint16<br />
| Consumed current, I = register * 250*10*e-6 / (100 * 5*10*e-3) [A]<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_CURR_DELTA_MA (50) from the last registered value happens<br />
|-<br />
| 6<br />
| Range finder<br />
| Uint16<br />
| Distance to sensor, register * 25.4 / (147*10*e-6 * (10M / 10)) [mm]<br />
Register zeroed if less than 152 mm (sensor min distance) or greater than 1500 mm (arbitrary max distance), event not sent in such case<br />
| Kart -> Smartphone<br />
| When a delta of at least SENS_RANGEFNDR_MM (100) from the last registered value happens<br />
|-<br />
| 7<br />
| End switches<br />
| Vector(16)<br />
| Sensors current values, right justified (sensor 1 is bit 0)<br />
| Kart -> Smartphone<br />
| On any edge change of any sensor<br />
|-<br />
| 8<br />
| Hall1<br />
| Uint16<br />
| Hall pulses count, zeroed on overflow of the register<br />
| Kart -> Smartphone<br />
| Each 100 ms if value changed from last time<br />
|-<br />
| 9<br />
| Hall2<br />
| Uint16<br />
| ''See Hall1''<br />
| Kart -> Smartphone<br />
| ''See Hall1''<br />
|}<br />
<br />
=== Control Registers ===<br />
<br />
Reading range : 0xC0 to 0xDF<br />
<br />
Writing range : 0xE0 to 0xFF<br />
{{WarningBox|content=<br />
The control registers module is '''WRITE ONLY''' for now !<br />
}}<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Address<br />
! Name<br />
! Type<br />
! Description<br />
! Direction<br />
! Event<br />
|-<br />
| 0<br />
| Hardware Control<br />
| Vector6<br />
| Bit 0: when '0', the Kart goes backwards when the motor turns foward<br />
Bit 1: when '1', the Kart turns to the right as the stepper coils go from 1 to 4<br />
<br />
Bit 2: when '1', the angles are measured clockwise<br />
<br />
Bit 3: emulates the end switch contact for the stepper motor<br />
<br />
Bit 4: restart the stepperMotor module, stops the DC motor while '1'<br />
<br />
Bit 5: when '1', the BLE connection has been established (otherwise, the Kart should not be able to move)<br />
| Smartphone -> Kart<br />
| The end sensor always defines angle 0. Angles are always positive numbers in registers.<br />
If bits 1 and 2 are different, the stepper motor phase sequence has to be inverted.<br />
If the Bluetooth connection is lost, the DC motor has to be stopped.<br />
|}<br />
<br />
<br />
<br />
<br />
==== Sequence control register ====<br />
<br />
''The sequence control register is not yet re-implemented.<br />
The old behavior, kept for reference, is the following:''<br />
<br />
The sequence control register is used to load a new sequence from start of memory as well as to start and stop a sequence.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Bit<br />
! Meaning<br />
! Description<br />
|-<br />
| 0<br />
| Reset sequence<br />
| sets the sequence RAM write and read addresses back to 0<br />
|-<br />
| 1<br />
| Run / stop<br />
| starts or stops a sequence<br />
|}<br />
<br />
===== Sequence operations register =====<br />
<br />
The sequence memory is made out of 16-bit controls and the sequence can range up to 2<sup>10</sup> operations.<br />
From the communication point of view, the sequence memory is seen as a FIFO&nbsp;:<br />
the sequence operations are pushed one after the other into the sequence register,<br />
starting at the first one of the list after the <code>reset sequence</code> bit<br />
has been set in the [[#Control register|control register]]<br />
<br />
The sequence operations are split into 2&nbsp;parts: a 4-bit command and optional parameters.<br />
A sequence register has been defined in order to build loops:<br />
the <code>goto</code> operation is only carried out if the register is not zero.<br />
The register is initialised with all bits to&nbsp;'1'.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
|<br />
! colspan = "2" | command<br />
! parameter<br />
| comment<br />
|-<br />
| Bits<br />
! colspan = "2" | 15 ÷ 12<br />
! 11 ÷ 0<br />
|<br />
|-<br />
| rowspan = "13" | || 0 || nop || ||<br />
|-<br />
| 1 || set speed || speed || set the propulsion motor speed<br />
|-<br />
| 2 || set angle || angle || set the direction motor angle<br />
|-<br />
| 3 || drive LEDs || pattern || specify a given pattern for turning the LEDs on or off<br />
|-<br />
| 4 || set LEDs || mask || set bits from '1's of mask<br />
|-<br />
| 5 || clear LEDs || mask || clear bits from '1's of mask<br />
|-<br />
| 6 || blink LEDs || period, mask || ''not implemented yet''<br />
|-<br />
| 8 || run distance || hall ticks || run until the Hall counter has augmented by at least a given tick number<br />
|-<br />
| 9 || run for || milliseconds || run for a specified time span<br />
|-<br />
| A || run until || event || ''not implemented yet''<br />
|-<br />
| D || modify register || operation, operand || bits 11÷10 : 00 = set, 10 = add, 11 = sub / bits 9÷0 : operand<br />
|-<br />
| E || goto nz || address || jumps to the specified sequence step as long as the register is not zero<br />
|-<br />
| F || end || || the sequence controller in the FPGA stops and the <code>running</code> status bit is cleared, announcing that the sequence is terminated<br />
|}<br />
<br />
===== Sequence status register =====<br />
<br />
The sequence status register tells what operation is currently active.<br />
<br />
{| cellpadding="4" cellspacing="0" border="1"<br />
! Bit<br />
! Meaning<br />
! Description<br />
|-<br />
| 15 ÷ 12<br />
| Current command<br />
| indicates which command is currently being processed<br />
|-<br />
| 0<br />
| Running<br />
| indicates that a sequence is currently running<br />
|}<br />
<br />
== Kart init ==<br />
<br />
To init the Kart, the following sequence should be sent to the Kart:<br />
* Write '''DC Motor | Prescaler''' to '''31''' (around 21 kHz PWM frequency)<br />
* Write '''Stepper Motor | Prescaler''' to '''400''' (250 Hz coil switching frequency)<br />
* Write '''Control Registers | Hardware Control''' to restart the system while telling the BLE client is connected (0b110xxx)<br />
** The stepper should turn until hitting the end switch, except if already on it<br />
* Read '''Stepper Motor | Stepper HW''' and check the last bit<br />
** If is '1', it means we are already zeroed<br />
** If not, wait for an event from this register to tell the reset is complete<br />
* Write '''Control Registers | Hardware Control''' to deassert the reset (0b100xxx)<br />
<br />
The Kart is now ready to function !<br />
<br />
== Testing through USB ==<br />
[[File:Kart_kci.jpg|450px|right|Kart Command Interpreter]]<br />
To test the Kart from a PC directly, one can do as follows:<br />
* Remove the [[Kart/Bluetooth|BLE]] from the [[Kart/Motherboard|motherboard]]<br />
* Power the [[Kart/Motherboard|motherboard]] with a DC voltage regulator (+12V)<br />
* Wire the USB-C present on the daughterboard to your PC<br />
** Two new COM ports should be detected<br />
* Download and open the '''Kart Command Interpreter''' utility (available in the VHDL project -> CommandInterpreter)<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_WIN.exe Windows 10]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_MAC macOS (ARM64/Apple Silicon)]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_MAC_amd64 macOS (AMD64/Intel)]<br />
** [https://github.com/hei-synd-2131-eln/eln-kart/blob/master/CommandInterpreter/KartCommandInterpreter_LIN Linux]<br />
* In the top menu '''Serial -> Port''', select the correct COM port (should be the biggest of the two new ports)<br />
** You can also change the baudrate, by default '''115'200''' (the correct one if it was not modified in the VHDL '''Kart_pkg.vhd'''<br />
<br />
To test the connection, click the '''Read''' button. The '''Tx''' and '''Rx''' values should change, and a text added to the text area.<br />
<br />
=== Simple operation ===<br />
The simplest way to test both motors are the three button at the bottom.<br />
<br />
* '''Init Kart''' button<br />
** Will set the DC prescaler, stepper prescaler, and execute the restart sequence. '''Must be clicked first.'''<br />
** You may need to modifiy the [[Kart/serial_link#Control_Registers|'''CReg -> HW Control''']] register to correspond to your Kart design. Only change x in the following value: '''0b100xxx'''<br />
* '''DC Motor''' button<br />
** Will set the DC speed to full for 2s, quickly 0, then reversed full speed for 2s<br />
* '''Stepper Motor''' button<br />
** Will set the stepper to 400 (30°) then 0<br />
<br />
=== Custom operation ===<br />
Each register can be read and/or written by hand following their [[Kart/serial_link#Registers|data description]].<br />
<br />
For this, select the '''Module''' first, then which '''Register'''.<br />
<br />
==== Read ====<br />
To read, simply click the '''Read''' button. Successful read will be shown in green (CRC is ok) and logged, with extra info (e.g. for the DC prescaler, will give the motor frequency).<br />
<br />
==== Write ====<br />
To write, enter a value in the value box such as:<br />
* Direct integer (only DC speed should be negative)<br />
* '''0b'''xxxx binary values<br />
* '''0x'''xxxx hexadecimal values<br />
* ''Other values will throw an error''<br />
<br />
Then click on the '''Write''' button.<br />
<br />
=== Reset ===<br />
In case of problem, you can simply power-cycle the FPGA board to reset the registers.<br />
<br />
[[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2022-08-16T08:11:50Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students<br />
between the 2nd and the 3rd semester.<br />
It is a [[kart/gallery|home-made model car]] remotely controlled by a smartphone.<br />
<br />
[[File:Kart I2C.jpg|150px|center|Demo Kart]]<br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis and the body<br />
* analysis of the DC motor<br />
* [[Kart#FPGA_Design|configuration of the controlling FPGAs]]<br />
* [[Kart#Android_App|completion and extension of the control GUI on the smartphone]]<br />
<br />
Take a look at the [[kart/gallery|karts gallery]] !<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Hardware ===<br />
The electronic is composed of an [[Kart/Daughterboard|FPGA daughterboard]] mounted on a dedicated [[Kart/Motherboard|motherboard]].<br />
<br />
An Honor10 Lite running Android acts as the interface for the user.<br />
<br />
=== Distributed controls ===<br />
<br />
A [[Kart/Bluetooth|Bluetooth - USB dongle]] on the kart communicates via an [[kart/serial link|UART serial link]] with the FPGA.<br />
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]].<br />
<br />
The design is separated over four different modules:<br />
* A [[Kart/DC motor controller|DC motor controller]] is controlling the propulsion motor.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] is responsible for the Kart to turn.<br />
* A [[Kart/Sensors|sensor controller]] controls various I/Os (LEDs, buttons, range finder, hall sensors ...).<br />
* A [[Kart/serial_link#Control_Registers|control registers manager]] retrieve and control various status information (bluetooth connection, hardware directions ...).<br />
<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive the FPGA board preprogrammed with a functional solution and Android phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/a/YV2oi5ct FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
For the smoothest experience, you can use Git directly by cloning the repository.<br />
<br />
Otherwise, it is possible to download directly the corresponding <code>zip</code> and store it in you personal drive (<code>U:\</code>).<br />
While working on the project, it may be preferable to copy it locally for a quicker experience.<br />
<br />
Do not forget to either commit and push your modifications to your Git repository or save the modified files on your drive !<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the full path to the project files.<br />
<br />
HDL may hang while booting or files not loading/saving correctly.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Modules designs ====<br />
<br />
Three of the different modules must be completed:<br />
* The [[Kart/DC motor controller|DC motor controller]] receives a '''prescaler''' and a '''speed''' value to build the corresponding '''PWM''' and '''direction''' signals.<br />
* The [[Kart/stepper motor controller|stepper motor controller]] receives a '''prescaler''' and the '''desired angle''' and builds the coil controls signals.<br />
* 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).<br />
<br />
==== Testing ====<br />
<br />
In addition to the tests explained in the different modules, an [[Kart/Daughterboard#Testing|overall tester]] is available to test the whole board.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The main power is drawn from two 6 V / 2400 mAh battery packs in series<br />
The [[Kart/Motherboard|motherboard]] provides two connectors for the batteries, along with an extra one to wire an NiMh charger.<br />
<br />
{{WarningBox|content=<br />
Make sure to shut the circuit off while charging to avoid higher voltage on the 12V rail.<br />
<br />
The charge rate should be of around 0.05C => 120mA here.<br />
}}<br />
<br />
The 12V is reduced to a 5V rail through a buck converter.<br />
<br />
The [[Kart/Daughterboard|daughterboard]] is then fed with the 5V to provide an extra 3.3V rail.<br />
<br />
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.<br />
<br />
=== FPGA board ===<br />
<br />
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.<br />
The clock is rooted to the FPGA from a 10 MHz quartz.<br />
<br />
It is designed as an SODIMM-200 RAM stick to be easily interchangeable and plugged into various motherboards.<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/Os of the motherboard are:<br />
* 1 to 2 [[kart/Sensors#Hall_sensors|hall sensor(s)]]<br />
* 1 [[Kart/Sensors#Ultrasound_ranger|ultrasound ranger]]<br />
* 1 [[Kart/Sensors#End_of_turn_switch|end of turn]] contact switch<br />
* 1 to 8 [[Kart/Sensors#LEDs_.2F_Low-consumption_outputs|LEDs or digital outputs]]<br />
* 1 to 16 [[Kart/Sensors#Buttons_.2F_Digital_inputs|buttons or digital inputs]]<br />
* 0 to 4 [[kart/Sensors#Proximity_sensors|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction.pdfFile:Programming Introduction.pdf2021-08-22T20:41:25Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction.pdf&quot;</p>
<hr />
<div>Presentation to introduce you to your tasks for the programming part of the Summer School's Kart project</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction.pdfFile:Programming Introduction.pdf2021-08-18T06:16:56Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction.pdf&quot;</p>
<hr />
<div>Presentation to introduce you to your tasks for the programming part of the Summer School's Kart project</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2021-08-17T06:23:36Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction.pdfFile:Programming Introduction.pdf2021-08-17T06:08:19Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction.pdf&quot;</p>
<hr />
<div>Presentation to introduce you to your tasks for the programming part of the Summer School's Kart project</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2021-08-17T06:07:50Z<p>Michael.clausen: /* Tasks */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Board designs ====<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2021-08-17T06:05:59Z<p>Michael.clausen: /* Tasks */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:SS1_Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
==== Design environment ====<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
The design is made using [https://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL Designer]<br />
as it was the case during the case during the [[Main_Page#Semester_1|previous semester's]] labs and project.<br />
The FPGAs are [[Libero IDE presentation|configured]] using the [https://www.microsemi.com/product-directory/design-resources/1751-libero-ide Libero IDE].<br />
<br />
==== Board designs ====<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202021-08-17T06:01:42Z<p>Michael.clausen: Blanked the page</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202021-08-17T06:01:21Z<p>Michael.clausen: /* Tasks */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
File:SummerSchool_15.jpg|Summer School '15<br>[https://youtu.be/hSTDnhofl60 Youtube teaser movie]<br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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 [[kart/serial link#Serial link protocol|protocol]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These baseboards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed), and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview of the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* '''Update for the Kart lib''': [[Media:kartlib-release.aar|kartlib-release.aar]], copy this into Kart/app/libs.<br />
* You can find the instructions on how to open the project in Android Studio in the [[Media:Programming_Introduction_2020.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards that drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction_2020.pdfFile:Programming Introduction 2020.pdf2021-08-17T05:52:56Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction 2020.pdf&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-27T13:27:34Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
File:SummerSchool_15.jpg|Summer School '15<br>[https://youtu.be/hSTDnhofl60 Youtube teaser movie]<br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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 [[kart/serial link#Serial link protocol|protocol]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These baseboards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed), and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction_2020.pdf|programming introduction]] gives an overview of the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* '''Update for the Kart lib''': [[Media:kartlib-release.aar|kartlib-release.aar]], copy this into Kart/app/libs.<br />
* You can find the instructions on how to open the project in Android Studio in the [[Media:Programming_Introduction_2020.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards that drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kartlib-release.aarFile:Kartlib-release.aar2020-08-27T13:26:27Z<p>Michael.clausen: </p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-27T13:26:16Z<p>Michael.clausen: /* Starting point */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
File:SummerSchool_15.jpg|Summer School '15<br>[https://youtu.be/hSTDnhofl60 Youtube teaser movie]<br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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 [[kart/serial link#Serial link protocol|protocol]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These baseboards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed), and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction_2020.pdf|programming introduction]] gives an overview of the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* Update for the Kart lib: [[Media:kartlib-release.aar|kartlib-release.aar]]<br />
* You can find the instructions on how to open the project in Android Studio in the [[Media:Programming_Introduction_2020.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards that drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction_2020.pdfFile:Programming Introduction 2020.pdf2020-08-24T12:55:05Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction 2020.pdf&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction_2020.pdfFile:Programming Introduction 2020.pdf2020-08-24T08:10:30Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction 2020.pdf&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction_2020.pdfFile:Programming Introduction 2020.pdf2020-08-19T13:48:35Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction 2020.pdf&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-19T13:40:14Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction_2020.pdf|programming introduction]] gives an overview about the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction_2020.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction_2020.pdfFile:Programming Introduction 2020.pdf2020-08-19T13:37:04Z<p>Michael.clausen: </p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-19T13:33:47Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction_2020.pdf|programming introduction]] gives an overview about the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction2020.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-19T12:50:16Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in three main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software and the students' tasks.<br />
They comprise:<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart_2020Kart 20202020-08-19T12:47:39Z<p>Michael.clausen: Created page with "{{TOC right}} 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 smar..."</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Main_PageMain Page2020-08-19T12:47:32Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
[[File:hesso_logo.png|left|200px|HESSO Valais Wallis Logo|link=http://www.hevs.ch]] Welcome to the knowledge database of the [http://www.hevs.ch HES-SO Valais Wallis] Bachelor Degree Course of Systems Engineering ([http://www.hevs.ch/de/hochschule/hochschule-fur-ingenieurwissenschaften/systemtechnik/bachelors/der-studiengang-1043 Systemtechnik] | [http://www.hevs.ch/fr/hautes-ecoles/haute-ecole-d-ingenierie/systemes-industriels/bachelors/presentation-1043 Systèmes industriels], SI).<br />
<br />
[[File:Icontexto-inside-rss.png|link=Help:http://wiki.hevs.ch/fsi/index.php?title=Special:RecentChanges&feed=rss|48px]] [http://wiki.hevs.ch/fsi/index.php?title=Special:RecentChanges&feed=rss Sign up to our RSS Feed to stay up-to-date]<br />
<br />
<br />
= Modules =<br />
Use the ''Navigation'' to the left or jump directly to your course using the links below.<br />
<br />
== Bachelor ==<br />
=== Semester 1 ===<br />
* [[eln|Digital Electronics (Numerische Elektronik / Electronique Numerique, ElN)]]<br />
** [[chrono|Chrono]] project<br />
** [[cursor|Cursor]] project<br />
** [[Eln/support|Support]] material<br />
<br />
=== Summer School ===<br />
* [[Kart|Kart (214_SS1)]] project<br />
* [[Kart 2020|Kart 2020 (214_SS1)]] project<br />
<br />
=== Semester 6 ===<br />
* [[SEm|Embedded Systems (Eingebettete Systeme | Systèmes Embarqués, SEm)]] module<br />
<br />
== Master ==<br />
*[[HiRel|High-Reliability Electronics (HiRel)]] module<br />
**[[HiRel/CanSat|CanSat]] project<br />
*[[SwiSSC|Swiss Space Summer Camp]] : a summer school in cooperation with [http://www.bmstu.ru/en/ Bauman University] in Moscow<br />
<br />
== Demonstration ==<br />
* EPTM / BFO [[EMVs/AudioAmp|audio amplifier]] project day<br />
* EPTM / BFO [[EMVs/RemoteControl|remote control]] project day<br />
<!-- * Besuchstag BFO BM [[Chrono|Konfigurierbare Hardware]] ProbeLabo --><br />
<br />
= Tools =<br />
* [[Tools/EDA/Install|Installation of EDA tools]]<br />
* [[LinuxInstall2016| Installation of Linux for DR01/DR03]]<br />
* [[Linux Install| (old) Installation of Linux for DR01/DR03]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:Master]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Kart2020Kart20202020-08-19T12:46:57Z<p>Michael.clausen: Created page with "{{TOC right}} 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 smar..."</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/Main_PageMain Page2020-08-19T12:46:19Z<p>Michael.clausen: </p>
<hr />
<div>{{TOC right}}<br />
[[File:hesso_logo.png|left|200px|HESSO Valais Wallis Logo|link=http://www.hevs.ch]] Welcome to the knowledge database of the [http://www.hevs.ch HES-SO Valais Wallis] Bachelor Degree Course of Systems Engineering ([http://www.hevs.ch/de/hochschule/hochschule-fur-ingenieurwissenschaften/systemtechnik/bachelors/der-studiengang-1043 Systemtechnik] | [http://www.hevs.ch/fr/hautes-ecoles/haute-ecole-d-ingenierie/systemes-industriels/bachelors/presentation-1043 Systèmes industriels], SI).<br />
<br />
[[File:Icontexto-inside-rss.png|link=Help:http://wiki.hevs.ch/fsi/index.php?title=Special:RecentChanges&feed=rss|48px]] [http://wiki.hevs.ch/fsi/index.php?title=Special:RecentChanges&feed=rss Sign up to our RSS Feed to stay up-to-date]<br />
<br />
<br />
= Modules =<br />
Use the ''Navigation'' to the left or jump directly to your course using the links below.<br />
<br />
== Bachelor ==<br />
=== Semester 1 ===<br />
* [[eln|Digital Electronics (Numerische Elektronik / Electronique Numerique, ElN)]]<br />
** [[chrono|Chrono]] project<br />
** [[cursor|Cursor]] project<br />
** [[Eln/support|Support]] material<br />
<br />
=== Summer School ===<br />
* [[Kart|Kart (214_SS1)]] project<br />
* [[Kart2020|Kart 2020 (214_SS1)]] project<br />
<br />
=== Semester 6 ===<br />
* [[SEm|Embedded Systems (Eingebettete Systeme | Systèmes Embarqués, SEm)]] module<br />
<br />
== Master ==<br />
*[[HiRel|High-Reliability Electronics (HiRel)]] module<br />
**[[HiRel/CanSat|CanSat]] project<br />
*[[SwiSSC|Swiss Space Summer Camp]] : a summer school in cooperation with [http://www.bmstu.ru/en/ Bauman University] in Moscow<br />
<br />
== Demonstration ==<br />
* EPTM / BFO [[EMVs/AudioAmp|audio amplifier]] project day<br />
* EPTM / BFO [[EMVs/RemoteControl|remote control]] project day<br />
<!-- * Besuchstag BFO BM [[Chrono|Konfigurierbare Hardware]] ProbeLabo --><br />
<br />
= Tools =<br />
* [[Tools/EDA/Install|Installation of EDA tools]]<br />
* [[LinuxInstall2016| Installation of Linux for DR01/DR03]]<br />
* [[Linux Install| (old) Installation of Linux for DR01/DR03]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:Master]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction.pdfFile:Programming Introduction.pdf2019-08-26T06:10:30Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction.pdf&quot;</p>
<hr />
<div>Presentation to introduce you to your tasks for the programming part of the Summer School's Kart project</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2019-08-22T13:42:56Z<p>Michael.clausen: /* Virtual Kart */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2019-08-22T13:17:16Z<p>Michael.clausen: /* Virtual Kart */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.08-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.08-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2019-08-20T13:25:56Z<p>Michael.clausen: /* Virtual Kart */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
* macOS version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-macOS.dmg here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/KartKart2019-08-19T09:34:00Z<p>Michael.clausen: /* Common Problems */</p>
<hr />
<div>{{TOC right}}<br />
<br />
The Kart module (214_Pr1) is a Summer School module for students between the 2nd and the 3rd semester.<br />
It is a home-made model car remotely controlled by a smartphone.<br />
<br />
<!--[[File:Kart I2C.jpg|400px|center|Demo Kart]]--><br />
<br />
<gallery><br />
File:Kart I2C.jpg|HES-SO Valais/Wallis Demo Kart<br />
File:SummerSchool_17.jpg|Summer School '17<br />
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]]]]--><br />
File:SummerSchool_13.jpg|Summer School '13<br />
File:SummerSchool_12.jpg|Summer School '12<br />
File:SummerSchool_09.jpg|Summer School '09<br />
File:SummerSchool_05.jpg|Summer School '05<br />
File:SummerSchool_04.jpg|Summer School '04<br />
</gallery><br />
<br />
The work of the students can be summarized in four main tasks:<br />
* design and assembly of the chassis<br />
* analysis of the motor driver circuits (DC and stepper)<br />
* configuration of the controlling FPGAs<br />
* completion and extension of the control GUI on the smartphone<br />
<br />
== System Architecture ==<br />
<br />
The kart is controlled by a smartphone via Bluetooth.<br />
<br />
=== Distributed boards ===<br />
<br />
A Bluetooth receiver on the kart communicates via an [[kart/serial link|RS232 serial link]] with the FPGA control board.<br />
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.<br />
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]].<br />
<br />
The control is distributed over several FPGA boards connected together via [[kart/I2C link|I2C]].<br />
These base boards each hold a slave function board:<br />
* A [[Kart/Bluetooth|Bluetooth RS232 modem]] sits on the [[Kart/FPGA board|I2C master FPGA]]<br />
* A [[Kart/DC motor controller|DC motor controller]] receives a speed value and builds a PWM and a direction control.<br />
* A [[Kart/stepper motor controller|stepper motor controller]] receives the desired angle and builds the coil controls signals.<br />
* A [[Kart/sensor board|sensor board]] manages I/O comprising proximity sensors, hall sensors (for the driving speed) and LEDs.<br />
== Tasks ==<br />
<br />
The [[Media:Programming_Introduction.pdf|programming introduction]] gives an overview about the structure of the software/hardware and the students' tasks.<br />
They comprise:<br />
* [http://en.wikipedia.org/wiki/Field-programmable_gate_array FPGA] design for driving the hardware and reading the sensors<br />
* [https://www.android.com Android] application development for the remote control<br />
<br />
The students receive FPGA boards preprogrammed with a functional solution and androïd phones with a demo application.<br />
This allows to start the development either with the FPGA design or the Android application development.<br />
<br />
=== FPGA Design ===<br />
<br />
A [https://classroom.github.com/g/s3xpuVfh FPGA design environment] is available, based on:<br />
* [http://www.mentor.com/products/fpga/hdl_design/hdl_designer_series/ HDL designer] for graphical design entry<br />
* [http://www.mentor.com/products/fv/modelsim/ ModelSim] for simulation<br />
* [http://www.microsemi.com/products/fpga-soc/design-resources/design-software/libero-ide Libero IDE] for synthesis and programming<br />
<br />
{{TaskBox|content=<br />
clone the Git repository or download the corresponding <code>zip</code> and install it,<br />
preferably to your personal drive (<code>U:\</code>).<br />
}}<br />
{{WarningBox|content=<br />
Make sure that there is no space character in the path to ELN_kart.<br />
}}<br />
<br />
With this, the following designs have to be completed:<br />
* the [[Kart/DC motor controller#FPGA design|DC motor controller FPGA]] has to generate the PWM and direction signals for the propulsion motor<br />
* 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<br />
* the [[Kart/sensor_board#FPGA_design|I/O control FPGA]] has to count the propulsion wheels' rotations and can count the ultrasound ranger distance.<br />
<br />
=== Android App ===<br />
One goal is to implement an Android application that controls and monitors the kart.<br />
<br />
==== Introduction ====<br />
<br />
The installable package of the (or rather a) solution can be found here: [[Media:Kart.apk|Kart.apk]]<br />
<br />
==== Starting point ====<br />
<br />
* You can download the Kart project with the minimal interface here: [[Media:Kart.zip|Kart.zip]]<br />
* You can find the instructions how to open the project in Android Studio in the [[Media:Programming_Introduction.pdf|programming introduction]] presentation...<br />
* The online documentation of all Java classes that are at your disposition is [[http://kart-javadoc.hevs.ch here]]<br />
* 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>.<br />
* 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(...)).<br />
<br />
==== Common Problems ====<br />
* Don't block the main thread with an infinite loop<br />
* Don't change the orientation of the display during the execution, it can crash the BT communication. Do it in the Manifest.<br />
<br />
==== Virtual Kart ====<br />
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.<br />
<br />
* Windows version [http://kart-javadoc.hevs.ch/Virtual%20Kart-2019.8-win64.exe here]<br />
<br />
== Components ==<br />
<br />
=== Power supply ===<br />
<br />
The [[Kart/power supply|power supply board]] provides the 5&nbsp;V and the 3.3&nbsp;V to the other boards.<br />
This is generated from two 6&nbsp;V battery packs.<br />
<br />
The power supply board also comprises an ADC which provides the [[kart/battery level|battery level]].<br />
<br />
=== FPGA boards ===<br />
<br />
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.<br />
<br />
They hold daughterboards which drive different parts of the Kart.<br />
The motherboards are interconnected via an [[kart/I2C link|I2C link]].<br />
<br />
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.<br />
<br />
=== FPGA daughterboards ===<br />
<br />
Existing daughterboards are:<br />
* a [[Kart/Bluetooth|Bluetooth interface board]]<br />
* a [[Kart/DC motor controller|DC motor controller]]<br />
* a [[Kart/stepper motor controller|stepper motor controller]]<br />
* an [[Kart/sensor board|I/O board]] for the sensors<br />
* an [[Kart/FPGA_board#Test|FPGA test]] board<br />
<br />
=== Sensors ===<br />
<br />
The sensors connected to the I/O board are:<br />
* 1 to 4 [[kart/sensors/VCNL4000|VCNL4000 I2C Distance/Ambience Light Sensor]]<br />
* 1 to 2 [[kart/sensors/SS311PT|SS311PT Hall Sensor]]<br />
* 1 [[Kart/sensors/HCSR04|ultrasound ranger]]<br />
* 1 [[Kart/sensor board|end of turn]] contact switch<br />
<br />
== Additional Information ==<br />
<br />
* Additional informations [[kart/professor|for collaborators]]<br />
* [[kart/toDo|To do list]]<br />
* When preparing the labs, follow the [[kart/setup|setup guide]]<br />
<br />
<br />
[[Category:Bachelor]] [[Category:SummerSchool]] [[Category:Pr1]] [[Category:Kart]]</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-12T11:14:06Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-12T11:14:06Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-12T07:20:24Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-12T07:05:34Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Programming_Introduction.pdfFile:Programming Introduction.pdf2019-08-09T17:52:50Z<p>Michael.clausen: uploaded a new version of &quot;File:Programming Introduction.pdf&quot;</p>
<hr />
<div>Presentation to introduce you to your tasks for the programming part of the Summer School's Kart project</div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.apkFile:Kart.apk2019-08-09T17:32:14Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.apk&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-09T17:30:02Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.zipFile:Kart.zip2019-08-09T17:23:19Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.zip&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.apkFile:Kart.apk2019-08-09T17:22:53Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.apk&quot;</p>
<hr />
<div></div>Michael.clausenhttps://wiki.hevs.ch/fsi/index.php5/File:Kart.apkFile:Kart.apk2019-08-09T13:05:51Z<p>Michael.clausen: uploaded a new version of &quot;File:Kart.apk&quot;</p>
<hr />
<div></div>Michael.clausen