In term three, I plan on working on a more advanced model of my walking robot. The idea behind it is that it can be used on search and rescue missions. It would be able to reach places where conventional vehicles cannot go. To do so, I plan on making my robot be able to not only walk, but also climb stairs or other steep surfaces. Once this goal is achieved, I plan on implementing an autonomous navigation system for the robot. It would have the ability to identify a target and navigate its way to its destination.
Through this project, I hope to gain more insight in more precise and controlled leg movement. I also want to learn more about autonomous robots and how they can move from one location to another without the need of a human controlling it.
The first phase of my project consists of building a prototype of the leg and adjusting its walking motion first. I will then work on the body and the whole robot in a later term.
http://www.cunningturtle.com/wiki/index.php?title=Radio_Controlled_Stepper
https://www.arduino.cc/en/Tutorial/StepperOneRevolution
code (basic):
/* Stepper Motor Control - one revolution This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor should revolve one revolution in one direction, then one revolution in the other direction. Created 11 Mar. 2007 Modified 30 Nov. 2009 by Tom Igoe */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); void setup() { // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); } void loop() { // step one revolution in one direction: Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(500); // step one revolution in the other direction: Serial.println("counterclockwise"); myStepper.step(-stepsPerRevolution); delay(500); }
code (for speed control):
/* Stepper Motor Control - speed control This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. A potentiometer is connected to analog input 0. The motor will rotate in a clockwise direction. The higher the potentiometer value, the faster the motor speed. Because setSpeed() sets the delay between steps, you may notice the motor is less responsive to changes in the sensor value at low speeds. Created 30 Nov. 2009 Modified 28 Oct 2010 by Tom Igoe */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); int stepCount = 0; // number of steps the motor has taken void setup() { // nothing to do inside the setup } void loop() { // read the sensor value: int sensorReading = analogRead(A0); // map it to a range from 0 to 100: int motorSpeed = map(sensorReading, 0, 1023, 0, 100); // set the motor speed: if (motorSpeed > 0) { myStepper.setSpeed(motorSpeed); // step 1/100 of a revolution: myStepper.step(stepsPerRevolution / 100); } }
Today, I worked on researching online for Arduino coding for the stepper motors. I looked for ways to control the speed and the rotational movements of the motor using a RC controller. After some research, I found useful information on YouTube and on the official Arduino website. I also found links to forums which seemed to provide tutorials on what I want Tom achieve. Unfortunately, the school internet has barred me access to the ose websites. Hence, I decided that I would make further research at home on Friday.
Aside from getting information on coding stepper motors with the Arduino, I thought about the type of material that I wanted to use. Some of the sources I found on the topic suggested that robots should use materials like aluminum or plastic. However, I found that the cost to acquire these materials was simply too high. Furthermore, I had little experience manipulating them Andy had no effective ways to cut them into the shapes I wanted. Hence, I decided to rely on thicker acrylic to ensure the integrity of the leg. After all, the stepper motors’ performance showed me that they have a lot of torque.
Next class, I plan to start coding and linking the stepper motors with the Arduino board. I would borrow one of Lauren’s stepper motor for testing purposes if she allows for it.
In today's period, I presented gave my midterm presentations. From the feedback I received, I learned that I could use brushless motors to power legs. By adding a 3D printed gearbox, the motors would have the same amount of torque as the stepper motors while also being much lighter. Other suggestions for my project included that I should add other limbs to increase the balance of the robot (such as tails, heads etc.) and that joints such as shoulders and knees should be able to move in other directions than forwards and backwards. This would increase the mobility of the robot and its capabilities to go over uneven terrain.
From the feedback I received, I concluded that I should first attempt to use stepper motors to power my legs. For the moment, I would rely on the Arduino and motor shield setup, as it is the most accessible and I am most acquainted with it.
Next class, I plan on testing out the viability of my design and of the arduino and motor shield setup. I will then use the results to determine where to go next.
//Controlling rotation angle/steps of a stepper motor from serial port
#include <AFMotor.h>
int steps = 32;
int ext_step = steps*64;
AF_Stepper motor(ext_step,2);
int Reset = 1024;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("BinuZकेHobbieZ");
motor.setSpeed(10);
motor.step(Reset, FORWARD,SINGLE);
Serial.println("Motor angle reset to centre");
}
void loop()
{
// put your main code here, to run repeatedly:
if(Serial.available() > 0);
{
if (Serial.peek()== ('R'))
{
Serial.read();
int data = Serial.parseInt();
int NegAngle = map(data, 0, 360, 0, 2048);
motor.step(NegAngle, BACKWARD,SINGLE);
Serial.print("Motor turns right ");
Serial.print(data);
Serial.print(" Degrees and steps ");
Serial.println(NegAngle);
}
if (Serial.peek()== ('L'))
{
Serial.read();
int data = Serial.parseInt();
int PosAngle = map(data, 0, 360, 0, 2048);
motor.step(PosAngle, FORWARD,SINGLE);
Serial.print("Motor turns Left ");
Serial.print(data);
Serial.print(" Degrees and steps ");
Serial.println(PosAngle);
}
}
}
During today's class time, I met with Mr. Luis to discuss about the electronics part and other aspects of my project. I first showed him the full robot leg and foot that I had been working on for the past week. Then I showed him the research I made on how to control the stepper motors and the progress I have made so far. After analyzing the situation, he pointed out the code I had been relying on were outdated or incompatible with my current Arduino-motor shield setup.
Some of the codes I used were made for older versions of the motor shield (v1) and others required a stepper motor driver to work. As such, he suggested that I should wait until the stepper motor drivers to arrive and work it out from there. He also also suggested that I experiment more with servos, as some servos could be strong enough to support my robot and fast enough to move my robot. He pointed out that my final iteration could use both stepper motors and servos.
At the end of our meeting, he asked that I draw a sketch of the final iteration of my robot. Tomorrow, as I still have to wait for the motor drivers to arrive, I plan on working on the support wall for the stepper motor shaft in the meantime.
In term three, I plan on working on a more advanced model of my walking robot. The idea behind it is that it can be used on search and rescue missions. It would be able to reach places where conventional vehicles cannot go. To do so, I plan on making my robot be able to not only walk, but also climb stairs or other steep surfaces. Once this goal is achieved, I plan on implementing an autonomous navigation system for the robot. It would have the ability to identify a target and navigate its way to its destination.
Through this project, I hope to gain more insight in more precise and controlled leg movement. I also want to learn more about autonomous robots and how they can move from one location to another without the need of a human controlling it.
The first phase of my project consists of building a prototype of the leg and adjusting its walking motion first. I will then work on the body and the whole robot in a later term.
http://www.cunningturtle.com/wiki/index.php?title=Radio_Controlled_Stepper
https://www.arduino.cc/en/Tutorial/StepperOneRevolution
code (basic):
/* Stepper Motor Control - one revolution This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor should revolve one revolution in one direction, then one revolution in the other direction. Created 11 Mar. 2007 Modified 30 Nov. 2009 by Tom Igoe */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); void setup() { // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); } void loop() { // step one revolution in one direction: Serial.println("clockwise"); myStepper.step(stepsPerRevolution); delay(500); // step one revolution in the other direction: Serial.println("counterclockwise"); myStepper.step(-stepsPerRevolution); delay(500); }
code (for speed control):
/* Stepper Motor Control - speed control This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. A potentiometer is connected to analog input 0. The motor will rotate in a clockwise direction. The higher the potentiometer value, the faster the motor speed. Because setSpeed() sets the delay between steps, you may notice the motor is less responsive to changes in the sensor value at low speeds. Created 30 Nov. 2009 Modified 28 Oct 2010 by Tom Igoe */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); int stepCount = 0; // number of steps the motor has taken void setup() { // nothing to do inside the setup } void loop() { // read the sensor value: int sensorReading = analogRead(A0); // map it to a range from 0 to 100: int motorSpeed = map(sensorReading, 0, 1023, 0, 100); // set the motor speed: if (motorSpeed > 0) { myStepper.setSpeed(motorSpeed); // step 1/100 of a revolution: myStepper.step(stepsPerRevolution / 100); } }