Other Parts Discussed in Thread: DRV8833, ENERGIA
Hi,
So let me try to explain the problem.
I am using the DRV8833 motor driver to control some pololu DC micromotors. I made a little API to use it with the Tiva.
I have 2 type of gearboxes, 1:100 and 1:50. Currently there is no real speed control or any feedback of the motors current or speed. Well I saw the problem first with a line follower.
When using the 1:100 there was no apparent problem, well I had to adjust the PID constants and all but so far so good.
Now with the faster motors (gearboxes), the 1:50, the problems appeared. Well the god dam motors would just be too fast and jumpy, this was mostly because I could not get them to work at lower speeds when going around corners. I assumed it was because of the lower torque. And it seemed the motors were really not even, they needed really different PWM duty values to go at about the same speed - again I assumed normal since the they are brushed and we're spinning in opposite directions (well to go forward that is necessary), it's the problems of not using speed control).
Now later I made a similar API for other ARM and well... it works so much better! The motor starts spinning at lower and they are pretty even! I connected the Tiva to the same motor driver and motor and it needed a higher duty to start spinning (and when it started spinning it was at higher speed than with the other ARM).
Well I don't have a scope here and can't exactly get to one right now (inflamed knee prevents me from walking - I am cursed this past days) to analyze the 2 PWMs.
Basic motor knowledge probably hinders me from solving the problem easily too.
So I hope that someone here can help me. I will provide then more info on PWM.
About the DRV8833 control:
I always use the fast decay mode. Meaning that the control is made by setting a pin HIGH and the other having the PWM (reversing which one does what when the direction changes). The PWM duty of course is "reversed" - lower duty = higher speed - in the API you use higher values for higher speed and then the code takes care of reversing it.
To use the pin as GPIO I change the register GPIO_O_AFSEL. When I need to use the PWM again I change it back.
Tiva:
Running at 80Mhz
Desired frequency output: 24Mhz.
API: github.com/.../DRV8833
Other ARM:
Running at 48Mhz
Desired requency output: 24Mhz.
I currently only have extra Tivas for the project and I require the use of Energia, among other hardware specific features, hence why trying to solve this problem instead of going with the other ARM.
Maybe I should try to simply use a timer instead of the PWM module?