Open GMDFr opened 5 years ago
Hi, Here are the values I changed to fit the hexapod configuration.
Phoenix_Code.h
Phoenix_Driver_AX12.h l.21-l.27 //#define cPwmMult 128 // modif //#define cPwmDiv 375 // modif //#define cPFConst 512 // half of our 1024 range //modif
/!\ cPinTable w= Get Pose AX_PRESENT_POSITION
Phoenix_Input_Commander.h
Phoenix.h
BioloidEX.cpp l.31-l.37 // initialize for(i=0;i<AX12_MAXSERVOS;i++){ id[i] = i+1; pose[i] = 2048; nextpose[i] = 2048; //pose[i] = 512; //nextpose[i] = 512; // l.57-l.61 // initialize poseSize = servocnt; for(i=0;i<poseSize;i++){ id[i] = i+1; //pose[i] = 512; //nextpose[i] = 512; pose[i] = 2048; nextpose[i] = 2048; }
BioloidEX.h
Hex_Cfg.h // Define other optional compnents to be included or not... //#define PHANTOMX_V2 // Some code may depend on it being a V2 PhantomX
//-------------------------------------------------------------------- //[MIN/MAX ANGLES] - Start off assume same as Phoenix...
//-------------------------------------------------------------------- //[BODY DIMENSIONS] // A Modifier selon la pose d'origine.
//#define X_COXA 60 // MM between front and back legs /2 //#define Y_COXA 60 // MM between front/back legs /2 //#define M_COXA 100 // MM between two middle legs /2
Thank's you !
I modify properly values but have motor blinking on red... Guessing if there is a bit frame issue between AX18/ MX28 values
Sorry currently busy with other stuff, so don't have time/energy to help much. As for Angle limits, they are in 10ths of a degree so don't really matter which servos...
One main difference as you already know is the conversion of Angles to servo units, as used in the values:
l.21-l.27
//#define cPwmMult 128 // modif
//#define cPwmDiv 375 // modif
//#define cPFConst 512 // half of our 1024 range //modif
#define cPwmMult 512 // modif
#define cPwmDiv 1500 // modif
#define cPFConst 2048 // half of our 4096 range //modif
One of the difficulties with some of these conversions is that the code could maybe overflow integer math: That is if you have: wCoxaSDV = (((long)(sCoxaAngle1)) * cPwmMult) / cPwmDiv + cPFConst;
Depending on which board you are using on size of long... 1500*512... Will probably fit...
Conversion update is probably wrong.. i.e. you did not actually change the resolution. You multiplied both Mult and Div by 4 and when you divide these two numbers it simply cancels out... You probably only needed to change Mult to 512...
For what it is worth: I have been playing with a version of the PhantomX that runs on OpenCM boards and either uses AX like servos or XL430 like servos: Which is part of the project: https://github.com/KurtE/Open_CM_CR_Arduino_Sketches The conversion factors I have are:
#define cPwmMultXL 225
#define cPwmDivXL 256
#define cPFConstXL 2048 // half of our 1024 range
The reason that it is not simply a multiply of 4 1024->4096, there is also a change in the ranges of degrees (0-300) -> (0-360).
I believe it is the same for the MX servos.
Note: I do not own any MX servos (except one MX12W that is floating around here somewhere...)
Other issues with MX might include:
a) Are you using Protocol 1 or Protocol 2? If Protocol 1, then same packet formats... If Protocol 2, then packets are different. Bioloid code in this project is Protocol 1 only... The other project I listed here has code for both Protocol 1 and 2... But uses different library...
b) Other control table differences? like different default baud rate for servos...
Sorry got to run.
Forgot to mention, about blinking lights...
The Phoenix code - does blink the leds on the servos, when it is NOT receiving any valid packets from the XBee (Commander). That code was added as I killed a couple of batteries, when I turned off the commander, which caused the robot to sit down and turn off the torque to the servos, but then I forget to actually turn off the power to the robot...
Hi KurtE, And Thank's you so much for your quick answer ! I figure out that's : MX28 uses (very probably) protocol 1 (and now Robotis made an update for protocol 2) and the baudrate is 8000 bps. About Protocol, Robotis talkes about MX-28T / MX-28AT (Half duplex Asynchronous Serial Communication (8bit,1stop, No Parity)) and for AX18 (Half Duplex Asynchronous Serial Communication (8bit, 1stop, No Parity). It seems to be the same. Maybe, as you said, I should use your Phantom Phoenix OpenCMR. I use Arbotix for MX28 but I have also a Opencm700 for specific setup for servos. I will check all of this and see if the magic operates ^^ Again, thank's you so much to help me for that, I will probably open a topic about on trossen to avoid to monopolize your time. ^^ Best Regards, TY
Hi KurtE ^^ I tested the opencmr version of phoenix code but it blinks my servo. So, I am looking for change the protocol to see if the magic operates. Just to confirm with you that MX28 employs protocol 2 for firmware >= 39. I got the 40 version with a 1000000 baudrate. I tried to recover the firmware but it kept the 40 version and change my baudrate to 57142. If I can recover the protocol 1 on the servo, I will probably able to run the phoenix code properly. ^^
Again, if you do not have an XBee hooked up to the board... I have an adapter that I plug into Serial2 and that XBee is not receiving properly formatted messages from Arbotix Commander (or something generating similar messages), the code will put the Robot into sort of an idle mode, and with the code will blink the different servos as a reminder to me, that I have not yet turned the power off...
As for servo firmware versions, again I don't have any of these servos... But have seen some reports on Robotis forum. That is the first firmware version that Protocol 2 was started from is 40, but that does not necessarily imply a servo with Protocol 1, will have a firmware version < 40... If I looked at stuff I think the current version is something like 40 for protocol 1 and 43 for protocol 2
Hi Kurt, Sorry for the reply delay (I did my 1st year PhD presentation^^). I put all the MX_Servo on protocol 1 and we get some result through the pypose + NUKE code from Trossen. I remember Zenta successes to implement MX servos with Phoenix code but I don't know how he did it ^^.
Hi KurtE, My name is Guillaume, and I am doing a PhD on Robotics and AI. I am ok with IK and I have already all the measure of the hexapod for settings. I am working on a Hexapod which runs MX28T instead of AX18. I saw that Zenta used this range for his MX-Phoenix. I tried some things, but I am still stick on the MX28.
1) Did you have a MX28 version of Phoenix code please ? If not, do you have a list of variables or the .h files I need to modify to implement it please?
I saw on the code the MinMax values are noted as 650 , -700 i.e. Is it using a neutral pose as reference ? Do I need to modify it using an arbitrary mx28 setting ?
Thank's you so much for any tips and helps you can provide.
Best regards,
Guillaume,