Phoenix code running on an Arduino Mega with an SSC-32

Hello

i change this:

if (LegIndex < 3) { wCoxaSSCV = ((long)(-sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)(-sFemurAngle1+900))*1000/cPwmDiv+cPFConst; wTibiaSSCV = ((long)(-sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(-sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif } else { wCoxaSSCV = ((long)(sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)((long)(sFemurAngle1+900))*1000/cPwmDiv+cPFConst); wTibiaSSCV = ((long)(sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif }

to this

if (LegIndex <3) { wCoxaSSCV = ((long)(sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)((long)(sFemurAngle1+900))*1000/cPwmDiv+cPFConst); wTibiaSSCV = ((long)(sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif } else { wCoxaSSCV = ((long)(-sCoxaAngle1 +900))*1000/cPwmDiv+cPFConst; wFemurSSCV = ((long)(-sFemurAngle1+900))*1000/cPwmDiv+cPFConst; wTibiaSSCV = ((long)(-sTibiaAngle1+900))*1000/cPwmDiv+cPFConst; #ifdef c4DOF wTarsSSCV = ((long)(-sTarsAngle1+900))*1000/cPwmDiv+cPFConst; #endif }

but now i have another problem. the hexapod walks backwards instead of front, and turn right instead of turning left. of course now upside down is right. have any idea what should I do?
sorry for my bad english but I’m from GREECE and translated with google translate

GIANNHSitia

Sound potentially like your left legs act like right legs… Couple of options you could try. One swap all of the legs.

2nd - Probably a bit easier. Experiment. First understand in the code, I mentally translate : Coxa - Is Hip Horizontal, Femur is Hip Vertical, Tibia is Knee. So you say it is going the wrong direction, sound like maybe the Hip Horizontals (coxa) need to be negated. So try changing the wCoxaSSCV lines back to what they were before the change. Does that solve it? If not we need to experiment a bit more.

Kurt

Hello

I change the wCoxasscV to - and now is perfect. But I find a bug. 5 legs to defaul body position Legs make FASTER motion and greater, we go higher, and 1 leg move normal. If I chan boby position one step up, all legs is ok. This problem had not before the change, Maybe the problem is code or firmware gp2.02. Generally works fine. Will you try to send a video

hello agean. i change the pin of ssc32 and code and now work perfect… the code is amazing !!!

Glad you got it working

Hello
I have a question to make the servo that moves the body front back, to have less traffic which prices fall from here;

//[MIN/MAX ANGLES] Original angle
//#define cRRCoxaMin1 -650 //Mechanical limits of the Right Rear Leg
//#define cRRCoxaMax1 650
//#define cRRFemurMin1 -1050
//#define cRRFemurMax1 750
//#define cRRTibiaMin1 -530
//#define cRRTibiaMax1 900
//#define cRRTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cRRTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…
//
//#define cRMCoxaMin1 -650 //Mechanical limits of the Right Middle Leg
//#define cRMCoxaMax1 650
//#define cRMFemurMin1 -1050
//#define cRMFemurMax1 750
//#define cRMTibiaMin1 -530
//#define cRMTibiaMax1 900
//#define cRMTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cRMTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…
//
//#define cRFCoxaMin1 -650 //Mechanical limits of the Right Front Leg
//#define cRFCoxaMax1 650
//#define cRFFemurMin1 -1050
//#define cRFFemurMax1 750
//#define cRFTibiaMin1 -530
//#define cRFTibiaMax1 900
//#define cRFTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cRFTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…
//
//#define cLRCoxaMin1 -650 //Mechanical limits of the Left Rear Leg
//#define cLRCoxaMax1 650
//#define cLRFemurMin1 -1050
//#define cLRFemurMax1 750
//#define cLRTibiaMin1 -530
//#define cLRTibiaMax1 900
//#define cLRTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cLRTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…
//
//#define cLMCoxaMin1 -650 //Mechanical limits of the Left Middle Leg
//#define cLMCoxaMax1 650
//#define cLMFemurMin1 -1050
//#define cLMFemurMax1 750
//#define cLMTibiaMin1 -530
//#define cLMTibiaMax1 900
//#define cLMTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cLMTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…
//
//#define cLFCoxaMin1 -650 //Mechanical limits of the Left Front Leg
//#define cLFCoxaMax1 650
//#define cLFFemurMin1 -1050
//#define cLFFemurMax1 750
//#define cLFTibiaMin1 -530
//#define cLFTibiaMax1 900
//#define cLFTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cLFTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…

Sorry, I am not sure what you are asking here? Traffic? Prices?

Sorry

sorry, I’m translating with Google…when the robot turns and I have the "Toggle double gait travel length " then walk brings you to one another. I want to have a lower servo motion, for example

//#define cRRCoxaMin1 -650 //Mechanical limits of the Right Rear Leg
//#define cRRCoxaMax1 650
//#define cRRFemurMin1 -1050
//#define cRRFemurMax1 750
//#define cRRTibiaMin1 -530
//#define cRRTibiaMax1 900
//#define cRRTarsMin1 -1300 //4DOF ONLY - In theory the kinematics can reach about -160 deg
//#define cRRTarsMax1 500 //4DOF ONLY - The kinematics will never exceed 23 deg though…

to

//#define cRRCoxaMin1 -500//Mechanical limits of the Right Rear Leg
//#define cRRCoxaMax1 500
//#define cRRFemurMin1 -900
//#define cRRFemurMax1 700…

You can always try that and see if it helps you. The other way is to go into the input code class and make mods, like if it only happens when you are rotating (right joystick horizontal moves), then change the code to not have it turn as much…
This may be controlled by a line like:

        g_InControlState.TravelLength.y = -(ps2x.Analog(PSS_RX) - 128)/4; //Right Stick Left/Right 

So maybe /4 is not sufficient. Maybe try 5. If too much maybe 4.5 (multiply by 2 an then divide by 9)

Or if it is with walking maybe change that code slightly to limit…
Example: The code for double length looks like:

if (!DoubleTravelOn) { //(Double travel length) g_InControlState.TravelLength.x = g_InControlState.TravelLength.x/2; g_InControlState.TravelLength.z = g_InControlState.TravelLength.z/2; }
So maybe there is in issue if X or z is > 100 or 110… So could put in an else clause here to limit these… Maybe something like:

#define MAX_TRAVEL_X 110 // If needed could experiment to see where the limits should b
#define MAX_TRAVEL_Z 110 // ..

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

Warning: typed in on fly so could be issues… But hopefully you get the idea.
Kurt

I’ll try it tomorrow :smiley:

[Moderator: The official languages of the RobotShop Forum are French and English. Message has been translated from Portugese]

Hello Thanks to the work kurte, could implement the algorithm paragraph run without Arduino Mega 2560 without the need for SSC-32
The Arduino Mega CONTROLLING THE SERVANTS, and I’m using the NRF-24l01 + radio

Thank kurte.

Was looking for something to improve the kinematics of my hexapod.

I will send the video

Hi Kurte,
I have the SSC-32U.
But it has a different ending in the query.
Instead of “GP” are the last characters “SB”.
Does your code work with the SSC-32U?
Thank you

Juka

Does KurtE still reads this topic? Or is there another topic related to this code? I’m trying to make DEMO of all possible movements without PS2 controller. I’m using arduino and ssc-32 but I have difficulties to understand how Phonex_Input_PS2.h code works.

As I understand it continuously read PS2 input and then, in base which button pressed, changes some variables and at the end this new settings moves servos. But maybe I understood wrongly.

thanks in adavance.

Hello KurtE and the whole community in general, first of all thank you all for the great work and contribution you make in this community, where I have learned much thanks to you.
I want to build a Hexopod, I have an Arduino Mega 2560 and a servo controller Lobot LSC-32, this controller is used in the “Robo-Soul CR-6”
(SSC-32 I have not been able to get it in my country and there are no shipments to my country.)

Manual y Software Controller Lobot LSC-32
dropbox.com/sh/16ivgj1p1a6t … q4sqa?dl=0

Where I can start building this hexopod, check all the examples on your page,but all give me an error in the Arduino IDE, as to upload it to the card.

github.com/klimbot/Arduino_Phoenix_Parts
Which of the examples should I use for my Arduino Mega 2560, controller LSC-32 and my servos Mg996R ???

Thank you very much for everything and I hope you can help me.

Can anyone tell me the following variables in what cm corespond according to the body/leg shown in the pic?

Hex_Cfg.h file

cXXCoxaLength
cXXFemurLength
cRRTibiaLength

cRROffsetX
cRROffsetZ
cRMOffsetX
cRMOffsetZ
cRFOffsetX
cRFOffsetZ

http://https://www.robotshop.com/forum/https://www.robotshop.com/letsmakerobots/files/userpics/u28919/irma_body_dimentions.jpg

http://https://www.robotshop.com/forum/https://www.robotshop.com/letsmakerobots/files/userpics/u28919/irma_leg_dimention.jpg

robotshop.com/letsmakerobot … ntions.jpg
robotshop.com/letsmakerobot … ention.jpg

Ive been working on a small hexapod that i have been trying to run using the phoenix hexapod code.

With help from members of this forum we have made some headway but the topic was on was off topic of wgat i originally started it for so i figured we would make it for the right topic. If that made sense.

So far we have done these things….

Changed the Leg IK measurements to match my hexapod.

Changed the body IK to my bots measurements

Changed the numbers of the feet start positions for my legs.

We also changed the PWM range to match my servos in the servo driver function.

Hi KurtE and Team,

Anyone tried this Lynxmotion code on Arduino Mega 2560 and Lobot LSC-32 servo controller board.
I got this board online and not able to proceed with circuit connections with Auduino Mega 2560 and Lobot LSC-32 with PS2 controller.
Any Leads will be really helpful.

Thank you for your help…!!!

Thanks

Sorry, I have no idea about this servo controller and/or if anyone has tried it.

I have touched RC type servos for many years now, as I migrated over to mainly using Dynamixel Servos and now starting to play with the new LSS servos.

Good luck

1 Like

Thank you KurtE, Will give a try and see.
Thank you !!!

I started a thread about teachmode for the Lobot lsc32 controller in projects showcase. There is a download for a basic arduino code ( for ESP32, but you only have to change pin numbers)
You can extract the way, how to talk ‘Lobot’ from it.
Any further questions are welcome
o_lampe

PS: here is a manual for the LSC-serial protocol.LSC Series Servo Controller Communication Protocol V1.2.pdf (94.5 KB)