Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Servo speed
03-16-2020, 10:25 PM (This post was last modified: 03-16-2020 10:26 PM by LOlsen.)
Post: #21
RE: Servo speed
(03-12-2020 05:13 PM)LOlsen Wrote:  
(03-12-2020 03:54 PM)JJrobots JP Wrote:  The key is to set the PEN UP and DOWN positions correctly adjusting their parameters. Every PEN has it own mass and the retraction behaviour will vary depending on it. The UP position should leave the tip of the PEN just mm away from the egg/ball surface

True, and I did as good as i could, taking the curvature of the egg into account. But shouldn't the speed setting actually influence the servo-speed?

Did you have time to look into this? It's really hurting the thin pen tips when you can't lower the pen softly. I can see a pull request from 2016 that uses a different servo library (https://github.com/cocktailyogi/EggDuino/puls) perhaps you could look at that and integrate it in your version?

Best regards
Lars Lund Olsen
Find all posts by this user
Quote this message in a reply
03-17-2020, 05:06 PM
Post: #22
RE: Servo speed
Jose, will take a look at it. I will come back with anything as soon as possible.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-21-2020, 10:25 AM (This post was last modified: 03-21-2020 11:22 AM by LOlsen.)
Post: #23
RE: Servo speed
I did a hardcoded work-a-round for slowing the servo down, code is below for anyone interested:

void PenDown(int intPenDownPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i >= intPenDownPos; i--) {
penServo.write(i);
delay(8);
}
}

void PenUp(int intPenUpPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i <= intPenUpPos; i++) {
penServo.write(i);
delay(8);
}
}


Replace the four calls to "penServo.write" with these functions. Speed is controlled by the Delay function. This works for my setup where Pen Up value is lower than Pen Down. If your setup is different, you need to change the logic of the two functions.
Good luck :-)

Best regards
Lars Lund Olsen
Find all posts by this user
Quote this message in a reply
03-23-2020, 01:02 PM
Post: #24
RE: Servo speed
(03-21-2020 10:25 AM)LOlsen Wrote:  I did a hardcoded work-a-round for slowing the servo down, code is below for anyone interested:

void PenDown(int intPenDownPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i >= intPenDownPos; i--) {
penServo.write(i);
delay(8);
}
}

void PenUp(int intPenUpPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i <= intPenUpPos; i++) {
penServo.write(i);
delay(8);
}
}


Replace the four calls to "penServo.write" with these functions. Speed is controlled by the Delay function. This works for my setup where Pen Up value is lower than Pen Down. If your setup is different, you need to change the logic of the two functions.
Good luck :-)

Best regards
Lars Lund Olsen
Thanks for this Lars. Jose is struggling to come back to UK from the USA and did not have time to take a look at this.
We will test your mod.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-13-2020, 12:22 PM
Post: #25
RE: Servo speed
(03-21-2020 10:25 AM)LOlsen Wrote:  I did a hardcoded work-a-round for slowing the servo down, code is below for anyone interested:

void PenDown(int intPenDownPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i >= intPenDownPos; i--) {
penServo.write(i);
delay(8);
}
}

void PenUp(int intPenUpPos){
int intCurrentPos = penServo.read();
for (int i = intCurrentPos; i <= intPenUpPos; i++) {
penServo.write(i);
delay(8);
}
}


Replace the four calls to "penServo.write" with these functions. Speed is controlled by the Delay function. This works for my setup where Pen Up value is lower than Pen Down. If your setup is different, you need to change the logic of the two functions.
Good luck :-)

Best regards
Lars Lund Olsen

Hi Lars
Could you please upload the Arduino code modified? I am having problems to make it work :-\

Thanks!
Find all posts by this user
Quote this message in a reply
04-19-2020, 04:21 PM
Post: #26
RE: Servo speed
Quote:Hi Lars
Could you please upload the Arduino code modified? I am having problems to make it work :-\

Thanks!

Sure, I have attached the project I currently use. Try it out :-)

Best regards
Lars Lund Olsen


Attached File(s)
.rar  Ejjduino_M0.rar (Size: 22.07 KB / Downloads: 4)
Find all posts by this user
Quote this message in a reply
04-22-2020, 08:50 AM
Post: #27
RE: Servo speed
(04-19-2020 04:21 PM)LOlsen Wrote:  
Quote:Hi Lars
Could you please upload the Arduino code modified? I am having problems to make it work :-\

Thanks!

Sure, I have attached the project I currently use. Try it out :-)

Best regards
Lars Lund Olsen
Thanks! Uploading the code now ;-)
Find all posts by this user
Quote this message in a reply
06-02-2020, 05:45 AM
Post: #28
RE: Servo speed
This worked awesome!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)