Model Railway Forum banner
1 - 17 of 17 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
 

·
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.
 

·
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.
 

·
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.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #21 ·
Hi Robbie,

I haven't yet decided how i'm going to do the track plan, the method used in RR&Co isn't bad and can achieve most if not all layouts I think but it can be improved by perhaps having some helpers like drawing loops automatically for example. I'll probably start with something similar to RR&Co (possibly this is how Rocrail does it as well; i've only briefly looked at Rocrail and without any accessories on my layout didn't pay any attention to that side of things), and then i'll develop it to add more time saving features in to speed up the process.

Another idea I had for it was to have the ability to import a picture, and then overlay graphics on top perhaps to visually change the way a point looks or add indicators or something but as I say, i'll probably start with the "graph paper" approach and work from there.

Again I like the way that RR&Co does points and accessories and I will probably emulate and extend it. That is, click on an accessory to change it, press a hot key to change it, or set up routes to chain them together. It makes sense and works well. I'll also look to add speech to extend it of course.

Without using some accessory decoders on the elite I have no idea why Rocrail would get it wrong - but I recall that Rocrail does not have support for the elite specifically, it uses the LI101F support, where as JMRI does have Elite support and thus it's plausible they have adjusted something to compensate and make it work properly for them... that would certainly be my aim, each system should work on its own merits and while my internal code for the LI101F and the Elite are currently the same, it has the ability to vary the behaviour between those systems still by extending one or the other in a slightly different direction.

I've spoken with Simon Kohler at Hornby a few times in the past and more recently, and he's been sent the Youtube videos. I'll be at Alexandra Palace with our UKTrainSim stand (they didn't want us to bring our DCC stand!) so no doubt I will meet up with Simon and we can have a chat about these things.

Thanks for your support!

Regards
Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #25 ·
Thanks for the pointer, it won't take me long to get the first basis of a track plan in to the system so i'm not too fussed about that.

Speech control hasn't really progressed much but I did send a copy to someone in Australia recently and i'm pleased to report that after a few early hiccupts he's now fully operational with it, so at least I know it works on someones machine besides mine


I am going to get started on the layout control stuff in the user interface asap, no idea yet when I'll make any progress on the actual interface to the layout itself - Hornby were extremely uninterested in talking over the weekend so no help there.

Regards
Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #28 ·
Well good news is that i've worked out how to get all the speech stuff running on an XP machine so it's not tied to Vista anymore.

The speech system is slightly more comprehensive in Vista because I can get back a "confidence" on each match, i.e. how close it things the spoken phrase was to the match it is offering up, which means that the application can then add further filtering to help minimise incorrect matches. On XP this always returns -1 but in the 20 or so recognitions i've just done it was spot on every time so I don't think it really matters.

Hopefully it'll be demonstrable at this weekends Bradford exhibition.

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #31 ·
It's had a pretty good outing at the Bradford show so far this weekend driving the N gauge demo layout (far more grand title for what it actually is, two loops of track
). After some initial frustrations getting the LI-USB working (the so-and-so's made a slight modification to the protocol for the LI-USB!) it's been running great all day.

XP speech recognition is definitely not as good as the one on Vista but it hasn't done bad and i'm sure a noise-cancelling mic would actually make a big difference when in a noisy exhibition room - but even then as I say, not many misunderstandings.

Might see if I can get the accessory stuff working tomorrow.

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #32 ·
Good news, first cut of accessories are in and working, need to refine my interface a bit but the underlying code seems to do the job.

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #34 ·
Well, for the latter part of the afternoon I set up a few extra mods to the voice throttle so that I could use names of colours to select various routes (I still don't have a decent speech rec grammar implemented
) - to go in to the two yard sidings or select the main and was able numerous times using only my voice to go from one running loco to another by putting it in the sidings and getting the next one out of a different siding etc, so it seems to work ok, including operating the signals as part of the route.

I understand a bit more about what's going on in that part of the interface now too, and it now has a nice simple API command in the SDK - it's also been used with two accessory decoders at once and seemed to always find the right accessory output regardless of which decoder it was on (one six output and one four output too), which is a bonus, means my maths is about right... though it wasn't to start with, most bizarre problem where all the outputs seemed to work fine except number four - switch it one way and it worked, switch it the other and a different output changed
simple maths error though once I sat down and saw what it was doing


A few others had a go this weekend at the speech, including one lad of about 8 or 9 who seemed to have no problem with it, I really must get my son (5) to have a go and see how he gets on.

Next step is to beef up the rest of the app a bit more so it's easy to try some things out without requiring code changes and then get it out to a few more people for testing (particularly as I can't test the accessory stuff myself normally!).

Anyway, pretty reasonable progress.

Thanks for the kind words Mike, very much appreciated - glad it's working ok. Hopefully i'll have a new version out to you soon to test the accessories, day-job permitting


Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #38 ·
Sorry for the lack of updates, unfortunately real life continues to be a pain in the neck and prevent me from doing fun stuff


My sons layout is now all pinned down and wired up somewhat better than it was - which means I can now get the point motors fitted (four done, loads to go) and that then leaves me in a better position to proceed with the accessory-related control.

I don't remember whether I mentioned it before but I do now have accessory control in the system and indeed at one exhibition I got simple voice control of routes working on our little demo n-gauge layout, which worked really well.

The experimentation is all basically done - what I need to do now is start back-filling in the bits i've skipped over, get the loco database in, get the layout-drawing and control stuff in and then start laying the voice control over all that.

The RailDriver people have also expressed an interest in my getting a version of RailDirector out soon too so my intention is to wrap up what i've got done thus far and release it - then i'll carry on working on the more detailed stuff while people give me their feedback on the current release.

So, hopefully not too long now there'll be a first general alpha release for folks to play with.

Matt.
 

·
Registered
Joined
·
52 Posts
Discussion Starter · #44 ·
Hi Hugh,

Yes it's certainly still on the cards - real life is rather taking priority unfortunately at the moment however it already does more than in those videos (accessory control for example, i've had a demo of it doing route setting via speech which was quite cool). I'm also getting my sons layout built up a bit (well, built, anyway
) so that I can do more with the accessories.

The "fun" bit is largely done, it's down to more hard graft now and turn it from a proof of concept in to a real tool.

Thanks for checking in though - really good to know people are still interested in it!

Matt.
 
1 - 17 of 17 Posts
Top