New to robotics here, and need some help with coding gears ratios

I know that you can easily program gear ratio after declaring motors or drivetrain in Vex pro v5 however, my team is using a drivetrain with six wheels with six motors.
Now to give you an insight into how the motors are arranged you can say that for both left and right there are 2 motors below with one motor above or in the middle of the two.

My problem is that the two below have the same 36 teeth gears the one above or middle of those is a gear with 24 teeth connected. How do I declare that difference in gear ratio with all those gears having motors in them instead of the one in the middle or above having its motor and not an idler gear? I’m new to programming, much less in programming robots, please help me and have mercy on me T~T

While this is not in any way ideal, it can be done.

Imagine that a motor is turning a 24 tooth gear which then turns an idle 36 tooth gear. The 36 tooth gear will have an angular speed of 2/3 the rate of the 24 tooth gear. (24/36 = 2/3).

If you swapped the motor to turn the 36 tooth gear and let the 24 tooth gear be idle, the 24 tooth gear would have an angular speed of 1.5 times the rate of the 36 tooth gear. (36/24 = 1.5)

Now, lets have motors on both gears. I cannot set the speed of the motor on the 24 tooth gear to 150% speed, but I can set the motor on the 36 to 66% speed so that the gears turn at the same rate.

Caution here. There are a number of complications that can arise from this setup. There may be issues with matching the torque outputs of the motors, causing one or more motors to overheat as they fight against each other to maintain a matched speed. While these problems may not be apparent in practice or in robot skills, they have potential to hinder your performance when you are in a match in constant push battles with opponents.

If you’re using C++, there’s a standard library called std::ratio that allows compile time arithmetic support for rational numbers. I used them last year in a custom chassis class.

void init()
{
    // This simplifies to 2/3 at compile time, so no runtime overhead
    std::ratio<24, 36> gearRatio;
    //                    numerator (2)    denominator (3)
    makeDrivetrain(gearRatio::num / gearRatio::den, MOTOR_PORTS...);
}
1 Like