<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chandula Nethmal on Medium]]></title>
        <description><![CDATA[Stories by Chandula Nethmal on Medium]]></description>
        <link>https://medium.com/@chandulanethmal?source=rss-1da8da7a68a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*pHP5cuwm3YRh_FDDtHOXeQ.jpeg</url>
            <title>Stories by Chandula Nethmal on Medium</title>
            <link>https://medium.com/@chandulanethmal?source=rss-1da8da7a68a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:00:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chandulanethmal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Deep Dive into Deep Packet Inspection]]></title>
            <link>https://medium.com/@chandulanethmal/a-deep-dive-into-deep-packet-inspection-6151865cf0c3?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6151865cf0c3</guid>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Sat, 13 Jul 2024 06:34:00 GMT</pubDate>
            <atom:updated>2024-07-13T06:34:00.122Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog post aims to unfold the details of DPI, exploring its definition, methods, applications, modern technologies, and the challenges it presents in the ever-evolving landscape of cybersecurity.</p><h3>Introduction to DPI</h3><p>Deep packet Inspection (DPI) is a technique in network traffic monitoring which is an essential part of the computer network field. Simply, packet inspection is the process of extracting details from network packets and use those details for purposes such as; identifying trends, catogorizing traffic into applications, anomaly detection, cyber attacks detection and so on.</p><p>When it comes to the DPI, it is a more sophisticated technology than normal packet inspection. It plays a crucial role in understanding, analyzing, and managing the complex flow of data across networks. In the vast landscape of network security and traffic management, one term that frequently surfaces is DPI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ffLij27-7JjRAdEP.jpg" /></figure><p>In this blog post, we will dive into the depths of Deep Packet Inspection, exploring its definitions, methods, and diverse applications.</p><h3>Understanding Deep Packet Inspection</h3><p>Deep Packet Inspection, often abbreviated as DPI, is a technology that enables the inspection and analysis of the content of data packets as they traverse a network. Unlike traditional packet inspection, which focuses on the header information of packets, DPI dives into the payload, scrutinizing the actual data being transmitted.</p><p>Packet inspection can be categorized into two parts as:</p><p><strong>Shallow Packet Inspection</strong></p><ul><li>Analyze up to layer 4 of OSI Layer model.</li></ul><p><strong>Deep packet Inspection</strong></p><ul><li>Analyze up to layer 7 in OSI model (Visibility of all the layers).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HgkbO1speHyLWAHS.jpg" /></figure><p>This granular level of examination provides a wealth of information about the nature and purpose of the data.</p><h3>Conventional Packet Filtering vs. Deep Packet Inspection</h3><h3>Conventional Packet Filtering</h3><blockquote>Conventional packet filtering (Shallow Packet Inspection) primarily examines the header information of data packets, making decisions based on source and destination addresses, ports, and protocols.</blockquote><p>Using the above 5 details, we can categorize all the packets travessing trough a network into sessions. A session is a packet exchange between two entities having above five-touple fixed during the sessoin.</p><p><strong>Five Touple</strong></p><ul><li>Source IP address</li><li>Destination IP address</li><li>Source Port</li><li>Destination Port</li><li>IP protocol</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2W7laVzbku7uDGCj.jpg" /></figure><p>It operates at the network layer of the OSI (Open Systems Interconnection) model and is effective for basic traffic categorization as sessions for the purposes of basic traffic analytics and control but lacks the depth required for detailed analysis.</p><h3>Deep Packet Inspection</h3><blockquote>DPI goes beyond header information; dig into the payload or content of data packets. This granular inspection allows for a thorough understanding of the data being transmitted. By operating at the application layer of the OSI model, DPI provides insights into the specific applications and services generating the traffic.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/0*Yk9HcfpwTuKUDAhc.jpg" /></figure><h3>Methods of Deep Packet Inspection</h3><h3>1. Signature-Based Inspection</h3><p>This is one of the basic methods identifies that known patterns or signatures within packet payloads, enabling the detection of specific applications, protocols, or threats.</p><p>Here, the content of the packets is compared against a database of predefined signatures. These signatures represent patterns associated with known applications, threats, viruses, malware, or other undesirable content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ulk39nRL0RIfW-eG.jpg" /></figure><p>Basically, this acts as mapping a set of bytes against a known byte pattern. Those signatures need to be updated regularly according to new applications or new threats by network engineers.</p><h3>2. String Matching Analysis</h3><p>Many applications have textual identifiers that are contained within the payload part of the IP packets. We can use those specific words or phrases to identify the applications and even extract more sophisticated details of the users as well. (http request packets: user agent string contains Device info; Model, OS, Browser,..etc.)</p><h3>3. Heuristic-Based Inspection</h3><p>Uses algorithms and rules to identify deviations from normal patterns, allowing the detection of previously unknown threats or anomalies. Here we are defining a set of rules which can be used to clearly identify normal vs. abnormal behavior of sessions.</p><h3>4. Behavioral Analysis</h3><p>Monitors and analyzes the behavior of network traffic over time, establishing baselines for normal behavior and detecting unusual patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5jDSm8Zj8BJ02GYy.jpg" /></figure><p>This is helpful to identify possible threats within a network such as cyber attacks. Ex: Whenever a DoS(Denial of Service) or DDoS(Distributed Denial of Service) attack happens, it can cause an unusual behaviour such as abnormally high amount of DNS requests (DNS floods), so suspicios traffic originating from a single IP or a subnet and sudden increment in bandwidths.</p><h3>5. Numerical Property Analysis</h3><p>There are many other properties that we can track with the time related to the statistics of network sessions such as</p><ul><li>packet/payload sizes</li><li>Packet Timing</li><li>Throughput</li><li>Connection Duration</li></ul><p>By monitoring the trends of those properties over time, we can come up with analytic conclusions about the sessions. This can help in identifying patterns or anomalies associated with certain types of traffic.</p><h3>A Challenge for DPI “Data Encryption”</h3><p>As encryption becomes more widespread, DPI faces challenges in inspecting encrypted traffic, leading to blind spots in threat detection. There are multiple encryption protocols and algorithms in use, such as TLS (Transport Layer Security) for web traffic and end-to-end encryption in messaging applications. Those are really challenging situations for DPI since the deeper details cannot be extracted using the ecrypted payload with many of the existing DPI techniques.</p><h3>Modern Technologies of DPI</h3><h3>Machine Learning and AI for DPI</h3><p>DPI leverages machine learning algorithms and artificial intelligence to enhance its ability to identify and respond to evolving threats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tIlMGAn_ShJOLoMU.jpg" /></figure><p>Machine learning algorithms enable the classification of network traffic by training models on known categories. These models can automatically identify and classify new traffic. Common algorithms used for this purpose include decision trees, support vector machines (SVM), and Naive Bayes classifiers.</p><p>Additionally, ML can assist in the automatic generation of signatures for known threats or applications. By analyzing historical data and patterns, ML models can create signatures that can be used to detect similar traffic in the future.</p><h3>SSL/TLS Interception</h3><p>DPI has evolved to inspect encrypted traffic, decrypting and analyzing the content of SSL/TLS-encrypted packets to ensure the security of the network.</p><p>A Solution for HTTPS Encryption Some firewalls now offer HTTPS inspections (Firewall SSL/TLS Interception), which would decrypt the HTTPS-protected traffic and determine whether the content can pass through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d8w7wxHm4Y_7CU6T.jpg" /></figure><p>According to the above illustration,</p><ul><li>The middle box (a firewall) decrypts the incomming packets from the Server or the client using its own a dynamic SSL certificate.</li><li>Then read the decrypted payload using above DPI methods and extract usefull information for application and threat detection.</li><li>Finally, it re-encrypt the packet using a certificate and forward to the receiving end.</li></ul><blockquote>Users’ browsers must trust this certificate, which is usually signed by a local certificate authority (CA) configured on the security device.</blockquote><h3>Applications of DPI</h3><h3>Application Identification</h3><p>DPI classifies and identifies applications running on a network, offering insights into application-level traffic patterns and enabling policy enforcement. This is most common because application wise traffic and usage monitoring is an essential need of any ISP. (Ex: ISPs offer data packages with high priority for business critical applications )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/0*LxxboWT9h3JGH_xK.jpg" /></figure><h3>Network Security</h3><p>DPI is a cornerstone of modern network security, providing the ability to detect and mitigate various threats, including malware, intrusion attempts, and data exfiltration.</p><h3>Quality of Service (QoS)</h3><p>DPI is crucial for managing network traffic, ensuring optimal performance for critical applications by prioritizing and allocating bandwidth based on application needs.</p><h3>Regulatory Compliance</h3><p>DPI assists organizations in adhering to regulatory requirements by monitoring and controlling the content of data traversing the network.</p><h3>Conclusion</h3><p>Deep Packet Inspection has emerged as a pivotal technology in the area of network security and management. Its ability to extract the content of data packets at a granular level provides invaluable insights for securing networks, optimizing performance, and ensuring regulatory compliance. However, the adoption of DPI comes with challenges, including privacy concerns and the need to adapt to evolving encryption technologies. As we discuss on the the cybersecurity field, DPI stands as a powerful tool, continually evolving to meet the demands of an ever-changing technlogies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6151865cf0c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital Camera Basics]]></title>
            <link>https://medium.com/@chandulanethmal/digital-camera-basics-2931fa558d63?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2931fa558d63</guid>
            <category><![CDATA[dslr-cameras]]></category>
            <category><![CDATA[digital-camera]]></category>
            <category><![CDATA[cameras]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Wed, 18 Jan 2023 13:55:49 GMT</pubDate>
            <atom:updated>2023-01-18T13:55:49.731Z</atom:updated>
            <content:encoded><![CDATA[<h3>Digital Camera</h3><p><strong>Note:</strong> I’m just a tech enthusiast, not an expert photographer</p><p>A digital camera is no longer a stranger item since it’s becoming a day-to-day appliance. It’s a device that captures photographs and videos using an electronic image sensor and stores the images and videos digitally, rather than on film.</p><p>One advantage is that you can see the images you have taken immediately after you have taken them because the images are displayed on a screen on the back of the camera. This allows you to check the composition of the image, and delete any that are not satisfactory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*7fa1osAAfP_FeioM.gif" /></figure><p>Digital cameras also offer a variety of shooting modes and settings that allow you to adjust the exposure, white balance, and other aspects of the image to get the desired result. We’ll discuss them later!</p><h3>Basic parts</h3><p>Almost every digital camera contains some common parts including a lens, a set of control buttons or scroll wheels, an LCD or LED display and batteries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*8DCCu7BfvlJkTTV7.jpg" /></figure><p>This image shows the basic parts we can see on a common DSLR type camera.</p><p><strong>Lens</strong></p><p>Set of optical elements(lenses) combined to give desired focal lengths and aperture sizes for photographers. Some camera types have an interchangeable lens(which can be detached from the body and replaced with another one) while others have fixed lenses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vLyV8aI6DbyjOzQv.jpg" /></figure><p>An interchangeable lens and a camera body without a lens</p><p>There are many different types of interchangeable lenses available,</p><ul><li><strong>wide-angle lenses</strong>: have a short focal length and are often used for landscape photography or to capture a wide field of view.</li><li><strong>telephoto lenses</strong>: have a long focal length and are often used for sports or wildlife photography, as they allow you to zoom in and capture distant subjects.</li><li><strong>prime lenses</strong>: have a fixed focal length and are generally smaller and lighter than zoom lenses</li></ul><p><strong>Viewfinder</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5MD0_i19bKrnqJJE.jpg" /></figure><p>It’s very difficult to see a scene from an LCD in a very bright daylight environment. That’s when the viewfinder comes to help which is used to view the target scene placing an eye on this place to do focusing and settings, before taking a photo. Some camera types have an optical setup(no electronics, just mirrors, prisms and lenses) while some types have a small LCD display for this.</p><p><strong>Image Sensor</strong></p><blockquote>Now this is another big topic to discuss ;)</blockquote><h3>Eye of a Digital Camera, Image Sensor!</h3><p>This is the most important component of a digital camera which converts light into an electric signal.</p><p>When capturing images with a digital camera, a small shutter opens, allowing light in for a fraction of a second. When he light hits the image sensor inside the camera, it reads color, contrast and other detail using an array of tiny little pixels and converts it into electric signals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*y4oNy8r2iB_Ijerv.jpg" /></figure><p>Real view of an Image sensor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EaQKCFIluFkQLB0k.png" /></figure><p>The process of making a digital image using light</p><p>There are two major types of image sensors used in cameras as CCD(Charged Couple Device) and CMOS(Complementary Metal-Oxide Semiconductor).</p><p>A sensor houses millions of tiny light-sensitive receptors called photosites — counted as megapixels or millions of pixels.</p><blockquote>Image quality(colors, contrast, details,..) highly depends on the physical size of the sensor. That’s why dedicated cameras (DSLR, mirrorless, bridge,..) are always better for quality images than mobile phone cameras(because phone cams have smaller sensors even if they have many megapixels).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uD8ONQn-hlZB-Wla.jpg" /></figure><p>Sensor size comparison for different camera types</p><h3>Camera Types</h3><p>If you ever think of buying a camera but don’t have a clear idea to choose the best camera for your purpose, let me enlighten you with some details. Digital cameras are available in a range of sizes, from compact cameras to larger, more complex models with interchangeable lenses.</p><ol><li>Point and Shoot Cameras</li><li>DSLR Cameras</li><li>Mirrorless Cameras</li><li>Bridge Cameras</li><li>Camera Phones</li></ol><p>They can be used for a variety of purposes, including casual photography, professional photography, and videography.</p><h3>1. Point and Shoot Cameras</h3><p>Point-and-shoot cameras, also known as compact cameras, are designed to be portable and easy to use. They are typically smaller and lighter than more advanced cameras and do not have interchangeable lenses. Often preferred by amateur photographers or those who do not want to spend a lot of time adjusting settings or changing lenses. They typically have a built-in flash and a zoom lens that can cover a range of focal lengths, from wide-angle to telephoto.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*C89kA2JKwvcG4LXg.jpeg" /></figure><p>Overall, point-and-shoot cameras are a good choice for people who want a simple, portable camera for casual photography and are not interested in the more advanced features and controls of larger cameras.</p><h3>2. DSLR Cameras</h3><p>A DSLR (Digital Single-Lens Reflex) camera is a type of digital camera that uses a mirror system to direct light from the lens to the viewfinder, allowing the photographer to preview the composition of the photograph before taking the picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*k77z7qZtfYSQAgvS.png" /></figure><p>DSLRs are popular among photographers because they offer a wide range of creative control, high image quality, and fast performance. Some of the key features of DSLR cameras are as follows.</p><p>FeatureDeatilsInterchangeable lensesHas a removable lens mount, allowing you to swap out lenses to achieve different focal lengths, apertures, and other effects. (Usually, lenses are very expensive :D )Manual controlsOffers manual controls for exposure, white balance, focus, and other settings, giving you greater control over the final imageViewfinderHave optical viewfinders which offer a clear view of the scene even in rough daylight conditionsHigh image qualityThey have larger image sensors. Therefore, produce high-quality images with good detail, dynamic range, and low noise, especially at low ISO settings</p><p>DSLR cameras are available in a range of sizes and price points, from entry-level models to professional-grade cameras.</p><blockquote>They are a popular choice among professional photographers and serious hobbyists.</blockquote><h3>3. Mirrorless Cameras</h3><p>A mirrorless camera is the latest type of digital camera that does not have a mirror or optical viewfinder like a traditional DSLR camera. Instead, it uses an electronic viewfinder (EVF) or an LCD screen to preview the image and display the camera’s settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FH07HZvKVtmB0pKA.jpg" /></figure><p>Mirrorless cameras have several advantages over DSLR cameras. They are generally smaller and lighter because they don’t have the large mirror and pentaprism required for an optical viewfinder. This makes them more portable and easier to carry around. They also tend to have faster autofocus and continuous shooting speeds because they don’t have to move a mirror(mechanicals) out of the way to take a picture. Additionally, the lack of a mirror allows for a shorter distance between the lens and the image sensor, which can result in better image quality and low-light performance.</p><p>Mirrorless cameras come in a range of sizes and prices, from high-end models with full-frame sensors and professional-level features to more affordable models with smaller sensors and more basic features. Many mirrorless cameras use interchangeable lenses, so you can choose the lens that best suits your needs.</p><blockquote>This is the modern alternative to DSLR cameras</blockquote><h3>4. Bridge Cameras</h3><p>A bridge camera is a type of digital camera that is designed to bridge the gap between point-and-shoot cameras and DSLR cameras. They are generally larger and more feature-rich than point-and-shoot cameras, but smaller and less expensive than DSLRs.</p><blockquote>Fun Fact: Bridge cameras are usually Mirrorless</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*AtHHs-xM48GOofpR.jpg" /></figure><p>Bridge cameras typically have a long zoom lens built into the camera body, ranging from 20x to 50x or more, which allows you to get close-up shots of distant subjects without having to change lenses. They also often have manual controls and a range of advanced features, such as manual focus, raw image capture, and the ability to shoot in different shooting modes (such as aperture priority and shutter priority).</p><blockquote>Bridge cameras are a good choice for photographers who want more control (But maybe not highly flexible like DSLRs) over their images than a point-and-shoot camera offers but don’t want to carry around the larger and more expensive equipment that comes with a DSLR. They are also a good option for travelers who want a single, versatile camera that can handle a wide range of shooting situations.</blockquote><h3>5. Camera Phones</h3><p>Definitely, you all are experts for this camera type, and no need for lengthy paragraphs. Camera phones are mobile phones that have built-in cameras. Many people now rely on their camera phones as their primary camera, using them to take photos and videos for personal and professional use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W1OSUJ6Iukj98IvL.jpg" /></figure><p>The main difference between phone cameras and the above camera types is the sensor size(Overall photo quality highly depends on this). The phone camera sensor size is relatively smaller to fit in a mobile phone.</p><p>Overall, camera phones are a convenient and versatile option for photographers of all levels. While they may not have the same level of control and image quality as a dedicated camera, they offer a convenient and easy-to-use way to capture and share photos and videos on the go.</p><h3>Structure and Operation of a Digital Camera</h3><p>I will explain a little about the inside of a typical DSLR camera using the below images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*_KpfqtmhAC074Gn4.jpg" /></figure><p>Step1. Light enters the camera via the front lens(a combination of lenses) and gets reflected by a mirror(which can be tilted up and down).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/0*KwO83-BRguHWbv1S.gif" /></figure><p>Step2. Then, the light enters a prism structure and is directed into the viewfinder at the top of the camera. This will helps the photographer to view the scene and do focusing and settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*HlHR64z9SG97IjW6.gif" /></figure><p>Step3. When the Capture button is pressed, the mirror will move upwards (mechanically) and allows the light to fall on the image sensor for a small period of time ( can be varied from minutes to a few nanoseconds) according to the shutter settings.</p><p>Step4. Then the sensor sends the digitally created image of the scene to a small computer unit inside the camera.</p><p>Step5. Voila…! After some image processing, the image will be stored in an SD memory card and can be reviewed on the LCD display…How fascinating!!</p><h3>Selecting the Best Camera for You</h3><p>Cameras are available in the market for different purposes(personal cameras, professional cameras, cinema cameras, camera drones, etc.) in different price ranges. So, after going through the above details of camera types, I guess, now you have some idea of the suitable camera type for you.</p><blockquote>Let’s take a look at the summary on camera selection.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oui1crSWUyI5Sxy6.jpg" /></figure><p><strong>Point-and-shoot; pros</strong>: Less expensive , Small in size <strong>cons</strong>: Quality is lower than DSLR/Mirrorless/Bridge, Do not have inter <strong>Best usage</strong>: for Travel or Personal moments photography, If you are an amateur and seeking a cheap camera</p><p><strong>DSLR; pros</strong>: Excellent Quality photos, Highly customizable settings, and control, Interchangeable lens <strong>cons</strong>: Expensive than others, Heavier and less portable, Difficult to use for beginners <strong>Best Usage</strong>: For professional photographers, Beginners hoping to enter the photography field, If you need more control over the settings</p><p><strong>Mirrorless; pros</strong>: Very good quality images(often the same quality as DSLRs), Lighter and more portable than DSLRs, Customizable Settings and lens are same as DSLR <strong>cons</strong>: Expensive than others, extra lenses can be very expensive, Difficult to use for beginners <strong>Best Usage</strong>: For professional photographers, Beginners hoping to enter the photography field, If you need more control over the settings</p><p><strong>Bridge; pros</strong>: High-quality images( higher than point-and-shoot), Excellent zooming capability, Cheaper than DSLRs, Offers many controls like DSLR, cheaper than DSLR/mirrorless <strong>cons</strong>: Less quality than DSLRs, no interchangeble lens <strong>Best Usage</strong>: Suitable for any kind of scenes:: casual, travel or wildlife photography, If you are seeking a less expensive cam but, with quality images, creative controls, and zooming</p><p><strong>Phone camera; pros</strong>: Highly portable, Easy to use,view and share images <strong>cons</strong>: Generally, quality is less than other cameras, and Cannot have much control over settings <strong>Best Usage</strong>: Suitable for casual photography and easy to use for anyone</p><p>I intended to cover the basic idea of a digital camera including the structure and composition of a camera, camera types, operation of taking a photo, and how to choose the most suitable camera for your need if you did not have an idea about camera types.</p><p>So, I hope you had an informative and awesome time reading this article. Do not hesitate to comment below your ideas regarding the content or any mistakes I’ve made within the article. Have a great time with your cameras!! :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2931fa558d63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Moon Illusion]]></title>
            <link>https://medium.com/@chandulanethmal/the-moon-illusion-be5e8212cecb?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/be5e8212cecb</guid>
            <category><![CDATA[illusion]]></category>
            <category><![CDATA[the-big-moon]]></category>
            <category><![CDATA[moon]]></category>
            <category><![CDATA[astronomy]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Mon, 06 Jul 2020 16:40:10 GMT</pubDate>
            <atom:updated>2020-07-06T16:40:10.814Z</atom:updated>
            <content:encoded><![CDATA[<p>We are going to discuss two really interesting phenomena for anyone curious about the Moon within this blog article! <br>It’s obvious that you normally tend to take a look at the moon when you just walk outside in a beautiful night, especially if there’s a full moon. While you enjoying this gorgeous view, have you ever noticed that, this same moon is appearing in different sizes in different days or different positions of the night sky?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*FmjqoOTdjl8hhxDx.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*UJxJU_ez3m3haqsw.jpg" /></figure><p>If your answer is yes and you are still keen to know the real science behind this phenomena, then you are just about to find out in a simplified manner. We can break this problem in to two cases. One case is something really happening in the physical space and the other case is something happening inside your brain which can be understood with some hypothetical(simplified) explanations.</p><h3>1. Super Moon</h3><p>A super moon is a full moon or a new moon which is having a slightly lager disk than the usual apparent size of the full moon you see from the Earth, happening due to the nature of the orbit of the moon around the earth. This moon’s orbit around the Earth is not a perfect cycle. It is an elliptical one having an average distance of 382,000km to the Earth. Scientists of NASA explain that the Earth, sun and all the other planets are exerting different gravitational pulling and pushing forces on the moon which give us the opportunity to have this elliptical orbit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*xTeZFdWc0NZTSfaC.jpg" /></figure><p>When the moon is at its Apogee position and it also at its full phase or a new moon, then this is called as a Micro-moon or a Mini-moon which may not be so familiar for you. In a similar but opposite manner, brightness will be reduced by 30 percent and disk size will be smaller than 14 percent than usual of a micro moon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*j45lOEvm4Lk5no_4.png" /></figure><p>Because of the elliptical orbit of the moon, it shows an oscillating nature in the distance to the Earth as the above graph with the time. As you can see, full moons are in dots and the new moons are illustrated in x makers. In the year 2020, you can see that there are two full moons having the closest distance to the Earth. Those were two super moons on 9th of March and 7th of April which you may have already watched from your own eyes.</p><h3>Is it the only reason?</h3><p>In the above section we discussed about one reason for moon to be appeared in different size than usual. However, it is not the only reason and super moons are not really show a huge size increment for human eyes. Anyway, at the super moon, you cannot catch a considerable apparent size increment of the moon but, its brightness increment will be very noticeable and really beautiful.</p><p>There is another reason which the image processing inside human brain makes us to believe that “Whoa! Moon is HUGE today!”. This is called as the <strong>Moon Illusion</strong> and in this article we are going to discuss the reasons behind it.</p><h3>2. The Moon Illusion</h3><p>This is an optical illusion which causes the moon to be appeared larger near the horizon than it appears in the higher sky(let’s say in the zenith). Many of you might have experienced this thing around a full moon day. Unlike in the super moon situation, this can happen regardless the distance to the moon from Earth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*p6IZzadkGW28llvS.jpg" /></figure><p>As in the above image, you see the moon larger near the horizon and it appears in usual size when it is away from horizon. That is the moon illusion and the real reason is still debated by scientists and several reasonable hypotheses are emerged to describe it fairly. Here we are going to discuss the two most reasonable explanations as follows.</p><p>* Apparent distance hypothesis</p><p>* Relative size hypothesis.</p><h3>2.1 Apparent Distance Hypothesis</h3><p>This theory purposes that the horizon moon seems larger than the moon at the zenith (right above our head) because it looks farther away. Does that make no sense to you?? Let’s say in your daily experience, an object overhead, like a bird or an aircraft flying by, appears closer and therefore larger than the same bird or aircraft near the horizon because it really is closer. Our brain built to think that objects near the horizon are (usually) more distant than those are above us because they appear to lie behind and beyond foreground objects. So the same image processing thing is happening inside our brain when we look at the moon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*_suSvSRR8CQCNsMC.jpg" /></figure><p>The same distance and size relationship deduction process happening inside our brain, cannot be used to very far object to us such as moon, sun or other celestial bodies because even if they appear from the horizon or zenith, there won’t be a considerable distance difference from us.</p><p>However, our brain tries to apply the same processing to build the distance-size relationship when we look at the moon and it thinks horizon moon is farther away than the zenith moon and it try to compensate the size of the moon by itself. Therefore, our brain makes us to believe the actual size of the moon at the horizon is larger than zenith moon even if the retinal image is same size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*TxU5gALo3h9FcfYl.jpg" /></figure><p>The background of the moon at the time we are looking at it also affect this size judging process inside our brain. Following image illustrates that effect. Most of us see the top Moon, seemingly located in the distance based upon the convergence of the railroad tracks, as larger than the bottom Moon. Yet they are identical. This is called as the Ponzo Illusion.</p><p>Now you see how marvelous is our brain. It can lie about what we see from our own eyes…Well that’s why it’s called as an illusion.</p><h3>2.2 Relative Size Hypothesis</h3><p>This is the next best explanation for the moon illusion, which says that, the perceived size of an object by the human brain is not only depending on the retinal image size, but also on the sizes of the surrounding objects which are in the immediate vicinity of our target object. So this effect is named as the Ebbinghaus illusion Do not get confused with the above definition. Let’s take a look in to this in a simple manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*eWFNIOUewMqXAmF6.png" /></figure><p>This image is an illustration of the Ebbinghaus illusion. Which orange color circle is the bigger one from two flower kind of patterns? The correct answer is; they are same in size. But, with the sizes of surrounding blue circles, many of you may see the right side orange circle is bigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*DhYOfRLFqfhCTc6K.gif" /></figure><p>This animation also shows the same effect more clearly with more steps. You may see the size of the orange color circle is decreasing when the surrounding circles are getting bigger. This means that, when the visual extent is smaller, a certain focused object may have perceived larger than the real size by our brain.</p><p>When we apply this to our scenario which is the moon in the horizon (which represents the smaller visual extent), can be represented as the right side pattern with smaller surrounding circles. Then the moon in the zenith (a larger visual extent) can be represented as the left pattern with larger surrounding circles. Therefore, we see the moon in the horizon larger because there the surrounding vicinity is smaller than the wide sky. Now I think you have a clear idea on why the horizon moon appears bigger than the zenith moon.</p><p>In this blog post we discussed two phenomena which cause the moon to be appeared in different sizes in the night sky. I hope you got a clear idea in both of them…Is that all????? Nope.</p><h3>How does the Moon Appear Big in Photographs?</h3><p>Now all the way I told that the big moon is just an illusion happening inside our brain. Then why the hell we see the moon very huge in some photographs just like the header image of this article and the following image??</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*WUE1XxSsNzbVK2rB.jpg" /></figure><p>This photo is a real one taken in Greece with a digital camera. Actually the moon can be captured with this kind of huge size in to photograph with a considerably good telephoto lens kit. But you need to move very far from the targeted objects. In above image you need to go far away from the building with the camera. Then zoom the building and the moon as the size you want with good details and take the shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*RMhowFIVAhfk0Elx.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*x8sp_YfDK_ynYPHS.jpg" /></figure><p>That’s all I have to share with you guys about the Moon Illusion. Feel free to ask any further details or something not clear to you regarding the content of the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be5e8212cecb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing a Micro Robot on a PCB]]></title>
            <link>https://medium.com/@chandulanethmal/designing-a-micro-robot-on-a-pcb-8fba993d647e?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fba993d647e</guid>
            <category><![CDATA[micro-mouse]]></category>
            <category><![CDATA[pcb]]></category>
            <category><![CDATA[micro]]></category>
            <category><![CDATA[robot-design]]></category>
            <category><![CDATA[robots]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Fri, 13 Dec 2019 16:48:51 GMT</pubDate>
            <atom:updated>2019-12-13T16:48:51.759Z</atom:updated>
            <content:encoded><![CDATA[<p>Micro robots are becoming popular in robotics and hobby electronics fields rapidly since they have several positive factors with comparison to the bulky designs. Generally, a design of a micro robot is heavily limited by its size and obviously by its hardware components because of they are designed to be light weight. Since these types of robots are designed according to a specific application like swarm-robots, micro mouse or even for educational purposes, we can design them with specific set of hardware which won’t get affected by above limitations that much. Designing of a micro robot can be bit difficult due to its highly compact nature. However, the same compact nature can make the assembling process easier and the building cost lower compared to a regular sized robot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*OdNCrich_7XejAzf.jpg" /></figure><p>One of the key advantages of these type of robots is that the whole hardware assembly can be done on a single circuit board or a stack of circuit boards. It makes them compact and cheaper. Here in this post I am going to discuss on designing a micro mobile robot with four wheels, which is targeted to be a general purpose development robot platform. I will explain the design considerations, how to design the modular schematics, PCB drawing and printing PCBs with a PCB manufacturing Company..</p><h3>Design Considerations of the Micro Robot</h3><h4>Base</h4><p>Basically my target was to design a four wheeled mobile platform with individual motor for each wheel and all the peripherals are embedded in a single printed circuit board. Actually the four wheeled design can also be achieved using only two motors with a simple gear plus bearing set rather than using four motors. However, there is some mechanical part over that implementation and therefore here I chose the simple individual motor design for each wheel. In addition to above two four wheeled designs, this kind of robots can be implemented with two driving wheels plus a free rolling caster ball or a caster wheel. Following images show different design approaches for the same kind of robot platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*T63RsOOGJwlekQL0.png" /></figure><p><strong>Motors and wheels</strong></p><p>Since we are interested in designing a micro robot, we cannot use large wheels or bulky motors with big gear boxes. In that case we have a huge advantage, because there’s no need of driving a heavy load due to the light weight design of the robot and still we are using four motors to drive that load. Speed of the motors is also a critical factor according to your application. Since I am designing a general purpose robot, according to my experience and the availability in the market, a considerably medium range RPM value such as 200RPM or 300RPM will be enough for my application.</p><p>In this case I used a two cell Li-ion or Li-Po battery (7.2V) as the power supply to the robot. Therefore, I selected 6V motors for my purpose. With above specifications I found micro metal gear motors with plastic brackets available in the online market. These motors are ideal for smaller robot designs since they can provide a desirable torque with the metal gear box.I found a set of plastic wheels which can be fitted in to the above motor shafts with the “D” shaped slot. Selecting the diameter is depending on your application. I chose the following wheels for my project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*yJbs68kxPCv828j4.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*ytPZK37bIwGDUMzm.jpg" /></figure><h4>Controller</h4><p>Obviously the heart of any kind of embedded system is its controller. It can be a microprocessor, micro-controller, FPGA or any kind of programmable logic device. For a micro robot, most of the time it will be a micro-controller since it’s easy to program using a common programming language /IDE and interface all the required peripheral devices to it through I/O pins. In the selection process of a matching microcontroller, first of all we need to identify the required processing power to handle all the processes.</p><p>In my design I have added an IR line detecting sensor panel (QTR panel) with 8 sensors, 4 front facing IR emitting LEDs and photo diodes to wall detecting task, 3 sonar sensors in three sides, 2 dual H bridge motor drivers for 4 motors, encoder reading interfacing for two motors, an IMU sensor, an I2C AMOLED display for monitoring or debugging purposes and additional I2C and UART ports for extensional purposes. For all the above mentioned peripheral devices, we need to have a considerable number of I/O pins from the microcontroller. Since it is cheaper and easy to deal with the Arduino IDE, I selected two Atmel Atmega328P-AU surface mounting microcontrollers which can make the design more compact. Communication between two microcontrollers is happening via I2C protocol. Motor controlling, IR sensor array reading, I2C slaves handling and some other tasks are assigned to one chip and the rest of are done by the other chip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/0*5t5wlpIKJRYkMsVN.jpg" /></figure><h4>Motor Controller</h4><p>As I discussed in the motor selection sub section, I need to control four DC micro metal gear motors with the specifications of 6V operating voltage and 1.5A stall current. Since this is a light weight application and need to control four motors, I selected MX1919 motor driver ICs with dual H bridges inside each package. They are available in the market at a very cheap cost and can operate in the 2V-10V supply voltage range. Each H bridge is capable of driving a maximum current of 2.5A. I used two of these ICs for my design. Main advantage of this model is, we can complete the motor driver with lesser amount of extra components other than the IC itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*c349iWwrNcdInwwm.jpg" /></figure><p><strong>Critical Components for the Design</strong></p><p>ATMEL Atmega 328p-AU microcontrollers</p><p>MX1919 dual H-bridge motor drivers</p><p>Micro Metal Gear DC Motors (6V brushed)</p><h3>Modular Design Approach</h3><p>The next step of our design process is implementation of the CAD drawings of the whole robot’s circuit schematics. Since this is a considerably complex circuit with a large number of components, the best approach is to broke the whole schematic into small modules and connect them through the labeled nets. In my design there are three circuits as follows and used the Altium Designer 16.0 electronic design software package for this design.</p><p>1. Main controller module and power distribution</p><p>2. Sub controller</p><p>3. Motor controller</p><p>We will discuss each of them briefly as following.</p><h4>Main controller module</h4><p>This schematic is based on the first Atmega 328P micro controller chip and its peripheral interfaces. QTR panel, encoder reading for one motor, ISP programming interface, I2C port, UART port for Bluetooth communication or FTDI programmer interface are the features included in this module. Other than that, we have the power distribution circuit as well within this module. Since all the sensors we are using and the two Atmega328 chips are working on 5V we need to regulate 5V from the Li-Po battery we are going to use as the power source. Therefore, I placed several ports for plug a switching buck converter and several other switches including main power switch and the motor controller power switch in this module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*H2VIDm2gcfHdzpky.jpg" /></figure><h3>Sub controller Module</h3><p>The second Atmega micro-controller and its peripherals are the main parts of this module. Wall or obstacle detecting front 4 IR sensors, 3 sonar sensors into three sides, Encoder readings for one motor, a buzzer, I2C interface, UART interface for FTDI programming and ISP programming interface are the peripherals which get connected to the second micro-controller chip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*CTFfiU9p8BGhhZQa.jpg" /></figure><h3>Motor Controller</h3><p>As we discussed earlier, I have used two MX1919 dual H bridge motor controlling ICs in my design. Since this IC package contains most of the components needs to implement the dual H bridges, we have to place only two zenar voltage regulators and two capacitors to complete the motor controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*MiWC9Z6Ffxat6HhE.png" /></figure><p>Competed Circuit schematics can be found in the following link:</p><p><a href="https://github.com/ChandulaNethmal/MicroBot-1">https://github.com/ChandulaNethmal/MicroBot-1</a></p><h3>PCB Design</h3><p>After completing the schematic designs by connecting each module on separate sheets using labels for each net, we need to do the most difficult and time consuming task of the project which is the PCB designing part. Here I used the Altium PCB designer to do the task. Since there are lots of components to be integrated in a small circuit board, organization of the component assembly is very critical. First of all, we need to define a board shape according to our purpose and shape. I chose a simple shape as the following images shows. In the front of the robot I placed the QTR panel, IR sensors, Sonar and two micro-controller chips. Then four motors are placed in the rear side of the board considering wheel and motor dimensions. Motor controlling part is placed in the middle of the PCB and power management and switches are placed in the far rear side of the PCB. You can customize this orientations according to your need.</p><p>For the routing purpose I selected a two-layer PCB design since we have to route a complex circuit in a small space. Thicknesses of each copper trace is very important because they must be capable of carrying different amount of currents according to the type of the trace. As an example, a copper trace carrying current to a motor must be capable of carrying at least the stall current of that motor. Micro-controller I/O traces may be thinner than a power supply traces since they are carrying a less amount of current.</p><p>Finally, I added a Copper polygon pour to both top and bottom copper layers and assigned labels and texts to each port and component on the Top overlay layer (Silk layer) and competed the design by placing some mounting holes for motor brackets and the PCB itself.</p><p>Following images shows that the both sides of the PCB from the design view and 3D view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/0*13TqEQxn3Th5EfQI.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/0*zxjDIPISB6HI03ai.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/0*D1K_ij-hQ8jQOIgi.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/0*1DnggSsm6i4GrzQI.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*83_O3a__FUZrVzU9.jpg" /></figure><p>Legacy 3D view of the PCB</p><p>You can find the completed Altium PCB drawing from the following link:</p><p><a href="https://github.com/ChandulaNethmal/MicroBot-1">https://github.com/ChandulaNethmal/MicroBot-1</a></p><h4>Printing the PCB with PCBWay</h4><p>After completing my PCB design, I chose a leading PCB Manufacturing company in China called the PCBWay to get printed my Micro Robot’s PCB since they are recognized over the world as one of the best quality PCB manufacturers with so many additional services at a fair price. In my next post I will discuss how to generate the Gerber files of this PCB design to send for manufacturing to the manufacturers.</p><p><strong>Services of PCBWay</strong></p><p><strong>1. PCB prototyping and manufacturing</strong><br>They can not only produce FR-4 and Aluminum boards, but also advanced PCB like Rogers, HDI, Flexible and Rigid-Flex boards, with very reasonable price. Online instant quote page — <a href="https://www.pcbway.com/orderonline.aspx">https://www.pcbway.com/orderonline.aspx</a><br>Online Gerber viewer: <a href="https://www.pcbway.com/project/OnlineGerberViewer.html">https://www.pcbway.com/project/OnlineGerberViewer.html</a><br>PCB manufacturing process: <a href="https://www.youtube.com/watch?v=_GVk_hEMjzs">https://www.youtube.com/watch?v=_GVk_hEMjzs</a><br><strong>2. PCB assembly</strong><br>SMT &amp; THT assembly, starts from only $30 with free stencil and free worldwide shipping.<br>The components can be sourced and provided by us, or by clients themselves<br>Rough quote online — <a href="https://www.pcbway.com/pcb-assembly.html">https://www.pcbway.com/pcb-assembly.html</a><br>Factory video — <a href="https://www.youtube.com/watch?v=24ehoo6RX8w">https://www.youtube.com/watch?v=24ehoo6RX8w</a><br><strong>3. Layout and design</strong><br>Partnering with quality service providers to offer design services — <a href="https://www.pcbway.com/design-services.html">https://www.pcbway.com/design-services.html</a><br><strong>4. Open source community</strong><br>Student sponsorship , shared PCB projects and so on. — <a href="https://www.pcbway.com/project/">https://www.pcbway.com/project/</a><br><strong>More details:</strong><br><a href="https://www.pcbway.com/why.html">https://www.pcbway.com/why.html</a><br><a href="https://www.pcbway.com/capabilities.html">https://www.pcbway.com/capabilities.html</a><br><a href="https://www.pcbway.com/high-quality-pcb.html">https://www.pcbway.com/high-quality-pcb.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fba993d647e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Raspberry Pi Live Video Streaming with Pi-Camera]]></title>
            <link>https://medium.com/@chandulanethmal/raspberry-pi-live-video-streaming-with-pi-camera-49a98ee51b4b?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/49a98ee51b4b</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[live-streaming]]></category>
            <category><![CDATA[picam]]></category>
            <category><![CDATA[pi-camera]]></category>
            <category><![CDATA[videostream]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 03:10:41 GMT</pubDate>
            <atom:updated>2019-11-18T03:10:41.198Z</atom:updated>
            <content:encoded><![CDATA[<p>Nowadays people are paying their attention to work with Single Board Computers (SBCs) for their projects rather than using large computers or bunch of micro-controllers inside a limited space. There are several reasons behind this. These SBCs are highly integrated circuit boards with many kinds of microprocessors, memory chips, GPIO (Input/output) features with different communication protocols and etc. within a small single printed circuit board. Considerably high computational power with essential external interfacing I/O features and low power consumption makes these kinds of circuits are ideal for robotics, IoT, Machine learning and many other portable applications. Here we are going to work on a considerably advanced project using a Raspberry Pi SBC which I was implemented as a sub part of one of my university projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*oAJlOXnH7tSZkS0d.jpg" /></figure><p>Therefore, in this blog post I am discussing about setting up a Raspberry Pi computer and use it for a useful and interesting project related to basic robotics and many embedded systems.</p><h3>Setting Up Raspberry Pi</h3><h4>Step1:</h4><p>Here we are going to flash Raspbian operating System to a Raspberry Pi SBC. I used a Raspberry Pi 3 Model B platform and a 16GB microSD card for the process. For our application any available version of RPi will be okay and at least 8GB microSD card is required. There are two steps to install Raspbian in to Raspberry pi.</p><p>1. 1. You need to download latest Raspbian image file to your computer from official website. (The latest version is Raspbian Buster July 2019 is for this date) I recommend to download ‘Raspbian Buster with desktop and recommended software’ option from the following link since there is a valuable software pack in it. After download the image file, write it to your microSD using ‘Win32DiskImager’ software.</p><p>Link:<a href="https://www.blogger.com/goog_1320614618"> </a><a href="https://www.raspberrypi.org/downloads/raspbian/">https://www.raspberrypi.org/downloads/raspbian/</a></p><p>2. 2. Online Installing process with NOOBS which is an easy operating system installer.</p><p>Link: <a href="https://www.raspberrypi.org/downloads/noobs/">https://www.raspberrypi.org/downloads/noobs/</a></p><h4>Step2:</h4><p>After successfully installing Raspbian into your microSD card plug it into your RPi and connect a Display through HDMI port, a USB mouse, a Keyboard and finally a 5V 2.5A micro USB power supply. It will boot up after several seconds with an initialization process.</p><p>After a successful bootup to the Raspbian desktop, you have to do several configuration setups to enable camera interface.</p><p>Open up a terminal window and enter following command to enable camera interface.</p><p><em>$ sudo raspi-config</em></p><p>This will open a new configuration interface with several options. You need to go the ‘Interfacing options’. There you will see several interfaces like SPI, VNC, Camera, SSH, I2C, Serial and Remote GPIO. Enable Camera interface and SSH(Secure Shell interface) from the above list. Here we enabled SSH of RPi in order to remotely access to our Pi from a computer. We will cover enabling camera step in the following topic.</p><p><strong>Interfacing the Pi Camera</strong></p><p>Now we are going to work with Raspberry Pi camera. In different models of RPi computers there is a dedicated socket for interfacing a camera. You need to connect the Pi camera to the Camera interface of your Raspberry Pi through the ribbon cable connector carefully as the following picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*qVlXUGv16htgkwSo.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*cJr2lCQPl6OMoxQ1.jpg" /></figure><p>Now make sure you enable the Camera interface on your pi following below steps.</p><p>Open a terminal and type</p><p><em>$sudo raspi-config</em></p><p>It will open the raspberry pi configuration window with several kinds of settings. You need to navigate through the menu using arrow keys to the Interfacing Options and select it by hitting enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*y3-Cpam-OlpWuHRr.jpg" /></figure><p>Then, enable the camera interface as you see in the following screen shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*CDeu2cxdzSQwsEkS.jpg" /></figure><p>Finally, finish configuration by saving the settings. It will ask to reboot your pi while quitting. Hit “yes”.</p><p>After successfully interfacing the camera to the RPi you can play with several python scripts which are related to Pi camera including taking photo stills, Videos, sequence of stills, and some other interesting activities which can be important for your projects. I am not going to go through these codes. You can find these basic scripts in the link below..</p><p><a href="https://github.com/ChandulaNethmal/Pi_Camera/tree/master/Pi_cam">https://github.com/ChandulaNethmal/Pi_Camera/tree/master/Pi_cam</a></p><p>Now we need to connect our raspberry pi to a local are network (i.e. through Wifi or Ethernet) selecting available connections. Not only the Pi, the computer which you are going to use to watch the live video also must be connected to the same local area network.(i.e. to the same wifi hotspot).</p><h3>Live Streaming with Pi Camera</h3><p>Here we are focusing on transmitting a video stream capturing from the pi camera to a computer or mobile phone via a local network in real-time.</p><p>First of all, let’s take a look at the python Script. Following is the first part of the code which is creating the web interface to the live stream receiver side.</p><p>PAGE=”””\</p><p>&lt;html&gt;</p><p>&lt;head&gt;</p><p>&lt;title&gt;Raspberry Pi — Live Stream&lt;/title&gt;</p><p>&lt;/head&gt;</p><p>&lt;body&gt;</p><p>&lt;center&gt;&lt;h1&gt;Raspberry Pi — Live Stream&lt;/h1&gt;&lt;/center&gt;</p><p>&lt;center&gt;&lt;img src=”stream.mjpg” width=”640&quot; height=”480&quot;&gt;&lt;/center&gt;</p><p>&lt;/body&gt;</p><p>&lt;/html&gt;</p><p>“””</p><p>Here we are taking the stream in to a web page according to the above HTML formatting. Title of the page is “Raspberry Pi — Live Stream” as you can see in the fourth row. We are taking the source of stills sequence from the code which is defined as “stream.mpeg”, which is having a width of 640 pixels and height of 480 pixels in the center of the window.</p><p>class StreamingOutput(object):</p><p>def __init__(self):</p><p>self.frame = None</p><p>self.buffer = io.BytesIO()</p><p>self.condition = Condition()</p><p>def write(self, buf):</p><p>if buf.startswith(b’\xff\xd8&#39;):</p><p>self.buffer.truncate()</p><p>with self.condition:</p><p>self.frame = self.buffer.getvalue()</p><p>self.condition.notify_all()</p><p>self.buffer.seek(0)</p><p>return self.buffer.write(buf)</p><p>Let’s define a python class called “StreamingOutput” containing two functions for initializing and writing the buffered frames.</p><p>Other than the above class, we are defining several other classes as StreamingHandler and StreamingServer. In the streaming handler we are maintaining the live stream with HTTP requests and image data sending. Streaming Server will keep the server function in the network and maintain the threading.</p><p>with picamera.PiCamera(resolution=’640x480&#39;, framerate=24) as camera:</p><p>output = StreamingOutput()</p><p>#Uncomment the next line to change your Pi’s Camera rotation (in degrees)</p><p>#camera.rotation = 90</p><p>camera.start_recording(output, format=’mjpeg’)</p><p>try:</p><p>address = (‘’, 8000)</p><p>server = StreamingServer(address, StreamingHandler)</p><p>server.serve_forever()</p><p>finally:</p><p>camera.stop_recording()</p><p>Finally, we have the main code which is continuously running. Here we are defining the resolution and frame rate of each frame at the beginning as “640x480” and “24fps”. You can change these two parameters according to your needs, but there are some limitations in the setup. Processing power of both RPi and Camera cause limitation of FPS and resolution. Even if the quality will increase with the resolution, it causes higher delays between frames depending on the LAN(WiFi) connectivity strength. Then we are defining the streaming server address as “IPV4_address_of _ur_pi,port”. Here we define our port as “8000” and the IPV4 address will depend on your local network and it will automatically assign.</p><p>You can download the full Python Script from this link.</p><p><a href="https://github.com/ChandulaNethmal/Pi_Camera/tree/master/Live_streaming">https://github.com/ChandulaNethmal/Pi_Camera/tree/master/Live_streaming</a></p><p>Now we are going to run the code on the Raspberry pi node through the Raspberry pi Terminal.</p><p>You will see something like following screenshot after that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*yYJ5ASFiRMjYKZ9t.jpg" /></figure><p>Congrtulations!………….You have successfully deployed the live streaming server.</p><p>Now we need to access to that server through another computer/mobile phone using a web browser. Open your web browser from a laptop or desktop computer or mobile phone while keep running the camera stream of our previous setup. In the web browser enter the following address in the URL typing bar according to your” Rpi_ipv4_address:Port” as the following example of mine.</p><p>192.168.1.4:8080</p><p>It will bring the web page we created in the very first of the python code and the live video frames from your PI Camera as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*9l91Noi-mT7TTlZO.jpg" /></figure><p>Now we have successfully deployed our project with the pi camera. You can use this setup in various projects such as a surveillance system with RPi, teleoperating robots and so on. Also you can change basic setting of the video in the python scripts and adjust the stream according to your requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49a98ee51b4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginning FPGA programing with Verilog]]></title>
            <link>https://medium.com/@chandulanethmal/beginning-fpga-programing-with-verilog-b58724c88aba?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b58724c88aba</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[pld]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[verilog]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Thu, 05 Sep 2019 01:50:07 GMT</pubDate>
            <atom:updated>2019-09-05T01:50:07.189Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous posts I have introduced Programmable Logic Devices(PLDs) and FPGAs which is a sub category of PLDs. Here I am going to show you how hardware implementation should be done with several basic examples with codes which I have done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*nl5cgnfgTi20YbI5.jpg" /></figure><p>As a recap of previous posts, Field Programmable Gate Arrays, is a programmable logic device that is used to make hardware designs using programming. The software associated with it provide the user with the ability to implement his design in hardware level using behavioral programming.</p><h3>VERILOG</h3><p>In this case I have used Verilog HDL. Verilog is a Hardware Description Language (HDL) which can be used to describe digital circuits in a textual manner. Learning Verilog is not that hard if you have some programming background. VHDL is also another popular HDL used in the industry widely. Verilog and VHDL share more or less same market popularity, but I chose Verilog since it is easy to learn ,it’s syntactical similarity to C language and most of our university assignments are recommended to do in Verilog. Once you are comfortable with Verilog, it should be easy learn VHDL as well.</p><p>Following is a little comparison between VHDL and Verilog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*EPftIpAEB-Cqa_JN.jpg" /></figure><p>If you are a begginer for Verilog programming you can learn Verilog easily througth this link.<a href="http://beginning%20fpga%20programing%20with%20verilog%20in%20my%20previous%20posts%20i%20have%20introduced%20programmable%20logic%20devices%28plds%29%20and%20fpgas%20which%20is%20a%20sub%20category%20of%20plds.%20here%20i%20am%20going%20to%20show%20you%20how%20hardware%20implementation%20should%20be%20done%20with%20several%20basic%20examples%20with%20codes%20which%20i%20have%20done.%20%20as%20a%20recap%20of%20previous%20posts%2C%20field%20programmable%20gate%20arrays%2C%20is%20a%20programmable%20logic%20device%20that%20is%20used%20to%20make%20hardware%20designs%20using%20programming.%20the%20software%20associated%20with%20it%20provide%20the%20user%20with%20the%20ability%20to%20implement%20his%20design%20in%20hardware%20level%20using%20behavioral%20programming.%20%20verilog%20in%20this%20case%20i%20have%20used%20verilog%20hdl.%20verilog%20is%20a%20hardware%20description%20language%20%28hdl%29%20which%20can%20be%20used%20to%20describe%20digital%20circuits%20in%20a%20textual%20manner.%20learning%20verilog%20is%20not%20that%20hard%20if%20you%20have%20some%20programming%20background.%20vhdl%20is%20also%20another%20popular%20hdl%20used%20in%20the%20industry%20widely.%20verilog%20and%20vhdl%20share%20more%20or%20less%20same%20market%20popularity%2C%20but%20i%20chose%20verilog%20since%20it%20is%20easy%20to%20learn%20%2Cit%E2%80%99s%20syntactical%20similarity%20to%20c%20language%20and%20most%20of%20our%20university%20assignments%20are%20recommended%20to%20do%20in%20verilog.%20once%20you%20are%20comfortable%20with%20verilog%2C%20it%20should%20be%20easy%20learn%20vhdl%20as%20well.%20following%20is%20a%20little%20comparison%20between%20vhdl%20and%20verilog./">Click here to learn Verilog</a></p><h3>Development board</h3><p>Here I have Used Altera (now it’s Intel) DE2–115 development board which has plenty of peripherals for our purpose. This has a Altera’s Cyclone IV FPGA chip. DE2 board is little bit expensive. However, we were able to borrow them form our university labs. You can use a cheaper board like Altera DE0-nano board rather than DE2 which also contain the same cyclone IV FPGA chip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*obmDZzHszlSu7M-0.png" /></figure><p>DE2–115 board</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*V3smC3E_eZ3k17lp.jpg" /></figure><p>DE0-nano board</p><p>There are 27 user controllable green and red LEDs , 18 sliding on/off switches and 4 push button switches . In this board and most of other FPGA development boards contain separated GPIO (General Purpose Input output) pins which can be used to connect external peripherals such as LEDs or switches. So, you should not be worry about onboard peripherals of your board a lot.</p><p>You can download user manual ,driver software and other important information about the board from following links.</p><p>Download DE2–115 User manual</p><p><a href="https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&amp;CategoryNo=139&amp;No=502&amp;PartNo=7">View details about DE2–115 board</a></p><h3>Design flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*IOBZppeZeSDNs1E9.png" /></figure><p>Typical design flow for hardware implementation is according to the above figure. You can get more knowledge on this flow with <a href="https://www.blogger.com/blogger.g?blogID=1114103411616807861#editor/target=post;postID=3530673224381499457">this link</a> .</p><p>Let’s begin with a simple example which is a simple adder. In order to write the Verilog code, we can use a simple text editor such as windows note pad or using the smart text editor in an Electronic Design software tool which is specializes in Verilog coding.</p><h4>Design</h4><p>We are going to implement a one-bit full adder using Verilog. So, first of all you need to identify the need and make the flow of a adder using textual manner using Verilog syntax.</p><p>We are adding two bits and a carry-in bit and assign output in to two bits which are called sum and carry-out. There should be 3 input variables and 2 output variables. Here I have used behavioral model and assign outputs to the sum of all three inputs at ones. Using any text editor copy these Verilog code given bellow and save it as “full_adder.v”.</p><p>module full_adder(</p><p>input x,</p><p>input y,</p><p>input cin,</p><p>output z,</p><p>output cout</p><p>);</p><p>assign {cout,z} = cin + x + y;</p><p>endmodule</p><h4>Create a new project</h4><p>Next, we will take the design we have created, to a specialized software suite where we can generate</p><p>the hardware requirement and deploy it on the FPGA. Because of we are using an Altera FPGA, we will use a compatible software suite called Altera Quartus II for our board. I assume you have properly installed Quartus II downloaded from Altera web site or from the Software disk comes with a development board.</p><p>If you don’t have the software you can download web(free) edition with following link by registering in to the Altera site. <a href="https://www.altera.com/downloads/software/quartus-ii-we/120.html">Download Altera quartus II v12.0</a></p><p>First go to “File” menu in in upper toolbar and select “new”. There u will see a new window with list of file type will appear and you must select “new quartus II project” and click “OK”.</p><p>Then a new project wizard window will appear. you should give a path and a name for the project. Top Level entity name also automatically changed with project name.</p><p>In the next tab you should give the path to our “full_adder.v” file and click “add”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*gTzX0rXhe9qgRI1K.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*MbZLaFf0nVlNvQl_.png" /></figure><p>Next you should select the FPGA type according to your Development board or separated FPGA. Here we are using a Cyclone IV E FPGA and you can find the exact name of the device from their user manual or the box of the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*F282nUX5hEZAQ5DQ.png" /></figure><p>After that there will be another two windows to complete the setup. You can skip them by clicking “Next” twice and finish the setup. Then the working area will appear with several pallets containing project details and files as the following image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*Iv3vvyBWZ8QkuBxL.png" /></figure><p>In the left side “project Navigator “panel, you will see the project files and the hierarchical design of the project. There the only module in this project “full adder” module is already assigned as the “top Level entity”. From the files tab you can select our Verilog file and do any change you want to do.</p><p>Next we should assign pins for the inputs and outputs.</p><h4>Pin planning</h4><p>In order to assign the actual pins of FPGA,</p><ol><li>Select <strong>Processing<em>&gt;</em>Start<em>&gt;</em>Start Analysis and Elaboration</strong>. The tool will analyze the design and inform you of any warnings or errors in the design.</li><li>Select <strong>Assignments<em>&gt;</em>Pin Planner </strong>to edit the pin assignments. You must see the output pins of our full adder design as shown below.</li></ol><p>According to the user manual of the device you should identify which pins are assigned in to which peripheral and fill them in the location column of the table. Here we need only three switches as inputs and two LEDs as the output bits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*o4-6qYLDOB8Kt8cF.png" /></figure><p>Here I have given some pin assignments of the DE2–115 board into Cyclone IV FPGA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*e7_AAU5tASqba-O9.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*0u54m82kdpLh2A3b.png" /></figure><p>As you fill the table in you will notice that the pin assignment diagram changes according to that automatically. The newly assigned pins will be highlighted in red. Furthermore, the rows in the table will be colored according to the physical location of the pin on the FPGA.</p><h4>Compilation</h4><p>After completing the above steps for the design, it should be uploaded to the FPGA as a bitstream. In order to do so, we need to compile the design as follows. Go to <strong>Compilation<em>&gt;</em>Start Compilation </strong>in the main Quartus II window. An automated toolchain starts which will translate the Verilog description in to a digital circuit, place the circuit into the FPGA and route the wire connections between logic elements and registers.</p><p>If everything has been set up properly, the compilation process should finish successfully without giving any errors or critical warnings</p><p>.<br>You could get a series of timing and utilization reports at each point of the compilation process and as shown below the final resource usage as the flow summery report will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*zrOaILgR9E2_g1z6.png" /></figure><h4>Program Hardware</h4><p>After compilation we need to upload the bit-steam to the FPGA using a inbuilt programmer of the Quartus II software.</p><p>Go to <strong>Tools &gt; Programmer </strong>and open the programmer window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*uI9tzUWC3BBaFLep.png" /></figure><p>There you will see a uploadable bitstream file named “<strong>full_adder.sof</strong>” will have been added to the programmer. If there is no such a file you have to add the file manually from the “add file” button.</p><p>So, we need to add our device. Plug the USB cable to FPGA board and connect it to the computer and powerup the Board with standard power supply for the board . Make sure you have installed popper drivers of the development board to the computer. Then go to the “<strong>Hardware setup</strong>” and select your board there and hit ” close”.</p><p>Finally click the “<strong>start</strong>” button and it will upload the bit stream to the FPGA.</p><p>You can verify the design giving input bits using switches which you have assigned for the inputs and observing the results of sum and carry out bits using two output LEDs.</p><h4>Simulate the Design</h4><p>According to the design flow we have another intermediate step before the programming step called “ simulation”. In order to simulate the project we need to write another code which is called a “<strong>Test bench code”</strong> with Verilog syntaxes. These codes are Verilog programs which are designed not towards building digital systems, but for testing them.</p><p>You might remember that the our “full_adder” module we built in a previous step had inputs and outputs to communicate with the outside world using switches and LEDs. A testbench can be thought of as a bigger module which exists around the full_adder, connects to its ports and receives values. Usually a testbench has no ports for the outside, since it is supposed to be an independent isolated system.</p><p>Go to <strong>files&gt;new &gt;Verilog HDL file </strong>and copy following testbench code there. Save the file as “full_adder_tb.v”.</p><p>module full_adder_tb;</p><p>reg x, y; // Inputs</p><p>reg cin;</p><p>wire sum; // Outputs</p><p>wire cout;</p><p>// Unit Under Test (UUT)</p><p>full_adder uut(x,y,cin,sum,cout);</p><p>initial</p><p>begin</p><p>// Initialize Inputs</p><p>x = 0;y= 0;cin = 0;</p><p>#10</p><p>// Wait 100 ns for global reset to finish</p><p>X=1;y=0;cin =1;</p><p>#10</p><p>X=0;y=1;cin=0;</p><p>#10</p><p>$finish;</p><p>end</p><p>endmodule</p><h4>Run the simulation</h4><p>After adding the testbench file we are going to run the simulation using Altera’s simulator software called “ModelSim”. Quartus II software suite includes this third party simulation tool , which is one of the most powerful simulation tools existing in the industry.</p><p>In order to open simulator go to ,<strong>Tools<em>&gt;</em>Run Simulation Tool<em>&gt;</em>RTL Simulation </strong>which will open ModelSim . After that a new window will open with ModelSim and there is the <strong>Library </strong>tab on the left side o the window. Go to “work” library and see whether full_adder module is there. Selecting that will open the inputs and output variables</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*jf28NCX3ZTPsvh3r.png" /></figure><p>Then right click the Test Up Counter module in the Work library and select <strong>Simulate option .</strong> The software will initialize a simulation of the module, you will see <strong>Objects </strong>and <strong>Processes </strong>windows fill up with new entries and a new <strong>simulation </strong>window will open parallel to the <strong>Library </strong>window. You can add one or several variables to the Wave window and adjust the <strong>Run Length</strong> according to your test bench code run time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*pI3LOcXVSV8jQg2C.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b58724c88aba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programming Atmega 328P chip with an Arduino board as an ISP programmer]]></title>
            <link>https://medium.com/@chandulanethmal/programming-atmega-328p-chip-with-an-arduino-board-as-an-isp-programmer-c6fbd895576d?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6fbd895576d</guid>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[isp]]></category>
            <category><![CDATA[atmega328]]></category>
            <category><![CDATA[standalone]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Fri, 16 Aug 2019 03:02:39 GMT</pubDate>
            <atom:updated>2019-08-16T03:02:39.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*GFXrzsEr8VU6-aJA.jpg" /></figure><h3>Here we are using an Arduino UNO board to program the Atmega 328PU chip. UNO board is acting as an ISP (In System Programming) programmer to program the chip on a bread board or on a PCB. This method allows to program a microcontroller while it is installed in a system.</h3><h3>Step1:</h3><p>Open Arduino IDE and go to Examples =&gt; ArduinoISP and there you can see the ArduinoISP example sketch.</p><p>Open this sketch in a new tab and upload it to the Arduino board which you are going to use as the ISP programmer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*M0lbffcSjcDa19ZA.png" /></figure><h3>Step2:</h3><p>After a successful uploading, connect your ATMega328p chip to several other components as following image. Here I have used an Arduino Uno board as the programmer. But you can use any other Arduino board for this. In that case pin connecting diagram will be differ according to the chip of the Arduino board.</p><p>There are two methods for the next step.</p><p>a. The ATMega chip on the programmer Arduino board should be removed from the board.</p><p>b. But if you have an Arduino clone board with a non-removable surface mounted Atmega chip, you need to connect the reset pin of the programmer Arduino board to the ground through a capacitor (here I used a 10uF one) as the image shown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*EU-tkdhbeXH0TaGb.png" /></figure><h3>Step 3:</h3><p>If your target ATMEGA 328P does not contain the Arduino bootloader, you need to upload it as follows. (If your 328P chip already contain the bootloader, you can skip this step).</p><p>Go to Tools=&gt; programmer and then select ‘Arduino as ISP’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*aq_GamSkf_F5SWUa.png" /></figure><h3>Arduino board as an ISP programmer</h3><p>1 Now you already have an Atmega 328 chip with the boot loader. Next step is to program this chip using an Arduino board as an ISP programmer.</p><p>Open the Arduino sketch which you want to upload. Connect the chip in the same configuration in above figures which you used to upload the bootloader. You need to upload ArduinoISP to the Arduino board and select programmer as ‘Arduino as ISP’ from tools tab.</p><p>Then go to the sketch tab and click on ‘Upload Using Programmer’. It will upload the sketch to the chip on the breadboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/0*xwnQk_d9_-P9PVOw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6fbd895576d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UART Communication Link Implementation with Verilog HDL on FPGA]]></title>
            <link>https://medium.com/@chandulanethmal/uart-communication-link-implementation-with-verilog-hdl-on-fpga-b6e405c5cbd8?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6e405c5cbd8</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[verilog]]></category>
            <category><![CDATA[uart]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[fpga]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Fri, 16 Aug 2019 02:59:50 GMT</pubDate>
            <atom:updated>2019-08-16T02:59:50.335Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is regarding a HDL implementation of a UART(Universal Asynchronous Receiver Transmitter) for one of our university fourth semester projects. This was a group project of four group members. My group members are Chirath Diyagama, Isuru Nuwanthilaka and Dileepa Sandaruwan. For the project we were supposed to implement a UART link for a FPGA development board using Verilog as the HDL and send some data to another FPGA development board which also have a UART implementation. Here we used a Used a Digilant Atlys FPGA development board with a Xilinx FPGA. That board is actually expensive to buy. But we burrowed that one from our laboratory for this project. There is no problem if you want to implement this using another board.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*iKdSIOWGWu4ZuBCx.jpg" /></figure><p>Here we actually doing a bi-directional asynchronous communication between two FPGA board. Atlys FPGA board has certain number of switches as internal peripherals. We used each of them to represent a binary value. Using 8 switches we sent 8bit data words to other board. Then there are 8 LEDs assigned in to the output of the receiver and it will display the received data using that LEDs. After the communication between two boards we will talk about communication between a FPGA board and a Computer through USB connections. In order to do so the only need is a USB to UART bridge for your board. There are so many cheaper boards with Xilinx and Altera chips which you can find from online sites.</p><h3>UART data frame</h3><p>The structure of a UART frame can be illustrated as the above. Normally the data field can be varied from 4 bits to 9bits. There can be occupied a parity bit also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*4Kk4LhhcPNGlYFOH.png" /></figure><p>When we consider the UART data frames that has several data fields. Here we are using only these fields.</p><p>● Start Bit</p><p>● Data bits</p><p>● Stop bit/bits</p><p>For our project we are using one start bit, eight data bits and two stop bits.</p><h3>Baud Rate Generator</h3><p>Every microprocessor and microcontroller require a clock signal because there are sequential circuits inside them. In our case also, there is an internal clock signal generator integrated onto the FPGA development board which provides a 100 MHz clock signal.</p><p>UART communication process also require a clock signal in order to generate and send each bit. But we cannot use the internal clock signal directly to our application. There are some standard Serial communication baud rates which the both transmitter and receiver parties should agree. Here we decided to use 115200 bits per second as the serial baud rate. We need a square shaped pulse at the above-mentioned clock rate in order to maintain a successful data communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*lTQrifRrkctQ6O_p.png" /></figure><p>As a solution, we designed a Baud tick generator module using Verilog HDL and the schematic can be illustrated as shown in above figure. The only input is the internal 100Mhz clock signal and the output is the Required Baud tick signal.</p><h4>Verilog Code for the Baud Tick Generator</h4><p><em>module BaudTickGen(</em></p><p><em>input clk, enable,</em></p><p><em>output tick // generate a tick at the specified baud rate * oversampling</em></p><p><em>);</em></p><p><em>parameter ClkFrequency = 100000000; //100MHz</em></p><p><em>parameter Baud = 9600;</em></p><p><em>parameter Oversampling = 1;</em></p><p><em>function integer log2(input integer v);</em></p><p><em>begin log2=0;</em></p><p><em>while(v&gt;&gt;log2)</em></p><p><em>log2=log2+1;</em></p><p><em>end</em></p><p><em>endfunction</em></p><p><em>localparam AccWidth = log2(ClkFrequency/Baud)+8; // +/- 2% max timing error over a byte</em></p><p><em>reg [AccWidth:0] Acc = 0;</em></p><p><em>localparam ShiftLimiter = log2(Baud*Oversampling &gt;&gt; (31-AccWidth));</em></p><p><em>// this makes sure Inc calculation doesn’t overflow</em></p><p><em>localparam Inc = ((Baud*Oversampling &lt;&lt; (AccWidth-ShiftLimiter))…</em></p><p><em>…+(ClkFrequency&gt;&gt;(ShiftLimiter+1)))/(ClkFrequency&gt;&gt;ShiftLimiter);</em></p><p><em>always @(posedge clk) if(enable) Acc &lt;= Acc[AccWidth-1:0] + Inc[AccWidth:0]; else Acc &lt;= Inc[AccWidth:0];</em></p><p><em>assign tick = Acc[AccWidth];</em></p><p><em>endmodule</em></p><p>Here we are taking two inputs for our module as the input clock signal (which is a 100MHz ) and enable input to turn on or off the communication process. We have one output which is the baud tick signal.</p><p>parameter ClkFrequency = 100000000; //100MHz</p><p>parameter Baud = 9600;</p><p>Here we defined the Input Clock frequency in Hertz and the the desired baud rate in ticks per second.</p><h4>Integration of Baud Generator</h4><p>Here we integrate this baud tick generator module in to both UART Receiver module and UART Transmitter modules. Therefore, both of them taking input clock as our FPGA board’s internal clock signal which is a 100MHz signal and then inside each module Baud tick generator converts 100MHz square pulse in to a 115200 ticks per second baud signal.</p><h3>UART Transmitter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*7Wf3-Ea4YTdg0rWy.png" /></figure><h4>Here we take three inputs to the Transmitter which are the parallel 8 set of input which contains the exact data we need to send, the starting input which act as a transmission on/off switch and the inbuilt clock signal from the FPGA development board.</h4><p>Inside this module we have our previously discussed baud tick generator and parallel to serial converter. Parallel data coming from 8 lines are time synchronously added together in to the rhythm of the baud tick and give to the out as a serial data stream on a single line. We also have another output to indicate an end of a packet called ‘Tx_done’.</p><h4>Verilog Code for Transmitter</h4><p><em>module UART_transmitter(</em></p><p><em>input clk,</em></p><p><em>input TxD_start,</em></p><p><em>input [7:0] TxD_data,</em></p><p><em>output wire TxD,</em></p><p><em>output reg TxD_done//Txdone,</em></p><p><em>);</em></p><p><em>// Assert TxD_start for (at least) one clock cycle to start transmission of TxD_data</em></p><p><em>// TxD_data is latched so that it doesn’t have to stay valid while it is being sent</em></p><p><em>parameter ClkFrequency = 100000000; // 100MHz</em></p><p><em>parameter Baud = 115200;</em></p><p><em>wire TxD_busy;</em></p><p><em>/////////////////////////////////////Baud tick Generartor/////////////////////</em></p><p><em>wire BitTick;</em></p><p><em>BaudTickGen #(ClkFrequency, Baud) tickgen(.clk(clk), .enable(TxD_busy), .tick(BitTick));</em></p><p><em>//`endif</em></p><p><em>//////////////////////////////////////////////////////////////////</em></p><p><em>reg [3:0] TxD_state = 0;</em></p><p><em>assign TxD_ready = (TxD_state==0);</em></p><p><em>assign TxD_busy = ~TxD_ready;</em></p><p><em>reg [7:0] TxD_shift = 0;</em></p><p><em>always @(posedge clk)</em></p><p><em>begin</em></p><p><em>if(TxD_ready &amp; TxD_start)</em></p><p><em>begin TxD_shift &lt;= TxD_data; end</em></p><p><em>else</em></p><p><em>if(TxD_state[3] &amp; BitTick) //Data bits(byte) sending</em></p><p><em>begin TxD_shift &lt;= (TxD_shift &gt;&gt; 1); end //input byte is sening in each clock cycle one by one</em></p><p><em>case(TxD_state) //counting each bit</em></p><p><em>4&#39;b0000 : if(TxD_start)</em></p><p><em>begin</em></p><p><em>TxD_state &lt;= 4&#39;b0100;</em></p><p><em>TxD_done&lt;=0;</em></p><p><em>end</em></p><p><em>4&#39;b0100: if(BitTick) TxD_state &lt;= 4&#39;b1000; // start bit</em></p><p><em>4&#39;b1000: if(BitTick) TxD_state &lt;= 4&#39;b1001; // bit 0</em></p><p><em>4&#39;b1001: if(BitTick) TxD_state &lt;= 4&#39;b1010; // bit 1</em></p><p><em>4&#39;b1010: if(BitTick) TxD_state &lt;= 4&#39;b1011; // bit 2</em></p><p><em>4&#39;b1011: if(BitTick) TxD_state &lt;= 4&#39;b1100; // bit 3</em></p><p><em>4&#39;b1100: if(BitTick) TxD_state &lt;= 4&#39;b1101; // bit 4</em></p><p><em>4&#39;b1101: if(BitTick) TxD_state &lt;= 4&#39;b1110; // bit 5</em></p><p><em>4&#39;b1110: if(BitTick) TxD_state &lt;= 4&#39;b1111; // bit 6</em></p><p><em>4&#39;b1111: if(BitTick) TxD_state &lt;= 4&#39;b0010; // bit 7</em></p><p><em>4&#39;b0010: if(BitTick) TxD_state &lt;= 4&#39;b0011; // stop1</em></p><p><em>4&#39;b0011: if(BitTick) // stop2</em></p><p><em>begin</em></p><p><em>TxD_state &lt;= 4&#39;b0000;</em></p><p><em>TxD_done&lt;=1;</em></p><p><em>end</em></p><p><em>default: if(BitTick) TxD_state &lt;= 4&#39;b0000;</em></p><p><em>endcase</em></p><p><em>end</em></p><p><em>assign TxD = (TxD_state&lt;4) | (TxD_state[3] &amp; TxD_shift[0]); // put together the start, data and stop bits</em></p><p><em>endmodule</em></p><p>Here we are calling the Baud tick generator from the inside of the transmitter to sample the input data.</p><h3>UART Receiver</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*vOCtdSXCtGALWrZa.png" /></figure><h4>UART receiver taking two inputs which are input clock signal and the serial data input which is carrying a serial data stream sampled in a standard Baud Rate. Input serial data is again formed in to a set of 8 data lines after each packet is arrived in to the receiver.</h4><h4>Verilog Code for Receiver</h4><p><em>module UART_receiver(</em></p><p><em>input clk,</em></p><p><em>input RxD,</em></p><p><em>output reg Rx_done=0,</em></p><p><em>//output reg RxD_data_ready = 0,</em></p><p><em>output reg [7:0] RxD_data = 8&#39;d0 // data received, valid only (for one clock cycle) when RxD_data_ready is asserted</em></p><p><em>// asserted when no data has been received for a while</em></p><p><em>//output reg RxD_endofpacket = 0 // asserted for one clock cycle when a packet has been detected (i.e. RxD_idle is going high)</em></p><p><em>);</em></p><p><em>parameter ClkFrequency = 100000000; // 100MHz</em></p><p><em>parameter Baud = 115200;</em></p><p><em>parameter Oversampling = 8; // needs to be a power of 2</em></p><p><em>// we oversample the RxD line at a fixed rate to capture each RxD data bit at the “right” time</em></p><p><em>// 8 times oversampling by default, use 16 for higher quality reception</em></p><p><em>wire RxD_idle;</em></p><p><em>////////////////////////////////</em></p><p><em>reg [3:0] RxD_state = 0;</em></p><p><em>//reg RxD_data_ready = 0;</em></p><p><em>`ifdef SIMULATION</em></p><p><em>wire RxD_bit = RxD;</em></p><p><em>wire sampleNow = 1&#39;b1; // receive one bit per clock cycle</em></p><p><em>`else</em></p><p><em>wire OversamplingTick;</em></p><p><em>BaudTickGen #(ClkFrequency, Baud, Oversampling) tickgen(.clk(clk), .enable(1&#39;b1), .tick(OversamplingTick));</em></p><p><em>// synchronize RxD to our clk domain</em></p><p><em>reg [1:0] RxD_sync = 2&#39;b11;</em></p><p><em>always @(posedge clk) if(OversamplingTick) RxD_sync &lt;= {RxD_sync[0], RxD};</em></p><p><em>// and filter it</em></p><p><em>reg [1:0] Filter_cnt = 2&#39;b11;</em></p><p><em>reg RxD_bit = 1&#39;b1;</em></p><p><em>always @(posedge clk)</em></p><p><em>if(OversamplingTick)</em></p><p><em>begin</em></p><p><em>if(RxD_sync[1]==1&#39;b1 &amp;&amp; Filter_cnt!=2&#39;b11) Filter_cnt &lt;= Filter_cnt + 1&#39;d1;</em></p><p><em>else</em></p><p><em>if(RxD_sync[1]==1&#39;b0 &amp;&amp; Filter_cnt!=2&#39;b00) Filter_cnt &lt;= Filter_cnt — 1&#39;d1;</em></p><p><em>if(Filter_cnt==2&#39;b11) RxD_bit &lt;= 1&#39;b1;</em></p><p><em>else</em></p><p><em>if(Filter_cnt==2&#39;b00) RxD_bit &lt;= 1&#39;b0;</em></p><p><em>end</em></p><p><em>// and decide when is the good time to sample the RxD line</em></p><p><em>function integer log2(input integer v); begin log2=0; while(v&gt;&gt;log2) log2=log2+1; end endfunction</em></p><p><em>localparam l2o = log2(Oversampling);</em></p><p><em>reg [l2o-2:0] OversamplingCnt = 0;</em></p><p><em>always @(posedge clk) if(OversamplingTick) OversamplingCnt &lt;= (RxD_state==0) ? 1&#39;d0 : OversamplingCnt + 1&#39;d1;</em></p><p><em>wire sampleNow = OversamplingTick &amp;&amp; (OversamplingCnt==Oversampling/2–1);</em></p><p><em>`endif</em></p><p><em>// now we can accumulate the RxD bits in a shift-register</em></p><p><em>always @(posedge clk) begin</em></p><p><em>//if(Rx_done) Rx_done =0;</em></p><p><em>case(RxD_state)</em></p><p><em>4&#39;b0000: if(~RxD_bit)</em></p><p><em>begin</em></p><p><em>RxD_state &lt;= `ifdef SIMULATION 4&#39;b1000 `else 4&#39;b0001 `endif; // start bit found?</em></p><p><em>Rx_done&lt;=1&#39;b0;</em></p><p><em>//Rxdone&lt;=0;</em></p><p><em>end</em></p><p><em>4&#39;b0001: if(sampleNow) RxD_state &lt;= 4&#39;b1000; // sync start bit to sampleNow</em></p><p><em>4&#39;b1000: if(sampleNow) RxD_state &lt;= 4&#39;b1001; // bit 0</em></p><p><em>4&#39;b1001: if(sampleNow) RxD_state &lt;= 4&#39;b1010; // bit 1</em></p><p><em>4&#39;b1010: if(sampleNow) RxD_state &lt;= 4&#39;b1011; // bit 2</em></p><p><em>4&#39;b1011: if(sampleNow) RxD_state &lt;= 4&#39;b1100; // bit 3</em></p><p><em>4&#39;b1100: if(sampleNow) RxD_state &lt;= 4&#39;b1101; // bit 4</em></p><p><em>4&#39;b1101: if(sampleNow) RxD_state &lt;= 4&#39;b1110; // bit 5</em></p><p><em>4&#39;b1110: if(sampleNow) RxD_state &lt;= 4&#39;b1111; // bit 6</em></p><p><em>4&#39;b1111: if(sampleNow) RxD_state &lt;= 4&#39;b0010; // bit 7</em></p><p><em>4&#39;b0010: if(sampleNow) // stop bit</em></p><p><em>begin</em></p><p><em>RxD_state &lt;= 4&#39;b0000;</em></p><p><em>Rx_done &lt;= 1&#39;b1;</em></p><p><em>//Rxdone&lt;=1;</em></p><p><em>end</em></p><p><em>default: RxD_state &lt;= 4&#39;b0000;</em></p><p><em>endcase</em></p><p><em>end</em></p><p><em>always @(posedge clk)</em></p><p><em>if(sampleNow &amp;&amp; RxD_state[3]) RxD_data &lt;= {RxD_bit, RxD_data[7:1]};</em></p><p><em>`ifdef SIMULATION</em></p><p><em>assign RxD_idle = 0;</em></p><p><em>`else</em></p><p><em>reg [l2o+1:0] GapCnt = 0;</em></p><p><em>always @(posedge clk) if (RxD_state!=0) GapCnt&lt;=0; else if(OversamplingTick &amp; ~GapCnt[log2(Oversampling)+1]) GapCnt &lt;= GapCnt + 1&#39;h1;</em></p><p><em>assign RxD_idle = GapCnt[l2o+1];</em></p><p><em>`endif</em></p><p><em>Endmodule</em></p><h4>Output from the Simulator</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*5kpIgPh3uxQ_o9Pt.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6e405c5cbd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rocker Bogie Suspension System for a Mobile Robot]]></title>
            <link>https://medium.com/@chandulanethmal/rocker-bogie-suspension-system-for-a-mobile-robot-654b1a30992e?source=rss-1da8da7a68a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/654b1a30992e</guid>
            <category><![CDATA[robots]]></category>
            <category><![CDATA[bogie]]></category>
            <category><![CDATA[rockers]]></category>
            <category><![CDATA[mobile-robot]]></category>
            <dc:creator><![CDATA[Chandula Nethmal]]></dc:creator>
            <pubDate>Sat, 25 May 2019 02:02:41 GMT</pubDate>
            <atom:updated>2019-05-25T02:02:41.373Z</atom:updated>
            <content:encoded><![CDATA[<p>When we are designing a robot, understanding the operating environment is a must. For a land mobile robot, we need to consider about the terrain and obstacles it needs to overcome.Mechanical design of the robot is highly dependent on this details. A suspension is the system which allows the relative motion between wheels and the body and connect them together. Rocker Bogie is a special suspension mechanism designed for land mobile platforms. Expectation of this design is providing a maximum stability to the platform in all kinds of difficult terrains. A surface with rough terrain including rocks, pits, sand or even stairs can be overcome by a mobile platform with the use of this mechanism.</p><h3>Origin of Rocker Bogie</h3><p>Rocker Bogie is a suspension system developed by NASA for its Mars Rover missions in 1988. First it was introduced for the Sojourner Mars Rover which landed on Mars on 1997 and after that for Spirit and Opportunity Rovers belonged to MER (Mars Exploration Rover) project in 2003 and also for Curiosity Rover on MSL (Mars Science Laboratory) project in 2012. Not only that, this system is already added to the Mars 2020 rover of NASA which is planed to launch in 2021.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*qFJfQSIfGeYy3tXx.jpg" /><figcaption>Mars 2020 Rover</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*oUJjt-_KbALMDpwo.jpg" /><figcaption>Sojourner(Left), Spirit-MER(middle), Curiosity(Right)</figcaption></figure><h3>Rocker Bogie Mechanism</h3><p>When we hear the name ‘Suspension Mechanism’ , at least one spring or shock-absorber will come to our mind. But unlike many other suspension systems we are familiar with, this one has no above hardware parts. Rocker bogie system has two main parts as shown i the following figure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*4CXB2e8pz1TDS4GI.png" /></figure><p>This consists of two solid links and 3 wheels for both sides of the center platform of the robot. The larger link 1 with only one wheel and two joints is called as the ‘Rocker’ and it is the forward part of one leg. The rocker dedicated for the rocking aspect of the platform.</p><p>The second link consists with two drive wheels at both ends called the ‘Bogie’ which is the rear part of the suspension design. Bogie part helps to maintain a proper load distribution over the terrain in order to protect the stability. This type of bogie parts can be seen in some heavy land vehicles such as trains, trucks and army tanks.</p><p>One leg for our platform is made connecting Rocker and bogie links together by a pivot at one end of the rocker and middle of the bogie. A mobile platform consists of two such legs as following figure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*3ORg9gXiDgYGYOKF.png" /></figure><h3>Differential to achieve Stability</h3><p>One main feature of this mechanism is, allowing individual link to move relatively, giving maximum stability to the body of the robot. Therefore each leg is connected to the chassis from rocker parts. Each rocker has an axle connected to a differential at the middle of the platform. This differential is a small arrangement of bevel gears with orthogonal rotation conversion, in order to maintain an average pitch angle of each rocker to the body part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*dGXtw95LuAXwRxvn.png" /><figcaption>Differential part of the center of the body</figcaption></figure><p>As you can see in the above figure, the center gear is connected to the body of the robot while other two side axles are connected to rockers. When the left rocker goes up on an obstacle, right rocker goes down because of the differential while giving an average pitch angle to the body. This will help to achieve a desirable stable position even the platform goes on a rocky terrain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*voOEs0olso5oAfd3.JPG" /><figcaption>Overall mechanical system of the Mobile platform</figcaption></figure><p>Tilting ability of the rockers is the main feature of the system. However, the stability against tilting is limited by the height of the Center of Gravity of the platform. Normally, a platform with this suspension system is capable of climbing over obstacles with approximately two times high as the diameter of a wheel.</p><h3>Steering of the Robot</h3><p>Steering capability is a key point for any type of robot. There are two methods to achieve that for this rocker bogie structure.</p><h4>Skid Steering</h4><p>This is one of the most commonly seen steering mechanism in robots. There is no need of additional motors for steering other than six wheels driving motors. If we rotate all six wheels in anti-clockwise robot will turn in the left direction. In another words, if we rotate left wheels to backwards and right wheels to forward direction we can achieve the left turning.</p><p>Similarly, the right turn can be achieved by rotating all six wheels in clockwise direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*bMY2IznX2ppOvNzp.png" /><figcaption>Rotation directions of motors ( Top view of the robot )</figcaption></figure><h4>Using Steering Motors</h4><p>In this method we are using additional servo/stepper motors to turn wheels. Two steering motors for front wheels and two Steering motors for rear wheels. Middle two wheels only have their driving motors. If we need to turn in to left side, turn front and rear wheels using steering servos as following figure .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*TqPqH-4JT7EHYl27.png" /><figcaption>turn wheels using steering motors ( Top view of the robot )</figcaption></figure><p>Then rotate all six wheels or two front and two rear wheels in clockwise direction in order to turn the whole platform in the left direction. In the similar way, we can achieve right steering also as following figure..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*nZHk4mVmmQg39Zvk.png" /></figure><p>Visit My Blog: <a href="https://chandula-nethmal.blogspot.com/2019/05/rocker-bogie-suspension-system-for.html">https://chandula-nethmal.blogspot.com/2019/05/rocker-bogie-suspension-system-for.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=654b1a30992e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>