View previous topic :: View next topic |
Author |
Message |
Khansokhua
Joined: 06 Nov 2021 Posts: 92
|
9g servo control algorithm (PIC16F877A) |
Posted: Tue Dec 06, 2022 8:27 pm |
|
|
Hi fellas, greetings.
It's been a while since I corresponded with you on the forum. I wonder how can I control 9 g servo with a PIC mc these days. I bought a Pickit3. I earned a new overlook inside my heart:)))
Respects!!! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Tue Dec 06, 2022 9:42 pm |
|
|
You really need to post WHICH 'servo' you have.
If I assume '9g' is a brand ?? then you mean a typical RC hobby 'servo', then you simply send a repeating pulse train at 50hz, that is between 1 and 2 ms.1ms is full left, 2ms is full right, updated 50 times a second..
at least that was the standard 3 decades ago
there has to be 100s of CCS c code on the web for this, several mfrs sold chips that controlled 8 or 16 servos .
CCS also supplies a basic RC servo program in the 'examples' folder
you can of course use simple delay_us(xxxx); commands for it , or use a timer...
what type of coding depends on what else you want the PIC to do... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Dec 07, 2022 12:20 am |
|
|
9G is a standard term for micro servos. 9 gram. Generally they are
standard servos in terms of driving. The original one was the FS90 and
then the SG90, So your comments are spot on Jay. Also there are quite
a few servo drive codes in the code library. |
|
|
Khansokhua
Joined: 06 Nov 2021 Posts: 92
|
Motor |
Posted: Wed Dec 07, 2022 6:27 am |
|
|
It is SG90. First goal is make a continuous movement 0 to 90 and then 90 to-90 then -90 to 90... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Dec 08, 2022 7:57 am |
|
|
You can even find them cheaper than that.
Some things now are mind blowing in terms of just how little they can be
bought for. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Dec 08, 2022 9:55 am |
|
|
I had to lookup what a 5 wire servo was....
sigh....
motor/drive train and pot....
NO electronics. |
|
|
|