Help Please with Phoenix Hexapod Code & Arduino Upload

Hi!

I desperately require your help regarding a problem I’m encountering.

Description Having difficulty with loading both the BotBoarduino_CH3R_PS2_2016-03-08 code and PS2X_lib files to Arduino IDE without encountering errors (i.e. “Hex_globals.h: No such file or directory”). I have limited but successful Arduino experience on a couple small projects so I do have some familiarity with uploading sketches, I bought the kit a few years back and finally have the time to put it together and would like to complete it now.

Hardware concerned: Original aluminum Phoenix 3DOF body, 18 Hitech HS-645MG Servos, SSC-32 and Botboarduino V1.0 PCBs from Lynxmotion and a newer V4 PS2 PCB. Everything is assembled and thoroughly checked. All servos are labled using SSC-32 port numbers. Everything powers up on each board. All connections have been triple checked.

Software concerned: Arduino IDE, software downloads Lynxmotion Hexapod Calibration Program (installed and waiting for Botboarduino programming)

Troubleshooting steps already taken: Please Note: there are a number of build plan discrepancies and code package editions which makes this more challenging than would first appear. I believe I’m good on the mechanical build and PCB installation and connections. I have RC car and robot building experience as well and I am a methodical builder. I have found Internet resources to assist with installing Arduino libraries and have seem to have gotten both the Phoenix code and PS2 code to reside in one sketch but I cannot upload to my board without errors. The Botboarduino PCB (and the PS2 Rx) light up when connected to my PC (without powering up the Phoenix). I’m surprised that there isn’t a complete Phoenix+PS2 code package available.

Additional information: At this point I am just trying to get a successful upload of code to my Phoenix to start Servo Calibration. Until I can do this and run the calibration program I’m unaware of any other potential issues. I’m either doing something wrong (or leaving something out) or there are newer less buggy code packs available.

UPDATE: Still have an issue but was able to fix the missing file issue (file did not stay with code packet).

Now the issue is that the code will not upload. This is the error message I get:

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “Arduino Duemilanove or Diecimila, ATmega328P”

Build options changed, rebuilding all
sketch\phoenix_driver_ssc32.cpp: In member function ‘void ServoDriver::FindServoOffsets()’:

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

  • static char *apszLegs[] = {"RR","RM","RF", "LR", "LM", "LF"};  // Leg Order*
    
  •                                                            ^*
    

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:366:64: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:367:71: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

  • static char *apszLJoints[] = {" Coxa", " Femur", " Tibia", " tArs"}; // which joint on the leg...*
    
  •                                                                   ^*
    

sketch\phoenix_driver_ssc32.cpp:367:71: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:367:71: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

sketch\phoenix_driver_ssc32.cpp:367:71: warning: ISO C++ forbids converting a string constant to 'char’ [-Wwrite-strings]*

C:\Users\Bill\Documents\Arduino\libraries\PS2X_lib\PS2X_lib.cpp: In member function ‘boolean PS2X::read_gamepad(boolean, byte)’:

C:\Users\Bill\Documents\Arduino\libraries\PS2X_lib\PS2X_lib.cpp:92:53: warning: narrowing conversion of ‘motor2’ from ‘byte {aka unsigned char}’ to ‘char’ inside { } [-Wnarrowing]

  • char dword[9] = {0x01,0x42,0,motor1,motor2,0,0,0,0};*

  •                                                 ^Sketch uses 23286 bytes (75%) of program storage space. Maximum is 30720 bytes.*
    

Global variables use 1283 bytes (62%) of dynamic memory, leaving 765 bytes for local variables. Maximum is 2048 bytes.

Thank you so much in advance for your help!

Hey @tobar8th,

Welcome to the RobotShop community!

Please find answers below (in-line) to your questions and comments.

Sounds good, I am glad to offer any assistance I can!

Sounds like the first step here would be to ensure you have the most up-to-date software setup (libraries, source code, etc.) so that you can both compile and upload properly. I’ll get to the details below.

The Lynxmotion Hexapod Calibration program is, hmm, arduous to use at best (and discontinued). In this case it may be best to use the SSC-32U/BotBoarduino passthrough debug mode with Lynxterm (download from here) to perform the calibration directly. More details below on this, too.

We’ll get to that part last. This issue may even disappear once we are done with the packages/code/libraries!

So, first things first: the example code for 3DoF hex (such as the Phoenix).
There is a ready-to-go download available in the Lynxmotion GitHub repository named 3DOF-4DOF-Hex. You can get a copy here. From what you said above you already have one of those.

I recommend that you do the following so we can ensure easy troubleshooting:

  1. Make sure you have the most recent version of the Arduino IDE installed. When writing this post it was 1.8.11. You can get a copy here. This is the version I will be using for these steps.

  2. Go to wherever your Arduino libraries folder is (typically in %UserProfile%\Documents\Arduino or /usr/share/arduino) and you rename your libraries folder to something else, maybe libraries-backup. Make a new replacement libraries folder that is empty.

  3. Get a fresh copy of the software from here and extract someone where you can access it easily. From this point forward we will only use this source code to keep things simple.

  4. Get a fresh copy of the recommended PS2 library. You can find a direct download for it here from the Lynxmotion Arduino-PS2X repository. You can install this library in your Arduino IDE by following the steps in the tutorial available here.

  5. Start the Arduino IDE (if it was already started before step #2-#4, please close it and start it again). You should have something like below, with only the PS2X_lib in the additional libraries section in the Sketch > Include Library > … menu.
    image

  6. Confirm the source code folder looks like the following:
    image
    Make sure the files are extracted properly into a folder and not in a “virtual folder” from a ZIP browser (Windows does this by default if you double-click a ZIP in most setups) or similar since that can cause many issues including “missing files” since the Arduino IDE won’t be able to see all of them. Typically you can force extraction by right-clicking the ZIP file and choosing Extract here… or something similar.

  7. Double-click the BotBoarduino_CH3R_PS2.ino file to open the project in the Arduino IDE. Once open you should have something like this:
    image

  8. Change the settings for have verbose output for both compilation and upload steps. This will help diagnose any issue you may have. See details in the image below:
    image

  9. Change the board settings to match the BotBoarduino, Arduino Duemilanove or Diecimila and ATmega328P:
    image

  10. Press the compile button to test the setup. If all goes well you should get something along this for output:
    image
    See the attached file for a copy of the full output produced.

  11. Take your BotBoarduino and disconnect all wires/cables/etc. from it (including PS2 adapter wires). Make sure the jumpers next to the screw terminals are set to VS=VL and USB (as opposed to EXT). In the BotBoarduino manual those are jumpers 13 & 17 (the manual’s image has jumper 17 set to EXT). Then, connect only a USB cable from your computer to the BotBoarduino. A new COM port should now be available.

  12. In the Arduino IDE under Tools choose the new COM port and click the upload arrow to upload the code to the BotBoarduino. You should get something like this:
    image
    Again, see the attached file for a copy of the full output produced.

Please try all the steps in order. If you have any issue with a specific step please post again right away with details about the situation and we’ll see what can be done to resolve it.

Sincerely,

P.-S.: Once you have the compilation & upload working we’ll move on to calibration using Lynxterm/SSC-32U.

3DoF-3DoF-Hex code compilation output.txt (37.1 KB)

3DoF-3DoF-Hex code upload output.txt (14.2 KB)

Hi Scharette,

First, let me say thank you for your quick, informative and methodical/logical approach!

Before receiving your response, I actually found a couple procedural errors in my upload attempts and got the sketch to Verify/Compile without issue. I then went to the Arduino Troubleshooting page concerning upload issues. I exhausted all the remedies to no avail. I then isolated the Botboarduino board itself (board parameters were set correctly to Duemilanove w/ATmega328) but I could not upload even a simple sweep sketch that I’ve used successfully in the past. Also, when choosing “Get Board Info” under Tools nothing happens. My board is NOS (6 years old) and may have suffered electrical damage of some sort during the build or before in storage. I have invested significant funds into this project so buying a new board without issue seemed to be my best plan. I ordered a new board late last night and will apply your meticulous steps when it arrives in a week or so and start again from the beginning. I will then update on my progress or lack thereof on the Forum. Before the board arrives, I will work on the preliminary steps (latest Arduino IDE, sketch and libraries, etc.) in anticipation of its arrival to set a fresh “clean” platform.

Again, I greatly appreciate your time, thoughts and efforts here and I will definitely keep you appraised of my progress once I have the new board in-hand.

Tobar8th

1 Like

Hi Scharette,

A quick update.

I followed your instructions and was able to successfully upload the Phoenix sketch to my new BotBoarduino PCB.

Unfortunately, my new SSC-32U board has an issue and I will be receiving a replacement in a week or so. I’ve been pointed to a third software app, Lynxterm, which was recommended by RobotShop to calibrate my 18 servos once I have the new SSC-32U. I could not find any documentation on the Calibration process of the Lynxmotion SSC-32 Servo Sequencer Utility program (although I found a great video on how to sequence using this program) and will move forward with Lynxterm.

Thank you so much for your time and advice! It is greatly appreciated.

I will let you know about my progress once I have the new SSC-32U PCB calibrated and installed.

Best Regards,
Bill (Tobar8th)

1 Like

@tobar8th
Hey Bill! Glad to hear from you again!

Sounds great!

Ah, that was you! :slight_smile: My colleague who helped you actually ask for my opinion on that issue! :smiley:

Lynxterm is definitely the way to go for pretty much all configuration tasks of the SSC-32U. It exposes nearly all settings and is pretty straight forward to use. In the past there was another software available (Hexapod Calibration Software) but it was discontinued many years ago since we the maintainer stopped updating it (community driven).

Please not that unlike the Lynxterm application, the SSC-32 Servo Sequencer Utility does not save the calibration settings on the SSC-32 directly. Instead, the offsets are stored on a local file. Therefore, if you change computer (or use a different software or a BotBoarduino), offsets set with the utility will have no impact.

No problem! :slight_smile:

Looking forward to it! You may even want to make a robot page about it here. I’m sure other people starting out would like to read about that.

Sincerely,

Hi @scharette,

Good News and still I request more help, please.

Okay, I finally got my new SSC-32U board and wired it into the Phoenix body. I was able to properly identify all 18 servo locations and calibrate positions of each requiring only 3 physical servo horn adjustments. It was also a good shakedown as I found an inverted servo and a couple minor build errors which are now corrected.

As mentioned earlier, I got the new BotBoarduino PCB uploaded with the proper sketch and PS2 library. I installed the Bot-Board stacked on top of the SSC-32U and followed the wiring diagram in the SSC-32U instruction manual. Its yellow LED lights when I power everything up. I then followed the PS2 Rx wiring instructions (very simple and straightforward) and again powered everything up and nothing happens when I try to use the PS2 controller. This is the latest RobotShop PS2 controller combo. When I turn the controller ON the Power (Green) and Mode (Red) LEDs flash in unison quickly and then shut off after a few seconds.

I must admit that the last video games I played were on an Atari 2600 and only my kids had Play Stations so I am completely ignorant with the SELECT, MODE and START buttons and do not know what to do next. Also, the “head” unit of the PS2 Rx which plugs into the PCB (this one is a Cyclops and only has one Green LED) does not light up and I’m not sure if this LED is a Power indicator or RF Signal indicator.

Therefore, I’m not sure at which end the problem may be or if it is at both ends. Some of the documentation seems to have “holes” assuming that the user is already knowledgeable regarding PS2 controls and button functionality making this a bit frustrating.

So close yet so far.

Please advise when you have a couple minutes.

I will definitely add some instructions for other that take on this project. I have done technical writing and more importantly IFU writing for the initiated and uninformed.

And, again. Thank you!

1 Like

HOLD THE PHONE!!! Please disregard my last post.

Issue Solved! It seems that the VL Jumper was not set back to EXT.

It Lives!

Thanks again for your assistance!
Bill, Tobar8th

1 Like

Remember - don’t feed it after midnight or get it wet.

1 Like