Saturday, May 26, 2012

Lifting 1 kg with a printed robotic arm

The arm is able to lift more than 1kg (the grapefruit has 1008 grams).
The arm was printed with an ORCA 0.3 printer with PLA.
Total weight of arm is 360 grams (including motors).
Heigth of the arm is 38 cm.
Servo motors costs about 300 Euros (2x HS-7980TH and 1xHS-7985MG).
For controlling the motors I use a SSC32 board from lynxmotion.
Everything is powered by a acid-lead battery of 6V, 12 Amps (costs about 50 euros).

A video is here:


Old attempts are here (smaller objects are lifted):

this is the first attempt, where a small apple is lifted.


this was the 3rd attempt where I lifted an 310 grams orange. Because the gripper was constantly slipping I have created a larger one. Also the shape was changed to be circular for holding spherical objects better.


Wednesday, May 23, 2012

ChipKit Uno32 vs Arduino Uno - speed test

I wanted to make a speed comparison between Arduino Uno and ChipKit Uno 32.


Their price is similar 25 euros for Arduino Uno (from farnell) and 29 Euros for ChipKit Uno32.
However the hardware specs are much better for ChipKit (32 bit controller compared to only 16 bit for arduino. Also ChipKit has a higher frequency - 80 MHz compared to only 16 MHz). 


I have run a simple program which counts the number of prime numbers smaller than a limit.


You may find the test program at the end of this post. The same program was run on both platforms.


Results are as follows:

----------------------------------------------------------
prime numbers smaller than 10000


Arduino Uno:
  • Duration: 2375 miliseconds
  • Count primes: 1229
ChipKit Uno32:
  • Duration: 98 miliseconds.
  • Count primes: 1229
----------------------------------------------------------
prime numbers smaller than 20000


Arduino Uno:
  • Duration: 5757 miliseconds.
  • Count primes: 2262
ChipKit Uno32:
  • Duration: 204 miliseconds.
  • Count primes: 2262
----------------------------------------------------------
prime numbers smaller than 30000


Arduino Uno:
  • Duration: 9737 miliseconds.
  • Count primes: 3245
ChipKit Uno32:
  • Duration: 323 miliseconds.
  • Count primes: 3245

As you can see on the largest test, ChipKit is 30x faster than Arduino.

I could not test on significantly larger numbers because Arduino is only 16bits microcontroller (the largest number that can fit is 2^16).


The program is:

----------------------------------------------------------------------


bool isPrime(int p){


 if ( p == 2 ) return true;
 if ( p > 2 ){
   int m = sqrt(p);
  for(int i = 2; i <= m; ++i){
   if (p%i==0) return false;
  }
  return true;
 }
}


unsigned long time_start, time_stop, runtime;


void setup() {
 // initialize serial communications at 9600 bps:
 Serial.begin(9600);
}


int run_once = 0;


void loop(){
 if (!run_once){
   time_start = millis();


   int count_primes = 0;
   for(int i = 2; i <= 30000; ++i){
     if (isPrime(i))
       count_primes++;
   }


   time_stop = millis();
   runtime = time_stop - time_start;
   Serial.print("Duration: ");
   Serial.println(runtime);
   Serial.print("Count primes: ");
   Serial.println(count_primes );
   run_once = 1;
 }
}