SLIR Projects - Small Projects with big theory

 SLIR - Sri Lanka Institute of Robotics - Advanced Robotics Course Projects 


Manipulating a GPIO in a PIC MC
Controlling a LCD using a PIC microcontroller

Connecting a Stepper Motor to Motor Driver
Connecting Motor Driver to arduino 
Optocoupler arduino shield to reduce EMI and
drive high power components
Water Level Adjuster using pump 
Program the System
Running Tests


Complete Setup

Penumatic Converyer belt and part picker
Penumatic Converyer belt and part picker

















WEEK 2 - Intern Diary

 Day 1 - Vega Innovation

Learning  in depth - C language 

Heap memory, stack memory

Identified a faulty ESP32 using a microscope. 

Using the UCTX Serial analyzer software, Learning about CARLA- Self driving car simulator\

Finding an online simulator, https://wokwi.com/features

WEEK 1 - Intern Diary

 DAY 1 - Vega Innovation


Learned the serial communication types other than RS-232,SPI and I2C

RS-485 : Faster, than its predecessor RS232 and can have a range of 400 feet. 
Can connect about 32 devices 
Than I2C - can send more data with more speed. 

The ESP-32 has several classes
  •     S-Class                   :  Uses WIFI, Bluetooth LOW POWER .
  •     Normal Class         :  Uses WIFI, Bluetooth LOW POWER and Normal Bluetooth.  
  •     Commercial Class : Uses a proprietary OS instead of RTOS.

Installing the  ESP-IDF plugin to VScode and debugging the errors in installing it
  •  Make sure the directory name has no spaces.
  • Make sure the code has the same name as directory.
  • Code runner cannot be used in Ardiuno or ESP IDF rather its inbuilt compiler is supposed to be used which is in the left bottom of the panel

Learning TOPICS

  • NB-IOT (Narrowband-Internet of Things), 
  • LTE-M(Long Term Evolution for Machines)
  • RTOS (Real-time operating system) : 
    • Event-driven – switches tasks only when an event of higher priority needs servicing; called preemptive priority, or priority scheduling.
    • Time-sharing – switches tasks on a regular clocked interrupt, and on events; called round robin.
  • Monolithic Kernels and Micro Kernels
  • LoRA (Long Range _Communication

  • References
    https://www.contec.com/support/basic-knowledge/daq-control/serial-communicatin/

 DAY 2 - Vega Innovation


Learned the serial communication types other than RS-232,SPI and I2C

Serial data Comm

CAN - Controller Area Networks
CAN is a multi-master serial bus standard for connecting electronic control units
CAN FRAME - SIZE DEPENDS
refer wikipedia


Refer https://copperhilltech.com/blog/controller-area-network-can-bus-tutorial-message-frame-format/
https://en.wikipedia.org/wiki/CAN_bus

4 types of CAN Frames
    Remote
    Error
    Overload
    


UART:
UART In works

Break Down oF Uart


RTOS: 
Real Time Operating System
There are several types
- Hard Time - Time is essential(ATMS) 
- Firm Time  - Time must be exactly strictly maintained(Airbag)
- Soft time   -Calculator

Dependant on 
    Time driven
    Event driven

In typical designs, a task has three states:

Running (executing on the CPU);
Ready (ready to be executed);
Blocked (waiting for an event, I/O for example)

ESP32
ESP32 Circuit Diagram



Using the different architectures and instruction sets in ESP32 and the use of RTOS on it.
We usually use Amazon's free RTOS but there are other alternatives like mongoos (FOSS) and QNX (Proprietary).
Each OS has inherently different advantages.

MQTT - Message Queing Telemetry Transmission (Protocol for IOT deivce communication)

Serial Communication:  https://circuitdigest.com/tutorial/serial-communication-protocols

DAY 3 - Vega Innovation


Learning more about the modules, functions and similar codes in C for the ESP32
Free() function : Removes the memory lock from melloc,calloc and other functions.
Logging in ESP32 -Uses the JTAG for it

Learning the OTA update system for the EVCU-Electrical Vehicle Controller Unit
USes the STM32 microcontroller - STM32 Cube IDE(IDE)
And the SPC570S microcontroller  - SP5 studio (IDE) and UDE (debugger)

Flash the SPC570S using JTAG debugger and using the debugger monitor the firmware using the EVCU.

Setup to flash the Jtag of the EVCU- uses ext.power supply 
And CAN to apply the OTA upadate
. 



DAY 4- Vega Innovation


Learn to create a pull request in github and merge changes.
Creating a branch so that edits can be made in the duplicate and merged finally to the ,ain branch.

Learn Code Composer Studio  and the architecture  behind programming the C2000 microcontroller(by texas Instruments)



DAY 5- Vega Innovation


Learning the C language furthur and make modifications in the giveen codes
Learn about the SMD coponents sed 
Learned abiut the different types of Capacitors 
Learnt about SIFFS,freeFS, FREERTOS functions, SD card usage in ESP32, and application of FAT in eSP

Learn that there are hardware accelerated encryption and an ULP-(ultra low power) coprocessor
Learnt about the ESP 32 in depth and the different variants in it.

Learnt to fing the MAC address in the ESP32 

My confusing ,yet satisfying review of Ubuntu Desktop

 My journey of migrating to Ubuntu Desktop from elementaryOS

Introduction

After 6 months of using Elementary OS as my main operating system, found the little bugs and issues as big inconveniences as I was wasting time trying to fix them. So I bit the bullet and chose to install Ubuntu 22.04 LTS. Here is my experiences

Issues from ElementaryOS 

ElementaryOS is a wonderfully made Linux distro with beautiful UI (Pantheon) which makes it an easy selection for a ex-Mac user. Beautifully crafted curated apps, and gesture based operation makes work on it wonderful. But I met some bugs that broke my interests.


  • Not able to extract files quicky
  • Lack of windows gestures or comlicated
  • Dark mode not working properly
  • Default apps not working as configured
  • AMD graphics driver issues
  • Windows tilling doesnt work properly.

So I came to the conclusion of  Switching into Ubuntu ,

Why Ubuntu?

Ubuntu as an OS has many qualities I am looking forward to:

  • Stability: Ubuntu is known for its stability and long-term support (LTS) releases, which means fewer bugs and more reliable performance.

  • Community Support: Ubuntu has a large and active community, making it easier to find solutions to any issues that may arise.

  • Software Availability: Ubuntu has a vast repository of software packages, making it easy to find and install the tools I need.

  • Customization: Ubuntu offers a high level of customization, allowing me to tailor the desktop environment to my preferences.

  • Performance: Ubuntu is optimized for performance, ensuring smooth and efficient operation even on older hardware.

Installation Process

The installation process of Ubuntu 22.04 LTS was straightforward and user-friendly. Here are the steps I followed:

  1. Download the ISO: I downloaded the Ubuntu 22.04 LTS ISO from the official Ubuntu website.

  2. Create a Bootable USB: Using a tool like Rufus, I created a bootable USB drive with the downloaded ISO.

  3. Boot from USB: I restarted my computer and booted from the USB drive.

  4. Install Ubuntu: I followed the on-screen instructions to install Ubuntu, choosing the appropriate options for my setup.

  5. Post-Installation Setup: After installation, I updated the system and installed the necessary drivers and software.

Post-Migration Experience

After migrating to Ubuntu, I noticed several improvements:

  • Smooth Performance: Ubuntu runs smoothly without the glitches I experienced on ElementaryOS.

  • Better Hardware Support: My AMD graphics card works perfectly with the proprietary drivers available in Ubuntu.

  • Enhanced Productivity: The availability of a wide range of software and tools has enhanced my productivity.

  • Improved Customization: I was able to customize the desktop environment to suit my workflow and preferences.

Conclusion

Migrating to Ubuntu 22.04 LTS has been a positive experience overall. The stability, community support, software availability, and customization options make it a great choice for my needs. While ElementaryOS has its charm, Ubuntu provides the reliability and performance I require for my daily tasks.


Python and my journey

 Python : My daily course

Day 1: Computational Thinking Computational thinking 1. Decomposition: Breaking down bigger problem to smaller ones 2. Pattern recognition : finding similar prolems and applying already solved questions 3. Abstraction: Identify the root cause and remove other factors 4. Algorithm design: We come out with step by step processes to solve the problem. Psedo code Flowcharts Blaise Pascal invented the first mechanical calculating machine, John Von Nuemann: Modern Computer Day 2: software anatomy 1.UI (User interface)- Client/ Front-end : Contains the Presentation logic(C,C++,HTML, CSS, JavaScript, Node, etc. If it is a mobile app, technologies such as Ionic, Swift, or Kotlin ) 2.Database: Stores the data(MySQL) 3. Server- Backend: The end( PHP, Ruby, Python, and Go) Day3: Programming Programming is the set of instructions given to a computer to follow using a language it understands Python uses interpreter Day 4: Python basics + Addition - Subtraction * Multiplication / Division ** Power % Remainder Power of precedence Parenthesis Power Multiplication Addition Left to Right Day 5:Bit more Complex = 5+10j 1.is operator and id() can be used to find the memory address 2.type() for the variable type 3.value for the value in the variable Mutability : value can change( list, set, dict ) Immutable : value cannot change ( int, float, bool, str, tuple ) Day 6:Seperator >>print(1,2,3,4, sep='-') 1-2-3-4 >>print(1,2,3,4, sep='*', end='#') 1*2*3*4# Day7: Functions A function is a block of organized ,reusable code used for a single related action. Gives Better Modularity High degree of code reuse Built in: print(), min(), max() Made up: what ever you want Syntax def functionname(): fucntionstuff return #((indentation required)) Docstrings The Docstrings are supposed to provide detailed documentation for a function. It can be composed of the function’s purpose, its list of arguments, its return values and any other information that the programmer thinks important to mention. A docstring is added as the first statement in the body of a Python function. These need to be within quotation marks and the recommended convention to use the triple-quotes (in double quotes) as “”” docstring “”” . These can be on a single line or be multi lined as well. If the docstring fits on a single line both the opening and closing quotes should be on the same line. We can also view the docstrings of built-in and user defined functions using the __doc___ attribute. def calc(quantity, price): """Returns the product of quantity and price""" return quantity*price print (calc.__doc__) Returns the prodcut of quantity and price >>> Day8: Errors 1. Syntax errors 2. Runtime errors NameError,IndexError,TypeError,ValueError,ImportError 3. Logical errors Try/Except : Just like in VB in SLIR Day 9 : Files open files using open() function -Gives a file handle which gives file operations like read,write example: fhandle = open("myfile.txt","r") We can use the read function too if you want to (read())