Lynxmotion SES V2 Hexapod Robot

I like this actually. Having it this way makes it easy to program and also gives a symmetrical travel for backward and forward motion for servos if you see what I mean. I have configured it this way as well. I am not sure what is the advantage of having it lay flat and then having that as the centre of travel.

Regarding the servo ids I have just configured them starting 0 for left front coxa to all the way upto 17 for right front tibia. It is something that can be easily changed in the code. I agree with @kurte it doesnā€™t really matter what ids we have and. Having them same as Phoenix ( I donā€™t know much about it though) does posses an advantage that the same code base can be potentially made to run with std servos using the servo controller boardā€¦ scs32

Having said that I do feel that there has to be an easier way out to be able to set the ids in the final version of the hexapod. When someone would start assembling from new the first step should be to set the correct id for the servo and label them. Otherwise, it is a bit cumbersome to change it once everything is assembled and wired with everything set to 0 ā€¦

That is great @cyberpalin. I donā€™t have the st7789 display
I will order one. I can see if I can get it routed to the serial portā€¦ let me see. Also, I donā€™t have the teensy board that you do. I have the teensy breakout board from kurt. Where does the St7789 connect to on that oneā€¦ ?

Hang on to ordering - updating the code so you can use the PS4 or PS3 controller wired to the hexapod for testing. Also added alot more status updates to the serial monitor when you press buttons - unless of course you want to get the display :slight_smile:

Hello @madmax and @cyberpalin and @zenta and @xan and all:

Not sure if some of the history of some of this display stuff will be interesting or notā€¦

Back when a few of us had DIY remote controls that was built for us by Jim Fry a long long time ago. It originally worked using an RC receiver. Later I think all of us converted over to using XBees, and when we originally setup the DIY Remote control we added the ability to send data back to the remote, which I found useful. Things like knowing what state we were in or which walking gait or ā€¦

Again the drop of code from Zenta still makes use of thisā€¦ But I know that we are not all going to be using a DIY remote, so I wanted some way to still see that information. So for example my first board for the lss I added pins to match up with the sort of Adafruit display sort of standard, which includes the ST7789ā€¦ I then added code that displays at least some of this on those displaysā€¦

But board did not have XBee on itā€¦ and I know at least some still wish to use XBee based setup, so I did the boards with XBees on it. But I did not then have room for displayā€¦ Also some might want to use the Shield so I setup a simple board that connects to the servos using the Robotshop shield.

And have made a few other designs, like the one @cyberpalin is running which does not require the shieldā€¦

Now back to pointā€¦ My goal is/was to make this optional with a few different options:
a) Can use the ST7789 , which Mike and I have a few of!
b) Use a monochrome display plugged into to the Wire object. In particular ones that have the qwiic connectorsā€¦ But warning the connectors on the ones that @dialfonzo soldered used the wrong one (due to my mistake), should be ones that lay horizontalā€¦ I updated mine (unsoldered the ones he did and soldered on the right partā€¦
So assuming this the initialization code would do a quick check to see if the display is plugged in and if so use itā€¦
c) optional to send most to debug terminalā€¦

My plan was to maybe setup something like a notification object that all of the other objects can send information to and then different objects can optionally be clients of this object and get notified (call back method called) when messages are sentā€¦ or something like that.

Hope that makes sense

Hello @madmax and @kurte and @zenta and @xan and all:
I just pushed an quick and dirty update to the LSS_PhoenixUSBJoystick code so you can basically use any PS4 controller in wired mode or only the DS4 in Bluetooth mode (its a define in HEX_CFG.h file). Also added serial messages when you push the push the buttons on the controller if you donā€™t have a ST7789 handy. As @kurte mentioned we have a few different ones in our stock pins.

You can get it from @kurteā€™s LSS_TEST_SKETCH directory or mine that I posted earlier. Both have been updated.

Triangle - Change Walk Mode (Walk, Translate, Single, Rotate)
Square  -  Balance mode on/off
Dwn Arrow - Sit
Up Arrow - stand (ready to go)
R2 - Double or Normal Leg Lift Height 
Circle - Switch between Walk methods Right Joystick or Auto.
PS - on/off
L1 - Adjust Up/Dwn (Ry), Spd (Rx)
X - Debug joystick - note this option overwhelms the Arduino Sermon
Option - Gait Select (there are several)
R1 - Hold selected leg in position

Cheers

EDIT:
DISCLAIMER AND WARNINGS.

  1. Servo configs are setup for the 0 method as described earlier. This can be changed to meet your setup needs as well as changing ServoIds in the Hex_cfg file.
  2. Pretty sure gait isnā€™t working correctly but not sure if that is a issue with the config hexapod parameters I set up for your lynxmotion hexapod (dimensions, angles, leg heights etc) or because we are still using moveTā€™s.
1 Like

@cyberpalin I think at this point youā€™ve already looked at the code. What defines the duration of the movements is the ā€œirdā€ā€¦ the ā€œirdā€ divides the difference between a target position and a previous position into small increments (the bigger the ā€œirdā€, the more increments, and the slower the movement will be). However, nothing defined with time (ms or whatever).

Nice! :slightly_smiling_face:

@kurte Yesā€¦ more or less like this.

Thanks @cyberpalin!

I synced up and will try soon, although maybe in the morning. Currently hacking LSS library like I mentioned yesterday.

@madmax - I totally agree that there will need to be some instructions page on how to set a hexapod or other robots. I would guess that some generic instructions exist somewhere in the WIKI.

As for more complete complete specific instructions for this hexapod, that will probably depend on RobotShops plans. That is will they sell a complete Robot Kit? If so, then that product should include specific instructions on how assemble, and should mention that all of the servos should have their IDs set before they get to some step.

And how they may want to instruct the user on how to do this will depend on what their final choices are for things like electronics. For example if they donā€™t ship it with a Teensy or if they do and the Teensy board controls the servos directly and does not require the shield. Then their instructions will need to be tailored. They may do it using an Arduino program, or they may choose to ship it with a simple USB to LSS servo adapter and give instructions for that.

But I totally agree we probably need some form of documenting set up for these beta like setups. For example when any one gets to the point that the wish to use the PS4 with bluetooth, how do you bind the twoā€¦

More later.

@dickel - first thanks for posting the code. It makes for a good reference. Second asked that question before I saw the code. After I went through it kind replied back to @dialfonzo that it was doing the same thing as his reference sketch which I was having a problem with getting back correct positions. Planning on going through your code tomorrow in the late after noon (have things to do in the morning) and to see what I am doing wrong and rerunning my test sketch for one servo. And yes it was pretty much what @kurte was suggesting as you quoted.

@cyberpalin and all, this is all for me today, but thought I would mention I pushed up a new branch of the LSS library:


Which added a member function to allow the sketch to decide how long to wait for responsesā€¦

I also set a #define in header to know that this API exists.

I then updated the LSS servo test program to call it and set the two settings I put in:
20 - How long I will wait for the starting * of a response
5 - how long to wait for other characters within a message.

Tested with the ā€˜cā€™ ā€˜iā€™ commands and as you can see it did shorten the delay from 100ms to 5ms when we do get a communication failure, which is getting better.

Again all for tonight, but feel free to try it outā€¦ Will play more tomorrow and if it looks like it is working without problems, will issue a Pull Request. But no guarantee it will be accepted.

Thanks Kurt. Just updated everything and will play with it tomorrow kind of done for the night as well :slight_smile:

okay i started playing with the code in @cyberpalin respo LSS_PhoenixUSBJoystick

I had to change the servo IDs to what i have assigned but that is really easy. Using the USB host i.e. wired USB PS4 controller to start with. I have tested that the buttons do work and upon moving the joysticks i can see the LX, LY, RX, RY moving.

This is what i get on the serial monitor

Program Start

Servo(0): 15 482
Servo(1): 12 -143
Servo(2): 9 221
Servo(3): 6 3
Servo(4): 3 -297
Servo(5): 0 -381
Servo(6): 16 318
Servo(7): 13 172
Servo(8): 10 316
Servo(9): 7 -41
Servo(10): 4 -397
Servo(11): 1 36
Servo(12): 17 -285
Servo(13): 14 -298
Servo(14): 11 -176
Servo(15): 8 383
Servo(16): 5 -294
Servo(17): 2 -37
Servos for Leg Left Front **found**
Servos for Leg Left Middle **found**
Servos for Leg Left Rear **found**
Servos for Leg Right Front **found**
Servos for Leg Right Middle **found**
Servos for Leg Right Rear **found**
USB Joystick Init: Arduino Phoenix Monitor

D - Toggle debug on or off

J - Show Joystick data

V - Voltage

M - Toggle Motors on or off

T - Test Servos

P - Servo Positions

S - Track Servos

O - Enter Servo offset mode

*** Device HID1 54c:9cc - connected ***
  manufacturer: Sony Interactive Entertainment
  product: Wireless Controlle
*** HID Device Joystick1 54c:9cc - connected ***
  manufacturer: Sony Interactive Entertainment
  product: Wireless Controlle
  Joystick type: 2
*** First Joystick message 54c:9cc ***
  manufacturer: Sony Interactive Entertainment
  product: Wireless Controlle

I do hear some beeps upon pressing some buttons but the servo show no sign of lifeā€¦ Is this expected ?

Yep. What you have to do is hit the PS button to turn power on, and test that the legs move with the up and down arrows. Here are the commands again:

Triangle - Change Walk Mode (Walk, Translate, Single, Rotate)
Square  -  Balance mode on/off
Dwn Arrow - Sit
Up Arrow - stand (ready to go)
R2 - Double or Normal Leg Lift Height 
Circle - Switch between Walk methods Right Joystick or Auto.
PS - on/off
L1 - Adjust Up/Dwn (Ry), Spd (Rx)
X - Debug joystick - note this option overwhelms the Arduino Sermon
Option - Gait Select (there are several)
R1 - Hold selected leg in position

EDIT:
DISCLAIMER AND WARNINGS.

  1. Servo configs are setup for the 0 method as described earlier. This can be changed to meet your setup needs as well as changing ServoIds in the Hex_cfg file.
  2. Pretty sure gait isnā€™t working correctly but not sure if that is a issue with the config hexapod parameters I set up for your lynxmotion hexapod (dimensions, angles, leg heights etc) or because we are still using moveTā€™s.
1 Like

@cyberpalin and @madmax
Quick update. I am playing with the servo test program with doing my own interpolation for servosā€¦
Which is starting to work reasonably well.

Once I have a few more updates to it, will then integrate it into my version of Phoenix code. Will be like the DXL(bioloid) version of driver, where I will probably have a class member variable, that will allow me to choose either hopefully let the servos do the work or simply use servos to receive N positions per second and sketch code will drive what the positions will be.
Will have debug command that allows me to switch betweenā€¦

May be later today, may be in a few daysā€¦ It is sunny out today :smiley:

That was itā€¦ PS buttonā€¦ I was trying all sortsā€¦ lolā€¦ my kid was watching TV and me hitting the PS button switched on my PS4ā€¦ my kid watching TV was annoyed hahaha.

Nice!

ā€¦ its nice and sunny here tooā€¦ now in the park kids timeā€¦ Will play on a bit laterā€¦

Glad its working have fun playing as I said its still a work in progress especially the gait stuff. @kurte changes should help.

As I mentioned it may be a day or so before I push up changes to Phoenixā€¦

But if you want to see difference in motion. Try syncing up to the LSS test sketch
and try the new ā€˜kā€™ command it takes an optional frames per second.

Also unlike "iā€™ command after it goes to the several positions and pauses. It then goes to all of these positions again at 4 times slower speed and without pauses.

Maybe will add that part back to ā€˜iā€™ later

Iā€™m trying to compile the LSS_PhoenixUSBJoystick. Where are the TeensyDebug.h supposed to be held? I get an error since it canā€™t find this file.

Sorry @zenta - probably should try to remove itā€¦ Or conditionally include itā€¦

It is up at:

It is a library that can add code to add some GDB debug support. I had the code optionally setup to allow me to compile with USB type of dual serial. Where then GDB talks using one of these and the other is used normally.

When working nicely you can use GDB to set breakpoints and show you the call back stack and variablesā€¦ Which is all nice. Also there is some stuff setup that if you use VisualMicro stuff within VisualStudio you can do some debugging at source level which again is nice. The last time I played with it, it had some issues with timing sensitive codeā€¦

Keep meaning to try it again.

1 Like

Thanks for the tip. I think I tried the tcflush but not tcdrain. I had the same results during testing of the FTDI and also tested the CP2102 chips. Using ā€œsetserial low_latencyā€ the FTDI will reduce the 64byte FIFO to 8byte. low_latency setting doesnt seem to do much on the CP21x but its fifo is 12bytes if I recall. Currently I am using RPIs TTL serials which show up as ACMs and they work with very little latency. Also RPi4 has like 5 of them compared to 1 on earlier Pis. I did some comparisons with a teensy and they were the same, so that is good news.

On the humanoid there is a reference pose, basically sitting on itā€™s knees, with arms touching a part on the quadricepsā€¦then hit a menu command to calibrate. The calibration pose was chosen to be one that is simple enough to physically move the robot into.

2 Likes