Problem uploading sketch.  

Page 4 / 6
  RSS

ZeFerby
(@zeferby)
Reputable Member
Joined: 7 months ago
Posts: 353
2020-02-05 9:34 am  

@dorsay

Ok it looks like this one : https://www.amazon.com/Deek-Robot-Expansion-Sensor-Shield-Arduino/dp/B00QEQURWU/ref=cm_cr_arp_d_product_top?ie=UTF8

From the description above it simply makes all IO pins available with additional GND and +V pins. I think the +V is regulated from the barrel jack because the amazon "description" ? lists "1 Servo power input".

You'll have to check with a multimeter...

EDIT : found this video with a google search of "Deek-Robot Sensor Shield", which shows several types of similar shields in action :

(the part between 0:32 and 1:42 shows 3 versions)

This post was modified 2 months ago 3 times by ZeFerby

Eric


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-05 1:33 pm  

@zeferby

Thanks for finding that. Mine is the blue board. But I'm not using it with a Nano, I'm using it with a Uno, using header pins to connect it.  It looks like I'll have to solder the pins into this board,  they don't connect reliably enough just pushing them through.  I have it working with 2 servos so far. 

And now that I have more servos,  I'm going to give your sketch a trial. 

David


ZeFerby liked
ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-13 9:31 am  

@zeferby

Eric, I've finally got round to testing your sketch.  And I hate to say it but it's not working as expected. I've cut it down to 4 servos and whilst movement is good, when the switchPin is high, although to corresponding servo is stationary, it is buzzing.  Doesn't happen when the switchPin is low.

David


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-13 10:06 am  

Obviously, my editing in my last post didn't work as planned. ?   I'll try again:

Eric, I've finally got round to testing your sketch.  And I hate to say it but it's not working as expected.  I've cut it down to 4 servos and whilst movement is good, when a switchPin is HIGH, although the corresponding servo is stationary, it's buzzing.  Doesn't happen with the switchPin is LOW.

David


ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 7 months ago
Posts: 353
2020-02-13 1:19 pm  

@dorsay

Yes I've had the same kind of issue with a number of cheap micro servos. If they are in a stable setup you may be able to tune the Min/Max values per servo to find a potition where they don't buzz any more ?

The original (limited) Arduino Servo library has a "detach" function to stop powering a servo, but I can't find the equivalent for the Adafruit PCA9685 library.

Eric


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-14 6:08 am  

@zeferby

Did you get to play with the debugger software that I give you the link for?

David


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-14 6:48 am  

@zeferby

Posted by: @zeferby

If they are in a stable setup you may be able to tune the Min/Max values per servo to find a potition where they don't buzz any more ?

I'll have to wait until I can fix them to the layout before I can test that.  At the moment, they're only sitting on my desk.  However, I can advise that after I can the limits as per

int rightPWM[NB_OF_SERVOS]        = { 290, 290, 290, 290,  };  //adjust limits per servo as required

to all being 290 rather than 285, the servos may still buzz but it's very, very quiet.  No more so than if I used my original sketch.

Posted by: @zeferby

The original (limited) Arduino Servo library has a "detach" function to stop powering a servo, but I can't find the equivalent for the Adafruit PCA9685 library.

I've seen comments that this can be an issue because when you re-attach, the servo is inclined to jump to it's default pos which I think is 90 degrees.

David


ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 7 months ago
Posts: 353
2020-02-14 6:08 pm  
Posted by: @dorsay

Did you get to play with the debugger software

Not yet...

Eric


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-16 6:46 am  

@zeferby

Sorry mate, looks like I've wasted my time and I've certainly wasted yours.  I'm at the point of giving up with Arduinos and servos to control model railway turnouts.  There's been nothing but issues.  It seems every time I connect power, one or more servos goes mental a la The Exorcist with the horn spinning round and round.  The latest episode cause the servo to fry it's motor because it was fixed under the layout and jammed trying to spin.

Very, very frustrated.

? ? ?

David


ReplyQuote
ZeFerby
(@zeferby)
Reputable Member
Joined: 7 months ago
Posts: 353
2020-02-16 10:25 am  

@dorsay

I don't have a model railroad but from what I've seen in YT videos from other model railroaders, they often use some kind of "flexible" transmission between their servos and their turn points, and they attach it to a point of the horns that is near enough the axis so that wild movement from the servos doesn't damage the turn points.

I think @john40131 has a working setup for servos/turn points where he designed his own 3D-printed support brackets

Eric


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-16 10:40 am  

@zeferby

Yes, I agree.  You connect the horn to the turnout through the baseboard with a piece of piano wire or something similar.  Must be flexible enough to allow for the variances in servos.  But when the servo attempts to spin in a circle, which happens all to frequently when you power up, the piano wire can only go so far.  Then it stops the servo movement with the results of a burnt out servo.  Or it may push itself clear of the mounting bracket enough the disengage the piano wire.  So you have the task of feeding the piano wire up through the baseboard and through the small hole in the turnout.  If the mounting bracket is made such that it "binds" the servo in place, and then the servo attempts its head spin, well...... been there, done that.

David


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-16 11:43 am  

@dorsay

I'm jumping in late, but I thought that there were two kinds of servos.  One type that only turned between 0 (zero) and 180 degrees and another type that would turn full circle.  The only type I have are the 0 to 180 type and I've never seen them do any full circle antics on power up.  Maybe just a twitch when power gets applied.  Mine are not in a model railroad setup, but I wouldn't think that would make a difference as they sure don't know what their function in life is all about.

SteveG


ReplyQuote
dorsay
(@dorsay)
Trusted Member
Joined: 3 months ago
Posts: 67
2020-02-16 12:03 pm  

@codecage

These are not supposed to be able to turn full circle, only 0 to 180.  But I don't think they got the message. 

David


ReplyQuote
John40131
(@john40131)
Trusted Member
Joined: 10 months ago
Posts: 77
2020-02-16 12:06 pm  

Yes the type I am using are DC90 which only have a turning circle of 180 deg, I have an Arduino Mega and a PCA9685 to give me 16 channels but then realised as I have 2 switches operating 4 servos I need more channels so will connect another PCA9685 and modify program... many thanks to @zeferby who has helped me on my Model railway travels, the servo Mega I had a lot of problems with sketch but finally got one that works ...

81746116 10207271647545798 5894477215122325504 o

 

The 7 servos on the left are just for test they will eventually go on another board..

John

This post was modified 2 months ago by John40131

ReplyQuote
John40131
(@john40131)
Trusted Member
Joined: 10 months ago
Posts: 77
2020-02-16 12:36 pm  

If it helps this is the sketch I used on Servo's... its very long winded and im sure with using arrays etc could be made more tidy but it does work for me ... so if it works dont touch it lol...

 


ReplyQuote
Page 4 / 6

Please Login or Register