How to drive train models - Page 2 - General Discussion - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

How to drive train models


  • Please log in to reply
59 replies to this topic

#21 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 05 April 2012 - 12:57 PM

Okay, but could you number *roughly* the leds, and the relays (i.e. rail exchange)? For example, 100 leds and 100 relays (=50 exchanges, since there are two relays for each one)? What else should be driven? Motors, locos, etc.
Biggest fault of Netduino? It runs by electricity.

#22 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 05 April 2012 - 05:40 PM

No, actually, we are more on the 50 & 50 side (50 leds and small things, plus 25 rail exchanges), but my friend is stuck with complexity: he would like to add things, but decided to stop and think what we can do... Anyway, from what you are telling me, the problem is more on distances, than quantity... Andrea

#23 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 05 April 2012 - 05:41 PM

...oh, and for now, I didn't think at all to locos and motors... we will see: I'm sorry, but not being an expert, I prefer to think problem by problem... Andrea

#24 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 05 April 2012 - 06:01 PM

Mario,
can you give a look at this thread?
http://www.avrfreaks...ewtopic&t=60979
It looks like leveraging low data frequencies, some result can be obtained.
I cannot understand the technical details, but someone agrees, some other not! :-)
Andrea

#25 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 05 April 2012 - 06:54 PM

...and I would add this document, too...
http://www.ti.com/li...441/slyt441.pdf
It looks interesting.
Andrea

#26 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 05 April 2012 - 09:06 PM

Thanks for the offer of a free dinner and well done on the research!

Threads will always have people that disagree. There are some basic recommendations in the thread you found:
  • use a slow clock speed, the SPI interface becomes more reliable when you slow down the clock,
  • use filters to try and remove high frequency noise,
  • use logic chips to clean up the signals before they go to the next device,
  • use cables that have shielding (a metal screen around the outside of the cable).
I think all of these things will help, but the railway may still have too much electrical noise for the system to work reliably.
If you have the time and some parts you might try it out with one or two shift registers to see if it can work on your railway. I'm sure there would be lots of interest in your results on the forum.

The Texas Instruments note goes into detail on what the problems are.
They end up suggesting using some transceiver chips (SN65C1167) that are used for RS422/RS485 interfaces. This will cost more to implement, but it will be more reliable and may make the system work.

Regards - Paul

#27 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 05 April 2012 - 09:41 PM

In fact I'm thinking to go down the data rate to minimum speeds... I don't think this can be a problem, with what I need... If this helps me a lot, do you think the solution can become feasible again? Yes, you are right... the only thing is to make some tests... Andrea

#28 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 09 April 2012 - 02:01 PM

...I'm still studying for the first problem of this thread, that, I recall, is about controlling some I/O devices (typically LEDS) from a distance of about 5-10 meters.
I still didn't try any of the solutions already kindly proposed (for example, direct SPI connection with a 74HC595): I made e new order of components, but they failed to arrive (it's Easter time! :-)).
So I went on looking at ways to solve *easily* the problem (SPI is not certain to function over a distance...).
Now I spot this component: http://www.nxp.com/d...eet/PCF8575.pdf
...that for a newbie like me looks like what I'm looking for! May I control this component (many of them) directly from a Netduino?
Thanks again to whoever will help me in choosing the solution.
Andrea

#29 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 09 April 2012 - 02:40 PM

Hi Andrea - Happy Easter,

That device looks very good - especially since it gives inputs and outputs. But, I don't think it will be any better than using SPI.

Finally, I do *NOT* suggest the I2C. That's because it's an (awesome) bus, but it's not targeted for long wiring, nor for "noisy" environments, such where are motors, AC, etc.


There is one small advantage with SPI, the signals in SPI are not bi-directional. This means it should be easier to add some logic gates or analogue electronics to boost the signals if necessary.

Don't eat too much chocolate - Paul

#30 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 09 April 2012 - 03:38 PM

As always, thank you, Paul! (but your advice on chocolate is a bit too late... You know, I live close to Perugia, that's a chocolate city!!! ;-))
Coming to the problem, yes, I read about not too long distances with I2C, but then I also read documents like this:
http://www.esacademy...ns/i2c-faq.html
or this:
http://ics.nxp.com/products/i2chubs/
where is explicitly said about hundreds of meters or even kilometers...
Do you think they are believable, or is there something hidden? :-)
Andrea

#31 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 09 April 2012 - 04:32 PM

I live in Reading, the famous home of the "Huntley and Palmer" biscuit factory. Luckily for me, it closed a long time ago.


Yes I think they are reliable.

The question is what will work on your railway.

The first one talks about reducing the clock speed to achieve very long distance communication (100m) - I assume this is with perfect conditions (no electrical noise).
It also talks about using better cable (twisted pair and/or shielding) to help stop noise causing bad signals.
I liked the "galvanic decoupling" circuit, I had not seen a circuit to do that before. It would be great to use this to drive a set of fibre-optic cables on the railway - expensive, but that would really be immune to electrical noise!

The second link has a list of the devices that are available (from NXP) that can be used to extend or clean up the I2C bus. It looks like they have thought of almost everything!

Again it looks like you will need to try it and see what you get. It should be really simple to slow down the clock*. If that works - great. If not try the better cable. If still not, maybe use some of the NXP devices.
It all comes down to how much time (and money) you are willing to spend experimenting.
* - check this is possible, I have not tried using I2C on the Netduino.

Note that you can only have 8 x PCF8575 on the same bus. So you will be limited to 8 x 16 input/output pins.

Regards - Paul

#32 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 09 April 2012 - 04:40 PM

Thanks for the offer of a free dinner and well done on the research!

Threads will always have people that disagree. There are some basic recommendations in the thread you found:

  • use a slow clock speed, the SPI interface becomes more reliable when you slow down the clock,
  • use filters to try and remove high frequency noise,
  • use logic chips to clean up the signals before they go to the next device,
  • use cables that have shielding (a metal screen around the outside of the cable).
I think all of these things will help, but the railway may still have too much electrical noise for the system to work reliably.
If you have the time and some parts you might try it out with one or two shift registers to see if it can work on your railway. I'm sure there would be lots of interest in your results on the forum.

The Texas Instruments note goes into detail on what the problems are.
They end up suggesting using some transceiver chips (SN65C1167) that are used for RS422/RS485 interfaces. This will cost more to implement, but it will be more reliable and may make the system work.

Regards - Paul


What about breaking the problem down into discreet components, all orchestrated by a master controller? This will require a little bit more on the cost side, but should allow for better expand-ability.

So the issue as I understand it is how to reliabely get a single over a longish distance? The a complete RF transceiver module with the NRF24L01+ chip can be had for $2.32 on eBay. Use that as the communication link between modules. And use a Netduino Mini at each point to do the comm and handle turning on the LEDs, etc.

Just a thought.

-dan

#33 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 09 April 2012 - 04:41 PM

It's always a pleasure, to hear from you, Paul! (do they sell Perugina's Baci - Kisses, in Reading? Ever tried one? :-)) I thought about fiber-optic cable, too, but never talked about it, because maybe it's a little bit James Bond-ish... :-) Yes, the only thing is trying, and it's because of this that I already had issued another order!!! :-) When I have everything, I will not have enough time to test everything! :-) Andrea P.S.: next in list would be the automation of the 'crib' in my church, for Christmas... (I don't know if 'crib' is the righe word, I found it with Google Translate)

#34 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 09 April 2012 - 05:04 PM

What about breaking the problem down into discreet components, all orchestrated by a master controller? This will require a little bit more on the cost side, but should allow for better expand-ability.

So the issue as I understand it is how to reliabely get a single over a longish distance? The a complete RF transceiver module with the NRF24L01+ chip can be had for $2.32 on eBay. Use that as the communication link between modules. And use a Netduino Mini at each point to do the comm and handle turning on the LEDs, etc.

Just a thought.

-dan

Hi Dan,

Its two problems in one - the distance (I think Andrea said its around 10m) and the noise caused by the trains on the railway.
I think the distance is not too much of a problem, others have used I2C to read temperature sensors at several meters OK.
The potential killer is the electrical noise causing false clock edges that appear on the serial lines causing bad data.

Mario felt that I2C would be unreliable, he is a good source of information for analogue electronics - I don't have any experience of using I2C in this sort of environment to be able to say yes or no.

I like the "NRF24L01+" RF transceiver idea, but it may also have issues with noise working in the electric railway environment.

(do they sell Perugina's Baci - Kisses, in Reading? Ever tried one? :-))

...

P.S.: next in list would be the automation of the 'crib' in my church, for Christmas... (I don't know if 'crib' is the righe word, I found it with Google Translate)


Hi Andrea,

No I have never had "Perugina's Baci - Kisses", I just Google'd them - they look good!

A "crib" is a bed for a baby.
Do you mean the nativity scene (small models of Jesus, Mary, Joseph, ...)? No trains there!

Paul

#35 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 09 April 2012 - 05:54 PM

No, no trains, but here in Italy we make them with real little rivers, moving puppets, dawn-sunset lights... and so on! :-) Ok, since I've said it, I'll have to arrange a box of Baci's for you! :-) Andrea

#36 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 09 April 2012 - 05:57 PM

...and for anyone interested in Netduino AND chocolate, here it goes...
http://www.baciperug...na_history.html
But don'ask for more boxes, I'll send one only to Paul! :-)
Andrea

#37 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 09 April 2012 - 06:21 PM

...and for anyone interested in Netduino AND chocolate, here it goes...
http://www.baciperug...na_history.html
But don'ask for more boxes, I'll send one only to Paul! :-)
Andrea


I can't accept any chocolate until the trains are working. B)

#38 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 19 April 2012 - 02:20 PM

Hi to all. I have all the pieces, now: italian mail system is not so fast, but at least I received everything, so I can start to make my tests (I have some test loco, rail exchange, power supply, courtesy of my friend, too...). The first test (Mario's suggestion) has been very fast: I tried a 9V DC battery trying to move the rail exchange, but I only hear a little click, and nothing moves. I tried every combination, but nothing. So it looks like I have to stick with AC: on the power supply, I see 16V, 8VA (so I suppose 0.5A :-)). With this low current, couldn't I use a 'normal' BC557 to act as a switch? Or the fact that it's AC blocks this possibility? I would like to get an advice, before burning something... :-) If not, what kind of relay do I have to look for? Thanks as always from a rainy Italy... Andrea

#39 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 19 April 2012 - 05:18 PM

Hi again,

Unfortunately the transistor will only pass DC, not AC.
Also 0.5A is a lot of current, so you if you can make it work on DC, you will probably need a high power transistor (maybe a darlington).
(That might be why the 9V battery did not make the points move - 9V batteries can't give out very much current.)

Paul

#40 Kermit

Kermit

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationCittà di Castello, Italy

Posted 20 April 2012 - 03:12 PM

Ok, I have still another order to do, for the relays! :-))) But, what's more interesting, today, is that I tried to use SPI on a long cable, so I create a test environment: My Netduino Plus, with two cables connected: one with two wires for +3.3VDC and Ground, and the other for the SPI signals (three wires used out of four). The cable was 5 meters long (16 feet?): I cheated a little bit, because I didn't have two different cables at hand, so I kept Netduino and breadbord very close each other, and used a normal short cable for +3.3 and ground, BUT I used the 5-meters long cable for the SPI. I started with a very conservative 1Khz setup (only because I couldn't make still less! :-)), and I found the signals went up and down without a single problem (leds attached, with fixed on/off time length). Then I went up until I saw that even at 1Mhz, the behaviour was still perfect, at least for what I could see personally on the leds (that's what's important to me). I don't know if at low level there are any problems, in syncing or what, and I know (thanks to Mario) that the main problem is not the frequency, but the wave shape: still, I'm very happy for the result, just for my start in this new (for me) field. Is there anyone that can tell me if I'm oversimplifying the problem? I know that I'll have to use it in a 'noisy' environment, but it looks like the start is encouraging! By the way, the cable I used for the SPI is a shielded telephone cable, with the mark on it: 'SYT PLUS 1 NUM 2X2XAWG24 A10-41/04', if someone knows what it can mean. I can only understand that they are 4 wires (NOT twisted, moreover) of type AWG24, plus another one, without any plastic around it. As always, I would like some comment from who knows way much more than me... :-) Andrea




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.