UVC Camera Servo Motor Control [P006.1]




https://www.youtube.com/watch?v=pAshFXld2N0


*GitHubhttps://github.com/rdiot/rdiot-p006.1.git


* Parts

- Arduino Yun (ARDUINO-YUN) [B015]

- Logitech HD WebCam C310 (C310) [S084]

- SG90 Camera Mount [B051]

- Tower Pro SG90 Micro Servo (SG90) [D018]  

 

Contents

- Control Interface 


- Source

#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#include <Servo.h> 
 
YunServer server;

Servo myservo1;
Servo myservo2;

int servoPin_leftright = 9; 
int servoPin_updown = 10; 

int pos_updown_min = 100; 
int pos_updown_max = 150;

int pos_leftright_min = 0;
int pos_leftright_max = 90;

int pos_updown;
int pos_leftright;
int pos_cnt = 5;

void setup() {
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  
  digitalWrite(13, LOW);
  Bridge.begin();
  digitalWrite(13, HIGH);
  
  server.listenOnLocalhost();
  server.begin();

  myservo1.attach(servoPin_leftright); 
  myservo2.attach(servoPin_updown); 

  for(int pos = 0; pos < 65; pos += 1) 
  { 
    myservo1.write(pos);
    pos_leftright = pos;

    delay(100); 
  }

  for(int pos = 150; pos>=100; pos-=1)
  { 
    myservo2.write(pos); 
    pos_updown = pos;
    delay(100); 
  } 
}

void loop() {
  YunClient client = server.accept();
 
  if (client) {
    process(client);
    client.stop();
  }
  delay(50); 
}

void process(YunClient client) {
  String command = client.readStringUntil('/');
 
  if (command == "control") {
    controlCommand(client);
  }
}
 
void digitalCommand(YunClient client) {
  int pin, value;
pin = client.parseInt();
 
  if (client.read() == '/') {
    value = client.parseInt();
    digitalWrite(pin, value);
  } 
  else {
    value = digitalRead(pin);
  }
  client.print(F("Pin D"));
  client.print(pin);
  client.print(F(" set to "));
  client.println(value);
 
  String key = "D";
  key += pin;
  Bridge.put(key, String(value));

}

void controlCommand(YunClient client) {
  String mode = client.readStringUntil('/');
  
  if(mode == "up")
  {
    int temp = pos_updown + pos_cnt;
    if(temp < pos_updown_max)
    {
      myservo2.write(temp); 
      pos_updown = temp;
    }
  }

  if(mode == "down")
  {
   int temp = pos_updown - pos_cnt;
    if(temp > pos_updown_min)
    {
      myservo2.write(temp); 
      pos_updown = temp;
    } 
  }

  if(mode == "right")
  {    
   int temp = pos_leftright - pos_cnt;
    if(temp > pos_leftright_min)
    {
      myservo1.write(temp); 
      pos_leftright = temp;
    }  
  }

  if(mode == "left")
  {
   int temp = pos_leftright + pos_cnt;
    if(temp < pos_leftright_max)
    {
      myservo1.write(temp); 
      pos_leftright = temp;
    }

  }

  client.print(F("Camera "));
  client.print(mode);
  client.print(F(" Current Point X = "));
  client.print(pos_leftright);
  client.print(F(", Current Point Y = "));
  client.print(pos_updown);
}


Posted by RDIoT
|

Clamp Gripper Bracket Servo Mount [B045]



https://www.youtube.com/watch?v=j95yky2IYIc


* Specs

Use:Vehicles & Remote Control Toys

Technical parameters:Value 2

RC Parts & Accs:Servo Accessories

Model Number:gripper

Robot Clamp Gripper Bracket Servo Mount Plastic Claw Arm kit For MG995 MG996 SG5010 Servo use of the egineering Plastics material very light, solid and hardness

'3) Actuator > Motor' 카테고리의 다른 글

100RPM Gear Motor [S141]  (0) 2016.10.05
TT Motor Car Gear Motor [S142]  (0) 2016.10.05
4-Phase 5-Wire Stepper Motor (28BYJ-48) [D021]  (0) 2016.10.04
TowerPro SG5010 Micro Servo (SG5010) [D032]  (0) 2016.10.04
SG90 Camera Mount [B051]  (0) 2016.10.04
Posted by RDIoT
|

Digital Multi Servo Tester ECS [B176]



https://www.youtube.com/watch?v=pz_NQSSGqaw


* Specs

Features:

CCPM Servo Consistency Master / Servo tester

The device also can be used as a signal generator for electric speed controller (ESC), then you can test your motor system without using a transmitter and receiver.

There are 3 modes to check servos or ESC:

Manual mode: turn the knob with different speed, check the reaction time.

Neutral mode: make the servo go back to the neutral point.

Automatic \"window wiper\" mode: make the servo swing like a window wipers in the biggest angle.

It can connect 1-3 servos simultaneously and test such as 1-3 servos consistency and so on.

You can also connect 1-3 ESC to test and compare their reaction time respectively.

It can connect 3 servos of the CCPM helicopters and select servos.

It can also connect the servo of airplanes install the steering-box and adjust planes by using such as the neutral mode and so on.


Specification:

Voltage consumption: DC4.8-6V 

Size: 48 x 42 x 17mm 

Original box: NO

Color: Blue

Item size: 48*42*17 mm

Net weight: 7g

Package weight: 13g


Packet content:

1 x multi Servo tester

Posted by RDIoT
|

TowerPro SG5010 Micro Servo (SG5010) [D032]



https://www.youtube.com/watch?v=xRpws0Ecrfc


* GitHubhttps://github.com/rdiot/rdiot-d032.git


* Specs

owerPro SG5010 Micro Servo.

Small and exquisite appearance, it is convenient to carry.

Coreless motor and double ball bearing.

Less noise, light weight.

Used for model airplane accessories.

Stable performance and shock proof.

Color: Black

Connector wire length: 28.3cm

Operating speed (4.8V no load): 0.14sec/60 degrees

Operating speed (6.0V no load): 0.11sec/60 degrees

Stall torque(4.8V): (8kg/cm) (110oz/in.)

Stall torque(6.0V): (11kg/cm) (156oz/in.)

Temperature range: -30 to 60°

Dead band width: 4usec

Operation Voltage: 3.5-8.4V

Item weight: 55g

Package including:1 * Torque servo

4 * Rubber grommets

4 * Brass eyelets

5 * Screws

5 * Servo horn set


* Contents

- Key Code

#include <Servo.h>

Servo towerprosg5010; 

 

int pos = 0; 

 

void setup()

{

  towerprosg5010.attach(9); 

}

 

void loop()

{

  for(pos = 0; pos < 180; pos += 1)  // 0 to 180 degrees with 1 degree step

  {                                  

    towerprosg5010.write(pos);  

    delay(120);                       // time set 120 ms 

  }

}

Posted by RDIoT
|

Tower Pro SG90 Micro Servo (SG90) [D018]



https://www.youtube.com/watch?v=qdUgJtBClZ4


* GitHubhttps://github.com/rdiot/rdiot-d018.git


* Specs

Speed: 0.12 second / 60 degrees rotation

Torque: 1.2-1.4kg @ 4.8V~6V power

Comes with full ranged connectivity accessories and mounting screws

Working temperature: -30 to +60 degrees Celsius

Dead band setting: 7 microseconds


* Contents

- Connect

Brown - GND

Red - 5V

Orange - D12



- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#include <Servo.h> 



LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

Servo myservo; 

int servoPin = 12;

int pos = 0; 


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  myservo.attach(servoPin); 

  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("D018:SG90 Servo");


  for(pos = 0; pos < 180; pos += 1) 

  { 

    myservo.write(pos);

    lcd.setCursor(0,1);

    lcd.print("pos0~179=" + (String)pos + "  " );


    delay(0); // Control Speed by delay time.

  }


  for(pos = 180; pos>=1; pos-=1)

  { 

    myservo.write(pos); 

    lcd.setCursor(0,2);

    lcd.print("pos180~1=" + (String)pos + "  " );

    delay(0); 

  } 

}


Posted by RDIoT
|