Tuesday 17 November 2015

Hexapod Robotic Platform

And as any other obsession begins by seeing either a video or a picture of some insanely well designed project, this one is no exception.

And so it came that for my final project to complete my B-Tech degree I chose to design and build a Hexapod walker.

The concept stage . . . Uhmm. . .


Final CAD Design:




Material:

The chosen material is 1050H14 Aluminium and is probably the most common Aluminium. The majority of the parts are 1.2mm where the body mountings are of 2mm to ensure a good Factor Of Safety (FOS). The canopy and rear cover can be made of any thickness close to 0.8mm as it is not a vital component. Finite Element Analysis were done on all of the parts to ensure that the Hexapod won't fall in on it self.

Anodizing were done in blue and black to give some contrast between the different parts and makes it look interesting.

Servo:




A force of 18Kg.cm can be excerted by each of the 18 6v servos used in the Hexapod. This means when converting the value it can apply a force of 1.67Nm which is quite a lot for a servo. Iding current is specified to be around 100ma per servo and results in a current draw of 1.8A when no force is applied to any of the servos. Maximum current draw (at stall) per servo is specified to be around 4A and means that worst case scenario (would probably never happen due to the geometry of the legs) a current draw of 72A is possible.

Battery:




Which brings us to the next section. To be able to handle high current draw I have chosen a 5000mah 2s 50C Lipo battery to power all of the electronics. An instantaneous current draw of 200A is possible which is definitely an overkill but it should fit nicely inside the bottom of the Hexapod body.

Microprocessor:




Communication via Bluetooth is received and processed accordingly with the aid of the Arduino. Because of its availability and reputation mounting holes for an Arduino Uno R3 were placed on the electronics platform inside the body.

Servo Controller:

Pololu sells a great servo controller going by the name of "Mini Maestro 24-Channel USB Servo Controller" which is ideal for a project where it requires a lot of servo motors to be integrated.

Free to download software with a great looking interface allows you to move each servo individually with a slider bar and finding the correct operating range for your servo model. Running scripts where you move a servo at a frame by frame can also be replayed on power up as well as writing your own code that runs on startup.

HMI (Human Machine Interface):



A standard PlayStation 4 controller were used because of its ergonomics and the fact that everything already works perfectly. It uses a Bluetooth connection which makes it easy to integrate and communicate with the Arduino with the aid of the USB shield and the Bluetooth dongle.

Wireless Communication:




A USB shield for the Arduino fits nicely inside the body and allows a Bluetooth dongle to be connected and communicate with the handheld controller.

So how it works is the PS4 controller takes inputs from the user, the data gets sent via Bluetooth to the Bluetooth dongle on the USB shield and then finally the Arduino reads the values, processes the received values and sends the servo controller specific locations of each leg location.

Ground, Rx & Tx lines goes from the Arduino to the Maestro 24 Servo Controller which allows for serial communication between the two modules.

Programming

As of writing this, the programming has not been finalized yet and I feel that it is the fun part that you have to do yourself.

*But what REALLY helped was this post from HACKADAY which showcases a library for the Arduino to connect to the PlayStation 4 controller through Bluetooth. A big thank you to Kristian Lauszus for writing the library and making it freely available. Go and have a look at what this guy achieved here.

Manufacturing:

All of the CAD files (Solidworks 2015) can be found at Grabcad. https://grabcad.com/library/hexapod-robotic-platform-1

This includes all of the parts (screws included), sub assemblies and final assembly. A simple BOM can be generated to get your parts list.

It is a fully working model which can be built and assembled.

**PLEASE NOTE THAT I TAKE NO RESPONSIBILITY AND IT IS AT YOUR OWN COST TO VERIFY THE CORRECTNESS OF ALL CAD AND MANUFACTURING FILES**

***ONLY condition, if you decide to build this Hexapod, post a picture on the grabcad model page or email me the build because I would love to see other versions***






Thursday 30 April 2015

Delta Parallel Robot

I thought that I should document this before I lose the code, CAD and interest :)

When I came to the end of my Diploma for Mechatronics Engineering, I had to expand/show my knowledge gained.

So I decided on doing a parallel robot. (Little did I know all the trouble that I will have completing this project)

After numerous amount of research and reading theses and forums I found that Trossen Robotics had everything I needed to successfully complete this project.

I had to do the following:

  • Design the parallel platform using CAD
  • Construct control electronics
  • Write software to move the end-effector to desired location by using control electronics

**All the CAD files can be found at Grabcad. (Project name: "Delta Parallel Robot")



The stepper motor controller used was the Toshiba TB6600HG and details can be found here:



**Control kinematics can be found here:



I have changed it a bit so that i could compile it in C:

// Originally from: http://forums.trossenrobotics.com/tutorials/introduction-129/delta-robot-kinematics-3276/

// Delta parallel robot Forward & Inverse Kinematics
// Modified by Frans Roelofse
// September 2013


// robot geometry
 // (look at pics above for explanation)
 const float e = 115.0;     // end effector
 const float f = 457.3;     // base
 const float re = 232.0;
 const float rf = 112.0;

 // trigonometric constants
 const float sqrt3 = sqrt(3.0);
 const float pi = 3.141592653;    // PI
 const float sin120 = sqrt3/2.0;
 const float cos120 = -0.5;      
 const float tan60 = sqrt3;
 const float sin30 = 0.5;
 const float tan30 = 1/sqrt3;

 // forward kinematics: (theta1, theta2, theta3) -> (x0, y0, z0)
 // returned status: 0=OK, -1=non-existing position
 int delta_calcForward(float theta1, float theta2, float theta3, float &x0, float &y0, float &z0) {
     float t = (f-e)*tan30/2;
     float dtr = pi/(float)180.0;

     theta1 *= dtr;
     theta2 *= dtr;
     theta3 *= dtr;

     float y1 = -(t + rf*cos(theta1));
     float z1 = -rf*sin(theta1);

     float y2 = (t + rf*cos(theta2))*sin30;
     float x2 = y2*tan60;
     float z2 = -rf*sin(theta2);

     float y3 = (t + rf*cos(theta3))*sin30;
     float x3 = -y3*tan60;
     float z3 = -rf*sin(theta3);

     float dnm = (y2-y1)*x3-(y3-y1)*x2;

     float w1 = y1*y1 + z1*z1;
     float w2 = x2*x2 + y2*y2 + z2*z2;
     float w3 = x3*x3 + y3*y3 + z3*z3;
   
     // x = (a1*z + b1)/dnm
     float a1 = (z2-z1)*(y3-y1)-(z3-z1)*(y2-y1);
     float b1 = -((w2-w1)*(y3-y1)-(w3-w1)*(y2-y1))/2.0;

     // y = (a2*z + b2)/dnm;
     float a2 = -(z2-z1)*x3+(z3-z1)*x2;
     float b2 = ((w2-w1)*x3 - (w3-w1)*x2)/2.0;

     // a*z^2 + b*z + c = 0
     float a = a1*a1 + a2*a2 + dnm*dnm;
     float b = 2*(a1*b1 + a2*(b2-y1*dnm) - z1*dnm*dnm);
     float c = (b2-y1*dnm)*(b2-y1*dnm) + b1*b1 + dnm*dnm*(z1*z1 - re*re);

     // discriminant
     float d = b*b - (float)4.0*a*c;
     if (d < 0) return -1; // non-existing point

     z0 = -(float)0.5*(b+sqrt(d))/a;
     x0 = (a1*z0 + b1)/dnm;
     y0 = (a2*z0 + b2)/dnm;
     return 0;
 }

 // inverse kinematics
 // helper functions, calculates angle theta1 (for YZ-pane)
 int delta_calcAngleYZ(float x0, float y0, float z0, float &theta) {
     float y1 = -0.5 * 0.57735 * f; // f/2 * tg 30
     y0 -= 0.5 * 0.57735    * e;    // shift center to edge
     // z = a + b*y
     float a = (x0*x0 + y0*y0 + z0*z0 +rf*rf - re*re - y1*y1)/(2*z0);
     float b = (y1-y0)/z0;
     // discriminant
     float d = -(a+b*y1)*(a+b*y1)+rf*(b*b*rf+rf);
     if (d < 0) return -1; // non-existing point
     float yj = (y1 - a*b - sqrt(d))/(b*b + 1); // choosing outer point
     float zj = a + b*yj;
     theta = 180.0*atan(-zj/(y1 - yj))/pi + ((yj>y1)?180.0:0.0);
     return 0;
 }

 // inverse kinematics: (x0, y0, z0) -> (theta1, theta2, theta3)
 // returned status: 0=OK, -1=non-existing position
 int delta_calcInverse(float x0, float y0, float z0, float &theta1, float &theta2, float &theta3) {
     theta1 = theta2 = theta3 = 0;
     int status = delta_calcAngleYZ(x0, y0, z0, theta1);
     if (status == 0) status = delta_calcAngleYZ(x0*cos120 + y0*sin120, y0*cos120-x0*sin120, z0, theta2);  // rotate coords to +120 deg
     if (status == 0) status = delta_calcAngleYZ(x0*cos120 - y0*sin120, y0*cos120+x0*sin120, z0, theta3);  // rotate coords to -120 deg
     return status;
 }




Tuesday 5 November 2013

High Current Stepper Motor Driver Options

. . . So I have been through A LOT of datasheets and manufacturers websites to find a high current stepper motor driver for my application (+-2.5A per phase). After "googling" until my search window links were all purple on the +-8th page, I decided that recapping was necessary. So here I will supply you with my top 3  motor driver options for your DIY CNC machine.

Option A:

Name: Stepper Motor Controller IC
Supplier: Texas Instruments
Max current: 2.5A
Continuous current: +- 2.0 A
Microstepping: Full step, 1/2 , 1/4, 1/8
Max step frequency: 500 kHz
Price for one IC: +- R70.00 (+- $7)
Pros: Very small, low idle current
Cons: Proper heat dissipation needed ,Only for Bi polar motors (4 wires)
Full datasheet: DRV8818





Newer model: DRV8825 (includes stepping 1/16 and 1/32, Not pin compatible)
Full Datsheet: DRV8825

The nice guys at Electrofunltd have a lot of open source projects with full schematics and PCB layouts in a well documented assembly manual. They also feature a shield and driver board for the DRV8818 (the previous driver board they used). You can find it here ( Tested, it works well)





Option B:

Name: Linistepper V2
Supplier: Piclist or DIY
Max current: 3A @ 36V
Continuous current: Depending on heat-sink size and ventilation
Microstepping: Full,1/2,1/6,1/18 and infinite
Max step frequency: Around 333 kHz
Price per kit: $28 (USA shipping only)
Pros: Easily replace components, components easily available
Cons:  5,6,8 wire unipolar motors only (Doesn't support 4 wire steppers)
Full specs, Schematic,PCB assembly: LinistepperV2




Piclist seems like they took their time to design a good,reliable,strong and affordable stepper controller. I haven't tried it out yet (currently using bipolar stepper) but i will have to build this creation soon.

Option C:

Name: Toshiba TB6600HG bipolar stepping motor driver
Supplier: Toshiba
Max current: 5A
Continuous current: +-3.5A
Microstepping: Full, 1/2,1/4,1/8,1/16
Max step frequency: 200 kHz
Price per IC: +- R110.00  (+-$11)
Pros: Integrated 5V regulator, Easily attach heat-sink
Cons: hard to come by depending on location.
Full datasheet: TB6600HG ( HG = through hole)



Cuteminds offers enough information of CNC machines to be able to construct your own CNC machine from scratch after going through their detailed posts. They were also nice enough to share the schematic and PCB layout of their stepper motor driver using the Toshiba TB6600. Links to that TB6600HG Driver



I hope that this quick guide gave you an answer or at least put you in the right direction.
So let's start Objectively Constructing Devices!
MechMoth



Thursday 31 October 2013

In hindsight

So, I always have that problem trying to remember the formula that I wrote down years ago while being distracted by class mates and the lecturer fully explained something I never thought I will have to use again. . . I was wrong, very wrong indeed. This is where calculatoredge comes to save us all. This well laid out website integrates general "every day use" formulas to the more advanced Mechanical Engineering, Electrical Engineering, Electronics Engineering and so forth.


Bookmark this page and you'll find yourself solving problems the easy (and lazy) way.

MechMoth