Servo motor does not work correct


Closed Thread
Results 1 to 38 of 38

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    As far as I know, X1 will be 0 first time through, maybe. I always set variables to 0 at top of program.

    PAUSEUS will be nothing so SERVO1 will be turned OFF quite fast.

    Then the PIC will wait for the next SERIN from the PC, it won't emit more pulses until then.

    Assuming your MODE is configured properly.

    Robert
    Last edited by Demon; - 17th June 2014 at 14:23.

  2. #2
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Hello Robert okay
    you have to make an example as I do
    I think I'm losing myself in programming
    Between two pic I did worked.
    With pc always had the difficulty.
    Thank you.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Quote Originally Posted by cesar35 View Post
    Hello Robert okay
    you have to make an example as I do
    I think I'm losing myself in programming
    ...
    Sorry, have chores to do.

    You really should start small and add one thing at a time. I suggest you practice SERIN first, then add the pulses to the servo.

    Robert


    Edit: check out the PBP sample programs, they cover a LOT of material.

  4. #4
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Last edited by cesar35; - 17th June 2014 at 17:15.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    My VB is severly rusted but I think you've got a format mismatch between what VB is sending and what the PIC is expecting - as I suggested in a previous post.
    I think that SerialPort1.Write(pos) will send the content of variable pos as an ASCII string while the PIC is expecting two binary bytes, not an ASCII string.
    If that's the case you need to change the VB program or the PIC program, on the PIC side you can use the DEC modifier to recieve an ASCII string consisting of decimal digits and parse that into a value.

    Again, there's a big difference between sending a byte as binary, ie 123 and sending it as an ASCII string. If you loop the TX to RX on the PC and fire up a terminal program, what does the data look like?

    /Henrik.

  6. #6
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Quote Originally Posted by HenrikOlsson View Post
    Again, there's a big difference between sending a byte as binary, ie 123 and sending it as an ASCII string. If you loop the TX to RX on the PC and fire up a terminal program, what does the data look like?

    /Henrik.
    VB serialport.write defaults to ASCII characters so change PIC side and use DEC modifier.

  7. #7
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Quote Originally Posted by cesar35
    Hello EarlyBird2
    I modified the program (dec pos)
    The servo move well.
    have problem
    I have no command (RX) not working AC motors
    Could you tell me why (RX) does not work.
    thank you
    Could you explain more "I have no command (RX) not working AC motors. Could you tell me why (RX) does not work."

    RX has the value "X" and the servo works so how is RX not working?

  8. #8
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    Hello
    After modifying (DEC POS) The RX does not work
    I can send data to the rx ac motors not working.
    So the servant move
    I used (Servo gosub)
    The servant problem has already works better
    Thank you all.

    serin2 RX_inp,16468,500,PAR,[wait("PC"),RX,DEC POS]

    IF RX = "A" THEN FRE
    IF RX = "B" THEN TRA
    IF RX = "C" THEN ESQ
    IF RX = "D" THEN DIr
    GOSUB SERVO
    GOTO PROG

    SERVO:
    servo1 = 1
    PAUSEUS 1000 + pos
    servo1 = 0
    Pause 16
    RETURN

  9. #9
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Servo motor does not work correct

    You are saying that POS is received and works but "X" is not received.

Similar Threads

  1. Servo motor control
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th July 2010, 22:44
  2. servo motor control??help
    By HYETİK in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th April 2009, 07:41
  3. servo/motor problem
    By griffin in forum mel PIC BASIC
    Replies: 10
    Last Post: - 10th February 2009, 20:07
  4. Servo motor problem
    By dboy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th September 2008, 15:54
  5. contorlling servo motor
    By shirleyz in forum General
    Replies: 10
    Last Post: - 31st May 2008, 23:53

Members who have read this thread : 0

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