Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.1K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

Constrain inputs for the gain function of LQR Controller?

Posted 7 years ago

Hi there, I'm working on a small project, whereby I'm controlling an inverted pendulum via Flywheel and a bldc motor.

I have a NonlinearStateSpacemodel with a single input u[t] and single output theta[t] (the angle of the pendulum body) .

I have completely simulated the system, and created a control scheme that seems to work well, even made a nice little animation to visualize.

pendulum (please excuse the framerate)

Now comes to the point of programming my micrcontroller, and running/verifying the experiment. However, I've come to notice the control equation ends up producing a solution that can could calculate thousands of ampres...However the motor itself can only take 2...Is there a way within Mathematica and the control system to constrain inputs for the gain function directly using builtin functions? Or must this be done via a semi-smooth newtonian solver or something "hand made"

I can gladly post code should a person want to play with my system, or more info is required.

Thanks for the help!

POSTED BY: Mor Bo
2 Replies
Posted 7 years ago
POSTED BY: Mor Bo

Mor,

LQR regulators let you put weights on the states and the inputs. It seems that your scaling is wrong and you are weighing the states far more than the inputs. Post your code if you want me to be more specific. The problem is that you need to constrain the inputs more.

As to your general application: Here is an example of the inverted pendulum solved in Wolfram SystemModeler with an LQG Regulator. They use SystemModeler (WSM) to load the regulator into an Arduino using ModelPlug.

Another resource: At the 2018 Wolfram Conference, I demonstrated how to take a State Space Model from WSM and move it to MMA (you already have yours in MMA) and design an LQR controller. Also, in a different talk the Wolfram developer showed new functionality with MMA 12 that allows you to load your regulator designed in MMA into an embedded processor (so soon you will not even have to program the processor yourself!). I believe that both talks (certainly mine!) will be repeated live in this free Wolfram U Webinar Series November 28. (The Webinar will also be posted after the live event)

I believe that webinar will have multiple talks that are relevant to what you are doing. In the meantime, please post your code and I can comment on it.

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard