We are making a junior soccer robot and we just got our brilliant motors from Maxon. Setting the PWM timer to low-frequencies (around 39kHz or 156 kHz ) the robot acts as expected. But this produces some problems.
- It puts a heavy current on batteries (around 1.5A for 3 motors which is far too high).
- The high current causes our motor drivers (L6203) to heat up very quickly and even heat-sinks won't help them.
- The motors make such a bad sound as they are screaming and this is not normal.
In contrast when I configure the timer on high-frequencies (such as 1250 kHz or 10000 kHz) the current drops off to 0.2A which is ideal and the sounds quit down. But this causes a problem that our 3 motors when set to run on their highest speed (PWM set to 255) don't run by the same rpm. like one of them runs slower than others making robot turn to a specific side and so our handling functions fail to work correctly.
Asking someone he told me that the drivers don't respond the same to frequencies thus resulting in different speeds and because on low frequencies the difference is very small I won't notice it but on higher frequencies the difference becomes bigger and noticeable.
So is there any workaround for this problem? or I should continue using low frequencies?
PS: I'm using ATMEGA16 as the main controller with a 10 mHz external crystal.