Close
0%
0%

3DOF Hexapod (Hexapi)

Hexapod using Inverse kinematics with a Raspberry PI 3 brain, XBox 360 Wireless controller running on Windows 10 IOT Core. (3d printed legs)

Similar projects worth following
This project has been used in an educational setting to teach students from middle school STEM student level to college level classes. It is open source and has support for a wide variety of sensors. Including the ADS1115, Adafruit Fona, Mpr121, MPU 9150/6050, HC-SR04 ping sensor, Windows remote arduino, Navspark RTK GPS, General purpose NEMA parser and XBox 360 controller.

The code is a work in progress and does require basic programming knowledge.

All the parts for the legs and servo modifications are 3d printed with any decent printer using .2 - .3 mm resolution with ABS.

The servo used is the Solar D772, which has high reliability without the high price. It runs about $22. If a fast movement speed is desired without the ability to carry a large payload, the Solar D771 is about twice as fast.

Everything was written in C# using Visual Studio 2015, runs on Windows 10 IOT Core using the Raspberry PI 3 as the computing platform

All the parts for the legs and servo modifications can be 3d printed with any decent 3d printer with .2 - .3 mm resolution using ABS.

The servo used is the Solar D772, which has high reliability without the insane price. It runs about $22 or so.

Servo bottom replacement to allow mounting a bearing,

Acetone was used to fuse the various parts

All the CAD models can be found here.

https://www.tinkercad.com/users/kGfZmAhYRc2-larryw

At this point all the models have been pretty well refined and will function as intended when printed. Coxa parts used a 20% infill, tibia 60% and the femur was 30%. I can post the tested gcode files if there is any interest.

My parts were printed at .3mm to save time as my printer is quite dated!

The C# code for this project has the following features:

  • General NMEA sentence parser (GPS)
  • Adafruit Ultimate GPS support (now using the NavSpark GPS)
  • NavSpark RTK GPS support
  • NTRIP client for RTK GPS corrections - allows for CM accuracy
  • (beta) Adafruit Fona support (Cellular modem/phone/SMS)
  • (beta) MPU 9150 support
  • Lynxmotion SSC-32U support
  • XBox 360 Controller and wireless receiver support
  • Windows remote Arduino / RemoteWiring / Firmata - this is used with a SparkFun RedBoard that controls the HC-SR04 sensors.
  • HC-SR04 sensor via remote Arduino functionality

The Inverse Kinematics code mostly uses standard .net math libraries. The basics for way point following and navigation is also there. Recently added some obstacle avoidance code to be used in conjunction with the way-point following or the XBox 360 remote.

Feel free to contact me with questions!

Update : Everything does seem to work with the Raspberry PI 3. Too bad Windows 10 IoT does not have the on-board UART, on-board WiFI or on-board bluetooth enabled yet. It also appears to not support 64bit yet.

sonar_sensor_array_-_hexapod_-_httpswwwhacksterioslimordium.stl

Sensor array. Print .3mm, 15% fill, no supports, 3 horizontal shells, 2 vertical

sla - 79.18 kB - 05/28/2016 at 14:11

Download

tibia_-_hexapod_-_httpswwwhacksterioslimordium.stl

Print .3mm, 70% fill, supports, 3 horizontal shells, 3 vertical shells

sla - 184.07 kB - 05/28/2016 at 14:11

Download

raspberry_pi_3_mount_for_ssc-32u_on_hexapod_-_httpswwwhacksterioslimordium.stl

.3 mm, 15% fill, supports, 3 horizontal shells, 2 vertical shells

sla - 65.71 kB - 05/28/2016 at 14:11

Download

for_printing_-_new_femur_-_hexapod_-_httpswwwhacksterioslimordium.stl

.3 mm, 20% fill, supports, 3 horizontal shells, 3 vertical shells

sla - 114.93 kB - 05/28/2016 at 14:11

Download

coxa_joint_-_hexapod_-_httpswwwhacksterioslimordium.stl

.3 mm, 60% fill, no supports, 3 horizontal shells, 3 vertical shells

sla - 92.95 kB - 05/28/2016 at 14:11

Download

View all 7 files

  • 1 × Raspberry PI 3 Raspberry PI 3
  • 1 × NavSpark RTK GPS
  • 1 × Lynxmotion SSC-32U Servo controller
  • 1 × Sparkfun Red Board Arduino
  • 18 × Solar D772 Servo Servo

View all 14 components

  • SSC-32U Raspberry PI 2 or 3 mount

    Larry W.05/28/2016 at 14:05 0 comments

    To allow for more room for components on the robot, I designed a mount for the PI 3 so it sits directly above the SSC-32U. It mounts with stand offs, then the "head" or sensor/component platform mounts on top of that with 1in stand offs. It works pretty well, and looks much cleaner.

    Mount

    https://tinkercad.com/things/9NUqQ0Bz2cN

    Head

    https://tinkercad.com/things/kz4KcjPqyLH


  • Femur/Foot redesign to allow for a switch in the foot

    Larry W.05/28/2016 at 13:59 0 comments

    The redesign of the femur to accommodate a foot switch is in a working state:

    https://tinkercad.com/things/lKMM8y2zH88

    The idea behind this, is to allow terrain adaptation as well as automatically calibrating the legs on startup.

    The switch is not yet wired up, not really visible, but it is just under the cap head screw near the foot.

    The redesign also allows using a threaded rubber foot typically used on furniture or a small appliance.

  • C# Inverse kinematics -

    Larry W.05/28/2016 at 13:51 0 comments

    After much tweaking and re-writing the IK and SerialPort code, the gait is much improved. I still need to figure out why the _bodyPosY or height has odd results the closer it is to the ground. However, the code is in a very usable state.

    I was also able to figure out a reliable way to query the SSC-32U for the movement status, and base the gait timing on that status. Makes for a much smoother gait.

    SerialPort.ReplyCallback = b =>
    {
    Task.Factory.StartNew(async () =>
    {
    if (b == 0x2e) //0x2e = .
    {
    InverseKinematics.SscCommandCompleteEvent.Set();
    return;
    }

    await SerialPort.Write(_querySsc);
    });
    };

    Then:

    SscCommandCompleteEvent.Wait((int)(_gaitSpeedInMs + 75)); //Timeout
    SscCommandCompleteEvent.Reset();

    There may be a better way than using the manual reset event, but I have yet to find it.

  • Raspberry PI 2, RTK GPS, RTCM base station, C#

    Larry W.05/28/2016 at 13:43 0 comments

    C# Code for NS-HP RTK GPS base station working. Allows for a client on the local network to connect to a REST endpoint on a PI 2 and receive RTCM 3 messages for corrections. So far I have only been able to achieve a FloatRTK fix. However the accuracy is still much improved over conventional GPS. I used a NS-HP-10 with a 5Hz update rate. The message age maxed out around 500ms.

    https://navspark.mybigcommerce.com/ns-hp-rtk-capable-gnss-receiver/

    https://navspark.mybigcommerce.com/content/NS-HP-User-Guide.pdf

    I am pretty happy to achieve the accuracy I do with about $125 worth of GPS equipment, a Raspberry PI 2 for the base station.

    Code

    https://github.com/Slimordium/RtkGpsBaseStation

  • RTK GPS

    Larry W.03/29/2016 at 14:50 0 comments

    Finally have the RTK GPS working properly using the NTRIP client I wrote in C#. I was able to draw a rectangle that was about 12 or so inches on a side by moving the antenna. See the image below, bottom right corner, red circles.

    I am using a CORS station about 25 miles away. The recommended maximum distance is about 10 miles. So I will be purchasing another RTK GPS module from NavSpark and setting up my own base station. However the TCP serial NTRIP client using the Fona does work as well as the TCP client over WiFi/Ethernet.

    Hopefully the snow will melt enough and the roads will dry enough to be able to do some outside tests of route finding/way point finding.

  • C# code - IK, GPS, MPU, SSC-32U

    Larry W.03/17/2016 at 22:10 0 comments

    The C# code for this project has the following features:

    • General NMEA sentence parser (GPS)
    • Adafruit Ultimate GPS support (now using the NavSpark GPS)
    • NavSpark RTK GPS support
    • NTRIP client for RTK GPS corrections - allows for CM accuracy
    • (beta) Adafruit Fona support (Cellular modem/phone/SMS)
    • (beta) MPU 9150 support
    • Lynxmotion SSC-32U support
    • XBox 360 Controller and wireless receiver support
    • Windows remote Arduino / RemoteWiring / Firmata - this is used with a SparkFun RedBoard that controls the HC-SR04 sensors.
    • HC-SR04 sensor via remote Arduino functionality

    The Inverse Kinematics code mostly uses standard .net math libraries. The basics for way point following and navigation is also there. Recently added some obstacle avoidance code to be used in conjunction with the way-point following or the XBox 360 remote.

View all 6 project logs

  • 1
    Step 1

    To hook up the ssc-32U to the PI, you will need a SparkFun Voltage Level Translator or something similar.
    The ssc has a logic level of 5 volts, the PI level is 3.3v.
    So you would hook the low side power/ground to the PI. For the ssc side, I only needed to hook up the ground.
    TX on the PI goes to RX on the ssc, RX on the PI goes to TX on the ssc.

    Be sure that when you attached your servos to the 3d printed parts, they were centered. I use "Lynx SSC-32 Terminal" to center the servos and adjust them after everything is assembled. The femur should be horizontal, the tibia should be vertical when mounting.

    I mounted my ssc with the power connections facing the rear of the hexapod. If you mount your ssc similarly, you can attach the servos as follows.
    You should have the hexapod frame with mounted servos in front of you with the ssc power connectors facing you.
    Starting with the left rear leg and proceeding clockwise, the servos are plugged into the ssc as follows:

    Left rear
    Coxa - 20
    Femur - 19
    Tibia - 18

    Left Mid
    Coxa - 24
    Femur - 23
    Tibia - 22

    Left front
    Coxa - 28
    Femur - 27
    Tibia - 26


    Right Front
    Coxa - 12
    Femur - 11
    Tibia - 10

    Right Mid
    Coxa - 8
    Femur - 7
    Tibia - 6

    Right Rear
    Coxa - 4
    Femur - 3
    Tibia - 2

    After you have everything plugged in, you should use the "Lynx SSC-32 Terminal" to set all the servos to the 1500 position or center with the "All=1500" button.

    Then click the "All=0" button.

    To adjust the joints that are not centered, click the "Reg." button. A window will open, at which point you will need to click the "Read" button.

    Then check the Global check box, and the "Initial pulse offset" check box. Then click write.

    For the joints that are not aligned, click the radio button on the left next to the number that corrosponds to the servo.

    When you do that, you will be able to use the "Offset" scrollbar to adjust the center position of that servo. What I found works best, is to do a joint then clicking - write -> Exit -> "All=0" before adjusting the next servo.

    It is a little tedious but the closer things are lined up, the better the results.

View all instructions

Enjoy this project?

Share

Discussions

Dylan Brophy wrote 05/24/2017 at 01:52 point

Which 3d printer do you have?  I know you say it is "dated", but I'm curious.

  Are you sure? yes | no

Larry W. wrote 05/27/2017 at 02:57 point

A0-100 

  Are you sure? yes | no

Dylan Brophy wrote 05/27/2017 at 03:25 point

Thankyou!

  Are you sure? yes | no

ProfessorZ wrote 04/11/2017 at 18:16 point

Thanks for posting this!!!  Where did you hide the Xbox 360 receiver wire?  The official Microsoft receiver has a fairly long cord.  Or did you use one of the short wire knockoffs? (if so, do you remember where you got it?)

  Are you sure? yes | no

Larry W. wrote 05/27/2017 at 02:58 point

I cut the wire and carefully soldiered it back together

  Are you sure? yes | no

Larry W. wrote 06/15/2016 at 15:17 point

I have had very good luck with the Navspark GPS. The important part, is to allow the base station to sit a while and get a good fix. Then the rover GPS is surprisingly accurate. I have code for the PI 2/3 Windows 10 IOT  core in C# that sets up a REST server to stream NTRIP/RTCS data to multiple rovers. The base runs at a update rate of 5hz, as do the rovers. I have not tested the setup indoors. I think the base station would still need to be outdoors to have a solid stable fix.

  Are you sure? yes | no

Ed0 wrote 06/15/2016 at 14:58 point

Very neat.  This is the first I have seen a cheap RTK GPS working and it might make my project kind of pointless.  What are your thoughts on how well has the Navspark RTK GPS works?  Is there much difference indoors versus outdoors?  Could you leave it in one spot collecting data for a few hours and show a plot of it or statistics?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates