Alvin’s Status Report for 4/6

Personal tasks of this week:

Task: Tuning the SLP parameters

Definition: The SLP solver includes multiple tunable parameters, including the bounds for the constraints and the time discretization. The damping coefficient is another variable that is adjustable. Tuning these parameters will effect the performance of the solver.

Completion: Apart from affecting the performance of the solver, these parameters also affect the stability/reliability of the circuit. After testing with different numbers, we found that using the (-0.6, 0.6) as the bounds for the state and (-0.2, 0.2) as the bounds for the control input yielded good results.

 

Note that the pendulum takes multiple swings back and forth before being swung up due to a cost penalty on the control effort.

 

 

Next Steps:

Set up raspi and the drivers for communicating with the PCB.

 

Verification & Validation:

As the digital SLP solver is completed, we can now perform tests to gauge its robustness. Namely, we can run the test suite T2 as we defined in our report.

Run digital implementation 30 times and verify it solves the problem at least 90% of the time

We will run the test with three different starting positions to verify the correctness of the solver.

 

Overall progress assessment:

The SLP solver is mostly completed, moving on to configuring the raspi. On schedule.

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.

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.