麦轮全向移动原理

参考作者在路上@Amos《麦克纳姆轮全向移动原理》,作者讲述了麦轮的基础知识,感兴趣请戳。


这里只涉及4个轮子的特定方向安装,还有很多种安装方式。

俯视轮子图
在小车上安装麦轮的图

下图轮子的方向为俯视时辊子的方向

与地面接触的辊子方向

其中 v t v_t vt是小车的速度, ω \omega ω是小车的角速度。

小车的运动
小车底盘的速度 v t v_t vt可以分解为X,Y轴平动速度 v t x , v t y v_{tx},v_{ty} vtx,vty,及yaw轴旋转角速度 ω \omega ω

由车体的速度计算轮子的速度

  • 小车的四个轮可以由车体的平动速度 v t x , v t y v_{tx},v_{ty} vtx,vty及转速 v r = ω ⃗ × r ⃗ v_r = \vec{\omega}\times \vec{r} vr=ω ×r 合成得到。 (其中 r ⃗ \vec{r} r 是小车中心到轮子中心的向量。 v r v_r vr则是垂直于 r ⃗ \vec{r} r 的向量)

如图所示。
v r 1 ⃗ = ω ⃗ × r 1 ⃗ = − b ω i ⃗ + a ω j ⃗ v r 2 ⃗ = ω ⃗ × r 2 ⃗ = − b ω i ⃗ − a ω j ⃗ v r 3 ⃗ = ω ⃗ × r 3 ⃗ = b ω i ⃗ − a ω j ⃗ v r 4 ⃗ = ω ⃗ × r 4 ⃗ = b ω i ⃗ + a ω j ⃗ \begin{aligned} \vec{v_{r_1}}&=\vec{\omega} \times \vec{r_1} = -b\omega\vec{i}+a\omega \vec{j}\\ \vec{v_{r_2}}&=\vec{\omega} \times \vec{r_2} = -b\omega\vec{i}-a\omega \vec{j}\\ \vec{v_{r_3}}&=\vec{\omega} \times \vec{r_3} = b\omega\vec{i}-a\omega \vec{j}\\ \vec{v_{r_4}}&=\vec{\omega} \times \vec{r_4} = b\omega\vec{i}+a\omega \vec{j}\\ \end{aligned} vr1 vr2 vr3 vr4 =ω ×r1 =bωi +aωj =ω ×r2 =bωi aωj =ω ×r3 =bωi aωj =ω ×r4 =bωi +aωj
那么各轮子在x,y轴平动的速度分别为
v x 1 = v t x − b ω i ⃗ , v y 1 = v t y + a ω i ⃗ v x 2 = v t x − b ω i ⃗ , v y 2 = v t y − a ω i ⃗ v x 3 = v t x + b ω i ⃗ , v y 3 = v t y − a ω i ⃗ v x 4 = v t x + b ω i ⃗ , v y 4 = v t y + a ω i ⃗ \begin{aligned} v_{x1} = v_{tx}-b\omega \vec{i},v_{y1}=v_{ty}+a\omega \vec{i}\\ v_{x2} = v_{tx}-b\omega \vec{i},v_{y2}=v_{ty}-a\omega \vec{i}\\ v_{x3} = v_{tx}+b\omega \vec{i},v_{y3}=v_{ty}-a\omega \vec{i}\\ v_{x4} = v_{tx}+b\omega \vec{i},v_{y4}=v_{ty}+a\omega \vec{i}\\ \end{aligned} vx1=vtxbωi ,vy1=vty+aωi vx2=vtxbωi ,vy2=vtyaωi vx3=vtx+bωi ,vy3=vtyaωi vx4=vtx+bωi ,vy4=vty+aωi
轮子的速度计算辊子的速度及轮子的转速
轮子的速度可以分解为沿辊子的速度 v ∥ v_{\parallel} v和垂直于辊子方向的速度 v ⊥ v_\bot v。但垂直于辊子方向的速度 v ⊥ v_\bot v只会使辊子转动,而不会对轮子整体有影响,所以忽略 v ⊥ v_\bot v,只观察 v ∥ v_{\parallel} v

如图,图中 u ⃗ \vec{u} u 为轮子正转时沿辊子方向的单位向量。
u 1 ⃗ = − 1 2 i ⃗ + 1 2 j ⃗ u 2 ⃗ = 1 2 i ⃗ + 1 2 j ⃗ u 3 ⃗ = − 1 2 i ⃗ + 1 2 j ⃗ u 4 ⃗ = 1 2 i ⃗ + 1 2 j ⃗ \begin{aligned} \vec{u_1} &= -\frac{1}{\sqrt{2}}\vec{i} + \frac{1}{\sqrt{2}}\vec{j} \\ \vec{u_2} &= \frac{1}{\sqrt{2}}\vec{i} + \frac{1}{\sqrt{2}}\vec{j} \\ \vec{u_3} &= -\frac{1}{\sqrt{2}}\vec{i} + \frac{1}{\sqrt{2}}\vec{j} \\ \vec{u_4} &= \frac{1}{\sqrt{2}}\vec{i} + \frac{1}{\sqrt{2}}\vec{j} \\ \end{aligned} u1 u2 u3 u4 =2 1i +2 1j =2 1i +2 1j =2 1i +2 1j =2 1i +2 1j
那么沿辊子方向的速度为
v ∥ 1 ⃗ = v 1 ⃗ ⋅ u 1 ⃗ = 1 2 ( − v x 1 + v y 1 ) = 1 2 ( − v t x + v t y + ω ( a + b ) ) v ∥ 2 ⃗ = v 2 ⃗ ⋅ u 2 ⃗ = 1 2 ( v x 2 + v y 2 ) = 1 2 ( v t x + v t y − ω ( a + b ) ) v ∥ 3 ⃗ = v 3 ⃗ ⋅ u 3 ⃗ = 1 2 ( − v x 3 + v y 3 ) = 1 2 ( − v t x + v t y − ω ( a + b ) ) v ∥ 4 ⃗ = v 4 ⃗ ⋅ u 4 ⃗ = 1 2 ( v x 4 + v y 4 ) = 1 2 ( v t x + v t y + ω ( a + b ) ) \begin{aligned} \vec{v_{\parallel 1}} = \vec{v_1}\cdot \vec{u_1} &= \frac{1}{\sqrt{2}}(-v_{x1}+v_{y1})=\frac{1}{\sqrt{2}}(-v_{tx}+v_{ty}+\omega(a+b))\\ \vec{v_{\parallel 2}} = \vec{v_2}\cdot \vec{u_2} &= \frac{1}{\sqrt{2}}(v_{x2}+v_{y2})=\frac{1}{\sqrt{2}}(v_{tx}+v_{ty}-\omega(a+b))\\ \vec{v_{\parallel 3}} = \vec{v_3}\cdot \vec{u_3} &= \frac{1}{\sqrt{2}}(-v_{x3}+v_{y3})=\frac{1}{\sqrt{2}}(-v_{tx}+v_{ty}-\omega(a+b))\\ \vec{v_{\parallel 4}} = \vec{v_4}\cdot \vec{u_4} &= \frac{1}{\sqrt{2}}(v_{x4}+v_{y4})=\frac{1}{\sqrt{2}}(v_{tx}+v_{ty}+\omega(a+b))\\ \end{aligned} v1 =v1 u1 v2 =v2 u2 v3 =v3 u3 v4 =v4 u4 =2 1(vx1+vy1)=2 1(vtx+vty+ω(a+b))=2 1(vx2+vy2)=2 1(vtx+vtyω(a+b))=2 1(vx3+vy3)=2 1(vtx+vtyω(a+b))=2 1(vx4+vy4)=2 1(vtx+vty+ω(a+b))
由于轮子的转速与沿辊子方向的速度关系为
v ω = v ∥ cos ⁡ 4 5 ° = 2 v ∥ v_\omega = \frac{v_\parallel}{\cos 45^\degree}=\sqrt{2}v_\parallel vω=cos45°v=2 v
所以
v ω 1 = − v t x + v t y + ω ( a + b ) v ω 2 = v t x + v t y − ω ( a + b ) v ω 3 = − v t x + v t y − ω ( a + b ) v ω 4 = v t x + v t y + ω ( a + b ) \begin{aligned} v_{\omega1} &= -v_{tx}+v_{ty}+\omega(a+b) \\ v_{\omega2} &= v_{tx}+v_{ty}-\omega(a+b) \\ v_{\omega3} &= -v_{tx}+v_{ty}-\omega(a+b) \\ v_{\omega4} &= v_{tx}+v_{ty}+\omega(a+b) \\ \end{aligned} vω1vω2vω3vω4=vtx+vty+ω(a+b)=vtx+vtyω(a+b)=vtx+vtyω(a+b)=vtx+vty+ω(a+b)

反过来由轮子的转速推算小车的 v t x , v t y , ω v_{tx},v_{ty},\omega vtx,vty,ω同样成立。

受力分析
猜测:电机控制轮子正转反转,当正转时,给轮子整体施加向前的力 F F F,此时由于只有辊子接触地面,力 F F F分解为垂直于辊子的力 F ⊥ F_\bot F和平行于辊子的力 F ∥ F_\parallel F。力 F ⊥ F_\bot F会使辊子转动,对轮子整体不起作用。而力 F ∥ F_\parallel F才是使轮子整体运动的力。

小车前后移动受力

  • 平移

    上面左图受力会使小车左移,这是由于沿 y y y轴方向的受力平衡。而右图使小车右移。

  • 原地旋转

    上图左图会使小车顺时针旋转,这是由于 F ∥ 2 , F ∥ 4 F_{\parallel2},F_{\parallel4} F2,F4(分别为左上和右下轮的力)及 F ∥ 1 , F ∥ 3 F_{\parallel1},F_{\parallel3} F1,F3(分别为右上和左下轮的力)构成力偶系,那么合成的力偶矩矢量为两个力偶各自的力偶矩叠加,即 M = ∑ M i M=\sum M_i M=Mi;而这两个力偶矩都会使小车顺时针转动。(力偶是大小相等、方向相反、作用线平行但不重合的两个力,力偶矩是使刚体转动的量度, M o ( F ) = r A × F + r B × F ′ = ( r A − r B ) × F = r A B × F M_o(F) = r_A \times F + r_B \times F^\prime = (r_A - r_B) \times F = r_{AB} \times F Mo(F)=rA×F+rB×F=(rArB)×F=rAB×F)

  • 前后移动

  • 斜移

  • 6
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
麦克纳姆轮是一种全向移动装置,常用于机器人和小车等设备中。它由四个轮子组成,每个轮子都有45度角倾斜。通过控制每个轮子的速度和方向,可以实现机器人的全向移动。 下面是一个使用Arduino控制麦克纳姆轮的示例代码: ```C++ //定义引脚 int motor1Pin1 = 2; int motor1Pin2 = 3; int motor2Pin1 = 4; int motor2Pin2 = 5; int motor3Pin1 = 6; int motor3Pin2 = 7; int motor4Pin1 = 8; int motor4Pin2 = 9; void setup() { //设置引脚为输出模式 pinMode(motor1Pin1, OUTPUT); pinMode(motor1Pin2, OUTPUT); pinMode(motor2Pin1, OUTPUT); pinMode(motor2Pin2, OUTPUT); pinMode(motor3Pin1, OUTPUT); pinMode(motor3Pin2, OUTPUT); pinMode(motor4Pin1, OUTPUT); pinMode(motor4Pin2, OUTPUT); } void loop() { //控制麦克纳姆轮的运动方向和速度 move(255, 255, 255, 255); //向前移动 delay(2000); //延时2秒 move(-255, -255, -255, -255); //向后移动 delay(2000); //延时2秒 move(255, -255, 255, -255); //向左移动 delay(2000); //延时2秒 move(-255, 255, -255, 255); //向右移动 delay(2000); //延时2秒 } //控制麦克纳姆轮的函数 void move(int motor1Speed, int motor2Speed, int motor3Speed, int motor4Speed) { //控制第一个轮子 if (motor1Speed > 0) { digitalWrite(motor1Pin1, HIGH); digitalWrite(motor1Pin2, LOW); analogWrite(motor1Speed, motor1Speed); } else if (motor1Speed < 0) { digitalWrite(motor1Pin1, LOW); digitalWrite(motor1Pin2, HIGH); analogWrite(motor1Speed, -motor1Speed); } else { digitalWrite(motor1Pin1, LOW); digitalWrite(motor1Pin2, LOW); analogWrite(motor1Speed, 0); } //控制第二个轮子 if (motor2Speed > 0) { digitalWrite(motor2Pin1, LOW); digitalWrite(motor2Pin2, HIGH); analogWrite(motor2Speed, motor2Speed); } else if (motor2Speed < 0) { digitalWrite(motor2Pin1, HIGH); digitalWrite(motor2Pin2, LOW); analogWrite(motor2Speed, -motor2Speed); } else { digitalWrite(motor2Pin1, LOW); digitalWrite(motor2Pin2, LOW); analogWrite(motor2Speed, 0); } //控制第三个轮子 if (motor3Speed > 0) { digitalWrite(motor3Pin1, HIGH); digitalWrite(motor3Pin2, LOW); analogWrite(motor3Speed, motor3Speed); } else if (motor3Speed < 0) { digitalWrite(motor3Pin1, LOW); digitalWrite(motor3Pin2, HIGH); analogWrite(motor3Speed, -motor3Speed); } else { digitalWrite(motor3Pin1, LOW); digitalWrite(motor3Pin2, LOW); analogWrite(motor3Speed, 0); } //控制第四个轮子 if (motor4Speed > 0) { digitalWrite(motor4Pin1, LOW); digitalWrite(motor4Pin2, HIGH); analogWrite(motor4Speed, motor4Speed); } else if (motor4Speed < 0) { digitalWrite(motor4Pin1, HIGH); digitalWrite(motor4Pin2, LOW); analogWrite(motor4Speed, -motor4Speed); } else { digitalWrite(motor4Pin1, LOW); digitalWrite(motor4Pin2, LOW); analogWrite(motor4Speed, 0); } } ``` 这段代码可以实现麦克纳姆轮的向前、向后、向左、向右移动,并且可以控制移动的速度。需要注意的是,这段代码中的引脚定义和控制逻辑可能需要根据不同的硬件平台进行修改。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值