Jump to content

Block detection and automation test/practice layout


gavino200

Recommended Posts

4 minutes ago, Martijn Meerts said:

The ready made ones are more expensive than an Arduino yes, but they come with lots of features. The one I'll be using can also control motors and servos, and has inputs as well.

 

Pretty sure everything can be done with an Arduino (or, multiple Arduinos) as well, but if you want to control them using DCC you'll also be needed a DCC shield thing, and no idea if they're compatible with the smaller Arduinos, and what the cost is going to be like. I've not looked into them much, apart from having a look at controlling a custom turntable using one.

 

What will you use the motor/servo outputs, and the inputs for? I wrote down somewhere the name of the model you use, but could you share it again?

 

I'm playing with the layout right now. It's really a lot of fun controlling the layout with the laptop 😀

 

Link to comment

I'm up to 15 on the Bob Fuller Tutorial. So far he's been teaching based off the iTrain Demo. I decided to ignore the demo part and go straight to following him using live functioning locos. The disadvantage (and advantage) is that I was forced to play around and experiment myself quite a lot, in order to resolve the differences between the demo and my live layout. I think that struggle has helped me to learn and remember.  

 

Bob is now switching to "Preparing your locos for iTunes". I'm going to start again and prepare the layout 'by the book' along with the videos. It'll be a good opportunity to switch out my locos. So far, I've been using push-me/pull-you type locos which has been very annoying. I keep having to reset the direction because the locos head off in an unexpected direction. There's no way I can remember which end is the "Front" from the tiny differences. I'm switching to locos that have a distinct front and back. 

 

 

Edited by gavino200
Link to comment
2 hours ago, gavino200 said:

I think it would be cool to have a few embedded tiny cameras to see the trains whizzing by from an N-scaler's perspective!


live done this at shows with the train cams of placing them next to tracks to act as a track side camera. I have a couple of tiny cams I also used once and want to get built into some track side structures on Ttrak. The wireless spy cams are so cheap these days. I was spying a little 4 channel security video receiver to then rotate the cameras on a small screen. Really is fun and kids love to try to find the camera. They are dirt cheap now!

 

Jeff

 

 

  • Like 1
Link to comment
2 minutes ago, cteno4 said:


live done this at shows with the train cams of placing them next to tracks to act as a track side camera. I have a couple of tiny cams I also used once and want to get built into some track side structures on Ttrak. The wireless spy cams are so cheap these days. I was spying a little 4 channel security video receiver to then rotate the cameras on a small screen. Really is fun and kids love to try to find the camera. They are dirt cheap now!

 

Jeff

 

 

 

This sounds like too much fun. It just has to be done!

Link to comment
2 hours ago, gavino200 said:

Definitely. The ready made ones are a little pricey IIRC. There's probably some pre-written code for this out there too. It might be a simple assembly job. 


the guy who made the one we had was pretty inexpensive, I think $40. But sadly I think he passed away or had a major medical thing that closed his biz. Is pretty simple just look for current drop on photo resistors on two inputs and time the period between hits. Then just need a display shield to export the value to for display. 
 

His second generation added a led and photodiode so it could work in the dark, but it was a bit more fussy than the old simple photo resistor one. That one we could plug into multiple places if we wanted as the photo resistor detectors were dirt simple and cheap. It was just a simple pic system he homebrewed before arduino was around much. 
 

im actually kind of surprised there are not more little widgets for simple train stuff being done on cheap arduinos for sale these days.

 

jeff

Link to comment
Martijn Meerts

Servos could be used for something like the lowering the guards at a level crossing, or to control a semaphore, or opening the doors of an engine shed, or moving a crane, set a turnout etc, plenty options there. Motors I’d probably not use myself, but you could for example hook up motors of a fun fair ride, and then control that based on the time in a simulated day/night cycle.

 

Inputs can be used with regular physical buttons, so if you have a shed, you could have a physical push button to open/close the doors. But you can also detect a reed switch or some some IR circuit to trigger things.

 

The device I’m using is the OC32. I’ve used an older version of it before but sold it a long time ago. I do have a new version as well, but haven’t experimented with it a lot yet. I wanted to see if I could do some custom setup for Japanese light signals, but haven’t gotten around to it yet. The nice thing about the OC32 is that iTrain supports it really well.

 

Again, all of this can also be done with an Arduino with some custom code, but I have no idea what the exact cost of the Arduino setup will be. The OC32 had 32 outputs (or inputs, they use the same pins), Arduino might have fewer, especially the nano ones. The OC32 might be a bit more pricey to get outside of the Netherlands though, it’s made by a Dutch guy, and not exactly mass produced I think. Not many model train stores stock it.

 

  • Thanks 1
Link to comment

 

"I'm using the µCon Railspeed from LSDigital. I got the starter pack that comes with a so-called Mini Manager which connects to the local network. iTrain has full support for it, so it does the speed measurement fully automatic. I made a separate test track for mine, but it's also possible to mount it in a layout."

 

 

 

LOL. You posted just as I found the post where you told me before!!!

Edited by gavino200
Link to comment
Martijn Meerts

Ah, you meant the speed measuring device, not the one to control lights, servos, motors etc? 🙂

 

The speed measuring device is the uCon Railspeed yes. It’s definitely not needed for measuring speeds, you can use your existing block detection. The Railspeed just does things a bit quicker, and at higher speeds especially is more accurate. But it’s a bit of a luxury item in a way, I’ve measured a lot of trains just using block detection before I got the Railspeed.

 

Link to comment

 

Just now, Martijn Meerts said:

Ah, you meant the speed measuring device, not the one to control lights, servos, motors etc? 🙂

 

The speed measuring device is the uCon Railspeed yes. It’s definitely not needed for measuring speeds, you can use your existing block detection. The Railspeed just does things a bit quicker, and at higher speeds especially is more accurate. But it’s a bit of a luxury item in a way, I’ve measured a lot of trains just using block detection before I got the Railspeed.

 

 

Ah, yes, but that's great information about the light controller too. Thanks much!

Link to comment

So far everything is going well. I have really a good overview understanding, thanks to Bob Fuller's teaching method. Next up is speed measurement using block detection. In preparation, I restored the full loop to my practice layout and restored accurate measurements to iTrain.

 

I'm glad I decided to start with a practice layout. Now that I know a bit about automation, I'll want to make some changes in my layout plan to take advantage of it. One thing I really like about automation is how it breaks the dependency on having loops of track. Loops of track really eat up space and give a very unreal impression. I'll definitely want to incorporate more terminal ends and lay-bys, so that I can have lots of trains running at once without having them simply running in circles. 

 

H69wzOd.jpg

  • Like 2
Link to comment
Martijn Meerts

Once you've done a speed measurement and see the locos actually stop where you want / tell them to stop, it'll be even more fun 🙂 

  • Like 2
Link to comment

A question for @Martijn Meertsor anyone else who is an iTrain user. I've been unsure for a while about how my junctions should be wired. I wired my blocks before I learned that in iTrain a block cannot contain a junction. 

 

So my "Station platforms 1 and 2, all three yard lines, and my "North end" are all blocks that don't contain any junctions. That much is good. 

 

In iTrain my East and West end curves are also blocks without junctions. 

 

However on the physical layout my junctions are powered by the electrical connections to the east and west loops. That must mean that they're part of that detection area. I think that will mes up my speed measurements as a the train will be detected before it gets to the "official" block area. 

 

Do I need to completely isolate my junctions? And then give them their own non-block-detection power supply? Or can I leave them as they are and just add the length of the junctions to the length of the block? 

 

You can see the isolated joiners on only one end of the junction.

 

CIqA9UB.jpg?1

 

Theres no isolation between the "East curve" and either of the junction areas. 

 

lNL0MCJ.jpg

Link to comment

I think I knew the answer, so I bit the bullet and wired the junctions independently to a the non detection terminal of the Digikeijs block-detection module. I guess that's what it's there for.

 

I was hoping not to have to re-wire. I recently moved to a different power connection method and I dismantled my old unijoiner power connectors. My soldering gear is all packed up as I'm about to paint my work room. Fortunately I was able to locate exactly three sets of these - all I needed. I crimped them to some wire and hooked it up. Man, I forgot how much I don't like crimping. 

 

HrCwU5I.jpg?2

 

yNM5mxe.jpg?1

Link to comment
Martijn Meerts

With junctions you mean the turnouts? Those shouldn't be part of a block, mainly because if a turnouts is part of a block, it can keep both directions of the turnout as being occupied. You can still add detection to turnouts to monitor them, for example when a car derails / gets stuck on a turnout.

Link to comment

Yes, sorry, I mean turnouts (aka points). That's interesting that I can have them detected but not a "block". So a turnout, could be isolated isolated and detected, or isolated and not detected. And the same could go for a string of turnouts directly joined to each other. The group could be powered together and detected or powered together and not detected. Or powered/detected in any other permutation of grouping. 

Link to comment
Martijn Meerts

Yeah, it's not very common to detect turnouts, but it's definitely doable. It also depends a bit on the turnouts whether it's worth the effort. I don't know much about Kato turnouts, but you might need to add multiple wires to fully detect it. You can also combine multiple turnouts and detect them as a single section.

 

I haven't added detection to any of my turnouts on the yard and helix. Trains tend to travel fast enough to go through them without stalling, and even if they're slow, I use electrofrog turnouts. With the frogs powered, there's almost no dead zone on the turnouts for things to stall. Of course, it can still happen that a car / coach gets stuck on a turnout, but so be it 🙂

 

I do have some very short sections on the helix which are detected, but which aren't part of a block. It's more or less the same idea as detecting a turnout.

 

  • Thanks 1
Link to comment
gavino200

I've hit a wall with my learning. I haven't been able to get iTrain to execute the three feedback speed detection routine. After spending a lot of time with the manual and the Bob fuller tutorials unfruitfully troubleshooting, I suspect that I've changed a setting somewhere that is causing a problem. I've decided to take a fresh start at it. I've stripped the layout down to a simple loop with five blocks each with one feedback. No sidings, no turnouts. I'm going to uninstall and reinstall iTrain and build up the new switchboard from scratch, keeping no data from the previous run through. I think I'll give it a week also to let things settle so I can see it fresh. 

 

If I were to do this again, I'd start with a simple loop and do the speed trial and stopping distance first. It's definitely nice to have an overview of how the higher functions work, but I think the rest would be more enjoyable if this part were done first.  

Edited by gavino200
  • Like 1
Link to comment

This happens to me all the time (with Rocrail) too. Learning, moving forward, then often going back to apply what we have learnt. 

  • Like 1
Link to comment
Martijn Meerts

Yeah, there's a lot to take in when you try to do everything at once. But it's also somewhat addicting, so you do tend to want to use all the features available to you 🙂

 

Not sure what could've gone wrong with the speed measurements. I've use the double feedback measurement before, where you have a start sensor, and end sensor, and a section of track in between them. You just specify the 2 sensors and the correct lengths, place a loco on the track, make sure its direction is correct, and then start the measuring sequence. I have had it go wrong, but that was usually because I didn't check the direction of the loco ...

 

Link to comment
gavino200
6 minutes ago, Martijn Meerts said:

Yeah, there's a lot to take in when you try to do everything at once. But it's also somewhat addicting, so you do tend to want to use all the features available to you 🙂

 

Not sure what could've gone wrong with the speed measurements. I've use the double feedback measurement before, where you have a start sensor, and end sensor, and a section of track in between them. You just specify the 2 sensors and the correct lengths, place a loco on the track, make sure its direction is correct, and then start the measuring sequence. I have had it go wrong, but that was usually because I didn't check the direction of the loco ...

 

 

Yes, it's really quite fun. I really don't know what the problem is, but I've been doing some fairly complex things, following along with the Bob Fuller tutorial. I bet I have some contradictory commands given to the computer. Either, that or there's a problem with the CV setup. Neither Bob nor the manual are great about that part, though the manual is the better of the two. 

 

I'm going to start again, and set up a basic oval. Then set up a simple loco/train using a loco that I haven't done anything iTrain related with. I bet I'll get it to work. 

Link to comment
gavino200

As I go forward, I think I'll make copies of the "project" whenever I start to learn and experiment with a new idea. That way if I run into problems I can revert back to the earlier version without having to start again. 

Link to comment

Rocrail does that automatically. It creates a backup folder with all past versions of the main files (I am not trying to sell Rocrail, just saying).

Another good thing to learn/know: source control. I have started to use Git (https://git-scm.com/ and https://en.wikipedia.org/wiki/Git) a few years ago and now I use it for most of my projects. You’ll have to invest some time learning how to use it but it’s worth it, believe me.

  • Thanks 1
Link to comment

One good practice to get into is every hour or two of coding try to save another version. Really good early on as you may screw up things that were working as you learn things rapidly and add complexity. I just use a three digit code first digit being major changes and additions and second two digits being little incremental saves. Then if I’m being good I have a comment out area of my code where I just keep a running list of the version number and a quick sentence or two of what I did. In the short term it helps you to keep focused on what you are working on as if you start doing lots of tiny changes all over I can be a mess to figure out what is causing issues later based on what you did and the version number.

 

In the extreme some of my exhibit coding projects were going on two decades (I just retired from one that went 23 years as it was finally redone in a proprietary video server system) and it was the only way to remember what we did when and why. I was the only one on the project there the whole 23 years as well so it was the only place we had any sort of continuous history anywhere in the project. You may eventually be like this on your model railroad! 
 

When learning it can seem like ages ago the next day you have moved ahead so far at some points. 

 

jeff

  • Like 1
  • Thanks 1
Link to comment
4 hours ago, Madsing said:

Rocrail does that automatically. It creates a backup folder with all past versions of the main files (I am not trying to sell Rocrail, just saying).

Another good thing to learn/know: source control. I have started to use Git (https://git-scm.com/ and https://en.wikipedia.org/wiki/Git) a few years ago and now I use it for most of my projects. You’ll have to invest some time learning how to use it but it’s worth it, believe me.

 

Just FYI for people not that familiar with it, there are "free" git services available online, the most popular two being github.com and bitbucket.org.  (I use both in various capacities).  And there are also apps for Windows and Mac that make it easier to use than learning a bunch of command line stuff (though the command line stuff is useful to know about -- especially in complicated situations).

 

  • Like 2
Link to comment

Booted back up with a fresh install and a basic oval. First successful speed profile measurement! 

 

kHpyY1C.jpg

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...