HSERIN problem


Closed Thread
Results 1 to 4 of 4

Thread: HSERIN problem

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Syariful,

    The problem with controlling RC servos is that they require a continuous pulse stream. At least long enough for the servo to move from its current position to the new position.

    Also, PULSOUT works by toggling the output pin twice, so the initial logic state of the output pin determins the polarity of the pulse.

    For a high-going pulse, you would first need to clear the output pin. Then PULSOUT will toggle the pin twice providing a logic 1 polarity pulse.

    Issuing a single PULSOUT command will probably not provide the result you're expecting. You need a loop that will continue the pulse stream for at least the time period it's going to take to move the servo horn to the position you need.

    We have several servo control examples in our Micro-Bot robot projects section you might find helpful.

    http://www.rentron.com/Micro-Bot/index.htm

    For your particular application however, I would opt for a dedicated type servo controller like the Scott Edwards Mini SSC II or something similar.

    With a dedicated servo controller, you won't need to run in a continuous loop just for servo control, and can free up processor time for monitoring other tasks.

    Also, unless you maintain the pulse stream to each servo, the servo will relax. This will cause major problems in an RC airplane since force against each servo will move the servo, and cause loss of control. Maintaining the servo control pulses will keep servo motors fixed in position, and your RC airplane on a true course.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    s_syafiq81's Avatar
    s_syafiq81 Guest


    Did you find this post helpful? Yes | No

    Default hserin problem

    hi Bruce!

    I would try add a loop in my code as suggested. Another thing I would like to know, are my HSERIN command is correctly used. THe AHRs will output the euler angle as presented below. Can the HSERIN command detect the negative sign since from what i have read from the manual, A variable preceded by DEC will receive the ASCII representation of its decimal value. All non-digits received prior to the first digit of the decimal value are ignored and discarded.

    example:

    E:-0.01825,12.45123,-5.23564

    The three Euler angles roll, pitch and yaw are output in degrees.
    (roll range:-180 < roll angle < 180 , zero deg mean level with positive angle is right wing down)
    (pitch range: -90 < pitch angle < 90, positive angle = nose up)
    (yaw range: -180 <yaw angle < 180, positive angle = easternly heading)




    regards,
    syariful.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi syariful.

    Your hserin looks fine to me, but nothing beats testing it in your application to make sure.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. 16F877 HSERIN problem with 3th party software
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 18:11
  2. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 12:08
  3. HSERIN problem
    By eggman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th October 2007, 22:31
  4. Replies: 3
    Last Post: - 12th February 2007, 19:32
  5. HSERIN problem
    By s_syafiq81 in forum Serial
    Replies: 2
    Last Post: - 1st January 2006, 12:05

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