Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

  1. #11
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    860
    Images
    25
    Rep Power
    96

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    What is the problem? I used that software for several months. It should be as simple as reversing the direction and adding the offset angle of the new tibia.

  2. #12

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Quote Originally Posted by KevinO View Post
    What is the problem? I used that software for several months. It should be as simple as reversing the direction and adding the offset angle of the new tibia.
    Hi Kevin,
    I was able to have it working, not only by the modifications suggested in another post, but also doing another change on the Startup position of all the femur angles . I will post the code, and pictures and video , as I have doubts that is all correctly, and I will love to be able to confirm, comparing the code with others.

    1- latest KurtE Phoenix Ported Code, download from https://github.com/KurtE/Arduino_Phoenix_Parts
    2
    - After distributing the folders as libraries, etc. Im able to compile, and the body position is an all upsidedown robot, that I showed already in a picture.
    3- Changes in the code for a STOCK Hexapod Mark2, the new version. :

    a) Hex_Cfg.h
    //[LEG DIMENSIONS]
    //Universal dimensions for each leg in mm
    #define cXXCoxaLength 52 // PhantomX leg dimensions.
    #define cXXFemurLength 66 // MEASURE THIS!!! Guessed now :-)
    #define cXXTibiaLength 132 // MEASURE THIS!!! Guessed now :-)


    b) //IKTibiaAngle
    Temp1 = ((((long)(byte)pgm_read_byte(&cFemurLength[LegIKLegNr])*(byte)pgm_read_byte(&cFemurLength[LegIKLegNr])) + ((long)(byte)pgm_read_byte(&cTibiaLength[LegIKLegNr])*(byte)pgm_read_byte(&cTibiaLength[LegIKLegNr])))*c4DEC - ((long)IKSW2*IKSW2));
    Temp2 = (2*(byte)pgm_read_byte(&cFemurLength[LegIKLegNr])*(byte)pgm_read_byte(&cTibiaLength[LegIKLegNr]));
    GetArcCos (Temp1 / Temp2);

    TibiaAngle1[LegIKLegNr] = -(1400-(long)AngleRad4*180/3141); //!!!!!!!!!!!!1400 instead of 1800
    this line on the option where isnotdef opt_walk_upsidedown.

    c) in the following code, I didnt copy the part //[Rotate functions] , as depende on other parameters that kingping didint include . so i dont know how important is this.

    Phoenix_Input_SerialCommand

    In this part you should especially look at de directions or minus signs that were either added or removed, don't know for sure which i changed. The multipliers I used or totally optional of course, i.e. (5/4)); //Right Stick Up/Down !!!! time 1.2 (5/4) .

    //Walking
    if (WalkMethod) //(Walk Methode)
    g_InControlState.TravelLength.z = (-(command.leftV) * (5/4)); //Right Stick Up/Down !!!! time 1.2 (5/4)

    else
    {
    g_InControlState.TravelLength.x = -command.RightH; //!!!!!!!!!!changed direction
    g_InControlState.TravelLength.z = (-(command.RightV) * (5/4));// !!!! time 1.2 (5/40
    }

    if (!DoubleTravelOn) { //(Double travel length)
    g_InControlState.TravelLength.x = g_InControlState.TravelLength.x/2;
    g_InControlState.TravelLength.z = g_InControlState.TravelLength.z/2;
    }

    g_InControlState.TravelLength.y = -(command.leftH)/4; //Right Stick Left/Right !!!lowered x % (4 to 5)
    }

    //[Translate functions]
    g_BodyYShift = 0;
    if (ControlMode == TRANSLATEMODE) {
    g_InControlState.BodyPos.x = SmoothControl(((command.RightH)*2/3), g_InControlState.BodyPos.x, SmDiv);
    g_InControlState.BodyPos.z = SmoothControl(((command.RightV)*5/9), g_InControlState.BodyPos.z, SmDiv); //changed from 2/3 to 5/9
    g_InControlState.BodyRot1.y = SmoothControl(((-command.leftH)*2), g_InControlState.BodyRot1.y, SmDiv);

    // g_InControlState.BodyPos.x = (command.RightH)/2;
    // g_InControlState.BodyPos.z = (command.RightV)/3;
    // g_InControlState.BodyRot1.y = (command.leftH)*2;
    g_BodyYShift = ((command.leftV)/2); // changed from 2 to
    }

    //[Rotate functions]
    if (ControlMode == ROTATEMODE) {
    g_InControlState.BodyPos.x = SmoothControl(((command.RightH)*2/3), g_InControlState.BodyPos.x, SmDiv);
    g_InControlState.BodyPos.z = SmoothControl(((command.RightV)*5/9), g_InControlState.BodyPos.z, SmDiv); //changed from 2/3 to 5/9
    g_InControlState.BodyRot1.x = ((command.RotV)*5)/4; //!!!times 1.5
    g_InControlState.BodyRot1.y = (command.leftH)*2;
    g_InControlState.BodyRot1.z = ((-command.RotH)*5)/4; //!!!times 1.5
    g_BodyYShift = ((command.leftV)/2);





    If you want to use single leg:

    //[Single leg functions]
    if (ControlMode == SINGLELEGMODE) {
    //Switch leg for single leg control
    if ((command.buttons & BUT_R1) && !(buttonsPrev & BUT_R1)) {
    MSound (1, 50, 2000);
    if (g_InControlState.SelectedLeg<5)
    g_InControlState.SelectedLeg = g_InControlState.SelectedLeg+1;
    else
    g_InControlState.SelectedLeg=0;
    }




    d) in the file In the Phoenix_Driver_AX12.h


    wCoxaSSCV = (((long)(-sCoxaAngle1))* cPwmMult) / cPwmDiv +cPFConst; wFemurSSCV = (((long)(-sFemurAngle1))* cPwmMult) / cPwmDiv +cPFConst; wTibiaSSCV = (((long)(-sTibiaAngle1))* cPwmMult) / cPwmDiv +cPFConst; <--- remove the negative here } else { wCoxaSSCV = (((long)(sCoxaAngle1))* cPwmMult) / cPwmDiv +cPFConst; wFemurSSCV = (((long)((long)(sFemurAngle1))* cPwmMult) / cPwmDiv +cPFConst); wTibiaSSCV = (((long)(sTibiaAngle1))* cPwmMult) / cPwmDiv +cPFConst; <-- add one here


    e) After all this, the startup body position looked almost good, but the angle in FEMUR.
    so I changed on the file Hex_cfg.h
    the
    #define CHexinitY 25 ----------------------> #define CHexinitY 74
    CHECK THE FIRST PHOTO ATTACHED.

    f) Also I upload the Kurte CommanderEXT : https://github.com/KurtE/CommanderEx




    a
    ttached is the first picture, BEFORE DOING PARAMETERS CHANGE, etc.
    PhoenixChangesStockMK2.tar.gzClick image for larger version. 

Name:	IMG_20130617_170437.jpg 
Views:	214 
Size:	142.0 KB 
ID:	4824
    Last edited by ezex; 06-18-2013 at 05:30 PM.

  3. #13
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    860
    Images
    25
    Rep Power
    96

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Some of those are KingPin's personal preference, especially the changing of the multipliers. The angle offset actually has a variable you can set but it isn't in the PhantomX config file. It's TibiaOffset I think. Now the flipping of the servo direction is the only thing there that doesn't have a variable you can set in the config file but I'm sure Kurt will fix that. Kurt will probably chime in after the sun goes down.

  4. #14

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    im still waiting for youtube.com to upload some videos .

    I wonder if taking a look at the videos, there is any suggestions to be corrected.


    cheers
    Eze
    Last edited by ezex; 06-18-2013 at 07:00 PM. Reason: fix

  5. #15

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    video of the Hexapod Mark2 Stock, new version, running phoenix.

    http://www.youtube.com/watch?v=Jne3XHa1r44&feature=youtu.be
    http://youtu.be/yXxcOAzCs80
    http://youtu.be/_CGHovhiftk
    http://youtu.be/JRhJb8H3W4A
    http://youtu.be/hgqzJVadIfs

    there are short, and after switching to some mode, gate or something, I cannot get out of rotation mode, may be I still need to undertstand the commander, but I guess also there are some settings to be corrected.

    I will correct all cables, and make it nicer, ones I know all is good.

  6. #16

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Sun is still out

    With the latest Quad code, there was code added to allow for the servo direction to be changed in a more configurable way. Will try and probably port back to non-quad code....

    Kurt

  7. #17
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    860
    Images
    25
    Rep Power
    96

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Something is wrong. You are getting a dip during the step. Something is off... Could be a measurement or angle wrong. Also you are the second person with the hex upside down! Is there a reason why?? Also I can't confirm your leg angles due to my leg config being different.
    Last edited by KevinO; 06-18-2013 at 07:49 PM.

  8. #18
    Join Date
    May 2008
    Posts
    2,228
    Images
    155
    Rep Power
    135

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Quote Originally Posted by KurtEck View Post
    It could be that the Arbotix people changed the format of the Pypose information. I probably should remove all of this from the default version of the sketch.
    Nothing of consequence has changed in the libraries, or the format of the exported header files, since 0013. The .ppr file format has had some updates over the last couple of releases. The only changes in header files between 0014 and 0015 is that 0015 is now compatible with Arduino 1.0 (the 0014 release was not), but this is mainly a change if #include directives and directory structuring.

    -Fergs

  9. #19

    Re: compiling Phoenix code for Stock Hexap M2 on linux troubleshooting

    Quote Originally Posted by KevinO View Post
    Something is wrong. You are getting a dip during the step. Something is off... Could be a measurement or angle wrong. Also you are the second person with the hex upside down! Is there a reason why?? Also I can't confirm your leg angles due to my leg config being different.
    thank you KevinO, I would compile the code that KingPin posted,
    rigth now im waiting for some parts to arrive, as the bottom plate/top plates, got broken while removing some screews on a leg,
    I will check on the angles,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mark II running Phoenix code, first go
    By KingPin in forum Humanoids, Walkers & Crawlers
    Replies: 53
    Last Post: 07-04-2013, 10:14 AM
  2. Stock vs. Phoenix code?
    By TXBDan in forum Humanoids, Walkers & Crawlers
    Replies: 7
    Last Post: 05-15-2013, 10:43 PM
  3. Phoenix code...strange effect...
    By KingPin in forum Humanoids, Walkers & Crawlers
    Replies: 13
    Last Post: 03-04-2013, 05:30 PM
  4. Want to use Phoenix code on PhantomX Quadruped
    By Tony S in forum Humanoids, Walkers & Crawlers
    Replies: 38
    Last Post: 01-25-2013, 06:42 PM
  5. Question(s) Xan's Phoenix Code Clarification
    By parallax in forum Software and Programming
    Replies: 5
    Last Post: 08-15-2010, 11:11 PM

Posting Permissions

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