Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traj opt 2DOF wing flapping #51

Merged
merged 94 commits into from
Jul 5, 2019
Merged

Traj opt 2DOF wing flapping #51

merged 94 commits into from
Jul 5, 2019

Conversation

avikde
Copy link
Owner

@avikde avikde commented Jun 3, 2019

  • implement dynamics
  • compare discrete to cts
  • animation
  • flapping kinematics
  • get osqp iteration to run
  • initial trajectory is too infeasible to refine tol. try to make more feasible?
  • factor the wingqp and the wing2dof model into a WingTrajOpt.py module
  • function to animate these ~23 knot point trajectories
  • Constraint: linearization of dynamics (as before). Nothing needs to change from the MPC module. This will set A, b for OSQP. Actuator constraints
    image

  • Objective: quadratic approx can be used for OSQP. Two choices: one needs Hessian, and one needs only Jacobian. See https://math.stackexchange.com/questions/2349026/why-is-the-approximation-of-hessian-jtj-reasonable One or both of these could be symbolically implemented and stored in Python (maybe using autograd) and OSQP update could update P, q.

Implementation

  • Split up LTVMPC module into a LTVSystem: assembles A, b, has options for input, state, polytope constraints
  • LTVMPC then needs a LTVSystem as one of its members (vs. a Model)
  • For this, use as much of LTVMPC as possible,
  • make a new module called SQP

@avikde
Copy link
Owner Author

avikde commented Jun 6, 2019

For the dirtran optimization

First should try the simplest optimization (smallest dimension) and then slowly increase complexity.

  • max lift s.t. constraints?
  • change wing size s.t. actuator limits

@avikde
Copy link
Owner Author

avikde commented Jun 6, 2019

Confirmed that the y2-dependence of the objective gradient is due to the appearance of psi (hinge angle) in the AoA. Fixing that results in y3-dependence only.

@avikde
Copy link
Owner Author

avikde commented Jun 30, 2019

Manually rescaled by multiplying rows of A and the limits:
image

@avikde
Copy link
Owner Author

avikde commented Jun 30, 2019

There is something somewhat wrong with the rescaling. When increasing it, the hinge angle wants to become higher, though the actual underlying dynamics should have not changed

@avikde
Copy link
Owner Author

avikde commented Jul 1, 2019

Nonconvexity:

  • think about the function and see if it makes sense
  • can help it out by adding regularization (either damping or wx)\
  • cost does improve when doing this

@avikde
Copy link
Owner Author

avikde commented Jul 4, 2019

Right: desired hinge angle = 0; left: pi/4

image

EDIT: with increased force limit

image

Remember that there is a periodicity constraint. Accounting for that and dynamics, maybe this is somewhat working

@avikde
Copy link
Owner Author

avikde commented Jul 4, 2019

Trying to do anything with the 2nd order lift approx as cost results in garbage like this

With outer prod of J
image

With hessian
image

@avikde avikde merged commit da5a9ff into master Jul 5, 2019
@avikde avikde deleted the traj-opt-flap branch July 5, 2019 00:26
@avikde avikde mentioned this pull request Jul 16, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant