Model Railway Forum banner

Computer, Speech and RailDriver Control

16144 Views 47 Replies 17 Participants Last post by  darren mark green
3
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
See less See more
21 - 40 of 48 Posts
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.
See less See more
Best of luck Matt, both on the development work and with Hornby.
I look forward to further reports.
Robbie
3
QUOTE (Matthew Peddlesden @ 23 Mar 2008, 12:33) <{POST_SNAPBACK}>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
Good luck with this I feel its a nice kick up the but for Railroad&co they want 200 pounds for their programe and i feel that someone who is just starting out with this computer control is not going to pay that very silly price its just damm crazy in my books SO GOOD ON YA .ROB
See less See more
QUOTE (RAFHAAA96 @ 27 Mar 2008, 14:25) <{POST_SNAPBACK}>Best of luck Matt, both on the development work and with Hornby.
I look forward to further reports.
Robbie
Matt
Further to your response about drawing up the trackplan
I've been looking at TrainBrain from CTI-Electronics. Their software is a free download and drawing up a very clear format trackplan is a doddle using it. They support Lenz-USB, so effectively I guess the Hornby Elite. The command consoles are the standard floating screen type seen in other train control packages.
The problem is the software is rigged to run into the CS using their various TrainBrain modules.
No doubt you could easily sidestep this with your code as the code they use is Train Control Language - a type of plain English code (like programming in Basic) that is further compiled by the modules.
It may be the answer to a quick trackplan to go with your splendid voice-command application, which I trust is going from strength to strength.
Robbie
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.
See less See more
Matt, this is an absolute sensation. i've just watched it on Youtube and I'm stunned at what you've achieved.
You've also solved the Elite users multi button push syndrome for function selection. I'd love to have a go with it when you've got it all sorted out. i'll keep an eye out for it, please keep us informed about whwre to get it from etc.
Cheers
PaulM
See less See more
2
QUOTE (nzpaul @ 4 Apr 2008, 17:22) <{POST_SNAPBACK}>Matt, this is an absolute sensation. i've just watched it on Youtube and I'm stunned at what you've achieved.
You've also solved the Elite users multi button push syndrome for function selection. I'd love to have a go with it when you've got it all sorted out. i'll keep an eye out for it, please keep us informed about whwre to get it from etc.
Cheers
PaulM

Hi Paul, and all other interested parties....

I have been doing some beta testing for Matt and can only say that the video is only half the story. When you actually start to command your trains using voice it is excellent
. The elite obviously has 2 throttles, but as most of you are aware, using both at once is problematic anyway, rotating both dials simultaneously causes glitches with one or both of them. With voice control, even at the early stage it is in, i can EASILY control 3 locos at once, on 2 loops!! Switching between locos is very fast and i can run a quick string of commands.....Say my sound equipped diesel is at 50%, i can give 4 uick "slowdowns" then "brakes" and another "slowdown" it cruises in with brake squeal sounding and can stop where i want.

I am using a bluetooth headset (usually for mobile phone use) direct to my laptop. I can talk to all my locos anywhere in my garage.

I hope Matt gets a little support from some keen dealers or manufacturers so accessory decoders for point control can be utilised.

Michael in Aus.
See less See more
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.
Oh, and thanks for the great feedback Michael, glad it's working


Matt.
See less See more
Good news about voice recognition over XP Matt.
I had word from Rocrail that they have sorted the HAD addressing offset problem. So that may be a help whenever you can get hold of some HADS.
I'm looking for 'info' per your PM.
I will be keen to see your stirling efforts out of beta.
Best of luck, Robbie
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.
See less See more
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.
QUOTE (Matthew Peddlesden @ 6 Apr 2008, 22:28) <{POST_SNAPBACK}>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.
Matt, Your earlier post was 0859, saying you will have a look at accessories, then only 1.5 hrs later you have had initial success, this is coming along at an amazing rate Matt, good work.

I have used both the "Simple throttles" as well as "Voice Control" several times over the weekend and it has been great.

Funny, my son unfortunately has had little success with using his voice so he prefers to "Do it the old fashioned way!!!" using the Elite.

Anyway, eagerly await Pt II of this excellent software.

Mike.
4
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.
See less See more
4
QUOTE (Matthew Peddlesden @ 6 Apr 2008, 21:03) <{POST_SNAPBACK}>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.
Hi Matt
More good news from you - well done.
I'm happy to do some accessory testing using all Hornby kit.
Cheers, Robbie
See less See more
hi matt,
great what you have done so far.
i am willing to do some testing for you,as to help this application along.
i have ms visual studio which i can use to create windows applications and windows mobile applications
when you have the source code available to download and test out,i would like to import it to a mobile device
thanks
darren
Hi Matt
How is this coming along
There has not been a update post for some time
Regards Zmil
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.
See less See more
Hi Matt

Sounds Great
Looks like I better put a wireless headset on my wishlist


Regards Zmil
See less See more
Hi Matt,

Its been a while!! I fully understand about the time issues!!!

Anyway, glad to hear things are still progressing - my layout has doubled in size and complexity.

I eagerly await the next instalment / version of your software.

Mike.
21 - 40 of 48 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top