10 years, 9 months ago.

Wheels move in opposite directions on Freescale KL25Z. HELP

When we run the car with both wheels running at the same power one of the wheels spins the opposite direction. When we run the car with the wheel that runs backward running at a negative power neither of the wheels move at the speed or direction they should. Since we can get both wheels to run fine when we use a single power parameter we assume it must be a hardware problem. Any suggestions?

2 Answers

10 years, 9 months ago.

I assume this has no relation to software or the KL25Z. In general you can reverse the running direction of a DC motor by reversing the + and - polarity of the motorsupply. You should simply reverse the two wires to the motor that is running in the wrong direction. Note that when you have two identical motors connected in the same way they will run in the same direction. However, in a car the wheels are on opposite sides and one seems to run in the wrong direction...

Accepted Answer
10 years, 9 months ago.

Are you using the Freescale shield for the FRDM-KL25Z board?

While this should not cause opposite rotation, R24 on the FRDM board will contend with the PWM output PTC1. The mbed firmware generates a 32kHz clock that's fed to the KL25Z through a zero Ohm resistor, R24.

Changing this resistor to a 5.6K or so fixes the issue. The signal still prevents PTC1 from being used as an input other than for the "real" time clock function, but it can be used as a PWM output for the Freescale shield and produce a clean control signal to the MC33887.