-
An update on dealing with Servos
04/06/2016 at 19:47 • 0 commentsMy servo demo worked fine on SG90 but when I tried it with a MG90S (essentially a metal geared version of the SG90) that I got today wouldn't work right. I hypothesized the reason for the problem was due to the frequency of the PWM signal sent to the servo has being too far off of 50Hz for the MG90S.
With the Attiny85, I managed to (at least theoretically) get very close to 50 Hz, but not spot on. I pulled out my Arduino Uno, and thanks to it's 16 bit timer I managed to get (a theoretical) 50Hz signal. I hooked up the MG90S to the Uno and it worked perfectly. I took frequency measurements of the PWM signals from the Attiny and Uno using my multimeter and got the following results:
50.76Hz from the Attiny85
49.99Hz PWM signal from the Uno
The PWM signal from the Attiny85 isn't off 50Hz by much but apparently my MG90S wants a practically spot-on 50Hz signal.
I decided to play with OCR0A value a bit to get closer to 50Hz and managed to get the MG90S to sometimes work with a PWM frequency of 49.5Hz from the Attiny85, but even then, it still tends to act up.
Lesson learned: Some servos demand a practically spot-on 50Hz signal to work properly.
-
Thanks for the support and stay tuned for a potential giveaway!
04/02/2016 at 21:27 • 3 commentsA special thanks to everybody that has liked/followed my project. I just found out Hackaday is giving out seed money and so far I've been awarded some, so make that double thanks for the likes/skulls!
This has me thinking about doing a board giveaway later on this year as a way to give something back to the community. The winner(s) would get a board either assembled or in kit form (whichever form the winner(s) would like to receive it in) and I'll probably throw in a USBasp.
Again, I'm still taking suggestions for a 4th revision of the board.
-
Demo series: Servo Demo
03/26/2016 at 16:11 • 0 commentsI'm thinking about starting a demo series of sorts. Every so often I'll post a demo project to demonstrate what all can be done with the Attiny85. The Attiny85 isn't exactly the mcu that has every feature under the sun, but it's surprisingly useful even though it only has a few I/O pins.
I thought I would post my demo code for controlling a cheap SG90 servo motor. It uses pin 6 to generate a PWM signal that is fed into the signal input of the servo. The code is posted in the demos folder on the GitHub page.
Again if anybody has any suggestions for a 4th revision, please feel free to let me know.