ramaniitrgoyal92 / Modeling_of_Tensegrity_Structures_MOTES

Modeling_of_Tensegrity_Structures(MOTES)
Mozilla Public License 2.0
14 stars 10 forks source link

Control of tensegrity: Questions about control paper #11

Closed waltejon closed 4 years ago

waltejon commented 4 years ago

Hello @ramaniitrgoyal92!

I have the following questions about the control of tensegrity structures (modeled with MOTES) and the related paper "Model and Data Based Approaches to the Control of Tensegrity Robots". I would be really happy if you could help me.

ramaniitrgoyal92 commented 4 years ago

Hello @ramaniitrgoyal92!

I have the following questions about the control of tensegrity structures (modeled with MOTES) and the related paper "Model and Data Based Approaches to the Control of Tensegrity Robots". I would be really happy if you could help me.

  • Eq. (13): Do $\Lambda$ and $\tau$ have a physical meaning? I could not find a information about this in this paper and your modeling paper (2019).

No. The final equation is just a linear programming problem and those are the just the coefficients of that.

  • Eq. (14): What is the difference between $L$ and $N$? Also $N$ shall define the x-, y- and z-coordinates of the nodes?

$N$ is the matrix for all the nodes position. L defines which axis to choose and R defines the node number. Like choose L = [1 0 0] for x axis and L = eye(3) for all the three axis.

  • Eq. (16): How to choose/setup the control gain parameters matrices $\Psi$ and $\Theta$? Their dimensions must be chosen so that matrix multiplication is possible?

Yes, the dimension should be chosen based on that and the values such that the differential equation is stable.

  • Eq. (21), (23): What does this \widespan{…} mean? I think that is related to the equation rearrangement and the “using the identity”, but I am not sure about this. Unfortunately, I did not find a helpful information yet…

That basically makes the diagonal vector out of a vector, put all the values of the vector along the diagonal of the matrix.

  • Is it only necessary to measure the force densities inside the strings? At least that's how I understood/interpreted it when I read the paper... Or is the position of the nodes necessary to implement the proposed control concept, too?

You need the full state feedback, i.e. both position and velocity of the nodes to control it. No need to measure the force density.

  • What would you recommend if I want to combine equations (14)-(24) or (14)-(30) with MOTES. Probably creating and implementing another function within the function library, e.g. 'tenseg_simclass1closed.mor tenseg_simclasskclosed.m`?

Instead of calculating gamma as the elastic string \gamma = k(1-s_0/|s|), calculate the \gamma from the controller and feed it back. To calculate \gamma, take the values of position and velocity as the feedback. Basically, two functions in the loop feeding to each other.

waltejon commented 4 years ago

@ramaniitrgoyal92: Thank you for answering my questions!

Now I'm trying to apply the model-based approach to the simple 1-bar example. Maybe I would contact you and Mr. Wang if new questions arise - I hope that's okay :)

waltejon commented 4 years ago

@ramaniitrgoyal92, @rwang0417:

Tensegrity Control-9 1

ramaniitrgoyal92 commented 4 years ago

@ramaniitrgoyal92, @rwang0417:

  • Is the control structure shown correct?

It would be correct with a few modifications. Just to control the positions, the controller needs information about $N$ and $\dot{N}$, as the big matrix, $\Gamma$ and $\mu$ contains both position and velocity. The controller needs information about the states not just the error to find the control.

The discussion about the velocity control is totally different.

  • $\gamma$ is the control signal / command value / plant input, isn't it?

Yes.

  • Did I understand you right with the feedback of position and velocity? Do you mean the two error dynamics of $E_p$ and $E_v$? Actually, then the output of "Mechanism" should be also $\dot{N}$.

No, I meant you need both the feedback of position and control for the position control only, i.e. only for $E_p$. Check that you need N and Ndot to calculate \Gamma and \mu.

  • Is it possible to control only the position of the nodes? So just using the error dynamics $E_p$ and just feedback the position $N$.

Yes, you can only control the position using E_p equation, but you need feedback for both position and velocity.

  • Did I understand you right with the calculation of $\gamma$ from the controller? Do I have to invert $\Gamma$ to compute $\gamma$ and feed it to the mechanism? Is $\Gamma$ then invertible? If not, then I could use left-/right-side inverse or Pseudoinverse?

Mostly, it is not invertible, not even square. I would suggest using some linear programming solver like linprog or least square solver to solve it with the constraint that \gamma>0.

I hope it helps!

Tensegrity Control-9 1

waltejon commented 4 years ago

@ramaniitrgoyal92: Thank you for the answer!

In between, I managed to control the node position $n_2$ of the simple 1-bar structure in 2D. For this, I used the pinv from MathWorks to calculate the $\gamma$. So far, it has worked, I can not really assess whether this is runtime-efficient. I primarily wanted to combine the equations from the control paper with MOTES. I managed that thanks to your tips above.

Next steps/challenges

image

image

waltejon commented 4 years ago

@ramaniitrgoyal92:

ramaniitrgoyal92 commented 4 years ago

@ramaniitrgoyal92:

  • In which unit are the node positions $N$ in MOTES specified? In meters?

You can choose anything you want. The default values are in meters.

  • Eq. (24): $n_r$ are the number of nodes to be controlled?

Yes, basically the number of columns in matrix R.

  • Eq. (13), (22)-(24): What is $e_i$? Probably a unit vector? But then I wonder where the 1 is? I have not used $e_i$ for the simple system because there was no need to do so... However, I want to generalize the equations, so I have to rely on $e_i$.

It is a unit vector with 1 as the ith element and rests 0s. The order of the vector depends on the context.

waltejon commented 4 years ago

@ramaniitrgoyal92: Does MOTES also allow to define active and passive strings (see Fig. below)? Active string in the meaning of that it's length could be changed by an actuator. Passive string in the meaning of string length is not changed actively, but maybe due to an external force.

If this is possible, how can I define active and passive strings?

3-dof-joint-2d

Background information

I try to control node $n_2$ to a certain position. However, the length of the two passive strings is also varied when calculating the force density $gamma$. I would like to avoid this and instead just change the length of the active strings.

ramaniitrgoyal92 commented 4 years ago

Hi @waltejon! The best way to do this is to go inside the code and define two kinds of strings. So the function you must have created to solve the control from \Gamma \gamma = \mu, in that, choose the active strings to solve for that and separately solve for the tension of the passive strings using Hooke's law.

so, let's say tension/force density in active strings is t_a and tension/force density in passive strings is t_p:

Solve for active strings using \Gamma \gamma_a = \mu

and solve for passive strings as t_p = Hooke's law using node position.

waltejon commented 4 years ago

@ramaniitrgoyal92: Thank you for the answer!

I tried the above approach by differentiating active and passive strings. It also works purely from the matrix operations. However, the 3-bar structure becomes still unstable... As the simulation time continues, the \gamma_a values increase incredibly and when I look at the function via the plot function, it looks as if it would explode.

1 Question about control strategy

For this reason, I went back one step and looked at the values for \gamma in the case of the simple 1-bar structure. I noticed a peculiarity regarding the control strategy.

The \gamma_1 and \gamma_2 are the same size (see Fig. below)... Intuitively, I would have thought that \gamma_1 would be much smaller than \gamma_2. So you could increase efficiency by not pulling on a high tensioned string or am I wrong?

So now I'm wondering what the controller's strategy is. Also the valus of gamma seem to be really high (like 2000 N/m)?

image

2 Why do I need N_dot as feedback and \Gamma_v for position control?

It would be correct with a few modifications. Just to control the positions, the controller needs information about $N$ and $\dot{N}$, as the big matrix, $\Gamma$ and $\mu$ contains both position and velocity. The controller needs information about the states not just the error to find the control.

Gamma_v

I only want to control the node positions. For this, I have assumed that I can only work with equations (14)-(24) and do not necessarily need \Gamma_v. So currently, \Gamma = \Gamma_p from Eq. (14).

N_dot

I understand that I need \dot{E} to calculate \Gamma_p. So far I've used ETA2_dot and the resultingNd from your function tenseg_dyn_ckopen:

    % Reshape from vector to matrix form

    XETA2 = X(1:numel(X)/2);
    XETA2_dot = X(numel(X)/2+1:end);
    ETA2 = reshape(XETA2,3,[]);
    ETA2_dot = reshape(XETA2_dot,3,[]);

    N = [ETA1 ETA2]*U';
    Nd = [zeros(size(ETA1)) ETA2_dot]*U';

I route these variables ETA2_dot and Nd to my own created control function. Is this OK?

3 Instability during control of structures with \beta > 1

As soon as I simulate systems with several bars, I get instabilities. This manifests itself in the fact that

The calculation of Omega also causes difficulties and infinitely large values for me ...

Overall, the whole thing still seems a bit strange to me. So far, I have only controlled the single node n_2 using the approach described above (Gamma = Gamma_p). Even if I choose the target position of the node to be controlled equal to the start position (Y_bar = n_2), I get instabilities after ca. 0.3 seconds.

The initial error E is very small (approximately 10e-6 in the x and y directions). However, it is getting bigger and the system is rocking...

image

Note: In the Figures above, the differentiation between active and passive string is inactive. Even when it is activated, I have some stability problems.

So, I have the following questions:

ramaniitrgoyal92 commented 4 years ago

@waltejon Sure! Let us meet via zoom. Any daytime (Texas time) this Sunday will work for me. Please send me an invitation.

waltejon commented 4 years ago

@ramaniitrgoyal92: I would have a few more questions about the usage of MOTES and the model-based control.

Following our zoom meeting, I use linprog and lsqlin to calculate gamma. For the 1-bar-structure this works well. The resnorm of lsqlin is always within the permissible error range of numerical calculations.

Again I have problems with the control of the 3-bar-structure - despite the calculation of gamma using lsqlin. For my configuration, lsqlin does not find an optimal solution, i.e. the resnorm is very large (e.g. resnorm = 125). At the same time linprog of course does not find an optimal solution...

I don't know yet what the reason for this might be - but I have at least made some observations and the following questions

Question 1

During the simulation in an open loop, I noticed that the 3-bar-structure oscillates in vertical direction (see Figure below). This is due to the pre-tension in the strings. The greater the percentage deviation from 'S_O', the stronger the oscillation becomes. No pre-tension means no oscillation. However, in this case no regulation is possible? Have you ever had the effect of oscillating structures in MOTES? How I can avoid it? Do I have to set the pre-tension differently in active and passive strings?

image

Question 2

When I had problems with the 3-bar-structure again, I went back to the 1-bar-structure. However, I made a change here in that the original single bar now consists of two bars lined up next to each other. With this I want to validate my calculation in the case of beta > 2... During this simulation I noticed that the two bars buckle. Does MOTES allow bars to be firmly joined together so that the assembly cannot bend (see Figure below)?

image

Question 3

Do you have another idea why I can control 1-bar-structures easily and strugge with 3-bar-structure? I checked already the equations from the control paper and I am pretty sure that they are fine...

ramaniitrgoyal92 commented 4 years ago

@ramaniitrgoyal92: I would have a few more questions about the usage of MOTES and the model-based control.

Following our zoom meeting, I use linprog and lsqlin to calculate gamma. For the 1-bar-structure this works well. The resnorm of lsqlin is always within the permissible error range of numerical calculations.

Again I have problems with the control of the 3-bar-structure - despite the calculation of gamma using lsqlin. For my configuration, lsqlin does not find an optimal solution, i.e. the resnorm is very large (e.g. resnorm = 125). At the same time linprog of course does not find an optimal solution...

I don't know yet what the reason for this might be - but I have at least made some observations and the following questions

Question 1

During the simulation in an open loop, I noticed that the 3-bar-structure oscillates in vertical direction (see Figure below). This is due to the pre-tension in the strings. The greater the percentage deviation from 'S_O', the stronger the oscillation becomes. No pre-tension means no oscillation. However, in this case no regulation is possible? Have you ever had the effect of oscillating structures in MOTES? How I can avoid it? Do I have to set the pre-tension differently in active and passive strings?

image

As this is an open-loop simulation, the configuration has to be in equilibrium at the start. It is simply like a spring-mass system oscillating with constant energy. So, at the start, you have to give the equilibrium pre-tension in both the active and passive strings. This is fine, as you are the boss to choose the initial configuration of the system with the starting pre-tension. You can also add damping to the strings as:- DataStructure.c = 2. This will make the system go to an equilibrium configuration.

Question 2

When I had problems with the 3-bar-structure again, I went back to the 1-bar-structure. However, I made a change here in that the original single bar now consists of two bars lined up next to each other. With this I want to validate my calculation in the case of beta > 2... During this simulation I noticed that the two bars buckle. Does MOTES allow bars to be firmly joined together so that the assembly cannot bend (see Figure below)?

image

Actually, tensegrity structures are supposed to be joined together by ball joints only. Otherwise, there can be a moment/torque transfer from one bar to another, but by definition of tensegrity, the load on any bar should be only axial. So, all the joints in MOTES are ball joints in 3D and hinge joints in 2D.

But to avoid buckling of the structure, something else can be done. You can reinforce the center by adding some more bars and strings, and then by adding some pretension to them. Something like this: image

And you give large enough tension, so that this doesn't happen: image

For more details, you can check out this recent paper: R. Goyal, R. Skelton, and E. A. Peraza Hernandez, “Design of minimal mass load-bearing tensegrity lattices,” Mechanics Research Communications, vol. 103, p. 103477, 2020.

Question 3

Do you have another idea why I can control 1-bar-structures easily and strugge with 3-bar-structure? I checked already the equations from the control paper and I am pretty sure that they are fine...

I would suggest starting with 2 bar structure, where two bars are not even connected to each other. Then, you can try to control them individually and then if that works, control them together. It should work just fine, I cant point at anything honestly.

I hope it helps! Good luck!