Model Railway Forum banner
1 - 20 of 48 Posts

·
Registered
Joined
·
52 Posts
Discussion Starter · #1 ·
I've been having a bit of a play this easter weekend... I'm writing my own computer interface software and have just rewritten it all to tidy a few things up as well as start getting some simple user interfaces on it.

My DCC system is a Hornby Elite, so chosen because it gives me fairly high end features plus the computer interface at a remarkably low cost, even the Dynamis can't compete in this area imho (note: not saying one or the other is better, I like both systems quite a lot - but I specifically wanted a computer interface and for the Dynamis that means you're looking at more like double the cost of the elite). Anyway, enough apologising for choosing Hornby...

The first video demo shows the software in action, it's pretty basic right now. It's got some throttle controls for driving on the screen both simple and advanced, and also a RailDriver throttle.


Simple - Single slider, does what you'd expect, higher it goes the faster the train goes.

Advanced - Dual sliders, one for throttle and one for brake - you should be able to figure out how they work


RailDriver - Interfaces to the PI Engineering RailDriver (http://www.raildriver.com) to talk to your DCC system via the PC. Requires no other drivers or set up, it's all contained in my code.

Function controls are supported (as demonstrated), but accessories, feedback etc will have to come later when I have access to that kind of equipment.

The plan for the software is for it to be very easy to use and free with full layout and locomotive control. Currently it talks Xpressnet over the serial port so anything that supports it should be fine (LI-101-F, LI-USB and Hornby Elite I'm pretty sure should/do work fine) - if I get access to other equipment i'll add in support for those also.

In addition to the application itself, which is what i'm sure the majority will be more interested in, there will also be a separate software developers library which will allow any of you budding programmers to go download yourselves a free copy of Visual Studio Express and start writing your own software very easily and quickly. It's specifically designed to be a publicly visible API and is therefore very easy to use.

The library will be free to download and use within personal or freely distributed software, however if you want to use it in a commercial / shareware application then a different license will apply.

If you don't know code or aren't interested, skip on down for the next demo


I use Visual C#.NET - but VB.NET will work just as well.

CODEDccDevice device = DccDeviceFactory.Instance.createDccDevice("HORNBY-ELITE");
ConfigurableValue comPort = device.getConfigurableValue("ComPort");
ConfigurableValue baud = device.getConfigurableValue("BaudRate");
comPort.Value = "COM4";
baud.Value = "9600";
device.startDevice();

That got us connected and talking to the railway on COM4 at 9600 baud. Note: You can "ask" a configurable value what it's possible options are too, that's how the drop down boxes in my application are pre-filled in.

CODELoco eurostar = device.newLoco(11);

Create a "Loco" addressed to number 11.

CODEeurostar.setFunctionStatus(0, true);

Turn the lights on!

CODEcurrentLoco.setDirection(Dcc.enumDirection.Forwards);

Set the direction to Forwards.

CODEcurrentLoco.setSpeed(30);

Start the loco moving at speed step 30.

Hopefully you get the idea, dead easy.

Anyway, moving on to the second demo which I produced this morning. This one isn't actually integrated in to the main application yet, it started out as a simple test of doing speech recognition in a test application and then once I got it working reasonably reliably I railway-enabled it in about 5 minutes to produce this:


Essentially it works by having a set of voice commands each of which are mapped to various operations like direction, speed, and the functions. How and what you map are entirely up to you (or will be when I wrap a nice configuration around it!).

I found speech control extremely usable, once you get over feeling like a prat for talking to your railway the fact that you're hands free and possibly also wire free (if you have such a headset) and simply talking to the loco you want and telling it what you want is great, it's like there's another person operating the trains and you're just talking to them (which I can assure you is NOT taking place in this video
). The quality of speech recognition isn't bad either, it took about 20 minutes to make the video and in all that time I think it mis-heard me twice, and didn't understand me three times - and I gave it lots to do, lots more than is on the 10 minute video.

The speech capability is just using the stuff built in to Windows Vista (possibly works with XP also, not tried) - so no extra cost to make it work. The speech engine in Vista is thankfully pretty reasonable and what you're seeing there is a completely untrained engine, so if I go through the training sequence then certainly it's going to get even more accurate.

No idea when I'm going to get the first release of any of this out yet, hopefully soon though as a more polished version of what is in the demo's here.

Thanks for your time, I look forward to any comments and feedback!

Regards,
Matt.
UKTrainSim
 

·
is asleep
Joined
·
758 Posts
QUOTE (Matthew Peddlesden @ 23 Mar 2008, 12:33) <{POST_SNAPBACK}>Thanks for your time, I look forward to any comments and feedback!
Wow Matt! That's tremendous and works very well. That it works with built in speech recognition software in Vista (aarrghh) is good.

I really like the way you can switch by just saying the name of the locomotive. I'm sure you don't need suggestions on how to proceed but it would be great if you could say, "speed sixty" or "speed 100" and the train would accelerate/decelerate realistically to that speed without further instruction. I suspect an emergency "stop all" command would be great when an operator anticipates a collision. I imagine everything that can be done by DCC can be done by speech as well so there is so much potential in the system. It would be great one-day say "train 2 platform 3" and watch the points set themselves and train 2 pull up at platform 3 without further instruction!

I look forward to seeing how this develops, and thanks very much for sharing it with us!

P.S. I think a smoke alarm battery needs changing!
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #4 ·
Hi all,

Thanks for the feedback...

QUOTE What cables do you use to connect to your PC? My Lokmaus 2 doesn't have a USB interface.

I'm using a Hornby Elite with a standard A->B USB cable as the Elite has a type B USB port (the one usually found on printers etc, more square shaped, still quite large). A Lenz LI-101-F or LI-USB would work just as well as they are protocol-compatible, other systems I'll add as I get access to the equipment.

QUOTE I really like the way you can switch by just saying the name of the locomotive.

Yes I must admit that was one of those surprises when you start using the system you realise just how powerful something can be. When I started this it was more for a geeky "wouldn't it be kinda cool, and pretty simple?" reason, but once it was working and i'd actually tested it for 10 minutes or so I quickly came to realise this was more than a geeky experiment, it was actually a plausible mode of operation. I can imagine someone wandering around a layout with a bluetooth headset, and that single wireless headset is giving them the ability to control every aspect of their layout as they wander around setting up stock around the back, 0-5-0 shunting or some other activity.

Wireless AND handsfree.


Not having to use the user interfaces of your system to do various aspects offers a lot of benefits - as good as the elite and dynamis are I still find that for more than one or two (depending on the system) locos at a time it still gets pretty awkward and the moment you bring accessories in it becomes unusable without risking crashes or stopping everything, the same applies to every other system i've used. Granted, ideally you've got multiple operators and you're each looking after different things but via speech control you could quite conceivably operate a shunter in the yard using your hands to uncouple, while also controlling two or three trains out on the mainline to get them stopping at platforms - couple that with the computer doing some of the control via feedback and one person can conceivably operate a busy layout without fully automating it.

QUOTE would be great if you could say, "speed sixty" or "speed 100"

I'm just starting to get to grips with the .NET Speech interface but yes, once I work out how to do more advanced grammars with numerics in them that's absolutely the goal - it does sound a bit daft saying "speedup" repeatedly, but it worked quickly so I went with it


I also want the speech interface able to accept a DCC loco id and switch to it.

QUOTE I suspect an emergency "stop all" command would be great when an operator anticipates a collision.

Already there, just neglected to demo
It's currently "stopall" but i'm thinking more "argh!" and also adding some of the more "colourful" things we say when we're about to witness a crash just to be sure


QUOTE It would be great one-day say "train 2 platform 3" and watch the points set themselves and train 2 pull up at platform 3 without further instruction!

Once I get my software able to deal with accessories and feedback etc, that's really the aim of the speech - it's one thing to drive the trains with Speech but it's entirely another to do all the despatching with it. Indeed you could probably couple it with feedback and have the computer drive the trains while you talk through the block setting, or some combination.

Regards
Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #6 ·
QUOTE (neil_s_wood @ 23 Mar 2008, 20:34) <{POST_SNAPBACK}>This sounds great Matt. Do you intend to market this as a commercial product?

Nope, a free one


It won't be open source because I am not sure I see the benefit in this case - particularly as the underlying library will be available for use, however the app AND the library will both be available free.

Note: Commercial / shareware use of the library will require a payment, but if you're writing freeware software that'll be free also. The application itself will be free.

Why? Because I want to see computer control of railways adopted much more widely. Hornby have taken a big step towards this by offering a product that gets you all the hardware for under £100 (ex vat at least) - with JMRI and RocRail already out there, I wanted to add more to the mix and try and put more of a focus on making it as simple as possible, as well as adding other things to the mix that perhaps aren't readily available.

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #7 ·
I just wanted to clarify that what i've shown / demonstrated here is not in any way linked with the so-called "CyberRail Systems Digital Voice Control" system advertised by UKModelShops.co.uk and I presume is an april fools joke


This is definitely real, but far less grand in terms of integration and so forth, as i've indicated


I've emailed them to let them know the joke is on them :-D

Matt.
 

·
Chief cook &amp; bottle washer
Joined
·
2,952 Posts
Now, I know not much at all about this sort of thing but, shouldn't you patent this work you've done. It would be horrible to see you do loads of work, only to see some scrote come along, nick it and put their own patent on it. Just a thought.
 

·
No Longer Active.
Joined
·
13,319 Posts
QUOTE (hoonsou @ 24 Mar 2008, 12:45) <{POST_SNAPBACK}>Now, I know not much at all about this sort of thing but, shouldn't you patent this work you've done. It would be horrible to see you do loads of work, only to see some scrote come along, nick it and put their own patent on it. Just a thought.

I don't know much about this either either, but surely, once something is in the public dormain you cannot patent it ?

Or maybe, once the details have been worked out you can lodge a sealed copy with your solicitor (or somebody of equivelent standing) to protect yourself.

It's a great pity that someone generous enough to make his work freely available for the benefit of all has to possibly take these steps.
 

·
Registered
Joined
·
828 Posts
QUOTE (poliss @ 24 Mar 2008, 15:20) <{POST_SNAPBACK}>It is doubtful if computer programs can be patented. See the editors notes on this UK Gov website.
http://www.ipo.gov.uk/press/press-release/...se-20080318.htm
Copyright may be more applicable in this case. Copyright is free and automatic. See http://www.ipo.gov.uk/copy/c-claim/c-auto.htm for more details.
Even if they could, in the UK it's too late once a public disclosure has been made. In the US you have 12 months from first disclosure to file a patent.

Andrew Crosland
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #13 ·
To be honest, i've got no interest in patents or other forms of restrictions at all. By making it public i've ensured that nobody *else* can patent it because there is clear "prior art". I don't really agree with software patents, the number of times i've fallen foul of them completely by accident proves to me that they're pointless - Patents are about someone reverse engineering what you've done to reproduce it and steal it, where as if you can walk in to the same solution then it should never have been patented or the patent should be invalidated. My original software was client/server like Rocrail and JMRI - then some time later I found out about the whole KAM industries thing and shelved it before my recent rewrite to another platform in which I also eliminated the client/server aspect. To me, it seemed "obvious" to make it client/server - but apparently the courts don't agree with that if they're continuing on with this farce against JMRI.

Rant over.


If someone wants to take my ideas and make them bigger, better and charge lots of money for them - then great, all power to you. I'll be here with a free alternative to keep you on your toes and if i'm not, at least the ideas can continue on with those who have the time to persue them.

It's all for the hobby as far as I'm concerned. Only reason I don't want to open source the app and library is because I don't see the point or need - it's one thing to take the ideas (which you're welcome to), another to use my code to achieve it
If later on I can see a benefit in open sourcing it then I might consider that option - but for right now the implementation / code will be closed source, but free to use and distribute for personal and free purposes.

Thanks for the kind words everyone, inspiring me to keep up the momentum and get on with it! I've started on the loco database now, which will enable me to get the speech stuff incorporated in to the main app, plus i'm going to get it all tested on XP so I can prove whether the speech code is viable on that platform or whether Vista will be required for speech (the rest is fine, just the speech that might be a concern).

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #14 ·
QUOTE This sounds tremendous, any plans to add support for other DCC controllers somewhere down the line ? ECOS

Not sure if i've mentioned it in this thread or whether it was other forums, so apologies if i'm repeating myself...

The underlying framework is extremely pluggable so that I can easily add new systems later on - however I don't have the funds to buy lots of different systems and all the relevant kit to make it work well - so system vendors / developers will need to contribute or loan equipment for me to achieve that... but if that happens then yes, i'm more than happy to add support for different systems and indeed would like as broad support as possible. I'm planning on taking it along to our DCC Workshop stand (which we run right next to our UKTrainSim stand at many major model railway shows) to demonstrate and try to convince the key people to contribute their kit to help push things along.

Bachmann have kindly donated a Dynamis to the Workshop stand, so all we need is the pro-box when it's out and I should be able to get that one up and running - and one would presume/hope that there isn't a million miles from the Dynamis Pro to the Ecos computer interfaces...

Cheers,
Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #16 ·
Not a clue - i'm using the standard out-of-the-box Vista speech rec engine, untrained. It comes with a training tutorial which teaches you how to use the speech rec system to control vista while at the same time learning how you say the various commands and improving the reliability of the speech rec for you personally.

If you have Vista then enable it (it's there on all versions) and see how you get on with it.

I suspect it'll work just fine, particularly as I aim to keep the vocabulary quite small, which aids it as it's picking from a smaller set and therefore you're less likely to have multiple things that sound alike.

Matt.
 

·
Paul Hamilton aka &quot;Lancashire Fusilier&quot;
Joined
·
844 Posts
Speech recognition is still developing and as a a basis you should assume that most utilities will require specific recognition that will over come most accent issues. Dunno about Scottish though, don't think there is a program in the world that will have the ability to decipher that. Mandarin Chinese would be easier I reckon (Dad's from Glasgow!!)
 

·
Registered
Joined
·
33 Posts
Hi Matt,

Followed the post over at Hornby, albeit a little brief and quiet. Again, congratulations in making this work. I am very new to model railway (xmas presents for the boys) and chose the elite controller. I am a technical / computer literate type and always get excited about the possibilities. Yeah, pc control might not be for everyone, but when people think and chat, they will see the sky is the limit. Imagine a physically disabled person using a microphone as the control interface for their railway, even younger children...I can't wait to use my blue tooth headset to drive my set - my 4 1/2 year old bot has been testing the speech recognition on my vista laptop to make sure he will be up to it - he is very advanced language wise and will be fine - he can't wait to tell Thomas to go.

The routes and more will be just as big a deal too.

I am wondering if any dealers out there are willing to send a decoder to test. I have the first version Hornby acc decoder that is idle at the moment and would be more than happy to post it to you for a few weeks?

Michael - Aus.

hopeful beta tester of this software.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #19 ·
Use Windows Update to get your laptop upgraded so that it has the latest .NET Framework 3.5 on it (or whatever is the latest you can get, might take two or three goes potentially, certainly my XP laptop won't go to 3.0 or 3.5 until it's had the 2.0 service pack installed.

Once you're up to .NET 3.5 (or whatever the latest you can get is) give me an email and include the following info:

For each loco that you want to control, I need a real simple name for it (e.g. "thomas", "james", "thirty-seven" etc), the simpler the better - preferably give them a shot on your speech rec in notepad or something and see how reliably it can pick the name up when either of you speak it. Next, for each loco i'll need it's dcc id. If you're using any functions, let me know which ones and what names you want to give them (obviously "lightson" and "lightsoff" is already there. I'm also assuming that you're set to use either 28 or 128 speed step - my code will use 128 speed step (but as long as you're set to the 28/128 option it is fine, and this is usually the default).

I'll then set it up with a simple default config based on what you send me and get you a copy to play with since it should work pretty easily on your machine.

Have you installed the vista drivers for the Elite and proven it works on something like JMRI just to make sure that side of things is good? You'll need the com port name (e.g. COM4) to put in to my software so that it can talk to the Elite. I've put a thread on the hornby site detailing how to get the Microchip 1.3 driver upgrade until Hornby release an official one (if they haven't already), this will get it all working on Vista.

Drop me an email at matt *at* uktrainsim *dot* com and i'll zip something up for you to play with and let me know how you get on, it'll be good to know that it will work for more than just me


Thanks for the offer of the decoder - let's hold fire on that, i'm going to try and encourage folks like Hornby etc to contribute some kit to the cause, i'm at most of the major shows in the UK with UKDccRail DCC Workshops and UKTrainSimLive, and i've spoken with the top people from most of the major companies now many times so with something tangible to see they may well be more interested in helping out.

Cheers
Matt.
 

·
Retired...
Joined
·
106 Posts
QUOTE (Matthew Peddlesden @ 26 Mar 2008, 12:43) <{POST_SNAPBACK}>Use Windows Update to get your laptop upgraded so that it has the latest .NET Framework 3.5 on it (or whatever is the latest you can get, might take two or three goes potentially, certainly my XP laptop won't go to 3.0 or 3.5 until it's had the 2.0 service pack installed.

Once you're up to .NET 3.5 (or whatever the latest you can get is) give me an email and include the following info:

For each loco that you want to control, I need a real simple name for it (e.g. "thomas", "james", "thirty-seven" etc), the simpler the better - preferably give them a shot on your speech rec in notepad or something and see how reliably it can pick the name up when either of you speak it. Next, for each loco i'll need it's dcc id. If you're using any functions, let me know which ones and what names you want to give them (obviously "lightson" and "lightsoff" is already there. I'm also assuming that you're set to use either 28 or 128 speed step - my code will use 128 speed step (but as long as you're set to the 28/128 option it is fine, and this is usually the default).

I'll then set it up with a simple default config based on what you send me and get you a copy to play with since it should work pretty easily on your machine.

Have you installed the vista drivers for the Elite and proven it works on something like JMRI just to make sure that side of things is good? You'll need the com port name (e.g. COM4) to put in to my software so that it can talk to the Elite. I've put a thread on the hornby site detailing how to get the Microchip 1.3 driver upgrade until Hornby release an official one (if they haven't already), this will get it all working on Vista.

Drop me an email at matt *at* uktrainsim *dot* com and i'll zip something up for you to play with and let me know how you get on, it'll be good to know that it will work for more than just me


Thanks for the offer of the decoder - let's hold fire on that, i'm going to try and encourage folks like Hornby etc to contribute some kit to the cause, i'm at most of the major shows in the UK with UKDccRail DCC Workshops and UKTrainSimLive, and i've spoken with the top people from most of the major companies now many times so with something tangible to see they may well be more interested in helping out.

Cheers
Matt.

Matt
So far so good. The possibilities are enormous. Couple of questions - 1. how do you draw up your trackplan - symbol picking like Rocrail & JMRI. 2. I presume points switching is from the trackplan firing Hornby HADs. Any clues as to why Rocrail screws up the address/port thing on HAD2 when the Elite works it OK , as does JMRI.
Best of luck with getting some kit out of Hornby - they have been requested to monitor this thread.
Robbie
 
1 - 20 of 48 Posts
Top