Making a single gate move. HELP!

Post all your model railway electronic problems, solutions and discoverys here.
User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Tue Sep 20, 2016 2:14 pm

On one of the pages of the site Richard posted there are some starter kits and the software is a free download.
Not that I know what the hell it is! :lol:
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Tue Sep 20, 2016 11:29 pm

Thanks for the link Roger. :)
Just to reiterate the way I need it to work...
Flicking the SPDT point switch on the layouts control panel, would change the point and also would set the gate to move rather than controlling the gate seperatly from any other switch or added manual control.
Basically flick the point switch and everything moves, point and gate.

The point control panel SPDT has 16VDC going through it coming from the CDU so that powers the point motor only.
The auxillary switch on the seep point motor has 12v running through it powering the control panel LED's for showing point direction and also any 2 aspect signal(s) I wish to add for that point on the same circuit.
Thus any other item like a triggering circuit for the gate wishing to use the Aux switch's circuit on the point motor has to be able to take 12v.

After some looking I see that a PIC for example can only take 4.5v(ish - let's not get bogged down here) and a servo would need it's own 5v power supply (I would use wall warts) so with this in mind I can't fathom how the "logic" can transfer through to the servo from the point motor or point motors 16VDC switch on the control panel.

HOLD ON!.....writing this I think I had a eureka moment..... A DPDT single flick switch for the point motor + the servo circuit.
This way I could run 16VDC AND 5v through it for the point motor AND gate. Can this even be done?
Still confused :?
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Tue Sep 20, 2016 11:46 pm

Roger (RJ) wrote:Fairly cheap. This board uses a variable resistor (supplied) to move the servo (not included) but by substituting it with two resistors and a toggle switch it can be made to drive the servo from fully clockwise to fully anti clockwise and vice versa, assuming it's still the same as the one I bought a couple of years ago. I also got the servo and battery holder from them at the same time but they can be bought cheaper elsewhere I think.


If the DPDT switch would work on 2 independant voltage circuits, throwing them at the same time (bearing in mind my point motor swtich jumps back to the middle to not burn out the coils on the point motor) then I understand this concept a little better.
I wouldn't need a full arc, perhaps as much as 120 degrees (more like 90). Would the 2 resistors act as the end of the arc and if so is there a way to add 2 of those resistors that can be set using a small screwdriver so I can set and reset them as I see fit? Or perhaps one of those screwdriver set-able resistors would do both ends?
I would probably buy a 6v wall wart for this rather than batteries.
I've seen servo's on the bay starting at 99p although I'm not sure if they can do more than 90 degrees.
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
Roger (RJ)
Posts: 1251
Joined: Tue May 29, 2007 2:59 pm
Location: Nottingham, UK.

Re: Making a single gate move. HELP!

Postby Roger (RJ) » Wed Sep 21, 2016 1:09 pm

I'm not fully up to speed with servo electronics but as far as I'm aware you can't drive a servo further than its fullest extent, so if it leaves the factory with 90 degrees of movement you can't make it go to 120 degrees but you should be able to make a 120 degree servo go no further than approximately 90 degrees* so it would be a matter of reading the servo specs to find one that serves your purpose. Using a linkage with slop in it could reduce the movement mechanically. The information sheet that comes with the servo control board that I linked to shows how to use resistors to limit the amount of travel on a percentage basis. The example they use is 56% one way with a 5K6 resistor and 22% the other way with a 2K2 resistor.

You could use preset pots (potentiometers) to make fine adjustments to the position but I think you would need a fixed resistor in series so that the resistance presented to the servo board cant go too low. I've no idea what the lowest allowable value is, there may not be a minimum.

The servo needs its operating switch to be operated continuously until it reaches its desired position, the switch can then be released and the servo will retain its position unless it is moved by an external force. To operate the servo from a non locking switch I would use a latching relay operated by the non locking switch and connect the servo control wires to the output connections of the relay. This would keep power applied to the servo wherever it is stopped ensuring that it can't move out of position. Keeping power applied is the norm when used in model aircraft and boats etc to hold the control surfaces in position.

* Approximately because it's degree of movement depends on resistor tolerances. Could be made more accurate by the use of preset pots perhaps.
If at first you don't succeed - cheat
Anyone who is willing to stand for political office isn't fit to be in political office

Rog (RJ)

User avatar
TimberSurf
Posts: 1522
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: Making a single gate move. HELP!

Postby TimberSurf » Sat Sep 24, 2016 8:15 am

E2E, here is a quick circuit to demonstrate the two types of switch and the latching relay.
555 timer 2 posit.png
555 timer 2 posit.png (67.97 KiB) Viewed 450 times

If you exchange the SPDT for a DPDT switch, then the second pole can select the resistor for the servo position.
If the switch is momentary, then you need the latching relay to "remember" the last position.

The circuit mentioned above (mindsetsonline) could also work with this switch arrangement in place of building your own 555 circuit
Servo's of the cheap type have an arc of over180deg, you need 90deg or could use 180deg if you use a lever arrangement.
Smaller resistors and a variable resistor in series would give adjustment of the end points
Basic principle of servos is:-
800hz = -90deg
1500Hz = 0deg
2200hz = +90deg
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Sat Sep 24, 2016 11:00 am

Thanks Timbersurf for the diagrams. :) Just a couple of quick questions.
What componant is the BC547?
The resisitors can be shown as 800, 1.5K and 2.2K Is this correct? I don't usually see resistors in 1500 and 2200 is all.
Yes the switch is momentary as it will also control the point motor so I would need to have a latching relay.

I am currently looking at a PIC soloution and whilst reading up on them i've found that PIC's can do almost limitless things. They probably do have thier limitations but I'm far too novice to find them yet and I can see a lot of potential using them not just for the gate but many many other layout things and beyond.
They can also (with the help of the correct FREE :D software) be programmed using very easy flowcharts. This would give me programmable intelligence in a circuit that could even be changed "on the fly" as it were. A very interesting peice of electronics :idea:

For all those following this thread I hope you have found this an interesting subject with all the answers given so far and many thanks to everyone for the replies so far.
It's not often I have seen other moving items on a layout bar the signalling, a fairground and the odd Faller and minic(?) car system so this could open up a whole new arena for moving other things on the layout.... washing blowing in the wind perhaps? I'm sure we could think of many many more though. :D
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
Flashbang
Posts: 3164
Joined: Thu Oct 18, 2007 1:07 pm
Location: SE United Kingdom

Re: Making a single gate move. HELP!

Postby Flashbang » Sat Sep 24, 2016 11:23 am

End2end wrote:Thanks Timbersurf for the diagrams. :) Just a couple of quick questions.
What componant is the BC547? Its an NPN transistor
The resisitors can be shown as 800, 1.5K and 2.2K Is this correct? I don't usually see resistors in 1500 and 2200 is all. Those figures are not resistor values, they are frequency values in Hertz
Yes the switch is momentary as it will also control the point motor so I would need to have a latching relay. Yes

<SNIP>
End2end
Broken? It was working correctly when I left it.

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Sat Sep 24, 2016 11:26 am

Thanks for the clarification Flashbang. :D
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
TimberSurf
Posts: 1522
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: Making a single gate move. HELP!

Postby TimberSurf » Sat Sep 24, 2016 11:45 am

The BC547 is a general purpose transistor (flashbang beat me too it by seconds) but any common transistor would do like a BC107 (you will still need one for a PIC circuit, as the servo takes a lot of current when its driving)

PIC chips as mentioned further back, are a good cheap option (if you don't mind getting your head round programming) and have/can handle a PC! And as you mention, lend themselves to allsorts of automation! Arduino is more powerfull and involves no soldering (and not much dearer)

Try a google search for "model railway animated action", you will be amazed at what has already been done before!

Great site for PIC http://www.trainelectronics.com/Animation_servos/
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

Gordon H
Posts: 192
Joined: Tue Mar 14, 2006 1:08 pm
Location: UK
Contact:

Re: Making a single gate move. HELP!

Postby Gordon H » Sat Sep 24, 2016 7:52 pm

TimberSurf wrote:800hz = -90deg
1500Hz = 0deg
2200hz = +90deg

Do you really mean Hz?
Shouldn't that be microseconds?
Or are you simply changing the pulse 'high' time by varying the 555 astable frequency as a whole? That would be an unusual approach, given that most R/C servo driver circuits use the standard 50Hz update rate with variable pulse high time 1000 to 2000us.
A quick calculation shows that 1500Hz equates to a period of 667us, which cannot produce the standard 1500us zero position pulse length no matter what duty cycle it is set to.
To use this approach the zero position frequency (assuming a 50% duty cycle) would need to be about 333Hz, with 1000us generated at 500Hz and 2000us generated at 250Hz.

User avatar
TimberSurf
Posts: 1522
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: Making a single gate move. HELP!

Postby TimberSurf » Sat Sep 24, 2016 9:19 pm

My apologies Gordon, you are completely right. Working from memory (or lack of), I miss quoted Hz for micro seconds!
RC servos work at a fixed 20ms period 'space' (50Hz) and variable time pulse 'mark' of 0.8ms to 2.2ms.(800us to 2,200us)
but Flashbang gets some of the blame for compounding the error! lol
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Sun Sep 25, 2016 9:44 am

er.... don't you mean milliseconds not microseconds with the prefix ms not us? :?
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

User avatar
TimberSurf
Posts: 1522
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: Making a single gate move. HELP!

Postby TimberSurf » Sun Sep 25, 2016 10:19 am

E2E, no, original figures were Microseconds!

800us (Microseconds) = 0.8ms (Milliseconds) = -90deg
1,500us (Microseconds) = 1.5ms (Milliseconds) = 0deg
2,200us (Microseconds) = 2.2ms (Milliseconds) = +90deg
pulse 3.png
pulse 3.png (41 KiB) Viewed 416 times

[1 sec = 1,000ms = 1,000,000us]
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

User avatar
End2end
Posts: 3161
Joined: Sun Jan 12, 2014 9:58 pm
Location: At the end....... and sometimes at the other end

Re: Making a single gate move. HELP!

Postby End2end » Sun Sep 25, 2016 10:11 pm

Thanks for clearing that up Timbersurf. :)
I've never worked in mircoseconds before only milliseconds. Musical delays / reverbs etc. that measure in milliseconds.
Also thanks for that link. I need to read it again as I had family visiting but very interesting. :idea:
Thanks
End2end
"St Blazey's" - The progress and predicaments.
Welcome‎
Planning
Building
St. Blazey's Works & Depot thread

Dad-1
Posts: 5207
Joined: Sun Aug 24, 2008 8:05 pm
Location: Dorset - A mile from West Bay.

Re: Making a single gate move. HELP!

Postby Dad-1 » Mon Sep 26, 2016 9:00 am

It's not that I hate electronics, it's just that we don't work
well together !! I read all this and think a Bowden Cable, or
wire in tube as it's often called in railway modelling circles
would be so much easier !! I like manual control.

Geoff T.
Remember ... I know nothing about railways.
viewtopic.php?f=22&t=32187 and Another on viewtopic.php?f=22&t=28436&start=60&st=0&sk=t&sd=a


Return to “Electronics”

Who is online

Users browsing this forum: No registered users and 3 guests