Go Down

Topic: [Help] Hack Servo For Egg Turner? (Read 2140 times) previous topic - next topic

ryhar25

Jul 05, 2015, 09:07 am Last Edit: Jul 05, 2015, 09:20 am by ryhar25
I want to make an Egg Turner with Servo. the problem is when servo power on the servo always move fast to 0 pos. I want to make servo move to 0 pos and stop for 3 hours, then move again to 40 pos and stop again for 3 hours. Any ways to make a servo continue it last pos after power off. what about modify the servo.h for default pulse modulation, can solve this? plz help :(

note : i used tower pro mg995 and RTC DS1307

Robin2

#1
Jul 05, 2015, 10:18 am Last Edit: Jul 05, 2015, 10:19 am by Robin2
If you know the angle the servo is at you could try

Code: [Select]
myServo.write(angle);
myServo.attach(servoPin);



but the problem is that the Arduino cannot detect the angle. If the Arduino is running all the time it can obviously remember the last servo position. If you want to turn the Arduino off you could save the servo position to the EEPROM memory after every move - if there is only one move every 3 hours you won't wear out the EEPROM.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ryhar25

Thanks Robin2. Maybe i'll try a motor dc with motor shield someday for safety :)

Robin2

#3
Jul 05, 2015, 09:06 pm Last Edit: Jul 05, 2015, 09:06 pm by Robin2
Thanks Robin2. Maybe i'll try a motor dc with motor shield someday for safety :)
If the exact angles are not important you might consider a continuous rotation servo which is simpler to use (and cheaper) than a DC motor plus motor shield both mechanically and programmatically. The Arduino just controls speed and direction.

Many regular servos can be converted to continuous rotation - consult Google if you are interested.


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

zoomkat

Quote
Any ways to make a servo continue it last pos after power off.
Why are you turning the power off? If you must turn the power off, you might add limit switches at each rotation position to determine where the servo is (might also add an external pot). You could do the position determination in the setup code section and use that position value when the servo is attached so the servo doesn't move.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

MorganS

Power cuts happen. The thing does need to carefully turn the eggs under reasonable assumptions of power availability.

The EEPROM solution sounds like the best way. Turn the egg, then save the posistion. If a power cut happens during the (slow) turn then you will have a problem but it's only half of the problem you had before. It will turn quickly from a middle position to the previously-saved position.
"The problem is in the code you didn't post."

ryhar25

Thanks Robin2, zoomkat, MorganS, really helped information. I'll try to store the pos to EEPROM. that sound good :)

zoomkat

Is a battery backed up real time clock going to be added to know just how long the power is off?
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Chagrin

I'm not prepared to believe that egg turning needs that much precision. I can't imagine it happens that way in the wild. And the parents certainly aren't turning the eggs slowly over a multi-hour period; I'd assume it's more of a bit of kicking for a few moments and then the bird sits down again.

JimboZA

Aaaaaah! This is eggs in their shells before hatching? I was thinking cooking, like an omelette or a pancake or something, and wondering where the 3 hours was coming from. I don't like runny scrambled eggs, but 3 hours is a wee bit too long. So that mystery is solved....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

shipkha

hi,

what is yoru servo's interval ? i am using 2-10 V servo for turner.

when the 2 v output from pwm to servo, the servo is closed, (or 0V) , when 10V, servo opened.

for the turner system, for 40 angle, must be 5,2 V or if you have 0-10 v servo, you must give the motor 4 V .

the other way,

a dc motor you can use with turner switch... please send me your incubator photos ( setter or hatcher that you have) please send me for troubleshooting. i can help you for your incubators every problem. ( don't worry , it is free :))

JimboZA

#11
Jul 07, 2015, 11:36 am Last Edit: Jul 07, 2015, 11:36 am by JimboZA
what is yoru servo's interval ? i am using 2-10 V servo for turner.
when the 2 v output from pwm to servo, the servo is closed, (or 0V) , when 10V, servo opened.
That's not how servos work, at least not here in Arduino-land with hobby servos that I've seen. The pulse is always 5V (ok, 4.8 to 6V), and at a length of 1000us to 2000us for 0 and 180 degrees.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

zoomkat

Quote
1000us to 2000us for 0 and 180 degrees.
I think that would normally result in ~90 degrees of rotation in a hobby servo, at least that is my experience.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

JimboZA

I think that would normally result in ~90 degrees of rotation in a hobby servo, at least that is my experience.
Perhaps yep, but that's a matter of degree (evil laugh), but my point was more to do with the 2-10V thing. Have you ever encountered that?
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

shipkha

That's not how servos work, at least not here in Arduino-land with hobby servos that I've seen. The pulse is always 5V (ok, 4.8 to 6V), and at a length of 1000us to 2000us for 0 and 180 degrees.
hi again,

you can use a converter or op-amp for 5 to 10 & 10 to 5 v conversion

with converter , e.g. delta dtc 1000 L , google it
 
with op-amp e.g. LM358 ,  have 2 inputs and 2 outputs, you can use first input 5 v to 10 v output, second is 10 v to 5 v input to arduino.

you may use resistors for use op-amp

Go Up