• There has been a recent cluster of spammers accessing BARFer accounts and posting spam. To safeguard your account, please consider changing your password. It would be even better to take the additional step of enabling 2 Factor Authentication (2FA) on your BARF account. Read more here.

R/C, Adruino, and EE hobbiest I need your help!

I've never used the large servos before. Is there actually enough to worry about? if the servos are analog and there's no alternating current or frequency changes, would inductance even show up?

How would you actually measure it? Is it a fast event that qould require an o scope with a recording function or would a dmm with a hold be able to read it?

Should probably also be sure to toss a zener across the outputs if they direct drive the servos to protect them from inductive kickback.
 
I've never used the large servos before. Is there actually enough to worry about? if the servos are analog and there's no alternating current or frequency changes, would inductance even show up?

How would you actually measure it? Is it a fast event that qould require an o scope with a recording function or would a dmm with a hold be able to read it?

It's an inductive load. That energy isn't dissipated, it sits there in the E&M fields. We make use of the magnetic field to move the servo, after all.

That reactive power is still moving back and forth when you turn it off... coupling back into the coil can spike the DC lines pretty high.

This is why diodes are placed across inductive loads, to clamp that and prevent damage to the device driving them.

If you'd like a little jolt? Take a small 9VDC relay and a 9v battery. Place a finger across the side of the power terminals. Apply the battery. Remove the battery, keeping your fingers across the terminals.

You'll find that the kickback easily exceeds the ~28VDC breakdown voltage of your skin.

It's very brief, you need a digital scope for this.
 
It's an inductive load. That energy isn't dissipated, it sits there in the E&M fields. We make use of the magnetic field to move the servo, after all.

That reactive power is still moving back and forth when you turn it off... coupling back into the coil can spike the DC lines pretty high.

This is why diodes are placed across inductive loads, to clamp that and prevent damage to the device driving them.

If you'd like a little jolt? Take a small 9VDC relay and a 9v battery. Place a finger across the side of the power terminals. Apply the battery. Remove the battery, keeping your fingers across the terminals.

You'll find that the kickback easily exceeds the ~28VDC breakdown voltage of your skin.

It's very brief, you need a digital scope for this.

Ok I did some googling and checked out the links but I am still confused on how to apply this to my sketch. Would you mind explaining where you would put these diodes on my crappy sketch?
 
Ok I did some googling and checked out the links but I am still confused on how to apply this to my sketch. Would you mind explaining where you would put these diodes on my crappy sketch?

Place about a 9v zener or similar across the power terminals of the servo.

That's it.
 
Just got done making the case that is going to hold everything and found out that one of the servos is dead :(

I should have this up and running tomorrow. I will do my best to put up a video of the wings opening and then its arts and crafts time!
 

Attachments

  • photo(1).jpg
    photo(1).jpg
    73.1 KB · Views: 61
Place about a 9v zener or similar across the power terminals of the servo.

That's it.

Pick one with a rated breakdown voltage of around 10V. Connect the cathode to positive power terminal. Anode to ground.

Edit: oh wait, right, 6V servos. Yeah, a 9V will do fine, you'd probably be ok even with a 7V+ breakdown.
 
Last edited:
What are you making?

Nice Birkenstocks :twofinger
 
I am now stuck on the coding portion and need some help.

Here is the code I am using

// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#include <Servo.h>
// a maximum of eight servo objects can be created

Servo myservo; // create servo object to control a servo
Servo myservo1; // create servo object to control a servo
Servo myservo2; // create servo object to control a servo
Servo myservo3; // create servo object to control a servo


int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo1.attach(10); // attaches the servo on pin 10 to the servo object
myservo2.attach(7); // attaches the servo on pin 7 to the servo object
myservo3.attach(6); // attaches the servo on pin 6 to the servo object
}




void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
myservo1.write(pos); // tell servo to go to position in variable 'pos'
myservo2.write(pos); // tell servo to go to position in variable 'pos'
myservo3.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
myservo1.write(pos); // tell servo to go to position in variable 'pos'
myservo2.write(pos); // tell servo to go to position in variable 'pos'
myservo3.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position
}


}


I want the wings to open and close at the same time but I can't get it to work. The above code will make all 4 servos move 180 degrees but they do it in the same direction. I would like myservo and myservo1 which is the left wing to stay the same but I need myservo2 and myservo3 (right wing) to move but in the opposite direction. I am banging my head into the wall right now! Please assist if you can!
 
I have a few of these BNIB if you're interested. The sunspot is a very cool device.
 
How about something like this?
Code:
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees 
 { // in steps of 1 degree 
pos_opposite = 180 - pos;
 myservo.write(pos); // tell servo to go to position in variable 'pos' 
 myservo1.write(pos); // tell servo to go to position in variable 'pos' 
 myservo2.write(pos_opposite); // tell servo to go to position in variable 'pos' 
 myservo3.write(pos_opposite); // tell servo to go to position in variable 'pos' 
delay(15); // waits 15ms for the servo to reach the position 
 delay(15); // waits 15ms for the servo to reach the position 
 }

And something similar for the returning loop.
 
How about something like this?
Code:
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees 
 { // in steps of 1 degree 
pos_opposite = 180 - pos;
 myservo.write(pos); // tell servo to go to position in variable 'pos' 
 myservo1.write(pos); // tell servo to go to position in variable 'pos' 
 myservo2.write(pos_opposite); // tell servo to go to position in variable 'pos' 
 myservo3.write(pos_opposite); // tell servo to go to position in variable 'pos' 
delay(15); // waits 15ms for the servo to reach the position 
 delay(15); // waits 15ms for the servo to reach the position 
 }

And something similar for the returning loop.

Ok you are on to something because the adruino liked the command pos_opposite however I still cant get the right wing to work correctly. It moves to a position and then just sits there. The motors are making noise like they want to move but nothing is going on. The left side however is moving as intended.

I rewrote anything with pos for servo2 and servo3 to pos_opposite.
 
Ok you are on to something because the adruino liked the command pos_opposite however I still cant get the right wing to work correctly. It moves to a position and then just sits there. The motors are making noise like they want to move but nothing is going on. The left side however is moving as intended.

I rewrote anything with pos for servo2 and servo3 to pos_opposite.

I would put the delay between the Pos and Pos_opposite calls, rather then after both of them.

Better yet, just make them two separate subroutines. That will make it easier to troubleshoot and if you want the left side do something different then the right.
 
Last edited:
It's been a while since I played with servos. You won't get full 360 degrees of motion out of them. Since you want servo 2 and 3 to go the opposite way, you need to start them off from the ending position.

Before the first loop put these lines.

myservo2.write(180);
myservo3.write(180);
delay(30);
 
I am so new to coding I really don't understand what you are talking about. Would you please explain it further or edit my code and I can reverse eng it.
 
I would put the delay between the Pos and Pos_opposite calls, rather then after both of them.

Better yet, just make them two separate subroutines. That will make it easier to troubleshoot and if you want the left side do something different then the right.

I think he wants the 2 opposite turning servos to work at the same time as the other two. In that case there is no need for a delay in the middle.
 
Back
Top