【RM2023-一个悬挂设计小工具开源】

方三水321 方三水321 | 453 | 2023-01-02

目前各种机器人大多使用纵臂式悬挂,而不同种类或者说不同重量机器人的悬挂会有所不同,设计几何参数时,考虑各种工作状态,老是陷入纠结,随着悬挂的压缩,力臂的大小会变化,弹簧的压缩速度也在变化,为了提高设计效率,用matlab写了一个快速计算的小工具,具体功能如下:

下载.png




改变结构几何参数(轮子、弹簧、摆臂之间的几何关系)和弹簧属性(初始张力和弹性系数),可以得到几何关系示意图,以及力臂比例、弹簧力、悬挂力随悬挂压缩行程的变化规律。

悬挂设计比较复杂,但在小尺度下强度问题会比较小,这也只是一个简单的计算,帮助考虑减震、抗冲击的能力。

代码复制进matlab运行即可,需要改变的参数有所注释。

clear
clc

%-----------初始几何关系定义----------%
l0=110; %弹簧初始长度 单位都是mm
l1=110; %弹簧连接处摆臂长度
l2=110; %轮子摆臂长度
x=-20; %弹簧绞点横坐标
y=80; %弹簧绞点纵坐标
theta=60; %两个摆臂之间的夹角
k=1; %N/mm弹性系数
N0=10; %弹簧初始压力/N
alpha0=atand(x/y)+acosd((x^2+y^2+l1^2-l0^2)/(2*l1*(x^2+y^2)^0.5)); %弹簧连接处摆臂与纵轴的初始夹角
%-----------初始几何关系定义----------%

dy=0;
l=l0;
alpha=alpha0;
n=1;

while(l>=l0*0.6&&(alpha>atand(x/y))) %弹簧最大压缩量,假设0.6全长
delta=alpha0+theta-90-asind(sind(alpha0+theta-90)-dy/l2);

alpha=alpha0-delta;
l=sqrt((l1*sind(alpha)-x)^2+(l1*cosd(alpha)-y)^2);
N(n)=k*(l0-l)+N0; %弹簧弹力
N_whell(n)=N(n)*l1*sind(acosd((l^2+l1^2-x^2-y^2)/(2*l*l1)))/l2*sind(alpha+theta); %轮上弹力
Nk(n)=l1*sind(acosd((l^2+l1^2-x^2-y^2)/(2*l*l1)))/l2*sind(alpha+theta); %力臂比例
if(n>1)
DN(n)=(N(n)-N(n-1))/1; %弹簧弹力变化率
DN_whell(n)=(N_whell(n)-N_whell(n-1))/1; %轮上弹力变化率
DN(1)=DN(2);
DN_whell(1)=DN_whell(2);
end
Dy(n)=dy;
Alpha(n)=alpha;
dy=dy+1;
n=n+1;
end
subplot(3,2,1)
set(gcf,'Units','centimeter','Position',[10 1 20 20]); %窗口位置
hold on
axis equal
axis padded
plot(x,y,'o')
plot(0,0,'o')
text(x-60,y,'弹簧铰点','color','r','FontSize',10)
text(-20,-10,'转轴','color',[0 0.3 0.8],'FontSize',10)
text(l1*sind(alpha0+theta)+10,l1*cosd(alpha0+theta),'轮子转轴','color',[0 0.3 0.8],'FontSize',10)
text(0.5*l1*sind(alpha0),0.5*l1*cosd(alpha0),'l1','color','r','FontSize',10)
text(0.5*l1*sind(alpha0+theta),0.5*l1*cosd(alpha0+theta),'l2','color','r','FontSize',10)
text(l1*(sind(alpha0+theta)+sind(alpha0))/8,l1*(cosd(alpha0+theta)+sind(alpha0))/8,'theta','color','r','FontSize',10)
text(0.5*(x+l1*sind(alpha0)),0.5*(y+l1*cosd(alpha0))+5,'l0','color','r','FontSize',10)

plot([0,l1*sind(alpha)],[0,l1*cosd(alpha)],'Color',[0 0 0])
plot([0,l2*sind(alpha+theta)],[0,l2*cosd(alpha+theta)],'Color',[0 0 0])
plot([l1*sind(alpha),l2*sind(alpha+theta)],[l1*cosd(alpha),l2*cosd(alpha+theta)],'Color',[0 0 0])
plot([0,l1*sind(alpha0)],[0,l1*cosd(alpha0)],'Color',[.5 0.5 0])
plot([0,l2*sind(alpha0+theta)],[0,l2*cosd(alpha0+theta)],'Color',[.5 0.5 0])
plot([l1*sind(alpha0),l2*sind(alpha0+theta)],[l1*cosd(alpha0),l2*cosd(alpha0+theta)],'Color',[.5 0.5 0])
plot([x,l1*sind(alpha0)],[y,l1*cosd(alpha0)],'--','Color',[0 0.5 0.5])
hold off
title('几何关系')
xlabel('x坐标/mm')
ylabel('y坐标/mm')

subplot(3,2,2)
plot(Dy,Nk)
title('力臂比例')
xlabel('悬挂压缩量/mm')
ylabel('弹簧力臂/重力力臂')
axis([0 inf 0 inf])

subplot(3,2,3)
plot(Dy,N)
title('弹簧力')
xlabel('悬挂压缩量/mm')
ylabel('弹簧力/N')
axis([0 inf 0 inf])

subplot(3,2,4)
plot(Dy,DN)
title('弹簧力变化率')
xlabel('悬挂压缩量/mm')
ylabel("弹簧力变化率")
axis([0 inf 0 inf])

subplot(3,2,5)
plot(Dy,N_whell)
title('悬挂力')
xlabel('悬挂压缩量/mm')
ylabel('悬挂支持力/N')
axis([0 inf 0 inf])

subplot(3,2,6)
plot(Dy,DN_whell)
title('悬挂力变化率')
xlabel('悬挂压缩量/mm')
ylabel('悬挂支持力变化率')
axis([0 inf 0 inf])






请问这篇文章对你有用吗?

【RM2023-一个悬挂设计小工具开源】
所有评论
暂无更多
暂无更多
关于作者
方三水321
方三水321
0 关注Ta
0 文章
0 经验值
0 获赞

目录

评论