# Spring 2018: BiPed Power Estimates of Components: Micro Servos

By: Jorge Hernandez (Electronics & Control Engineer)

Verified By: Miguel Gonzalez (Project Manager)

Approved By: Miguel Garcia (Quality Assurance)

# Power Estimates

For power estimates I calculated power and current on two types of servos; the Tower Pro SG90 and metal geared MG90s. To read the power and current from the servos on different loads, I used the INA219 current sensor. A 3-D pully was made and connected on top of the servos as Professor Hill suggested.

Fig.1 Testing Environment

# Coding

I combined the Sweep Arduino code with an Arduino code to read the current and power from the INA219 current sensor. I used a function ‘read values’ to act as the INA219 sensor and embedded it within the for loop which had the servo turn back and forth 180 degrees which are known as the sweep code for servos. Here it will read the values every 5 degrees to get an accurate reading.

/* Sweep

by BARRAGAN <http://barraganstudio.com>

This example code is in the public domain.

modified 8 Nov 2013

by Scott Fitzgerald

http://www.arduino.cc/en/Tutorial/Sweep

*/

#include <Servo.h>

#include <Wire.h>

#include <Adafruit_INA219.h> // You will need to download this library

Adafruit_INA219 sensor219; // Declare and instance of INA219

Servo myservo;  // create servo object to control a servo

// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

void setup() {

myservo.attach(9);  // attaches the servo on pin 9 to the servo object

Serial.begin(9600);

sensor219.begin();

}

{

float busVoltage = 0;

float current = 0; // Measure in milli amps

float power = 0;

busVoltage = sensor219.getBusVoltage_V();

current = sensor219.getCurrent_mA();

power = busVoltage * (current/1000); // Calculate the Power

//  Serial.print("Bus Voltage:   ");

//  Serial.print(busVoltage);

//  Serial.println(" V");

Serial.print("Current:       ");

Serial.print(current);

Serial.println(" mA");

Serial.print("Power:         ");

Serial.print(power);

Serial.println(" W");

Serial.println("");

}

void loop() {

for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees

// in steps of 1 degree

if (pos%10==0)

{

}

myservo.write(pos);              // tell servo to go to position in variable 'pos'

delay(15);                       // waits 15ms for the servo to reach the position

}

for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees

if (pos%10==0)

{

}

myservo.write(pos);              // tell servo to go to position in variable 'pos'

delay(15);                       // waits 15ms for the servo to reach the position

}

}

# Results

Table 1: SG90(plastic Micro-servo) @ 3.3 V

Table 2: MG90 (metal Micro-servo) @ 3.3 V

Table 3: SG90(plastic Micro-servo) @ 5V

Table 4: MG90(metal Micro-servo) @ 5 V

# Conclusion

SG90 Plastic Geared will be used for Micro Fobo as it satisfies more requirements than the MG90 metal geared micro servo. The SG90 also pulls less current at different loads.  Both micro servos operate at 3.3V (L2-7: Micro FOBO shall use a battery that outputs 3.7V) but as can be seen, the MG90 stalls with a load of 200 grams. Satisfies customer requirement as it is toy based and will have a cleaner look as they are small and fit well on the chassis.