I'm designing a compact mechanism for the deployment of a mast. The idea is that the linear actuator for the deployment is on the other side of the pivot, and a slider increases the lever arm to enable the actuator to deploy the mast.

I ran through the maths (shown in details below), and wrote the code for the simulation. I want to know how the actuator force and the lever length relate, and how the force varies with the angle. enter image description here

However, when I run the code I get huge spikes in the force (see below, I capped the force to 10^6 to better see the pattern), but for example I don't see why the mechanism would jam between 40 and 80°. For some reason the cross product of HP with OP (what I call the signed lever arm of F) goes through zero but I see no reason why it would given the current dimensions and angle range set. How can I fix it?


enter image description here

With the force capped at 200N: enter image description here

And the denominator of F:

enter image description here



close all
clear all

%See diagram for description of variables, units are metres
a = (2+10)*10^-3;
b = a;
c = 165*10^-3;
d = 70*10^-3;
h = 180*10^-3;

m = 8; %Mass of the mast in kg
g = 9.81; %Acceleration of gravity in m/s²

%Range of the input variables
thetaMin = 0*pi/180;
thetaMax = 100*pi/180;
tMin = 10*10^-3;
tMax = 100*10^-3;

theta = thetaMin:(thetaMax-thetaMin)/100:thetaMax;
t = tMin:(tMax-tMin)/100:tMax;

%Solve for F
F = zeros(length(t), length(theta)); %Actuator force
L = F; %Length of linear actuator
denominator = F; %Denominator of F, or "signed lever arm"
for i = 1:length(t)
    for j = 1:length(theta)
        M = [cos(theta(j)) sin(theta(j)) 0;
             -sin(theta(j)) cos(theta(j)) 0;
             0 0 1];

        HP = M*[-t(i);

       OP = [-b;

       L(j,i) = norm(OP);

        HG = M*[c;

        W = [0;

        weightMoment = HG(1)*W(2)-HG(2)*W(1); %cross(HG,W)
        forceLever = 1/norm(OP)*(HP(1)*OP(2)-HP(2)*OP(1)); %1/norm(OP)*cross(HP,OP)

        denominator(j,i) = forceLever;

        F(j,i) = -weightMoment/forceLever;

%Plot results
[T,THETA] = meshgrid(t,theta);

ylabel('Angle (deg)')
xlabel('Slide length (mm)')
zlabel('Force (N)')
title('Actuator force')

ylabel('Angle (deg)')
xlabel('Slide length (mm)')
zlabel('Actuator length (mm)')

ylabel('Angle (deg)')
xlabel('Slide length (mm)')
zlabel('Signed lever arm')

Maths: solve $$\vec{moment}(H)=\vec{HP}\times \vec{F}+\vec{HG} \times \vec {W}=\vec{0}$$ With $$\vec{F}=\frac{\vec{OP}}{OP}F$$ $$\vec{HP}= \left[ {\begin{array}{cc} cos(\theta) & sin(\theta) \\ -sin(\theta) & cos(\theta) \end{array} } \right] \left( {\begin{array}{cc} -t \\ a \end{array} } \right) $$ $$\vec{HG}= \left[ {\begin{array}{cc} cos(\theta) & sin(\theta) \\ -sin(\theta) & cos(\theta) \end{array} } \right] \left( {\begin{array}{cc} c \\ -d \end{array} } \right) $$ $$\vec{OP}=\vec{OH}+\vec{HP}$$ $$\vec{W}=\left( {\begin{array}{cc} 0 \\ -mg \end{array} } \right)$$ $$\vec{OH}=\left( {\begin{array}{cc} -b \\ h \end{array} } \right)$$

  • $\begingroup$ How should the mast be positioned with respect to the chassis when fully deployed? I.e., are they collinear, is the mast inserted into the chassis, does it rest on the chassis, will it connect to any surface not pictured here? $\endgroup$
    – Air
    Jul 29, 2015 at 16:00
  • $\begingroup$ Thanks - sorry I forgot to specify the ranges. Theta should go from 0 to just before whichever value makes the linear actuator aligned with the pivot - that's the limit of stability. Say, 100°. The slider length from say 10mm to 100mm. Oh, actually, it can be seen on the plot I've posted. $\endgroup$ Jul 29, 2015 at 16:03
  • 1
    $\begingroup$ I haven't looked too closely but I would guess this is the point where in the line where you calculate F you divide by zero. At least I can't see any other way you could easily get an infinity in your code. $\endgroup$
    – nivag
    Jul 29, 2015 at 16:25
  • $\begingroup$ I saw it too, but the denominator should never be zero at these locations... $\endgroup$ Jul 29, 2015 at 16:35
  • $\begingroup$ Well, it looks like you've certainly got some numeric weirdness. Have you isolated some test data points where you get huge spikes, and single stepped through the code there to see if you're getting variable values that are appropriate? $\endgroup$
    – rfdave
    Jul 30, 2015 at 2:36

1 Answer 1


If you plot the x values of OP and HP, they cross zero, which seems unphysical.

Looking more closely, you are doing your rotations backwards, i.e. you are doing our rotations in +theta whereas you want to go in -theta.

This is something I often do too. To fix, just replace theta with -theta in M.

Here's a figure of F when you do this which looks much more reasonable.

enter image description here

  • $\begingroup$ Thanks a lot, I finally have sensible F plots! I had carefully used -theta in my rotation matrix because the rotation matrix is given from the reference frame 1 to the reference frame 2 when rotating from 1 to 2... This is very strange, but the results speak for themselves; I'll look into this later. $\endgroup$ Jul 30, 2015 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.