Shop OBEX P1 Docs P2 Docs Learn Events
Penguin Programing help!! — Parallax Forums

Penguin Programing help!!

ZaxZax Posts: 48
edited 2008-04-08 19:27 in Robotics
Ok first off I have calibrated my STRIDE and TILT servos dead on, and when running these 2 programs it walks straight as an arrow! Penguin-AutonomousNavigation-v1.2.bpx or penguin_happy_feet.bpx But when running Penguin-AutonomousNavigationNoCompas_3.bpx it constantly walks to the Right! even when I recalibrate the TILT and STRIDE to compensate for this, and save it the program acts like its not loading the new settings from EEEPROM memory at all! So I thought that the photoresistors were causing it but even in total darkness it still does it! I am kind of stuck on truble shooting since its a programing issue of some kind thats out of my league it backs up perfectly straight thats what has me stumped, if the photoresistors were removed from the program would that help? I would rather just use the Irs for Avoiding obstacles but don't know how to chop them out of the code here it is
thanks Rick

Post Edited (Zax) : 4/6/2008 4:38:11 PM GMT

Comments

  • HumanoidoHumanoido Posts: 5,770
    edited 2008-04-03 17:07
    Curious, where did you find the code,
    Penguin-AutonomousNavigationNoCompas_3.bpx?
    At first glance, I see all the compass code remaining.
    (Look for HM55B and the word compass.)
    If you want to stop the directional navigation, this
    code can be removed, and will simplify the overall
    program. At this point it will be a chore to modify
    the remaining compass turn related statements.
    Then its a choice of routine, such as

    DO
      * walk forward
      * detect object
      * back up
      * turn
    LOOP
    


    Why not write your own code? It will be a wonderful
    learning experience, you can post your results, and
    everyone will benefit and appreciate your work.
    All of these routines have been posted in various
    applications for Penguin and can be linked into one
    program.

    humanoido
  • ZaxZax Posts: 48
    edited 2008-04-04 02:53
    Hello Humanoido, First of all thank you Very much for your Rapid Reply!!!!
    But Thank you Very Very Much For al the Great CODES you have provided here!
    I downloaded the code here on the Forum somewhere, but yesterday I pasted the wrong one.
    This is the No compas 3 code All the codes but the 2 I mentioned before cause a right walk! and when I try to chop out the photoresistors I get some strange results LOL!!! this is the code I would like to modify
    Thanks Again, Humanoido for all the GREAT WORK of yours!! you are in a league thats your own!!

    Post Edited (Zax) : 4/6/2008 4:38:55 PM GMT
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-04-04 17:06
    Hey thanks Zax! It's appreciation like yours that
    inspires me to write Penguin programs.
    This program is a mod by Interact
    and can be downloaded here, along with the
    modified compass version and text description.

    Penguin Another re-work on the Parallax AutonomousNavigation
    http://forums.parallax.com/showthread.php?p=672251

    As part of the normal functioning of the code,
    Penguin will implement turning while walking.
    I have highlighted an area of interest in Interact's
    quote.

    IR detectors, used for obstacle avoidance, receive
    reflected IR from the IR transmitter, and work in
    total darkness. Cutting out that code would cripple
    obstacle detection and give strange results.

    humanoido
    Interact said...
    Another thing about this re-work is that the step routines take into acount which foot is allready forward. this was another reason the poor guy would get "stuck". Also.. object avoidance logic with this simple routine.. The line below in the main loop that has the red hilighted Chirp - 2 can be adjusted to 4 for better results on most objects. The result is that after the penguin takes a few steps backwards while turning away from an object it will go straight for (in this case 2) steps before resuming looking for the light. It will still look for obstructions during this time. If ojects are white the penguin will see them sooner than dark colored objects etc. If objects are big or small also causes a slight change to the ideal logic here. I found that Chirp = 4 is best for most things. Also make sure your penguin CAN walk straight! if it tends go drift left, re-calibrate him/her so that he/she leans a bit to the right. Just setting it up so that it is perfectly vertical dosen't mean it will walk straight.
  • ZaxZax Posts: 48
    edited 2008-04-05 14:15
    Thanks again Humanoido!!! He Who is One with Penguin!!! I just picked up a remote and I am running Penguin Robot Wireless Soccer.
    I know the trouble is simple but this code works perfect but it still does not run or walk straight it still moves to the right and the left foot is always half a foot ahead of the right one. When walking during the calibration program he walks straight as an arrow!
    I am missing something here, even when I change the calibration to compensate he still turns right during the soccer code he will not go left He goes Straight, but he will sure make a sharp right LOL!!
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-04-05 15:05
    Thanks Zax for your detailed description. It sounds like
    your Penguin Robot has one servo that needs replacing.
    Providing that this Penguin is mechanical tuned, with no
    binding from side bolts, etc., and the batteries are checked
    and new (very important) and because the soccer
    code is tested to make Penguin go straight, I would say
    it's a done deal about the servo. When one foot is in
    front of the other, this is the key. Clearly, confusion
    could result when the calibration program is used in an
    attempt to center this servo. This happens to me when
    I use Penguins so much that a servo wears out!
    With such a worn servo, it's possible to bring it back to
    the home position, but then running software will cause
    the little bot to move in unexpected ways.

    humanoido
  • ZaxZax Posts: 48
    edited 2008-04-06 05:37
    O. K. Humanoido I will try fresh batteries.
    I have 2 boes, and 3 sumos ,and have considered the servo isue.
    I think it would have to be the Stride servo if any, I will change the positions Tilt to sride and stride to tilt and see what happens.
    As far as binding no way the little guy is fit as a fiddle there is no binding anywhere.
    What has me confused if he walks straight in the other programs such as Penguin-AutonomousNavigation_v1.1 and Happy Feet you would think logic would say it should in the others!
    Trust me on this oh GREAT MASTER STAMPER I am eager on you next upcomming codes!!
    I am having a Ball with your Soccer Code even if I cant turn Left Lol!! It is to much FUN!!
    Is it posible to use a say a RCA remote, so you can have two of the Little guys running at the same time ? I am using A RCA for mine With Sony TV code It would be a blast to have 1 try to to knock the the other down with a good kick in the foot!! LOL
    Thanks again Humanoido, for your very VALUABLE TIME
    Rick
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-04-06 08:41
    Let me know what you find after swapping the servos.
    Not being able to turn can also be related to the tilt
    servo and not just the stride servo. This is because
    turning employs a small tilt, one foot goes forward,
    the tilt is canceled, and the feet are brought together
    or motioned past each other. If both servos have
    worn out their positioning ability, swapping may create
    some other results.

    Penguin will need calibration again before running any
    programs. Some of these programs may be helpful for
    calibrating and study.

    11 penguin_automatic_servo_calibrator.bpx
    http://forums.parallax.com/showthread.php?p=671204

    15 penguin_calibration_companion.bpx
    http://forums.parallax.com/showthread.php?p=671346

    57 penguin_tiltstride_reader.bpx
    http://forums.parallax.com/showthread.php?p=691481

    30 penguin_motion_startup.bpx
    http://forums.parallax.com/showthread.php?p=695151

    52 penguin_startup_instructions.bpx
    http://forums.parallax.com/showthread.php?p=690297

    You have a very good idea here! To use the RCA codes
    and remote on one Penguin and the SONY standard codes
    and remote on another Penguin will require one Penguin
    to have code running to recognize SONY and another
    Penguin to have code recognizing RCA. Someone will
    need to write the RCA code for Penguin.

    humanoido
    humanoido said...
    Work is progressing on a new upcoming Penguin
    VSC Virtual Sound Chip and additional code
    that will demo four methods to create special sound
    effects. You will learn how to create sound with the
    following coding techniques:

    1) FREQOUT
    2) BAUD
    3) TOGGLE
    4) PULSOUT
  • ZaxZax Posts: 48
    edited 2008-04-06 10:22
    Thanks a Bunch, Humanoido!!
    Yes, I will let you know what happens!
    I wonder if you know Someone Who Would write the RCA code for Penguin, Hint Hint!!
    I thought it would be simple just changing a couple numbers for the input data but I have all ready found out there is more to it!
    Thanks for all the help Humanoido!!!!!!!
    But most of all for "THE SOCCER CODE OUTSTANDING WORK!!!!!!!!!!!!!!!"
    Rick
  • ZaxZax Posts: 48
    edited 2008-04-06 16:34
    Hey there Humanoido,
    I changed the batteries, and changed the servos, from Tilt to stride and stride to tilt and still get the same results.
    IT walks straight as an arrow when running Penguin-AutonomousNavigation-v1.1.bpx, or when I walk in Penguin-ServoCalibration-v1.2.bpx
    But when running Penguin-AutonomousNavigationNoCompas_3.bpx or Soccer it constantly walks to the Right! even when I recalibrate the TILT and STRIDE to compensate for this, and save it, the programs acts like its not loading the new settings from EEEPROM memory at all, no matter what position I calibrate the servos in, they remain in the same position in these programs but in the other 2 that it walks straight in, if the stride and tilt are off a little you can see the difference in the walk in other words I think I have narrowed it down Does the Soccer program not move the servos to the set positions I set and save in the Penguin-ServoCalibration-v1.2.bpx? I even went as far to calibrate it with the tilt and stride way way off center, but when I ran Soccer and AutonomousNavigationNoCompas_3.bpx it made no change, the center positions were the same.
    Thanks again Humanoido,
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-04-07 16:46
    Try this calibration program instead:
    penguin_automatic_servo_calibrator.bpx
    http://forums.parallax.com/showthread.php?p=671204
    The calibration changes to the stride motor will be evident
    and the position of the feet are easily adjusted about
    the front even point. I suggest calibrating with this software
    when running any of the humanoid penguin suite programs
    that call for calibration. (see attached file below)

    After calibration with the above mentioned code, the soccer
    program, which is part of the humanoido penguin suite of
    programs, will reflect this calibration in the walk and the
    effects will be apparent. After the walk is completed,
    the home code brings the feet back to the calibrated
    center position. The walk, during the walking process,
    is straight. However, the home code, normally induces
    a slight turn. This is because the foot is not raised when
    the two feet are returned to center home position.
    


    I believe the turn you describe in the soccer program is
    from the home position written into the code cycle when
    the feet are brought together. This happens in the subroutine
    Center and is the normal functioning of the program.

    You can disable this code, but would need to write new code
    subroutines to compensate and remember the ending
    position of the feet, and the beginning of the next
    start cycle. The key in doing this is to alternate the start
    and stop positions from feet, i.e. for example, when stopping
    the left foot can be fwd, and when starting, this would
    become the starting position. This would be a good upgrade
    idea for the next code version.


    Zax, thanks for your keen eye in drawing attention to this
    feature. Attached is a preliminary list of programs that are
    in the humanoido Penguin Robot suite. The reference can
    help decide which programs can be calibrated with
    penguin_automatic_servo_calibrator.bpx

    Also please refer to the Penguin Resources sticky at the
    top of the Robot Forum, to determine who created and
    modified which code. It will give an idea about who can
    best support the various Penguin code.

    http://forums.parallax.com/showthread.php?p=675357

    humanoido

    Post Edited (humanoido) : 4/7/2008 4:51:22 PM GMT
  • ZaxZax Posts: 48
    edited 2008-04-08 19:27
    Thank you thank you Humanoido!!!!!!
    I am up and running 100% your penguin_automatic_servo_calibrator.bpx did the trick I had a feeling it was something simple even the other programs I had that were walking to the Right are now PERFECT!!!!
    Thank you so much for the help!!!!!!!!!!
    I am sorry it took so long for you to trouble shoot it but that was it!
    Thanks again Humanoido!!
    Rick hop.gif
Sign In or Register to comment.