The manipulator on two servo motors

Today we will make a two-axis manipulator based on the knowledge of the lesson about servos.

In this project, we will need to print the three parts of the servo mountings and add electronic components:

Electronics components:

  • Arduino (Uno, Mega, Nano, Leonardo, ...)
  • 2x servo motors
  • Joystick
  • 6v electrolytic capacitor (example - 6.3V, 470µF)
  • Breadboard
  • Wires

You will need to print those parts.

We collect everything according to the scheme, without forgetting about the capacitor to the power supply lines (electrolytic, 6.3 V, 470 μF).

Before assembling mechanics assemble electronics and run. Servos will set to the initial position. Now attach the first servo to the base.

Now we fix the second drive to the part.



We join together on the screw m3 on one side.



The unit as a whole.


Load the firmware to the board.

#define s1 9 //first servo pin

#define s2 10 //second servo pin

#define axis1 0 //analog joystyck x-axis pin

#define axis2 1 //analog joystyck y-axis pin

//connect servo libraries

#include <Servo.h>

//create servo objects

Servo servo1;

Servo servo2;

void setup() {

 //attach servos to pins

 servo1.attach(s1);

 servo2.attach(s2);

}

void loop() {

 //take the value from the joystick, convert from the limit [0; 1023] to [180; 0] and send to the servo drive

 servo1.write(map(analogRead(axis1),0,1023,180,0));

 servo2.write(map(analogRead(axis2),0,1023,180,0));

}


If you do not touch the joystick, the servos will be in the middle. At this moment we combine all the elements together and enjoy the result.


The manipulator turned out to be simple, but for some tasks, this is quite enough.

Write in the comments where you used or want to use a two-axis manipulator, and also send photos of your assemblies.

Leave a comment

Name .
.
Message .

Please note, comments must be approved before they are published