Introduction: Magnetic Robot Arm
Hi, my name is Baymax, and I am a middle school student at Mounds Park Academy. I recently completed a challenging and exciting project—a fully functional robotic arm. This robotic arm features five movable axes, allowing it to perform a wide range of precise movements. Instead of a traditional claw, I designed it with a solenoid at the top, which provides a unique way to interact with objects.
This project took me approximately eight months to complete, involving multiple stages of design, testing, and refinement. Throughout the development process, I faced various challenges, especially in programming and ensuring smooth movement across all axes. And also the program has gone through 3 major iterations.
For the design and modeling, I used Autodesk Fusion, a powerful 3D modeling software that helped me bring my vision to life. And For programming, I used Mind+.
And then next are the details of my work.
Supplies
- Servo 25KG---1
- Servo MG996R---4
- Hyper PLA- CF
- Servo Horn Metal Aluminum---5
- ps2 controller---1
- Relay---1
- solenoid---1
- dupont line
- Arduino Mega 2560---1
- AA batteries---4
Step 1: Designing Robotic Arms
Designing Robotic Arms (My robot arm design tools is autodesk fusion). My robot are is gone through three iterations.
Step 2: Building Base
Step 3: Building Body
Step 4: Building Top
Step 5: Control System
Step 6: Programming
/*!
* MindPlus
* mega2560
*
*/
#include <DFRobot_PS2X.h>
#include <DFRobot_Servo.h>
// Dynamic variables
volatile float mind_n__4ShangXia, mind_n__2ShangXia, mind_n__5ShangXia, mind_n__3ZuoYou,
mind_n__1ZuoYou;
// Create an object
DFRobot_PS2X ps2x;
Servo servo_16;
Servo servo_40;
Servo servo_22;
Servo servo_18;
Servo servo_14;
// Main program start
void setup() {
servo_16.attach(16);
servo_40.attach(40);
servo_22.attach(22);
servo_18.attach(18);
servo_14.attach(14);
ps2x.config_gamepad(5,3,4,2, true, false);
ps2x.enableRumble();
delay(300);
mind_n__4ShangXia = 90;
mind_n__2ShangXia = 90;
mind_n__5ShangXia = 40;
mind_n__3ZuoYou = 150;
mind_n__1ZuoYou = 90;
}
void loop() {
ps2x.read_gamepad();
delay(30);
if ((ps2x.Analog(PSS_RY)<50)) {
mind_n__2ShangXia -= 2;
}
if ((ps2x.Analog(PSS_RY)<100)) {
mind_n__2ShangXia -= 1;
}
else if ((ps2x.Analog(PSS_RY)>150)) {
mind_n__2ShangXia += 3;
}
else if ((ps2x.Analog(PSS_RY)>200)) {
mind_n__2ShangXia += 5;
}
if ((ps2x.Analog(PSS_LY)<50)) {
mind_n__4ShangXia -= 2;
}
if ((ps2x.Analog(PSS_LY)<100)) {
mind_n__4ShangXia -= 1;
}
else if ((ps2x.Analog(PSS_LY)>150)) {
mind_n__4ShangXia += 3;
}
else if ((ps2x.Analog(PSS_LY)>200)) {
mind_n__4ShangXia += 5;
}
servo_16.angle(abs(mind_n__2ShangXia));
servo_40.angle(abs(mind_n__4ShangXia));
if (ps2x.Button(PSB_PAD_UP)) {
mind_n__5ShangXia += 2;
}
if (ps2x.Button(PSB_PAD_DOWN)) {
mind_n__5ShangXia -= 2;
}
servo_22.angle(abs(mind_n__5ShangXia));
if (ps2x.Button(PSB_L1)) {
mind_n__3ZuoYou += 2;
}
if (ps2x.Button(PSB_R1)) {
mind_n__3ZuoYou -= 2;
}
servo_18.angle(abs(mind_n__3ZuoYou));
if (ps2x.Button(PSB_L2)) {
mind_n__1ZuoYou += 2;
}
if (ps2x.Button(PSB_R2)) {
mind_n__1ZuoYou -= 2;
}
servo_14.angle(abs(mind_n__1ZuoYou));
if (ps2x.ButtonPressed(PSB_PINK)) {
digitalWrite(53, HIGH);
}
if (ps2x.ButtonPressed(PSB_RED)) {
digitalWrite(53, LOW);
}
}







