HubAp5 and motorcontroller

Hi all,

i have just a question about the combination gadgeteerd motorcontroller and the ap5 hub module when i connect these via my fez raptor i get the error System.ArgumentOutOfRangeException’ The frequency is too low. What is this about is the motorcontroller not usable with the ap5 hub ?

It is a known feature. If you use the L298 motor controller with the AP5 Hub, you have to set the frequency on the hub to a lower value…

from the hub developer’s guide:

"PWM and GPIO

Since the Hub AP5 relies on a secondary chip to drive PWM and GPIO, those functions are much more restricted than if they were on the mainboard. GPIO can only be toggled around 10Hz or less. Frequency and duty cycle control for PWM is also a lot less precise. With the default driver, PWM frequencies around 5KHz will give the best results."

So call the hub’s “SetFrequency” function and use 5000, and you will get good results.

For more details, see the end of thread:

https://www.ghielectronics.com/community/forum/topic?id=16946&page=2

I have good results using two L298 motor controller modules on an AP5 Hub connected to my raptor, controlling 4 independent motors. But originally I ran into the same problems you had, before taylorza and others helped me out.

Thank you for your reply. I have tried to lower the frequency of the motorcontroller to 5000 but still i get the same error. Does it work only with some of the hup sockets ?

Hi did you use your own drivers to lower the frequency of the motorcontroller ? Because when i lower the frequency of the motorcontroller i still get the error