Iron man motorised faceplate electronics tutorial!!!

What kind of a bolt or pin is that? I attached my servos to my helmet's widow's peak, but I still need to make the arms attached to the side.

Thats the arm i made using styrene ill try to do a video today to explain better, but you dont like photobucket videos :(
 
try a large 'decrease' in the servo range..

3 degrees isnt much..

considering most of these hobby servos only have 'around' 150-160 degrees of movement :)


try very SMALL.. movement.. and only de/increment by 10's until you are comfortable with the range *(and no sound/buzz)
then the other way...

try 30 & 150 for your range seem what happens..

so i have tried what you said, and i still have them same problem. i also tried a whole different whack of angles and i seem to be getting the same issue no matter where i set it.. could it be the delay in the code possibly??
 
1.) make sure all GNDS are connected (together).

2.) do you have the arms ON the servo right now? if yes.. take them off and try..

maybe you dont have the arms centered? I believe a servo arm travels (roughly, we know its less) 90 degrees each way from the CENTER point..

and I think when the servo first boots up it goes to this location..

try making that you starting point.. and adjust.


as far as code goes.. I dont know.. my code posted doesnt use delays().. and I dont use 7sinzz code..
 
as far as code goes.. I dont know.. my code posted doesnt use delays().. and I dont use 7sinzz code..

Dude do you have any idea where your code is? I'd like to pin it in the first post. I started going through the thread yesterday to find stuff to link in post 1 but got bored after 2 hours searching. Did a small bit of editing. Will take a round 2 one night this week.

Also, I have now installed the cable drivers and moved over to the Arduino Mini Pro. It slots nicely into the breadboard and is great to be rid of the bulky UNO.
 
Dude do you have any idea where your code is? I'd like to pin it in the first post. I started going through the thread yesterday to find stuff to link in post 1 but got bored after 2 hours searching. Did a small bit of editing. Will take a round 2 one night this week.

Also, I have now installed the cable drivers and moved over to the Arduino Mini Pro. It slots nicely into the breadboard and is great to be rid of the bulky UNO.


Can you post a pic of how its wired to the usb adaptor?, i cant get mine to sync
 
Dude do you have any idea where your code is? I'd like to pin it in the first post. I started going through the thread yesterday to find stuff to link in post 1 but got bored after 2 hours searching. Did a small bit of editing. Will take a round 2 one night this week.

Also, I have now installed the cable drivers and moved over to the Arduino Mini Pro. It slots nicely into the breadboard and is great to be rid of the bulky UNO.
I second this lol, I'm guessing your code doesn't make the servos vibrate..!! :). And to anyone else who has had this problem and fixed it please don't be shy to post a response!
 
Im not saying one is better than the other... :)

I just wanted to be clear that my code is for my wiring diagram posted. (very similar to memebr's diagram/code)..

my code was a stab/example at an FSM (Finite state Machine) type code approach is all :)

my code also use internal pull-up resistors for the switch..etc.. (so its wired than most of the diagrams posted here as well)

to be honest.. I havent re-visited my initial code since it was posted...

my personal project/version here (that I have posted the videos of)

IronMan eye fade & servo control demo - YouTube
IronMan code demo: v2 (w/sound, leds & servos) - YouTube


are using a 'custom' board that includes sound as well.. so I have only been helping with so much, as this code wont help anybody. :)
 
Not sure this is xl97 's code or not....but im sure i get this from this thread....
The code is better than the 1st page code which giving some extra movement to servo which connect to port 10.

:)

Code:
#include <Servo.h>
 
Last edited:
Not sure this is xl97 's code or not....but im sure i get this from this thread....
The code is better than the 1st page code which giving some extra movement to servo which connect to port 10.

:)

Code:
#include <Servo.h>
//servo 1
Servo myservo;
Servo myservo1;
int val; // variable for reading the pin status
int val2; // variable for reading the delayed/debounced status
int buttonState;
int servostatus = 0;
int switchPin = 2; // Switch connected to digital pin 2
int ledPin = 5;
void setup() // run once, when the sketch starts
{
//servo 1

myservo.attach(9);
myservo1.attach(10);
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
buttonState = digitalRead(switchPin);
myservo.write(5);
myservo1.write(140);
}

void loop() // run over and over again

//servo 1
{
val = digitalRead(switchPin); // read input value and store it in val
delay(10); // 10 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) { // make sure we got 2 consistant readings!
if (val != buttonState) { // the button state has changed!
if (val == LOW) { // check if the button is pressed
if (servostatus == 0) { // is the light off?
servostatus = 1; // turn light on!

myservo.write(5);
myservo1.write(140);
delay(1000);
digitalWrite(ledPin, HIGH);
delay(50);
digitalWrite(ledPin, LOW);
delay(5);
digitalWrite(ledPin, HIGH);
delay(50);
digitalWrite(ledPin, LOW);
delay(5);


// fading
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
delay(30);


}

} else {
servostatus = 0; // turn light off!


digitalWrite(ledPin, LOW);
delay(15);
myservo.write(140);
myservo1.write(5);






}
}
}
buttonState = val; // save the new state in our variable
}
}
.

Again in this is really hard for me not to be a pain in the ass, but if I wire it according to the diagram on the first page and try this code, do you think my servos will stop trying to fly away every time they're in the idle position!? Do your servos do the same thing? (Vibrate while idle)
 
Again.. I will ask (last time)..

do you have ALL the GNDS connected TOGETHER?

take apicture of your wiring..

not what you THINK you did..

not what you SAY you followed..

.......but what you actually have in front of you. :)

PS:
I think my initial code was posted on page 3?



here are the diagrams 'I' feel are correct and shoudl be followed:

memebr's:
http://www.therpf.com/f24/iron-man-...nics-tutorial-170853/index30.html#post2931061


Mine:
http://www.therpf.com/f24/iron-man-...nics-tutorial-170853/index32.html#post2936077

Code:
http://www.therpf.com/f24/iron-man-...onics-tutorial-170853/index3.html#post2647313

*please note you NEED to edit the range for the servos at the top (pos & pos1)

use something SMALL like pos = 20 & pos1 = 150

and work from there..

*again connect all grounds.... and post a picture of your set up.
 
Again.. I will ask (last time)..

do you have ALL the GNDS connected TOGETHER?

take apicture of your wiring..

not what you THINK you did..

not what you SAY you followed..

.......but what you actually have in front of you. :)

PS:
I think my initial code was posted on page 3?



here are the diagrams 'I' feel are correct and shoudl be followed:

memebr's:
http://www.therpf.com/f24/iron-man-...nics-tutorial-170853/index30.html#post2931061


Mine:
http://www.therpf.com/f24/iron-man-...nics-tutorial-170853/index32.html#post2936077

Code:
http://www.therpf.com/f24/iron-man-...onics-tutorial-170853/index3.html#post2647313

*please note you NEED to edit the range for the servos at the top (pos & pos1)

use something SMALL like pos = 20 & pos1 = 150

and work from there..

*again connect all grounds.... and post a picture of your set up.
I did double check everything you did mention.. I will post pictures of my setup when I get a chance tonight, thank you for your patience, I can feel you pulling your hair out lol.. I was ultimately thinking though, what if there was a way in the code to cut power to the servos as soon as it makes it's rotations ( power off when faceplate closes/ power off when faceplate opens?
 
hahaha.. Im not pulling my hair out.. :)

just how it reads!..

but when others in here mentioned the same problems (buzzing)..

it was either to big of a RANGE for the servos... (for example.. my cheapies.. I feel dont move more than 50-80 degrees or so... (so I'll have to look into how Im using them/feeding them the data/info)

or people not having ALL gnds connected.. Im not saying your GND from servo is connected to battery.. Im saying it also connected to the Arduino..etc?
:)

is it more of a 'twitching'.. or just a BUZZ..like the gears are at their max point/range?
 
hahaha.. Im not pulling my hair out.. :)

just how it reads!..

but when others in here mentioned the same problems (buzzing)..

it was either to big of a RANGE for the servos... (for example.. my cheapies.. I feel dont move more than 50-80 degrees or so... (so I'll have to look into how Im using them/feeding them the data/info)

or people not having ALL gnds connected.. Im not saying your GND from servo is connected to battery.. Im saying it also connected to the Arduino..etc?
:)

is it more of a 'twitching'.. or just a BUZZ..like the gears are at their max point/range?
basically the servos are stopped once they reach their postions and it's a vibration. Even when I changed the points the same issue occurred. I read on the addition forums that it could be caused by the servos not having thier own power source.. So basically I hooked the servos seperatley to a 4 AA battery pack and they still do a salsa dance on the table while they should be idle. Just the motor vibrates. Everything else is wired exactly as the first post instructs. I will post a picture when I get back home to stark industries :)
 
Back
Top