Alvin’s Status Report for 3/30

Personal tasks of this week:

Task: Deriving the SLP(sequential linear programming) formulation of a dampened pendulum

Definition: Due to the discovery of the limitation in Sergey’s circuit design, we are switching the problem and algorithm to try to accommodate. Thus, I am currently working on formulating the SLP for swinging up a single dampened pendulum.

Completion: The formulation has been derived. However, the parameters for the constraint bounds and the timestep still need to be tuned as SLP is more sensitive to these parameter values. Currently the solver can swing up the pendulum.

 

 

 

Next Steps:

Tune parameters for SLP solver.

Overall progress assessment:

Schedule changed, on schedule.

Andrew’s Status Report for Mar 30

Personal tasks of this week:

Task: Test and resolve circuit issues in simulation

Definition: Work with Thomas 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 have done extensive analysis and experiments in order to determine the cause of the issue. Furthermore, we have resolved all of the remaining issues with Sergey’s formulation as well.

Here is the sheet with all of our experiments: Experiments

Here are some screenshots of some of our successful simulations:

 

DC voltage sweep on optimal cost voltage

Success on new optimization Circuit

Next Steps:

My next step is to test the circuit for more complex optimization circuits in order to make sure that the circuit formulation method is sound, then finally try this on our pendulum LP circuit. I will also translate these circuits schematics into altium to begin pcb design.

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.

Andrew’s Status Report for March 23

Personal tasks of this week:

Task: Circuit Simulation:

Definition:  While the previous issues with Sergey’s thesis were resolved, the full scale circuit simulation must be made and tested using LTSpice.

Completion: The task is not completed :’)) . Iturns out that Sergey’s formulation of his problem introduces many issues when actually trying to solve a more general problem than the very specific problem that he formulated for his thesis.

To test the validity of the approach, we first began with creating a simple 6 variable optimization problem for the circuit primitives to solve.

The problem is as follows:

Linear Cost:  th_1+2th_2+3w_1+4w_2+5u_1+6u_2

Equality Constraints:  th_1+th_2+w_1+w_2+u_1+u_2 = 20

equality constraint: 2th_1+2th_2+w_1+w_2+u_1+3u_2 = 30

equality constraint: 3th_1+1th_2+2w_1+2w_2+2u_1+1u_2 = 40

equality constraint: 1th_1+3th_2+1w_1+3w_2+1u_1+2u_2 = 50

The largest problem that we figured out is that the circuit that solves the optimization problem does not properly converge. Through much testing, we were able to find many more issues with the current formulation being realized. In the end, we were able to get the circuit to converge to the proper voltages in less than a milisecond, but we were not able to get the circuit to converge to the correct values when adding the bias voltages for the equality constraint.

We also did some further experiments regarding the negative voltage on the linear cost to see how it converges as well.

Next Steps:The next steps is to diagnose and fix these further issues we found with Sergey’s formulation.

Overall progress assessment:

My progress is behind-schedule, as we have found more issues with the practical formulation of Sergey’s thesis.

Team Status Report for March 23

Significant risks and risk management:

Risk: The analog circuit as described by Sergey’s Thesis cannot be realized.

Definition: Through some more research and implementing his circuits through simulation, we were able to determine that the constraint primitives are not able to be realized for our optimization problem. Specifically, for the equality constraint, the theoretical formulation assumed infinite op amp rail voltages and the quadratic costs  could not properly be realized without first solving a linear programming problem.

Severity: The severity is very high. If this is not able to be resolved, our circuit will fail to converge.

Resolution:  We were able to resolve both of these issues. For the inequality, we reduced the operating voltage by 10x, so that the maximum voltage that we expect is within the rails of the op amp. As for the costs, we realized that we could not implement these quadratic costs for SQP without first solving a SLP (sequential linear programming), so we decided to compromise and solve our optimization problems using an SLP, using linear costs.

Current progress:

Apart from the risk identified from last week, the current big risk in our project is the uncertainty of whether or not we can create a working solution. We are putting in a lot of work to modify the circuit design so that the circuit is able to perform our needed calculations while remaining within the physical limits of the components, which is something that Sergey did not consider with his design. At the same time, switching from SQP to SLP means that the problem formulations need to be rederived, which will inevitably put us behind schedule. However, we are currently making good progress to both having a workable circuit simulation and a correct SLP formulation.

Changes to the existing design:

Apart from the changes described last week, we have successfully simplified the analog circuit to include less components by exploiting some of the structure within the problem. We also changed the problem we are trying to solve from a double pendulum to a single dampened pendulum to make it less non linear while making it still interesting.

Changes to the project schedule:

There are no significant changes to the project schedule, we are trying to complete the circuit simulation as soon as possible so that we can start to order pcbs.

Alvin’s Status Report for 3/23

Personal tasks of this week:

Task: Deriving the SLP(sequential linear programming) formulation of a dampened pendulum

Definition: Due to the discovery of the limitation in Sergey’s circuit design, we are switching the problem and algorithm to try to accommodate. Thus, I am currently working on formulating the SLP for swinging up a single dampened pendulum.

Completion: Currently I am still working on the problem formulation. I had some misunderstandings about the problem structure that hindered my progress, but was cleared after talking with Thomas.

 

 

 

Next Steps:

Complete the formulation of SLP and isolate the LP subroutine.

Overall progress assessment:

Schedule changed, slightly behind but catching up.

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.

Alvin’s Status Report for 3/16

Personal tasks of this week:

Task: Changing the simulation time discretization

Definition: Currently, the time discretization for the simulation and the NMPC formulation is the same. Essentially, the next state that the NMPC controller produces is used as the real next state. However, there is a flaw in this design, as the time discretization of the controller is quite large(0.2). This might cause the next state to not actually obey real world physics. To solve this problem, we can change the code such that after the controller produces a control, that is used by the simulator to generate the true next state with a much finer time discretization(0.01)

Completion: I was able to implement this change. The simulation now reflects real world physics much more closely. It also demonstrated that our dynamics derivation and controller design were correct.

 

 

 

Next Steps:

We’ve made some modifications to our schedule and the next step is still to look into ways to formulate the problem in way that is solvable by the circuits we have.

Overall progress assessment:

Schedule is changed, so slightly behind.

Team Status Report for March 16

Significant risks and risk management:

Risk: The analog circuit as described by Sergey’s Thesis cannot be realized.

Definition: Through some more research and implementing his circuits through simulation, we were able to determine that the constraint primitives are not able to be realized for our optimization problem. Specifically, for the equality constraint, the theoretical formulation assumed infinite op amp rail voltages and the quadratic costs  could not properly be realized without first solving a linear programming problem.

Severity: The severity is very high. If this is not able to be resolved, our circuit will fail to converge.

Resolution:  We were able to resolve both of these issues. For the inequality, we reduced the operating voltage by 10x, so that the maximum voltage that we expect is within the rails of the op amp. As for the costs, we realized that we could not implement these quadratic costs for SQP without first solving a SLP (sequential linear programming), so we decided to compromise and solve our optimization problems using an SLP, using linear costs

Current progress:

We have resolved the issues regarding the constraints

Changes to the existing design:

We have modified our problem formulation from SQP to SLP, modified the constraints to account for op amp rail voltages, and slightly descoped the optimization problem.

Changes to the project schedule:

Similarly, there are no significant changes to the project schedule, we are a bit behind schedule with pcb ordering though.