如何控制kiwi驱动机器人?

发布于 2024-09-24 06:13:39 字数 536 浏览 6 评论 0原文

我是高中 FIRST 机器人团队的成员,我们正在开发 kiwi 驱动机器人,其中有三个 全向轮 安装在等边三角形配置中,如下所示:

等边三角形配置中的三个编号全向轮

问题是对机器人进行编程以驱动电机,以便机器人沿给定的方向移动操纵杆输入。例如,要“向上”移动,电机 1 和 2 将同等供电,而电机 3 将关闭。操纵杆位置以向量形式给出,我在想如果电机也以向量表示,向量投影 可能就是我所需要的。但是,我不确定这是否正确,如果是,我将如何应用它。我还有一种感觉,一个操纵杆位置可能有多种解决方案。任何帮助将不胜感激。

I'm on the FIRST robotics team at my high school, and we are working on developing a kiwi drive robot, where there are three omni wheels mounted in a equilateral triangle configuration, like this:

three numbered omni wheels in an equilateral triangle configuration

The problem is programming the robot to drive the motors such that that the robot moves in the direction of a given joystick input. For example, to move "up", motors 1 and 2 would be powered equally, while motor 3 would be off. The joystick position is given as a vector, and I was thinking that if the motors were expressed as vectors too, vector projection might be what I need. However, I'm not sure if this is right, and if it is, how I would apply it. I also have a feeling that there may be multiple solutions to one joystick position. Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

冷默言语 2024-10-01 06:13:39

我在学校期间已经制作了 9 个机器人(1 个 FIRST,8 个 RoboCup)。我们使用与您相同的全驱动布局。 Beta 的答案看起来是正确的,但之后为所有车轮添加旋转

W1 = -1/2 X - sqrt(3)/2 Y + R 
W2 = -1/2 X + sqrt(3)/2 Y + R
W3 = X + R

[这是 Beta 的公式,添加了一些旋转]

您需要考虑电机的可用范围。我猜测它可以采用 +/-255 的 PWM 信号,因此输入或输出都必须进行一些调整。 (这并不难...)

一个很好的详细信息论文

要回答您的具体问题:矢量投影本质上就是您在这里所做的。您可以通过矩阵M、操纵杆I的输入以及电机O的输出来应用它。因此O = M * I

M = [(-0.5 -sqrt(3)/2    +1)
     (-0.5 +sqrt(3)/2    +1)
     (1     0            +1)]

I've built 9 robots during my time at school (1 FIRST, 8 RoboCup). We used the same omnidrive layout as you do. Beta's answer looks correct but add rotation to all wheels afterwards:

W1 = -1/2 X - sqrt(3)/2 Y + R 
W2 = -1/2 X + sqrt(3)/2 Y + R
W3 = X + R

[This is Beta's formula with some added Rotation]

You need to think about the available ranges for your motors. I am guessing it can take a PWM signal of +/-255, so either the input or the output has to be adjusted somewhat. (It's not that hard...)

A good paper with details

To answer your specific questions: Vector projection is essentially what you are doing here. You apply it by having a matrix M, your input from the joystick I and your output to the motors O. Thus O = M * I;

M = [(-0.5 -sqrt(3)/2    +1)
     (-0.5 +sqrt(3)/2    +1)
     (1     0            +1)]
鹊巢 2024-10-01 06:13:39

首先让我们定义一些术语。按照惯例,X 轴将指向右侧,y 轴将指向上方(因此轮 3 的推力沿着 X 轴)。我们将轮子的运动称为 W1、W2 和 W3,分别定义为 Wi> 0表示轮子顺时针方向旋转。在您的示例中,如果 W1 < 0、W2 = W1 且 W3 = 0,机器人将沿+Y 方向移动。

如果所有三个轮子以相同的速率旋转(W1 = W2 = W3),机器人就会原地旋转。我猜你不希望这样,所以旋转的总和必须为零:W1 + W2 + W3< /sub> = 0

每个轮子的运动有助于机器人的运动;他们添加为向量:
W1 = -1/2 X - sqrt(3)/2 Y
W2 = -1/2 X + sqrt(3)/2 Y
W3 = X

因此,如果您知道操纵杆所需的 X 和 Y,则有 W1、W2 和 W 3。正如我们已经看到的,W1 和 W2 之间的差异是驱动 Y 运动的原因。它们的总和驱动X中的运动。

First let's define some terms. In keeping with the usual convention, the X axis will point to the right and the y axis will point up (so that the thrust of wheel 3 is along the X axis). We'll call the motion of the wheels W1, W2 and W3, each defined so that Wi > 0 means that the wheel rotates in the clockwise direction. In your example, if W1 < 0, W2 = W1 and W3 = 0, the robot will move in the +Y direction.

If all three wheels rotated at the same rate (W1 = W2 = W3) the robot would rotate in place. I'm guessing you don't want that, so the sum of the rotations must be zero: W1 + W2 + W3 = 0.

The motion of each wheel contributes to the motion of the robot; they add as vectors:
W1 = -1/2 X - sqrt(3)/2 Y
W2 = -1/2 X + sqrt(3)/2 Y
W3 = X

So if you know the desired X and Y from the joystick, you have W1, W2 and W3. As we've already seen, the difference between W1 and W2 is what drives Y motion. Their sum drives motion in X.

兔姬 2024-10-01 06:13:39

虽然这个系统可以用数学方法求解,但在 2002 年,FIRST Team 857 选择用机械方法求解。我们的控制系统使用三个操纵杆,其 X 轴形成等边三角形,手柄替换为与 Y 形轭连接的球窝臂。将每个摇杆的X轴直接映射到电机速度,控制系统已经解决。该系统的一个优点是,对于外行来说运行起来非常直观——将操纵杆推向您想要的方向,旋转它即可转动。

Though this system can be solved mathematically, in 2002, FIRST Team 857 chose to solve it mechanically. Our control system used three joysticks mounted with their X-axes forming an equilateral triangle, and handles replaced with ball-socket arms connected with a Y-shaped yoke. Map the X-axis of each stick directly to a motor speed, and the control system has been solved. As an advantage, this system is very intuitive for laypeople to run--push the yoke in the direction you want to go, rotate it to turn.

踏雪无痕 2024-10-01 06:13:39

正如您所认识到的,第一部分将找到一个适当的方程来表示任何电机设置的合成运动。根据您对电机速度的控制和反馈水平,我建议您彻底的过程应该从编写矢量方程开始:(将正 X 定义为正向)

-M1Cos(30)+M2Cos(30)= X(负值是因为 1 和 2 必须提供相同大小的动力,但向前运动的极性相反)

M1Sin(30)+M2Sin(30)-M3 = Y(因为 1 和 2 上的逆时针运动将导致机器人移动Y 向左运动和 3 逆时针运动将导致机器人向右移动)

您需要添加的另一个输入是机器人所需的旋转,值得庆幸的是,M1+M2+M3 = W(旋转速度)

您的操纵杆输入将为您提供 X、Y 和 W,因此您有 3 个方程,其中有 3 个未知数。

从这里开始,它是联立方程,因此您最终可能会得到多个解决方案,但这些解决方案通常可以根据可能的电机速度等进行限制。

一个例子是 rec::robotino::com: :OmniDrive Class - 此方法的源代码也可用......

As you have recognized, the first part of this will be finding an appropriate equation to represent the resultant motion for any motor settings. Depending on the level of control and feedback you have on your motor speeds, I would suggest the process you go thorough should start with writing a vector equation: (define positive X as straight ahead)

-M1Cos(30)+M2Cos(30)=X (the negative is because 1 and 2 must be powered the same magnitude, but opposite polarities for forward motion)

M1Sin(30)+M2Sin(30)-M3 = Y (as anticlockwise motion on 1 and 2 will result in the robot moving left in the Y and anticlockwise motion on 3 will result in the robot moving to the right)

The other input that you need to add into this is the desired rotation of the robot, thankfully, M1+M2+M3 = W (Rotational velocity)

Your joystick input will give you X,Y and W, so you have 3 equations with 3 unknowns.

From here it is simultaneous equations, so you may end up with multiple solutions, but these can generally be restricted based on possible motor speeds and the like.

An example of this is the rec::robotino::com::OmniDrive Class - the source code for this method is available too...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文