Devan Grover’s Status Report for 12/09/23

This week I finished up some polishing touches on the circuit simulator and finalized some of the integration of our project. Stephen changed his computer vision algorithms to use functions that are not available in the default opencv framework. This means we have to build the framework using additional modules. I ran into some issues doing this because I have an Apple Silicon Macbook, but we hope to resolve this issue by using an Intel Mac.

 

I also polished up some of the integration code between the simulator and the rest of the app. Previously, the app would crash on my section if there were errors in the program. I have mitigated this issue and the app no longer crashes when the simulator errors out.

Devan Grover’s Status Report for 12/2/23

This week I worked a lot on integration of the parts of our app. I first had to get openCV to build on our iOS platform. I ran into many issues because Jaden and my computers have Apple Silicon, which makes us unable to test our code on the iOS simulators on our systems. We initially remedied this by working in WEH5201, but I set the project up so that we can now build directly on our phones from our own machines.

I had to create an objective-c++ file to bridge the code between the frontend and backends of our application. This meant learning the syntax and nuances of objective-c++, which is very different to other languages I have used in the past. I had to create new data structures that were compatible with objective-c++ and Swift so that I could pass data between the two languages. This meant I also had to do more work in the simulator to parse this new data structure into a readable structure for the simulator. I also helped Jaden integrate the CV with the app in a similar fashion with an objective-c++ file.

Now that we have a working application, I will resume my focus on the diode model in the circuit simulator. I am a bit behind schedule on the diode, but believe I will be able to complete it by the end of next week. I am satisfied with this past week’s progress because we have integrated our application’s parts together.

Devan Grover’s Status Report for 11/18/23

This week I worked on integration and on implementing a diode into the circuit simulator. I was able to interpret the list of edges and coordinates that the computer vision algorithm returns. This means I can now take this list of components and coordinates, make the coordinates into node numbers, and then condense the nodes that are connected by wires. This means we can fully take a circuit image, run it through our computer vision algorithm, and then simulate it with our simulator (provided dummy component values).

I also tried a lot to integrate opencv into our Xcode project, but this proved to be a tough task. Since Jaden and I are developing on Apple Silicon macbooks, the opencv library does not work for the iPhone simulator in Xcode. Therefore, I am unable to build for iPhone. We will try to circumvent this issue by running the code on intel based macbooks since these have support for opencv in  XCode.

I tried a bit more to get the diode modeling to work but am still unable to make the correct guesses and get to the right value. I am still reading some papers but think I will be able to get this done over break. I am fairly good on schedule with integration but am behind with the diodes. I hope to make this up over break

Devan Grover’s Status Report for 11/11/23

This week I worked a bit on some integration and on getting diodes integrated into my model. I wrote a function to create a netlist from the coordinate, component data structure we are using to send information between our backend and frontend. This function will register the coordinates as nodes and create component entries for each component  in the netlist with the nodes that it determines for each component based on the coordinates. It then condenses the netlist by making nodes connected with a wire considered one node. By conducting this process, we can integrate the different parts of our application more easily.

I have also been trying to work on getting the diode to work in my modified nodal analysis circuit simulator model. This is proving to be incredibly difficult, because I must iteratively solve the system of equations to arrive at a correct solution. I have been doing research on the Newton Raphson method and how to implement it successfully in my code with the diode model. I am still unsuccessful in this aspect. Since I have not gotten the diode to work, I am falling a little behind but I will work on this over Thanksgiving break to compensate.

I have run test circuits that I randomly create through my circuit simulator and through an existing web based simulator. In the web simulator, I have to drag and drop the components then click each node I want to measure. This works at a small scale but will be annoying when I am stress testing my simulator. Thus, I plan to run automated testing on LTspice where I will run netlists through my simulator and LTspice and compare the outputs. I will then compare the outputs of these simulators to ensure the accuracy requirement is met.

Devan Grover’s Status Report for 11/04/2023

I made a lot of really good progress this week. I spend lots of time over the course of this week trying to implement modified nodal analysis in C++ using the Eigen library. I was able to get nodal analysis to work for circuits that use resistors, independent current sources, and independent voltage sources. This means I can now take in a netlist, parse through the netlist, generate the required matrices to analyze the circuit, and finally analyze the circuit. The result of the circuit analysis gives me the voltage at each node and the current through each voltage source. With this information, I can then find the current going through every component.

I also wrote all this code within the environment of our mobile app, which means I know this code can compile for iOS. Although I have not written an Objective-C header to bridge the code between C++ and Swift and make my file interact with the main app, I can call my netlist analyze function and ensure it works. I am now going to try to model a diode for next week and get diodes working within the simulator: after some studying and research, I will likely have to use the Newton-Raphson method to find a solution to the circuit with a diode. I am on progress with the schedule and hope to successfully analyze circuits with diodes in them by the end of next week.

Devan Grover’s Status Report for 10/28/23

This week I worked on the netlist parser for the circuit simulator. I setup the Eigen library last week to compile for iOS – this allows me to generate and use matrices and other linear algebra functions. Therefore, I wrote code to parse through the netlist and start creating the required matrices for modified nodal analysis. As I described in the design report, we need to generate two matrices to solve our circuit. The first of these two matrices is composed of four sub-matrices. I am now trying to use the parsed netlist information and generate the sub-matrices for solving. Although I got the Eigen library to compile last week, I ran into some issues when actually using the matrix data structures and doing computations. I was able to solve these errors by fixing the linking settings and import settings in XCode and am now able to actually generate matrices and do computations on them. I also did a lot of work this week on the ethics assignment and completed it for our discussion next week. I am on schedule and hope to have some matrices generated next week to finally get the simulator up and running.

Devan Grover’s Status Report for 10/21/23

This week I made progress with the circuit simulator by installing matrix libraries and adding them to our iOS development environment. I am going to be using eigen, which is a C++ library that allows for matrix calculations. I also created a basic wrapper file to call C++ code from Swift, which is what our application uses. I am now able to conduct matrix calculations in C++ code that is called from the frontend of our application.

One tool that I need to learn further is the eigen library. It is an open source C++ library used for linear algebra. It supports matrices and vectors which are heavily used when solving circuits. I will need to use eigen to create the required A and z matrices in the modified nodal analysis equation. I will also need to use it to solve the system of equations and calculate the inverse of various matrices. I think my progress is good, and I hope to parse through the netlist and create the A matrix by next week.

Devan Grover’s Status Report for 10/07/2023

This week, I worked a lot on the design presentation, especially because I was the one presenting. We only finished roughly 30-50 percent of the slides on Saturday, so I spent my whole day on Sunday working on it. After finishing the slides, I drafted a rough script of what I was to say during the presentation and iteratively practiced and got better. At night, I practiced and had to keep cutting parts out of my presentation in order to stay at the proper time. I presented to Stephen over zoom to practice and to my roommates to get a more realistic feel for how I would present in class. This let me practice movement and hand gestures.

I also looked at existing algorithms used to solve circuits – a good way for computers to solve simple DC circuits is by creating a conductance matrix, which is a matrix describing how well current flows through specific parts of the circuit. You then create voltage equations describing the voltage drops across each component and arrange these into a matrix. You can then solve the system of equations to find the current at each node and the voltage drop across each component. I have not been able to figure out how to implement this in practice, so I am still reading more.


I got sick this week so I am a bit behind schedule, but I will definitely make up for this by putting work in every day over fall break. I hope to get a conductance matrix created for a simple circuit by next week.

Devan Grover’s Status Report for 9/30/23

I did research on possible computer vision algorithms, netlists, and worked on the design presentation this week. I did more research into netlists since most of our research was focused on computer vision last week. Netlists are commonly used in various programs such as SPICEand SystemVerilog to generate schematics of how various components are connected to each other. I plan on using a hierarchical, object oriented system in which all components share their properties – this way I do not need to handle extraneous cases for components that act differently from other components (eg. diode vs resistor). I wrote basic code to connect two resistors together to test this concept.

I also researched computer vision algorithms specifically for our design presentation. During our discussions with Professor Yu and Mukundh this week, we realized that we need to dig deeper into the computer vision aspect of our project and flesh out the techniques we will use. I read through many papers that tried to solve similar problems to our computer vision algorithm, and we all collectively decided on using ORB for feature detection and a brute force matching algorithm.
Since I am presenting the design presentation next week, I also spent time writing up scripts and notes to look at while practicing my presentation. In order to ensure I give the best presentation possible, I want to prepare and practice in front of real people. By creating notes ahead of time, I can review these and refine my presentation skills after presenting multiple times to my roommates.

I am a little bit behind schedule. I had three interviews this past week that took up lots of my time, and I was therefore unable to do as much as I originally planned in terms of researching netlists. I did not write very much code for the netlist, but since I only have one interview next week I will be able to devote much more time to this project and therefore will be able to catch up. I hope to complete a netlist with more than just two components and create more than one type of component.

In my work this week I used concepts from 18-220 for the circuit simulation. I have not taken a computer vision course, so I have been reading up on many guides and papers on the subject in order to better understand the concepts and educate myself. OpenCV also has many guides and tutorials online that I have been trying to do and follow along with to get a better grasp on computer vision.

Devan Grover’s Status Report for 09/23

This week I explored computer vision algorithms to separate the components from the rest of the circuit. In order to properly do this, I came up with the idea to have circular nodes at the end of every component’s two terminals. Then, I will use an algorithm to detect circles such as the Hough Circle’s algorithm in order to find these nodes. Next, each node that is found will have an algorithm run upon it in which it will find the closest nodes in the same x and y coordinates. Then, a bounding box will be drawn between the sets of two dots and this box will be looked at to find a component.

I tried to implement this with a simple picture of a resistor but was unable to get it to work. The circles were not being detected in the image. I tried to run a simple filter on the image to detect the components being drawn. I made every pixel that had a black value of over a threshold value completely black, and every pixel with a lower black value completely white. This also did not work well in differing light conditions like the picture below.

Furthermore, the circles on the end of the resistor were not even detected. I believe I need to look further into the problem because we need to make sure we can detect components separately from the whole circuit. I tried a contour plot which detected edges relatively well, but the nodes on each component were not filled in because the contour plot only detects edges. This is problematic because we will have other circular components like voltage and current sources that we will need to ensure By individually identifying components and wires with this technique, we can easily build a netlist for our circuit simulator. I also briefly explored the concept of netlists and how they work so that we can implement it for our circuit simulator.

I am still on track with the schedule because I am still researching CV algorithms. I want to have a picture of a resistor with the circles on its ends being detected properly by our circle detection algorithm. This will prove that we can go on with the technique I discussed above to detect individual components.