2014. július 28., hétfő

SG90 servo controller

If I'm finally able to reconstruct my 3D printer (I haven't touched it for a while) I want to have an automatic bed leveler on it, because the bed leveling today is painful. I found a solution what I like: https://www.thingiverse.com/thing:301715
For this I ordered a fistful of SG90 servos from the eBay what already arrived for a while.
At the end of the last week a task come by. It should be solved to change the vertical angle of a small webcam, what is in a not easily accessible place. I had only the weekend for it because I wanted to finish until today.
The original idea was the following:
TI Launchpad + SG90 servo, connected to a PC via USB port and it can be controlled from there.
I found a small sample code on the net:
https://www.youtube.com/watch?v=b0SYQ7JHgt4
It was working, but I didn't liked it. I was trying to write something based on the datasheet. The code was not working. The timing on the datasheet had no connection to the reality.
Finally I totally rewrote what I originally found. Restructured it just kept the timing.
After this the serial communication come.
After a bit struggling become clear that the user serial function of the LanuchPad is not even close to a working thing under Windows 8.1. The driver is there. It even allows me to connect, just no communication in the terminal emulator.
I picked from my drawer a CP2102 board from the Conrad. After some driver collection, it started instantly. I finalized the code, everything works, just I can't leave the it mechanically in this shape.
Unfortunately drawing schematics, designing and manufacturing PCB was out of question, because of the time. Only the perfboardleft as option (ohh, how I hate it).
Here is the result:




I'll put the finished code out to the GitHub.
Unfortunately I was not able to finish the whole project. When I tried to mill the camera holder on the CNC the spindle stopped and didn't started anymore. For the time being I had no energy to take it apart to find out, if the spindle or the shiny new PSU is the cause. I'll measure around tomorrow morning to find it out.

Nincsenek megjegyzések:

Megjegyzés küldése