Thomas’s Status Report for Apr. 27

Personal tasks of this week:

Task: Order PCB and Components

Definition: With Andrew, finalize and order the PCB as well as its components so that they can arrive before demo day.

Completion: The task is completed. In the process of ordering, we’ve discovered that it takes PCBWay over 20 days to fully manufacture and assemble the PCB due to the limited availability of some components. Therefore, we decided to order only the PCB from PCBWay, and order the components separately from DigiKey. The PCB will likely arrive on the 30th.

Next Steps:

My next step is to manually reflow the 406 surface-mount components, and solder the through-hole components, once the PCB and the components arrive.

Overall progress assessment:

My progress is behind schedule, because the PCB will arrive a few days before demo, and there are 406 components to reflow. However, we’re hopeful that we can have it fully manufactured by demo day.

Thomas’s Status Report for Apr. 20

Personal tasks of this week:

Task: Finalize circuit design and layout

Definition: Finalize the design of the circuit and the selection of all its components. With Andrew, complete the schematic and layout of the PCB in Altium Designer.

Completion: The task is partially completed. We’ve finished the schematics and made significant progress in layout. Many problems in the circuit were identified and resolved, including insufficient tuning accuracy of some trimming potentiometers, as well as OpAmp oscillations due to parasitic capacitances. However, the PCB layout is not yet finished and ready to be ordered.

Next Steps:

My next step is to continue working on the PCB with Andrew. In addition, I will work on digital interface testing with Alvin, so the software running on the Raspberry Pi can interact with the analog circuit  as soon as the PCB is manufactured.

Overall progress assessment:

My progress is somewhat behind schedule, because the PCB is not yet ready to be ordered.

Learning to use new tools:

A new tool I had to learn was LTSpice, which is a circuit simulation software designed for transient as well as frequency-domain circuit analysis. I learned how to use it though reading the official documentation as well as trail and error. Andrew also offered a lot of help since he learned to use LTSpice earlier than I did.

Thomas’s Status Report for Apr. 6

Personal tasks of this week:

Task: Further test and resolve circuit issues in simulation

Definition: Work with Andrew to test with a larger set of representative LP problems on the analog circuit simulation. Use actual LPs sampled from the software SLP solver to test the simulated circuit for convergence, accuracy, and robustness. Resolve issues discovered in the process.

Completion: The task is completed. We’ve successfully conducted tests on six LPs sampled from the software SLP solver. They represent two different configurations of the software solver, with the first, the last, and a random LP problem used for testing the simulated circuit. The circuit was able to converge on all six problems, and the worst error across all problems and variables is 2.37%. In addition, I have made automated Excel sheets to speed up testing and avoid mistakes in manual calculation.

Verification:

Analog Component Verification: With Andrew, verify that each individual analog component is configured and, if applicable, calibrated correctly. This mainly applies to digital potentiometers, as they have large resistance tolerances, but can (and should) be calibrated prior to solver operation. This also applies to other components like ADCs, DACs, and analog switches, as they can be configured incorrectly.

Orchestrator Verification: With Alvin, verify that the orchestrator program produces a valid LP at each SLP iteration, such that it can be represented by a configuration of the analog circuit. In addition, verify that the Raspberry Pi’s digital interfaces, including I2C and SPI, are configured correctly, to ensure that the analog circuit is configured and measured correctly.

Next Steps:

My next step is to work on the schematics and layout of the PCB with Andrew. I will also help Alvin in porting the orchestrator program to the Raspberry Pi, and write code for interfacing with the analog circuit.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed.

Team Status Report of Mar 30

Overall progress:

The simulation of the analog LP solver circuit is capable of solving several problems we’ve supplied to it, including dense and sparse problems with and without negative coefficients and non-zero bias terms. However, its accuracy is sometimes less than desirable. The software SLP solver is capable of solving the NLP formulation of the NMPC controller, but is pending more rigorous testing and robustness improvements.

Significant risks and risk management:

Risk: The analog LP solver circuit displays suboptimal accuracy depending on its configuration

Description: In our newest iteration of the circuit simulation, the analog LP circuit is capable of solving LPs, but the accuracy of the solution is sometimes problematic. Although we haven’t yet encountered a problem whose solution is more than 10% off, the cumulative effect of the SLP algorithm could yield a solution that is less accurate than each of its LP subproblems. In particular, we found that the error is dependent on V_cost, a voltage we could configure, with excessively high or low values causing high error in the solution.

Severity: If the conditional inaccuracies in the solutions can’t be reduced, the progress of the whole project would be severely jeopardized, because it will likely cause the accuracy of the solution to be worse than our 10% requirement, and might also cause swing-up to fail.

Resolution: We are currently investigating the root cause of the inaccuracies, and testing several potential solutions. In particular, we are looking into the possibility of raising OpAmp rail voltages without exceeding the voltage limits of the digital potentiometers. This might be difficult since the circuit needs to support a wide range of configurations.

Changes to the existing design:

There are currently no significant changes to the existing design. However, depending on the root cause of the inaccuracies, we might change the design to fix it.

Changes to the project schedule:

Similarly, there are currently no significant changes to the project schedule. We aim to order the PCB as early as possible.

Thomas’s Status Report for Mar 30

Personal tasks of this week:

Task: Test and resolve circuit issues in simulation

Definition: Work with Andrew to test representative LP problems on the analog circuit simulation to identify and fix issues that prevents it from converging to the correct solution. In particular, test with LPs that have non-zero bias terms in linear equality constraints, which has previously been problematic.

Completion: The task is completed. We’ve successfully discovered and fixed the issues causing the circuit to converge to wrong solutions with non-zero bias terms. The simulated LP circuit is now capable of solving all three problems we’ve tested it on, and we are working on testing with more problems.

Next Steps:

My next step is to test the analog LP circuit with more problems to ensure its correctness and robustness, together with Andrew. Then, we’ll work on PCB layout. In addition, I will explore the possibility of increasing OpAmp rail voltages without burning the digital potentiometers. I will also help Alvin in testing and fixing the software SLP solver.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed.

Thomas’s Status Report for Mar 23

Personal tasks of this week:

Task: Simplification of the analog circuit

Definition: Simplify the analog circuit so it can be realized by less components, especially expensive components. This is necessary mainly because there’s a significant risk of the project going over-budget. In addition, a circuit with more component would require more calibration, and is more likely to demonstrate unexpected behavior.

Completion: The task is completed. We discovered and leveraged the fact that a variable and its mirror variable will never be connected to the same equality constraint circuit in any valid problem, based on the formulation of LPs. Therefore, we were able to multiplex digital potentiometers with analog switches, reducing the number of digital potentiometers by half. The updated BoM shows the reduce component cost:

Task: Implementation of the SLP solver for NMPC

Definition: Implement a software SLP solver that solves the NLP associated with the NMPC controller of the torque-limited single pendulum swing-up problem.

Completion: The task is partially completed. We’ve made substantial progress towards a functional software NLP solver using the SLP algorithm and the Casadi library.

Next Steps:

My next step is to fix issues in the analog circuit with Andrew, and finish implementing SLP with Alvin.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed.

Thomas’s Status Report for Mar 16

Personal tasks of this week:

Task: Resolving Issues in Dr. Vichik’s Design

Definition: Based on our analysis of the failure of Dr. Vichik’s circuit in solving certain optimization problems, develop a fix that enables the circuit to consistently solve the set of problems required by our formulation.

Completion: The task is completed. I reduced the dynamic range from 100mV, which is used by Dr. Vichik’s in his design, to 10mV, preventing the op-amps from saturating in a pessimistic example problem. In addition, the SQP algorithm is replaced by the SLP (sequential linear programming) algorithm in our design to avoid other issues in Dr. Vichik’s QP circuit. Based on the new design, we updated the BoM and re-estimated component and manufacturing cost.

Task: Simplification of the NMPC problem

Definition: Formulate an alternative NMPC problem with less variables to reduce the size of the associated NLP, which reduces the complexity and cost of the analog circuit.

Completion: The task is completed. We formulated a torque-limited single pendulum swing-up problem, which is analogous to the mountain car problem, a classical problem in reenforcement learning. It has a lower-dimensional state space than the double pendulum swing-up problem, and its dynamics is still nonlinear. Alvin modified the code and we were able to achieve swing-up with NMPC.

Next Steps:

My next step is to synthesize the full circuit with Andrew, and implement SLP with Alvin.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed.

Team Status Report for Mar 2

Significant risks and risk management:

Risk: Dr. Vichik’s analog circuit failing to solve the problems we specify

Description: In a preliminary circuit simulation, we tried to solve a simple LP with the analog circuit proposed by Dr. Vichik. However, we found that the circuit fails to solve the LP with certain parameters. This indicates a risk that the circuit might not be able to solve the problems we specify.

Severity: If Dr. Vichik’s circuit fails to solve optimization problems we specify, the progress of the whole project would be severely jeopardized, because the design of our analog SQP solver is centered around Dr. Vichik’s circuit primitives. This is the most significant risk we’ve encountered so far.

Resolution: We are currently investigating the nature of the issue that causes Dr. Vichik’s circuit to fail. We aim to either solve this issue by improving Dr. Vichik’s design, or mitigate it by avoiding the optimization problems that would cause it to fail.

Changes to the existing design:

There are currently no significant changes to the existing design. However, depending on the nature of the issue that causes Dr. Vichik’s design to fail, changes to our design might be necessary.

Changes to the project schedule:

Similarly, there are currently no significant changes to the project schedule. We might have to delay PCB layout and manufacturing if finding the solution takes more time than expected.

Answers to additional questions:

Part A:

It is difficult to say whether our product can meet a specific need with regards to global factors. While it can be said that the capability to solve optimization problems faster and more efficiently has a wide range of potential benefits, it is unclear which specific benefit our work will entail. Some potential global benefits include MPC for safer vehicle controls, which would benefit the transition to electric vehicles globally.

Part B:

It is difficult to say whether our product can meet a specific need with regards to cultural factors. This is mainly because our product only serves as a proof of concept for the possibility of solving optimization problems faster and more efficiently than existing solutions. It is hard to predict how our solution will be modified and integrated into other products, and thus we cannot say if our product will meet specific needs in relation to cultural factors.

Part C:

Our proposed product has the potential of yielding a positive environmental impact. Optimization is widely used in process engineering, which focuses on optimizing industrial and logistical processes. By improving the speed of solving optimization problems, many industries and logistical systems can be made much more efficiency in terms of energy consumption and resources usage. In addition, solving optimization problems on digital computers can be very energy-intensive, while our proposed analog solver consumes much less power. We also plan to use RoHS-compliant components, as well as lead-free PCBs, to reduce the amount of harmful substances in our product. Therefore, our product has the potential of contributing to sustainable development.

Part A was written by Andrew, Part B was written by Alvin, and Part C was written by Thomas.

Thomas’s Status Report for Mar 2

Personal tasks of this week:

Task: Preliminary Simulation of Circuit Primitives

Definition: Build a circuit simulation in EveryCircuit, a simple circuit simulator, to validate the circuit primitives proposed in Dr. Vichik’s thesis on a small-scale optimization problem.

Completion: The task is completed. I was able to build a solver for a simple LP according to Dr. Vichick’s design. However, the simulation yields concerning results, as I was able to tune the parameters of the LP to make the circuit fail to solve it. We will need to further investigate its implications.

Task: Symbolic NLP Formulation of the NMPC Swing-Up Controller

Definition: Symbolically formulate the NMPC Swing-Up controller as an NLP, which acts as the NLP problem we supply to the analog SQP solver on each iteration. Validate the formulation by solving it with an open source NLP solver.

Completion: The task is completed. Alvin and I have successfully formulated the problem as an NLP, and were able to swing up a double pendulum in simulation by repeatedly solving it. Below is a visualization of the controlled double pendulum:

Next Steps:

My next step is to investigate the implications of the failure of Dr. Vichik’s circuit to solve some LPs, and develop a solution accordingly.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed. However, the observed failure of Dr. Vichik’s design indicates a significant risk.

Thomas’s Status Report for Feb 24

Personal tasks of this week:

Task: Library-Based NMPC Swing-Up Controller Benchmarking

Definition: Run a performance benchmark on the library-based NMPC swing-up controller, measuring the time it takes to complete each step of solving the NMPC problem, and identify the performance bottleneck of the system.

Completion: The task is completed. We benchmarked the swing-up controller and found that 32ms out of 38ms in each iteration is spent on solving the NLP, which can be accelerated using our proposed analog SQP solver to achieve significant speedup.

Task: Symbolic NLP Formulation of the NMPC Swing-Up Controller

Definition: Symbolically formulate the NMPC Swing-Up controller as an NLP, which acts as the NLP problem we supply to the analog SQP solver on each iteration.

Completion: The task is partially completed. We’ve made substantial progress in deriving the dynamics constraints and symbolic cost function. More work will be done in the next week.

Next Steps:

My next step is to continue working on formulating a symbolic NLP problem of the NMPC swing-up controller. I will also continue to work with Andrew on analog component selection and circuit simulation.

Overall progress assessment:

My progress is on-schedule, as all of my tasks this week have been completed or partially completed.