Shop OBEX P1 Docs P2 Docs Learn Events
autopilot — Parallax Forums

autopilot

kaydarakaydara Posts: 17
edited 2012-11-26 07:43 in Accessories
Hello my name is Daniel and I'm from Chile I wanted to see if I can help, I'm working on an autopilot, this includes far one accelerometer and one gyroscope, these sensors implemented in code in common work fairly well, but when I added a servo in the terminal code showed no sensor data, which led to stop working, one cause could be the voltage but has enough power for sensors and servo, I leave the code. Thank you very much beforehand.

MAIN.JPG
FUNCION ESTABILIZACION.JPG
OBJETOSERVO.JPG
729 x 383 - 38K
526 x 266 - 17K
683 x 536 - 70K

Comments

  • SRLMSRLM Posts: 5,045
    edited 2012-09-10 21:15
    Welcome to the forums.

    Could you post your full source code? It's much easier to get a good idea of what is going on when we have the complete files to look at.

    At this point, the only thing that I can see is in your servo object. The first line of the "principal" function is a cognew, and it is not indented at all. I don't know what the parser actually does, but it might be a bug source. You should indent it one step.
  • kaydarakaydara Posts: 17
    edited 2012-09-11 06:36
    you're right, here I leave codes.
    CODIGOS.zip
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-09-11 09:26
    Servos pull a lot of current when they start to move. This can cause a voltage drop which will reset the Propeller chip.

    What are you using as a power supply?

    I see you are using "waitcnt" to create your servo pulse. Have you tried using Servo32v7(in the Propeller Tool Library)? I attached a small demo for using Servo32v7 in post #15 of my QuickStart servo tester thread.

    I think using the object Servo32v7 will make using the servo a lot easier for you.
  • kaydarakaydara Posts: 17
    edited 2012-09-11 21:25
    Duane Degn wrote: »
    Servos pull a lot of current when they start to move. This can cause a voltage drop which will reset the Propeller chip.

    What are you using as a power supply?

    I see you are using "waitcnt" to create your servo pulse. Have you tried using Servo32v7(in the Propeller Tool Library)? I attached a small demo for using Servo32v7 in post #15 of my QuickStart servo tester thread.

    I think using the object Servo32v7 will make using the servo a lot easier for you.


    if I have actually used the item Servo32v7 above and to no avail, the font used is a battery charger with variable voltage regulator.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-09-12 12:21
    kaydara wrote: »
    if I have actually used the item Servo32v7 above and to no avail, the font used is a battery charger with variable voltage regulator.

    Have you tried a simple test program with only code to move a servo?

    Do you know how much current your battery charger/regulator can supply? I've had servo that didn't work well when powered from my bench power supply that worked a lot better when I used a high capacity battery pack.
  • kaydarakaydara Posts: 17
    edited 2012-09-12 20:52
    Duane Degn wrote: »
    Have you tried a simple test program with only code to move a servo?

    Do you know how much current your battery charger/regulator can supply? I've had servo that didn't work well when powered from my bench power supply that worked a lot better when I used a high capacity battery pack.


    charger is 1A to 12volt
  • A. ESERA. ESER Posts: 24
    edited 2012-11-26 07:43
    Hi Kaydara,

    Is there any progress on your project. I have seen quaternion based IMU code in your project.
    Is it working properly ?
Sign In or Register to comment.