Freerails Home 
Freerails > Model Railroad Forums > D.C.C. Electrical & Sound > Signals & Switches & L.C.C. Oh My !

Freerails IS ACCEPTING new Members ... To join Freerails ... See how to Register as a Member in the 'Joining Freerails' Forum

 Moderated by: .  
AuthorPost
Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
This winter I am going to design signals and controllable switches for my Gauge One RR.


I have two other threads for this RR:

The track design:
http://www.freerails.com/view_topic.php?id=8181&forum_id=52&page=1

The control and battery car designs:
http://www.freerails.com/view_topic.php?id=8145&forum_id=45&page=1


I expect to design the control around LCC: Layout Command & Control.  
Any opinions on this?  
Any suggested alternatives?

My first project will be prototype searchlight signals, using UP aspects of the 40's & 50's.
I have obtained 3 watt hi-power RGB LEDs and control ICs for the search lights. 

Expecting to use PWM from an Arduino board,
to light them up, change color, accept LCC commands, etc.

After this I expect to tackle LCC controllable switches.  
I am using LGB switches, but am not impressed with the motor units they sell.
 
Will experiment with servos and feedback micro-switches, again LCC connected.  
Any ideas/experiences in this area would be appreciated.

Steven P


Kitbash0n30
Registered


Joined: Mon Dec 10th, 2012
Location: Boonville, Missouri USA
Posts: 749
Status: 
Offline
I'm such a non-techie I had to Google what LCC: Layout Command & Control is.

Found this from the NMRA:

https://www.nmra.org/sites/default/files/standards/lcc_faq_handout.pdf


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

My biggest concern is that it seems to have been around for a few years,
yet I see very few manufactures building anything yet. 

The only full product line I've found is:

http://www.rr-cirkits.com/description/index.html

But I don't want to write code that follows no standard,
and I don't think DCC is appropriate.

I have a LOT to learn about CAN bus to proceed.

There are several inexpensive sources for Arduino based CAN controllers,
so that's encouraging.

Steven P


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
I've finished a prototype of a searchlight using a 3 watt high power RGB LED.  

This is the light only, no proper tower yet.

   

The above are red, yellow and green.  

The colors look much better to the naked eye,
something about photographing them shifts the color spectrum. 

I can clearly differentiate the 3 from 200', so it does what I need.  

And I think they will be much brighter when refined,
I didn't have the proper current limiting resistor on hand. 

This is using about 120mA of forward current,
the final version will be more like 350mA.


Steve P


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi,

The prototype is almost finished.  

I will be putting a video online of it going thru the 1972 UP aspect rules.





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi, 


Here's a video of it displaying the Union Pacific aspect rules of 1972:

UP rules


Again, I apologize for the quality of the LED colors.  

The yellow looks white, but to the naked eye it is quite yellow.
 
I did a little research,
and it appears to be a big effort to photograph RGB LEDs,
as their color spectrum confuses modern CCD technology.

:f:

Steve P


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Here's some perspective against my 1:32 scale Big boy:

The black disk is out of scale, at 48" prototype size,
but necessary to hide the box required by the size of the LED/heatsink.  

The 1/4" hole does approximate the 8" lens of the real deal.





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Here's the innard's:





Kitbash0n30
Registered


Joined: Mon Dec 10th, 2012
Location: Boonville, Missouri USA
Posts: 749
Status: 
Offline
That is pretty cool.





Si.
Moderator


Joined: Thu Feb 23rd, 2012
Location: London
Posts: 5666
Status: 
Offline
Hi Steve  :wave:



Lookin' AWESOME !  :!: :!: :!: :!: :!:



I recently put a couple of 4-Watt L.E.D. bulbs on my stairs.  :P

Swapped 'em out for a couple of lower 2-Watters in the end.

Boy they were BRIGHT !  :cool:

We are taking about 'ambient' night-lighting though.  L:


Great work on the signals.  :brill:



:)




Si.


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
I am starting to do the computer control/LCC R&D.
 
I have concluded that the CAN bus style of control will not work for my outdoor setup.
The RC Circuits power hub only provides 1/2 amp on its power bus,
while just ONE of my 3 searchlight poles consumes up to 2 amps!

Since my dead-rail engines require dependable WIFI coverage everywhere along the track,
I have decided to use WIFI enabled Arduino modules.
They're quite inexpensive and provide a lot of functionality in a small package.

This means my "bus" becomes a 2 wire 5v bus (with a LOT of amps).  
It doesn't have to extend the length of the track,
but only exist where controls are needed, ie. depots, freight yards, etc. 

If I can't get 110V to a particular depot,
I can park an Optima RedTop battery there for the season.

Hopefully the MKR1010 will provide adequate WIFI coverage with its internal antenna. 
If not I can use a WIFI shield with one of the other Arduinos.

I have a 24 channel PWM shield working now,
enough control for 4 of the 3 searchlight towers, using only 4 bits of the Arduino.  
Its SPI based, and can be daisy-chained, so you could control 4/8/12 or more towers.

They also make an i2c bus based 12 channel PWM servo driver board,
which I will be playing with to make tortoise style switch controllers.

Steve P


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

I built a few dwarf prototypes. 

I think I'll use ABS plastic for the stands next time.





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
My latest production prototype of a 3 searchlight pole. 

I'm pretty happy with it at this point.

Have to rework the electronics,
the LM317s I am using can't drive the green/blue segments to full current with a 5v supply.

Steve P





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

I have prototyped an RFID reader for tracking the movement of rolling stock.
It is based on an Adafruit Feather WiFi mcu, and up to 8 PN532 RFID readers.

By placing the readers on ends of different track sections and a RFID tag on each car,
I can determine the position of all cars at any time.

Next I need to design a weatherproof enclosure for the reader that fits under a section of track.

Steve P





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

I sent the RFID design out to fab, just got the boards back. 
This is the front, back, and most parts "in place".  No soldering yet. 
I need to ring out a few traces before starting real assembly. 

They sure look nice,
and will be MUCH more reliable than point-to-point solder tacking!

Steve P





Si.
Moderator


Joined: Thu Feb 23rd, 2012
Location: London
Posts: 5666
Status: 
Offline



















Hi Steve  :wave:



L :!: :!: KIN'   C  :cool:  :cool:  L   !



From Freddie Flintstone 'wooden stick with rocks' ...  ;)

... to prototype ...  :brill:


... to model  :pimp:  has worked out real well !



The new 'central switch tower' electronic-brain PCB is awesome !


:old dude:  I wouldn't want to have to hardwire one of those up using 6SN7s sonny  :P



:moose:



Si.


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Si,

Thanx, I'm happy...

The 1st RFID reader is fully functional and tested. 
I need to wire the additional 4 card readers I have and see how it works with 5 cards at once. 
Then I can start the higher level code that determines the location of rolling stock by track section.

I have done about 95% of the work on laying out the high power LED controller PCB.
It will drive up to 24 3Watt LED segments (ie 12 Red/Yellow/Green signals)
as well as up to 48 20mA LEDs.





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

I realized I would need an indoors test track,
so switched gears for a few days and built a table in the dining area.

Setup a Yard Master and placed a card reader under the track. 
Stuck a paper rfid tag on the underside of a passenger car. 

Started up the client software on a desktop, connected to the Yard Master via wifi,
then moved the car as quickly as possible back and forth over the reader several times:


$ ./LWClient feather2 2390 b
command to feather2 (10.11.12.143): "b" response from feather2: "Success "
response from feather2: "Reader: 0, Road mark: BLR877222 (UID: a6:62:5d:42)"
response from feather2: "Reader: 0, Road mark: BLR877222 (UID: a6:62:5d:42)"
response from feather2: "Reader: 0, Road mark: BLR877222 (UID: a6:62:5d:42)"
response from feather2: "Reader: 0, Road mark: BLR877222 (UID: a6:62:5d:42)"


So proof of concept is complete, this is going to work!





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi,

Been a long, hard winter up here... burr!

Lot to catch up on.

 
As I prototyped new boards,
I found myself using a new mcu each time, 
So I fell back and standardized on 3 for all the systems:

The Feather M4 Express (aka. small):
https://www.adafruit.com/product/3857

The Metro M4 Express (aka. medium):
https://www.adafruit.com/product/3382

The Grand Central M4 Express (aka. large):
https://www.adafruit.com/product/4084


All use the SAMD Cortex M4 cpu,
which means gobs of code and data space,
120MHz clock, hardware floating point.
 
The main difference is the number of IO bits available.


I also standardized on one Ethernet chip.

For the feather:
https://www.adafruit.com/product/3201

For the Metro and Grand Central:
https://www.adafruit.com/product/2971


And one Wifi chip.

For the Feather:
https://www.adafruit.com/product/3060
(mounted on a Feather protoboard)

For the Metro and Grand Central:
https://www.adafruit.com/product/3654


All the above simplifies the build and programming stages by quite a bit.

I now have 3 systems in various stages of build:





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

The boards shown in the last post are all based on the Arduino platform,
but are definitely NOT your father's board. 

The SAMD is an amazing amount of power in a tiny package.
 
I've re-thought the idea of mounting Wifi based mcus on the controller boards,
and instead am standardizing on separate mcus, with i2c buses for connectivity.

My main depot/freight yard area would have used over a dozen wifi/mcu boards,
a management headache for sure.
Three of the Grand Centrals, with Ethernet connectivity, should handle the same workload.

The connectors on Arduino style boards are great for breadboarding,
but poor for rugged, permanent connections.

So I built what I call a "Base Shield". 
Similar to the Arduina stacking shields, but designed for the mcu to plug into it. 

It has "standardized" 2x5 IDC socket connectors for the IO.
There are 2 8-bit analog ports, 2 8-bit digital ports, a Serial port, and six i2c ports.
This will allow me to run multiple controllers on each system.

This pic shows the Base with a Grand Central stacked above it,
and an ehternet shield on top:





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi,

I just sent the 'Switchman' to fab.

This is basically a 16 channel PWM controller,
with positive feedback of switch position,
via a pair of micro-switches on each channel. 

It uses my "standardized" i2c bus,
to send commands and receive micro-switch feedback.




 

Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

Boards back from fab, bringing up 1st:





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

I have been working on the SignalMan (ie LED controller) board in the background.
It had become way too large, unwieldy, hard to configure, etc. 
So I stepped back and took another approach.

First I made a little board (on the left),
that connects my "standardized Wire/i2c cable",
to the PWM LED control module I am using. 

I made the right end of this board match the modules,
so that they can be connected together in an arbitrarily long chain,
using right-angle stacking headers.

Note the 2x15 IDC  connector on the top edge of the 1st module. 
This mates perfectly with the cluster of 12 LED drivers on that edge. 
Using this, you can connect a ribbon cable directly to 12 LEDs (or 4 RGB LEDs).
 
I will make another board that has 12 of my 3 Watt LED drivers,
with a 2x15 IDC socket on one side,
and appropriate high power connectors on the other.  
Using this you can connect the 3 Watt LEDs.

The combination of the above gives an easily configurable,
relatively inexpensive solution for prototype signal control.





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
1st SwitchMan board finished and tested. 
Seems to work well, including the management of the 32 INTerrupts it can generate!

Starting to assemble the 2nd,
after which I will get the software working with multiple boards.
(not an easy task, the Arduino libraries don't expect these things to be stacked on 6 different i2c buses  :td:)





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
2nd Switchman board assembled and tested:
 

RRswitch.cpp, build Jun 23 2019, - 13:34:48

pca9685 control pins:
  GND: GND, Vcc: 3.3v, SDA: Wire:SDA, SCL: Wire:SCL, OE: unused

  6 servos
  Servo calibration:
    calculated minimum pulse: 204, programed: 90
    calculated center pulse: 307, programmed: 267
    calculated maximum pulse: 409, programmed: 445

SX1509 track switch monitor.

------------------------------------
Starting trackswitch board on wire 0
TrackSwitchBoard::begin(), _i2c: 0x200021cc
TrackSwitchBoard::wireScan()
   SX1509 #1 found @ 0x3e
   SX1509 #2 found @ 0x3f
   PCA9685 found @ 0x40
 trackswitch board found
 all modules found on trackswitch board
------------------------------------
Starting trackswitch board on wire 1
TrackSwitchBoard::begin(), _i2c: 0x200016c8
TrackSwitchBoard::wireScan()
   SX1509 #1 found @ 0x3e
   SX1509 #2 found @ 0x3f
   PCA9685 found @ 0x40
 trackswitch board found
 all modules found on trackswitch board
config file: track switch board #0
config file: track switch board #1

==============================
controlling track switches ...
> s 4
setting servo to #4
servo #4, pulse length: 267
> tp
Switch #4: diverging
>  brakeman requests we move trackswitch 4 to main line
  ... moving ...
#4 main line
> td
  ... moving ...
#4 diverging


Both boards recognized and initialized properly.

On to SignalMan, the new design for the LED controller.


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi again,

Been very busy writing code to connect my hardware to JMRI,
specifically an openLCB (aka Layout Command Control, aka. LCC) gateway to JMRI.
Has proven very challenging as I have no knowledge of JMRI itself.

At this point I have a prototype (in the computer programming sense of 'prototype'),
of a gateway that hooks my mcus to JMRI, for turnout control and signal mast (ie. LEDs)
control. 

I can click a turnout on the JMRI layout panel, see it filter thru the gateway to the mcu,
which then sends microswitch inactive status of an opening sensor, moves the servo,
and finally sends active status for the other sensor (microswitch). 

I can also flip the control handle on a switch, to send a command uphill to JMRI,
causing it to move the turnout to the opposite position.

I decided to build a complete test setup in the den, to make the development cycle easier.

The signal mast icons move thru clear/stop/advance slow/ etc as appropriate,
sending the associated commands to the mcu for changing the LEDs to those colors.
At this point they are NOT the appropriate aspects, as I haven't figured out signal mast setup of JMRI yet,
but they are distinct/correct commands in the abstract.
 
This allows me to proceed with final programming of an mcu to run turnouts and signals via my hardware!

Steve





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi,


Have working mast and turnout control working on my test track. 


Started a website to document everything: 

 Beaver Lode Railway

It's (ie. the website) still very much a work in progress...


Steve


Warren G
Registered


Joined: Mon Sep 28th, 2015
Location: Yorkton, Saskatchewan Canada
Posts: 13
Status: 
Offline
Looks like it's coming together quite nicely.  :)






Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Hi all, I have been busy with life ... but am back to it with a vengeance!
An update to the hardware page of my site lists all the boards I've made so far.

I have a working prototype of a turnout motor finished.
The circuit board for the production version should be back from fab in about a week.
Steve





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

Got off on a tangent.

Decided to buy a Sherline mill for fabrication of parts,
the Dremel was such a pain for precision work... 

Then I had to add a DRO setup!

Steve





Last edited on Tue Jan 28th, 2020 03:27 am by Steve P

Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

The circuit boards arrived a while ago,
but was full time on the mill improvements...

Back to the switch motor project itself,
everything looks good.

Steve





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
 
Hi,

Steve





Si.
Moderator


Joined: Thu Feb 23rd, 2012
Location: London
Posts: 5666
Status: 
Offline
Hi Steve  :wave:


It looks like you are doing really well.  :thumb:

Your awesome CAD work is producing some nice lil' prototypes !  :)


I just came across the i2S bus, for connecting up a small OLED screen.  L:

I need to fit a new floppy-emulator to the vintage 1980s Christmas present I got !  :shocked:


Things have moved on from vacuum-tubes a lot these days !  ;)
I'm a lookin' & I'm a learnin'.  :old dude:



:moose: :moose: :moose: :moose: :moose:



Si.


Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
Si,
Do you mean I2C bus?  That's the typical bus used for OLED displays.
Never have come across an OLED device with an I2S bus.
Steve

Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline

Hi,


Here's an updated JMRI panel of my test track.

Steve





Steve P
Registered


Joined: Fri Apr 20th, 2018
Location: Colorado USA
Posts: 160
Status: 
Offline
  Hi, I made a series of switch motor boxes, each with a different style of hole for weather testing:
  • 1: box without any additional holes.
  • 2: box with the "throw lever" switch installed.
  • 3: box with 0/039" hole and 0.039" rod.
  • 4: box with 0.039" rod running thru 1mm ID silicone sleeve.
  • 5: box with 0.039" rod running thru pair of 1mm ID silicone o-rings.
I placed a cobalt chloride moisture and humidity detection test paper inside each box.
The boxes have clear lids so I will be able to monitor them for leaks without opening.
The boxes are positioned on the trestle with the holes facing the wind/snow:

02-17-2020: 4" snow storm last night, all boxes dry inside:2t:

I took a chance and placed a "medium run" order for 40 of the PCBs.

Last edited on Mon Feb 17th, 2020 06:18 pm by Steve P


UltraBB 1.172 Copyright © 2007-2016 Data 1 Systems