Saturday, September 25, 2021

Design a FIR Filter for Given Specifications

Introduction

The objective of this project is demonstrating how a digital filter is designed using windowing method in conjunction with the Kaiser window for a given set of requirements. A digital filter is basically a filter which does mathematical operations on sampled discrete-time signals. In telecommunication engineering digital filters play a major role, in signal demodulators and many other systems. This project was carried out as a part of the module "Digital Signal Processing" and here we design a digital bandpass filter. The mathematical analysis was carries out using MATLAB 2018a.

Design

Many design methods are available for designing FIR filters. Closed form direct approach was used here which is followed by the Fourier Series method along with a Kaiser Window. The truncation of the impulse response was achieved using the Kaiser Window function. Here we analyze the causal impulse response and the magnitude responses of designed the filter to confirm its characteristics with initial parameter. Further, the filter was evaluated for its performance by analyzing the output signal obtained for a given input signal consisting of a combination of sinusoids which having frequency components in both the lower and upper stopbands and also in the passband as well. 

A detailed step by step design procedure is available in the documentation linked below.

Results


1 / 7
2 / 7
3 / 7
4 / 7
5 / 7
6 / 7
7 / 7

Complete Documentation Link can be found here.


Friday, September 24, 2021

Virtual Robotics Competition 2021

 

In this project we designed an autonomous mobile robot for completing a given set of tasks using the WebotR2021a simulation platform. First of all let's look at the task.

Task

At the beginning, the robot is at a 25cm x 25cm square. Then we have to navigate the robot using line following until it meets the wall following area. After wall following, the robot enters a circular maze and it has been divided into four quadrants. Then, we have to navigate the robot to the colored box which is located in one of the four radius lines of the circular maze while indicating the quadrant numbers. After approaching the box, the robot has to identify the colors of bottom and front sides of the box in order to calculate the direction it needs to follow at the ramp section. After color detection, it has to pass a dash line section to enter the ramp area. Then, it has to select the correct direction which was calculated in the color detection phase. There are pillars in order to confirm whether the direction it took is correct or not. After that, it enters the gate section. There are two synchronous gates which operates in a given sequence but two gates have different sequences. Finally, the robot has to pass both of these gates without hitting them and stop at a 25cm x 25cm white square in order to complete the task.

Design & Implementation

1. 3D Modeling, Physics Modeling and Sensor Modeling

The whole robot corresponds to a CAD model and all the parts and mechanisms used here should be implemented in real world as well. We must always try to make the simulation that matches with the real world implementation. Otherwise there's no meaning of simulating a robot in an unrealistic way. 

For designing the 3D model of the robot, we used SOLIDWORKS software. First, a complete CAD model was designed considering the real world implementation as mentioned above. There, we focused on size of the objects, material properties, weight distribution of the robot, and reliability and realization of mechanisms for every single peace of the robot. When modeling sensors, we did that according to sensor datasheets and considering Gaussian noise that will be added to sensor readings as well.

2. Line Following

Line following is one of the major tasks. In general we achieve this using an array of proximity sensors lies above the line. We used an array of 8 IR sensors placed in a constant distance apart from each other. We used a PID algorithm for line following. 

3. Wall Following

We used sharp IR sensors for this sub task. Two sensors were placed vertically in left and right sides of the robot. A PID algorithm was used for this task as well.

4. Maze Solving

We designed a custom algorithm this. After entering to the maze, the robot navigates along its the circumference while indicating quadrant numbers. Then it enters one of the diagonals and moves along it until it detects the box. It it could not find the box in that particular diagonal, it turns right and enters the other diagonal after traveling through the circumference and go along it until detects the box.

5. Robot Arm Manipulator

According to the task, the robot has to detect colors of bottom and front sides of the box. Since we want to find the bottom color we designed a robot arm that grabs the box and lift it up in order to expose bottom side of the box to the color sensor. The color sensor is also attached to the robot arm, and it is connected to a servo motor. Then the color sensor rotates in 90 degrees steps to get the colors of front and bottom sides.

6. Ramp Section

In order to navigate through ramp area properly, we did 3D modeling of the robot and placement of hardware (specially the battery - the heaviest part in the robot) by preserving the center of gravity of the robot as low as possible and preserving the balance of the robot. In the test runs we experienced that the robot turns unexpectedly at the half way, climbing the ramp. The reason was that the placement of battery. By adjusting its position we could solve that problem. Another problem we encountered in ramp section is that when the robot enters the top of the ramp and leaving from the top of the ramp, distance sensors used for line following gave us unpredictable outputs. Reason for this was that the considerable change of height between the sensors and the white line there. So we defined a separate function for navigating robot in such scenarios. 

7. Passing the Gates

We used an ultrasonic sensor for this purpose and designed an algorithm for passing both gates in a single attempt. Once the robot approaches the gate section, it stops and wait until the first gate is closed. If it is already closed, then the robot enters the algorithm. We used the state transition of the gates for navigating through them safely. 

Results


GitHub Link

Thursday, September 23, 2021

Core-XY 3D Printer

This project is about implementing my 3D printer. 3D printing is one of the cheapest and easiest ways to realize complex objects required for projects. Due to my curiosity on how does actually a 3D printer works, and get the hands on experience, I decided to build one from scratch. 

Initial Steps and Overview of the Project

Initially, I did a research on existing 3D printing technologies. The most commonly available 3D printer was that the ''cartesian'' printers. Apart from that I found about ''core-XY'' and ''delta'' printers. Delta printers are quite harder to implement compared with other two types. In cartesian printers, the printing bed moves along one of the horizontal axes, X or Y. The printing bed and its supports altogether have a considerable weight. Due to the high weight of the moving parts, it may cause the prints to detach from print surface when it changes the direction and in jerking movements at stops. When it comes to core-XY printers, their printing bed moves in a vertical axis (Z), which minimizes that effect. And also a higher printing speed can be achieved using a core-XY printer. Therefore, I decided to go for core-XY.

Goal

My goal was to build a core-XY 3D printer which gives a good print quality for a lower cost compared to commercial 3D printers.

Design & Implementation

First, I designed a CAD model of the printer. Then the frame of the printer is made using Aluminum bars. The strength of the frame and accuracy are extremely important to proceed with the project. Weight of the whole frame was concentrated more towards the bottom part in order to improve stability and reduce vibrations. Then the the Z axis setup was done. There I had to perfectly align the four metal bars which the printing bed moves along. After that, setting up X and Y axes was done. Then all the electronic components were placed and wired them properly. Then I used a customized version of Marlin firmware as firmware for the printer. This version of the printer was made using wooden parts since I wanted to minimize the cost, but having it in mind to replace them with 3D printed parts in the future. This version of the printer did not gave me that much of a print quality. But I could 3D print all the parts that required for replacing the wooden parts. So the version 2 of the printer is made by replacing wooden parts by 3D printed parts. This time time I could obtain my desired print quality. There I had to spend a considerable time to calibrate the printer for finding the best suitable values for my printer such as acceleration, print speed, jerk settings, retraction settings, printing temperatures and suitable PID values for heaters, and so many other parameters. After doing some modifications and proper calibration, I built the version 3 of my printer which gave me expected results. The cost was around 25000 Sri Lankan rupees in total.

One of the design considerations was reducing the weight of moving objects. Here I mainly considered X and Y axes since they are the axes which the print head moves along regularly. When it comes to extruders, there are mainly two types. They are direct drive and remote drive. In direct drive mode we have to use a stepper motor attached to the extruder and that stepper motor becomes a mobile part. Since a stepper motor has a considerable weight, I decided to use a remote drive which I can keep the extruder stepper motor as immobile. Further the mobile 3D printed parts also designed such that their weight becomes small while achieving the required strength. And also the stainless steel bars that used for X and Y axes were selected accordingly. There I decide to use 8mm diameter bars in order to reduce the weight while having a good strength.

By watching several videos on 3D printing, I found that vibrations are one of the major problems that affects the surface quality of prints. By making the body of printer strong and concentrating the weight towards the bottom of the printer the vibrations could be minimized. I observed that the belt tension is also responsible for vibrations. Therefore belt tensions were properly adjusted. Acceleration and jerk settings also directly affect the vibrations. Properly calibrating those also helped to reduce vibrations.

Another important fact is that reduce heat dissipation from print bed and extruder. All the heating elements used here controlled using a PID algorithm. Therefore, when the temperature of those elements go below the desired value, they power up again and again in order to maintain the desired temperature level. By reducing heat dissipation, we can reduce this where we can save power. Further, some filament types require more than 100 `C of bed temperature. Without properly managing heat dissipation, we may not be able to reach that temperature  since the heat dissipation may become more than heat supply. In order to reduce the heat dissipation I used an insulated sheet below the heat bed. And also an enclosure was made to cover the printer.

For electronics good cooling system is required to function properly over a long period of time.A dedicated 12mm x 12mm fan was used for cooling main circuit board and stepper motor drivers. The enclosure was designed to have proper air inlets and outlets. A dust filter was used at the cooling fan to reduce dust going for the the main circuit board. One other think you have to make sure is that using proper wires. Most of the wires carries electrical signals in the design but there are few connections which carries high currents (10-20 Amps). They are the heat bed and extruder. Copper wires having a higher gauge need to be selected for those connections in order to prevent from overheating wires which may cause fires and many other problems.

Results and Conclusion

I could gain a lot of hands on experience by engaging with this project. Since this is not a pure electronic project, it was very interesting and challenging. I had to take so many decisions than what I listed above while doing this project. This 3D printer is actually will be a gateway for many of my future projects.













GitHub Link

Popular Posts