# Smoother Tank-Drive Driving

You’re interpreting my statement as describing what the scaling does to high speeds, rather than to low speeds. As noted, any scaling function from `[0,1]` to `[0,1]` necessarily both maps a larger portion of the throw to a smaller portion of the output and maps a smaller portion of the throw to a larger portion of the output, since the domain and image are the same interval. The question is where the compression is happening, and where the expansion is happening.

A quadratic function will expand the portion of throw that corresponds to small outputs - i.e., “mapping a larger portion of the joystick throw to a smaller portion of the robot’s max speed.” It also, necessarily, maps a smaller portion of throw to a larger portion of speed elsewhere - but this is usually not what we are interested in.

Defense is a problem. However, if you are rocking as you turn, you are susceptible to a G20 violation if a defender gets under your bumper. The question is, which would you rather:

• maneuver quickly and line up for scoring quicker, giving a defender less time to push you, but be easier to push, or
• maneuver slower due to rocking, but not get pushed once you line up for a shot?

Trying 2/4 omnis cannot hurt. If it doesn’t work, go back to all traction.

1 Like

If you have a gyro (or encoders) you can always use a velocity pid.

While we use an arcade style, you could still do this with a tank style.

In short, you take the differential of the joysticks and map that to a velocity pid.

So if the left joystick is at 1 and the right is 0.25, then your differential is 0.75 clockwise. You then take that value and map it to a rotational velocity that you can set the range of (let’s say your robot can turn left / right at -50rpm to 50 rpm). Then, you take that rotational velocity and convert it to wheel speed and add that to the joystick forward / backwards bias and have an active PID for the wheel velocity.

TLDR: convert your joystick values to a speed target instead of motor power, and use your gyro (or drive encoders if you find it easier) to reach this target.

This is a little bit advanced if you have trouble doing PID, but the talon srx closed loop control will make it easier if you use them.

It looks like a mechanical issue that software cannot correct. We used an 8 wheel configuration last year and had the same symptoms. Our weight distribution and wheel placement just didn’t work well. We switched to omni wheels on the corners and fixed the issue.

David

In 2016, we were 6WD all pneumatics, 1/4" drop center. Apparently it was too much traction to even turn so they put duct tape on the wheels to make it smoother. Not sure what kind of wheels you have but its sounding to be regular traction wheels. Maybe you can try it?

1 Like

I usually don’t rag on people for giving bad advice, but could everyone please stop telling the OP to do complex things (new wheels, PID, new joytsicks) when a simple thing will likely fix his problem?

In a 6WD with all traction wheels, turning scrub is non-negligible and there’s a fair amount of voltage required to turn. This is a “mechanical deadband,” as I described above. When combined with cubic joystick scaling, it is very likely that a significant chunk of the joystick throw results in no turning whatsoever. However, plenty of teams run drives like this without issue.

OP: Change your joystick scaling to linear or quadratic, and see what happens.

1 Like

Mostly that it jumps when turning. You can see the video attached in the original post.

I’ve heard of the recent G20 trend, but I fail to see how us turning will be interpreted us entering a defender robot’s frame. Correct me if I’m wrong.

I would do that if I had the time to calibrate the PID

controllers, but given that competition starts on Tuesday and A-Bot’s drive (6 NEOs) is different from B-Bot’s (6 Mini CIM
) — both of which have the same jitter problem — I don’t think that I’ll have time to do that…

1 Like

Do neos not have closed loop velocity? It should be pretty easy given that it’s a brushless motor and has integrated position detection. Although I’m no expert on the sparks or what they’re capable of, I only know stuff about VESC and their derivatives.

What is the width between your wheels? What is the length of your drive base, and what is the length between the 4 inner wheels that are always in contact with the ground?

We use a cubic polynomial on our 6wd west coast and regardless of which wheel types we use, it drives mostly smooth. It’s an open loop controlled, 4 neo drive train. The way your robot was rocking makes me wonder if the issue isn’t programming or electrical, but the spacing of your wheels making it hard to turn/having too much scrub.

this depends heavily on the driver. lots of old school frc alum or mentors will swear up and down joy sticks are better than a controller. however most of the kids nowadays do better with a xbox or logitech play station controller. its more what you grew up playing and are comfortable with.
our driver for example uses a xbox controller for tank.

I’ll second this. When I was a driver (2012/2013) my controls were joysticks. In another project after I graduated high school I found driving with a controller to be way more preferable. My driver last year used joysticks because it’s what we had, but this year I gave him a controller. A few practice sessions later, and especially as we progressed into our first two events this year, he’s way better on it.

It comes down to preference.

1 Like

Yes, I am. This seems to be referring to what the scaling does to high speeds:

I understand and agree with the following:

Here is the part where the wording seems backwards to me:

expanding the portion of throw that corresponds to small outputs” sounds to me like it means “mapping a larger portion of the joystick throw to a smaller portion of the robot’s low-end speed.” like so:

An unrealistic example: 0 to .6 joystick throw commands 0 to .4 % output command… and .6 to 1.0 joystick throw commands .4 to 1.0 output command.

That is exactly what it means, and is exactly what happens.

With linear scaling, the preimage of the bottom 25% of motor output is the bottom 25% of joystick throw. In other words, the preimage of `[0, .25]` is `[0, .25]`.

With quadratic scaling, the preimage of that same 25% of motor output is an enlarged 50% of joystick throw. That is, the preimage of `[0, .25]` is `[0, .5]`. The same range of small motor outputs is mapped to by a larger portion of the joystick throw.

Again, this is exactly how it works: with quadratic joystick scaling, as mentioned above, 0 to .5 joystick throw is mapped to motor outputs from 0 to .25. The remaining joystick throw (.5 to 1) is mapped to the remaining outputs from .25 to 1.

the way your robot jitters, it happened to us in 2017. But we were a tall robot that year with 4WD, all AM White Hi-Grip traction wheels. That made us rock because

1. We were a tall robot and the drive base dimension was small.
2. You got the traction wheels. Now combine with small drive base design. Doesnt turn well.
3. We got beat up by other robots that year, broke a few wheel rims, kinda bent the base one way.

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