Program for controlling analog servo motor using PIC18F452


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2012
    Posts
    13

    Default Program for controlling analog servo motor using PIC18F452

    hi
    i am using pic 18f452 to control the servo motor Turnigy TG9e.
    i am programming it using microcode studio.
    i was not able to move the servo motor.

    i don't know what was the mistake.

    can anyone provide me a basic program in microcode studio for controlling servo motor Turnigy Tg9e using pic 18f452

  2. #2
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Program for controlling analog servo motor using PIC18F452

    Quote Originally Posted by SolaiKannan View Post
    hi
    i am using pic 18f452 to control the servo motor Turnigy TG9e.
    i am programming it using microcode studio.
    i was not able to move the servo motor.

    i don't know what was the mistake.

    can anyone provide me a basic program in microcode studio for controlling servo motor Turnigy Tg9e using pic 18f452
    I think its better you put here the code that you allready have, and if possible schematic also!
    Thanks and Regards;
    Gadelhas

  3. #3
    Join Date
    Jan 2012
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Program for controlling analog servo motor using PIC18F452

    this is my coding.

    define osc 20

    OUTPUT PORTB.0

    LOOP:

    PULSOUT 0,110
    PAUSE 1000

    PULSOUT 0,120
    PAUSE 1000


    PULSOUT 0,130
    PAUSE 1000

    PULSOUT 0,140
    PAUSE 1000

    PULSOUT 0,150
    PAUSE 1000

    PULSOUT 0,160
    PAUSE 1000

    PULSOUT 0,170
    PAUSE 1000

    PULSOUT 0,180
    PAUSE 1000

    PULSOUT 0,190
    PAUSE 1000


    PULSOUT 0,200
    PAUSE 1000
    GOTO LOOP
    END

  4. #4
    Join Date
    Jan 2012
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Program for controlling analog servo motor using PIC18F452

    Name:  motor.JPG
Views: 3101
Size:  64.3 KB

    this is my schema .

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Program for controlling analog servo motor using PIC18F452

    Looks like your motor ground is isolated from ground by capacitors and DC will not flow through those.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Program for controlling analog servo motor using PIC18F452

    Hi,

    Moreover your servo is powered between +V and +V ... ( yes, I wrote it fine !!!) ... and the reset pin can't do its job ...

    your program won't work fine as servo signal ( 1 to 2 ms pulse ) has to be sent every ~ 20 ms ... and not once every second ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts