# Looking for Inverse Kinematics for Swerve Drive with Shared Drive Motors

Hello,

This year our team has built a 4-Wheel Swerve Drive, and we have been able to find a wealth of information on the math to control a 4-Wheel Completely Independent Swerve Drive to allow us to design software to control that configuration. BUT…, our design is such that our Swerve Drive is not entirely Independent.

While each of the 4-Wheels is independent in Rotation Control, we have a shared Drive Motors for each bank of drive Wheels. The Left Front and Left Rear Wheels will be driven off one drive assembly so the two Left Bank wheels will be at the same speed, and the Right Front and Right Rear Wheels will be driven off another drive assembly and the two Right Bank wheels will at the same speed. I believe the swerve drive should still work fine, just the Wheel Angles would be calculated differently with these two additional constraints (Left Front Speed = Left Rear Speed) and (Right Front Speed = Right Rear Speed), but I’m having difficulty re-spinning the equations. Also I am having trouble finding documentation on this configuration to help.

Does anyone know if there is a specific name for this type of configuration (perhaps that might help narrow the search)?

Any links or suggestions on finding the derivation of inverse kinematics on this configuration would be great.

I scanned the topics here and nothing popped out to me and google searching on “Swerve Drive with Common Drive Motor” and “Swerve Drive with Equal Drive Speeds” didn’t pan out.

Any help is appreciated. Thanks.
Rufus

A swerve without independent drive motors is called a “crab drive”. You may have some issues finding examples of this, as your configuration is pretty unique.

I’m not quite sure it will be analogous to a completely independent swerve, as varying wheel speeds is pretty crucial to “skid” style turning.

Essentially, you might be on your own.

1 Like

You can’t drive completely holonomic in that setup without introducing friction; more specifically, strafing and rotating at the same time is going to give you trouble. You’ll be able to drive in any direction while the chassis orientation stays the same, and you can rotate the chassis in place or while driving forward/back (like a tank drive turns), but introducing any amount of strafing while rotating will cause the front of the robot to travel at a different speed than the rear. This will get more dramatic the faster you try to do both.

Personally, at this stage, I’d just program it like a normal swerve and see how severe the issue is. If it’s kinda okay at lower speeds, than just constrain the amount of simultaneous strafing and rotating that can be commanded. You probably won’t be able to do some of the fancier holonomic moves like rotating while driving in a straight line, but you’ll be more agile than a tank.

As an aside, this is one of the few times I might actually advocate for driving swerve robot-centric, or at least trying it. Due to what I imagine will be a stark difference in feel between driving straight vs. sideways, robot-centric controls might result in a more predictable response if your driver can adjust to it. But maybe not; I haven’t driven your setup.

1 Like

As for controlling this like a normal swerve drive, I’m not sure. But with how you have this set up, you can do two things: drive in any direction without turning, or rotate around a single point where that single point is on a line and that line is parallel to the line that intersects the locations of the FR/FL wheels.

In this image, any point on the green line your robot can rotate around without wheel slippage. You can of course still strafe left and right, but while you’re doing that you can’t rotate without wheel slippage.

As for the math for this, I keep meaning to upload our 2018 code to our github. We used two different ways to control the swerves. One way involved a point relative to the robot being the point we rotated around.

There’s probably a more standard way that maps the input to a joystick axis nicely, but I’m not aware of it.

1 Like

This is the same thing as driving forward or backward while rotating in a robot-centric setup, as I described in my comment. Due to that, I’d map the controls normally, and potentially just drive robot-centric. The tricky bit is handling simultaneous strafing; the first thing that jumps to my mind is giving rotation precedence over strafing, maybe with some tolerance if a little strafing while rotating works okay.

@robotSpit Ultimately, the problem here is that this assumption:

wasn’t 100% correct. There’s also not inverse kinematics for this setup, because inverse kinematics is just the process of determining the velocity of a singular point of an object given the entire object’s velocity and angular velocity. That’s not going to change with a different motor setup, and the reality is adding those constrictions results in some movements that aren’t possible.

1 Like

Thanks, @retrodaredevil, @EveryLittleBit, @thatnameistaken , This is all great information.

Our team was just discussing the idea of a prioritization scheme between rotation requests vs drive forward/strafe requests to prevent compound translation/rotation motion. Thanks for the info that with our set up it is just not a matter of working through mathematics, but also mechanics/physics with friction.

Let’s be clear here - you can absolutely rotate while driving straight forward/back relative to the robot with no problems. It is only strafing and rotating that causes the front and back motors on the same side to need different speeds. And, depending on how much traction you have, you may find you’re able to overcome some amount of friction to allow some strafing with rotating (after all, tank drive overcomes friction every time it turns - though it’s perpendicular to the wheel rather than inline).

Good luck, and if you have any further problems programming this, feel free to post back.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.