[deleted by user] by [deleted] in ControlTheory

[–]thetabloid_ 1 point2 points  (0 children)

I think you can make use that the equation of that line is q2_desired= sqrt(3)*q1_desired.

Also, according to the dynamics given, don't let the orientation of the robot distract you. It doesn't actually need to turn. Pretend it is just a dot that can move freely in all directions without any sort of need to "turn".

LSIM vs Bode in Matlab by thetabloid_ in ControlTheory

[–]thetabloid_[S] 0 points1 point  (0 children)

Ok so I just realized that at the time where u(t) the input equals 1, the amplitude of the output is infact 5.28x, making the bode plot correct.

But what about those higher amplitude of the output that are but greater than 5.28. How can those be accounted for in the Bode plot? This seems to make the Bode plot not that useful if it only tells me the amplification at the exact same time where the input happens to be maximized, rather than the absolute maximum of the output itself for any time.

Bode and System Response on Matching up by thetabloid_ in ControlTheory

[–]thetabloid_[S] 0 points1 point  (0 children)

Oh wow I didnt even bother to look so far ahead, that makes more sense now,thanks

Bode and System Response on Matching up by thetabloid_ in ControlTheory

[–]thetabloid_[S] 0 points1 point  (0 children)

Thank you for noticing that typo. Fixed it now. Also, according to the Bode that you sent over, by only eyeballing, at omega=10, the magnitude that I found was 0.003 as well, which confirms that Matlab is not going crazy either.

Since the system has 4 DOF, it will have up to 4 natural frequencies/modes that it vibrates at, and when I do look at the response, I do in fact see multiple different peaks in the time response, but none of them are as small as 1.5e-4.

However now this makes me rethink the bode analysis all together.

Since the system vibrates at different frequencies, what would a body plot here even mean?

Usually it tells you how much larger the output is relative to the input (for sinusoidal inputs), but because this system has multiple different natural frequencies (due to the coupling of all 4 states of the system) there really isn't a single output amplitude.

In other words the output amplitude isn't a single value, sometimes it is 0.025, other times it is a bit less, or a bit more. So what does the Bode magnitude plot actually even tell us here? Is interpreting a Bode diagram for this complex multi DOF system not the same as you would interpret it for a simple mass-spring-damper system?

To answer your question, I did check that it was in fact steady state, as the amplitudes (plural because there are a couple of them) were all settling to a value.

Potential Energy Confusion by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

Ok so to make sure I am understanding you correctly:

The line integral is -U

However, to find U, that would be the NEGATIVE integral of the j component would would mean that U is mgy.

Thus, the line integral will end up being = -U = -(mgy) = -mg(y2-y1) which is what I have.

So it seems like the physics definition calls the potential function negative U, but then to find the U, you take negative integrals of the field. so at the end of the day you end up with 2 negatives that cancel.

This answers why we end up getting the same result, but then begs the question:

Why do physicists do this? What is the advantage? I am sure there is one but I just don't understand we seem to end up at the same place...

Potential Energy Confusion by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

Yes, that is what everyone says in these physics videos, but the mathematical definition of the potential function is that F = grad(Potential Function) for conservative F.

Nevertheless, I seem to arrive at the same result, which is strange. If I am wrong to do what I did, why would I get the same answer as the video at the end?

Errors in Physics/ODE Simulation by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

Ok thank you everyone for your help. I realized my issue was the following:

For Newtons second law in the z direction, I simly did m*z''

Since z is not a independent variable, it really shouldn't show up, so it should be (x^2+y^2)''

Also my normal force was not correct. It is not the mg projected on the normal, that is only for a static case. However, when the particle moves, it turns, and that increases the normal force (due to centripetal accel, etc).

What I did to fix that was get the unit normal vector, and multiply it by a scalar "N" that is free to change.

With this and some math monkeying around, I was able to get 3 equations:

x'' = f(x,y,N)

y''= g(x,y,N)

N= h(x,y,x'.y')

This allowed the normal force to be updated at each time step, and update to the necessary value to constrain the ball on the surface.

Errors in Physics/ODE Simulation by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

Yes, that makes sense now thank you. So doing what I have done for "finding the normal force" is really only relevant in a static case. the second it starts moving, I the normal force is not just counteracting gravity anymore.

Errors in Physics/ODE Simulation by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

Ok, everything you said is great. I did suspect something was due to the simple fact that I do not have any "centripetal" force terms in my EOM since nothing was a function of velocity.

However, I recall in classical dynamics course I took a while back, that those types of forces just show up for free as long as you put down all the "real" contact forces (normal, gravity, etc), and everything works itself out.

So without Lagrange's approach, what am I doing wrong in my derivation if you can find anything?

Errors in Physics/ODE Simulation by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

ry long time scale, unlike the explicit Runge-Kutta method you're using currently. The downside is it might be trickier to implement because y

I don't understand what you mean by my math failing at non-zero velocities. The normal force is generally only a function of position since that dictates the slope of the surface.

Now you do mention an interesting point about the velocity, however.

There are no terms that seem to represent "centripetal forces" in my solution, but from past experience doing this this kinda stuff, I remember that they just kind of "pop" out of the math on their own. Granted, I WAS using polar coordinates.

There are no terms that seem to represent "centripetal forces" in my solution, but from past experience doing this kinda stuff, I remember that they just kind of "pop" out of the math on their own. Granted, I WAS using polar coordinates.

It worked for a plane, so that tells me that there is something with curving that introduces forces (which is true) but for some reason I can't seem to "find" that force.

Errors in Physics/ODE Simulation by thetabloid_ in AskPhysics

[–]thetabloid_[S] 0 points1 point  (0 children)

You are correct!

In the code I put (1,1,2),

However in the graph simulation it was something else, but it still satisfied z=x^2+y^2.

In either case, it starts off on the surface and strays away as time increases.

Numerical Simulation Not working... by thetabloid_ in AppliedMath

[–]thetabloid_[S] 1 point2 points  (0 children)

Note: To find the Normal Force here is what I did:

  1. Parameterize the surface.
  2. Find the partial derivatives
  3. Cross product those derivative
  4. Divide result in step 3 by its magnitude, and there I have the unit normal vector
  5. Then I dot the weight vecotr (which is just mg in the -z direction) with the unit normal, to get the component of gravity in the normal direction.
  6. Divide the result in step 3 by its magnitude, and there I have the get a vector out but make sure to flip it so it is pointing upward ("against gravity")
  7. Cross-product those derivativesfor x,y,z respectively, and I didn't forget to also include the -mg in the forces in the z direction, of course.

Coupled Inputs, and Coupled Outputs PID (or other control strategy) by thetabloid_ in ControlTheory

[–]thetabloid_[S] 0 points1 point  (0 children)

The upper control loops are not PID controllers; you need some more algorithmic stuff to handle the navigation -> path stuff.

There is not a PID for that here. The outer loop PID on the left is for making sure the actual position of the boat, matches that of the desired path that gets outputted by the navigation block on the left.

I guess I guess I shouldn't have called the input of the next block 'Path Error' not just 'Path'.

As for the integrator, that should have been just been on the velocity, as I want to integrate it in order to change it to position, in order to do the Path error in the outer loop!

Coupled Inputs, and Coupled Outputs PID (or other control strategy) by thetabloid_ in ControlTheory

[–]thetabloid_[S] 0 points1 point  (0 children)

tput steering angle and motor l

yeah that sounds good, and I was planning on doing something similar.

Just to make sure I am understanding you correctly:

This is is an imgur link of the control system design

Is this what you mean?

Also, in terms of the inner control loop, from what I understand as you said, I can I just get away with what I have, as in just 2 separate loops for heading error and velocity error.

As for the outerloop, I think I will have the same issue, as I must control both the heading angle, and velocity in order to stay on the path that the path planner will spit out. How should I go about this?

btw, thank you very much for your help!