One problem could be the difference of base frequency used by servos. Some cheap servos use a frequency around 3-500 Hz, and some (Futaba/Robbe) uses (accepts) a frequency between 30 and 60 Hz, and a pulse width between 920-2120 uS.
Another problem could be the mode selected. It should be the mode that sends a high that is kept high for the wanted duration, opposed to the mode that tries to equally spread short, alternating highs and lows in a pattern that reflects the wanted duty cycle.
Hardware PWM for servos, motors, and LEDs
29 posts
Page 2 of 2 1, 2
- Posts: 2
- Joined: Tue Apr 17, 2012 3:07 pm
Hi,
I have looked at Richard Hirst code and also wanted to use it for arbitrary PWM. I have just published the results on github under the GPL (like Richard's original code).
The code is here:
https://github.com/sarfata/pi-blaster
And you can use it (for example) to drive high power led:
http://www.tbideas.com/blog/2013/02/con ... pberry-pi/
Hope this helps!
cheers,
thomas
I have looked at Richard Hirst code and also wanted to use it for arbitrary PWM. I have just published the results on github under the GPL (like Richard's original code).
The code is here:
https://github.com/sarfata/pi-blaster
And you can use it (for example) to drive high power led:
http://www.tbideas.com/blog/2013/02/con ... pberry-pi/
Hope this helps!
cheers,
thomas
- Posts: 4
- Joined: Thu Feb 07, 2013 6:10 pm
Hello Joan, I'm back.
I've just tested your V2 code in my project, an it"s working flawlessly
I don't know exactly why it's working, and why the V1 won't, but thank you for your work! It's just awesome
I've just tested your V2 code in my project, an it"s working flawlessly
I don't know exactly why it's working, and why the V1 won't, but thank you for your work! It's just awesome
- Posts: 9
- Joined: Sun Nov 18, 2012 9:17 pm
dx21 wrote:Hello Joan, I'm back.
I've just tested your V2 code in my project, an it"s working flawlessly
I don't know exactly why it's working, and why the V1 won't, but thank you for your work! It's just awesome
The Arm cache.
The software writes a value to "memory". The CPU reads the value and stores it in its cache. It doesn't need to be written to physical memory until something reads that value. It doesn't know that the DMA hardware is reading the memory location so doesn't update physical memory until the cache is needed to store other memory locations.
Any userland (or kernel) program which uses DMA will have the same problem. I introduced a special cache "flushing" algorithm.