Python code turn twice as much as specified

Today we found out that the robot turned twice as much as specified. E.g. when we tell it to turn 90 degrees, it turns 180 instead. Before the new year it worked as expected.

We checked the drivetrain configuration, nothing odd found.
Start a new project w/ just the turn code, same issue.
drivetrain.turn_for(LEFT, 90, DEGREES)

However, if we start a new block project, it works as expected.

Any idea on what cause the problem?

We config the drivetrain exactly the same way in block and python.
We also found, if we change the Gear Ratio from 2:1 to 4:1 in python, it turns to the right angle. However, the drive distance gets to half (which is expected).

While I don’t know much text code, here is a way to fix it in block code
(not sure if text code has the same features, maybe somebody can translate this code)

This code uses custom blocks with a boolean value. When you insert a number into the custom block, the block divides the degree value in half, giving you the proper turn.

Hope this helps!

The issue does not repro in block code.
Currently we’re just turning half in python (the same as what you show in block), but we’d still want to know why what happen and what’s the proper way to fix it.

post the drivetrain configuration from your Python source code, should be something like this.

left_drive_smart = Motor(Ports.PORT1, 2.0, False)
right_drive_smart = Motor(Ports.PORT2, 2.0, True)
drivetrain = DriveTrain(left_drive_smart, right_drive_smart, 200, 146, 152.4, MM, 1)

This is the code

left_drive_smart = Motor(Ports.PORT8, 2.0, False)
right_drive_smart = Motor(Ports.PORT2, 2.0, True)
drivetrain = DriveTrain(left_drive_smart, right_drive_smart, 200, 146.04, 152.4, MM, 1)

Any idea what could be wrong?