MY NEW LAYOUT ARDUINO CONTROLLED

Post pictures and information about your own personal model railway layout that is under construction. Keep members up-to-date with what you are doing and discuss problems that you are having.
timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Sat Apr 28, 2018 9:45 am

Well I have to agree roll your own is the best option, as you design and build it to suit the circumstances that are present in the job you wish to achieve.
Today I breadboarded the new cut down block detection no going to worry about the low current end, Just worry about the Loco. As the previous design I can detect a stationary loco by applying a very narrow pulses to the track, as PWM gives full voltage and full current it is easy to pick up a loco.You just need to stretch the the detected pulse to ensure it is real positive and not just noise, a bit of filtering.

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Mon Apr 30, 2018 4:17 am

Why is it the most obvious solution is the hardest to see.Like they say can't see the forest for the trees.
Spent most of the weekend designing a complete new block control module that has the throttle and block detection on one PCB nearly got it finished, just need to move a few components around to get it to fit on the board. Then this morning while having my third cup of tea the penny dropped :oops: :x.

If you are loosing 5 volts across the L298n why not just lift the input voltage up by 5 volts. grabbed the variable power supply set it at about 20 volts dropped the throttle setting from 50% down to about 30% and it runs about the same speed. :oops:

Placed Mallard on the track and it runs beautifully at 50% throttle with 2 carriages, would not even move on the lower voltage.
So back to programming, and I can stop hitting myself on the head with the cricket bat

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Mon Apr 30, 2018 9:48 am

Hi All
Added a boring Video to YouTube of the panel with the train actually moving and changing the block numbers no talkies as I currently have no teeth :) without the teeth
https://youtu.be/qZnsDUmpP3I

User avatar
TimberSurf
Posts: 2019
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby TimberSurf » Mon Apr 30, 2018 1:01 pm

I didn't want to see your ugly mug anyway! lol. Just the train going round!
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Mon Apr 30, 2018 1:56 pm

TimberSurf wrote:I didn't want to see your ugly mug anyway! lol. Just the train going round!

It's good to know I have sincere friends :wink:

User avatar
Mountain
Posts: 2355
Joined: Mon Oct 24, 2016 3:43 pm
Location: Somewhere in Wales, UK.

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby Mountain » Mon Apr 30, 2018 4:48 pm

Ooh. Timer surf and Timbologist... Two different people. Thought it was all one person... :lol: Thought it was confusing!

User avatar
TimberSurf
Posts: 2019
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby TimberSurf » Mon Apr 30, 2018 7:18 pm

Yes Mountain, I frequently talk to myself don't we?

I am not sure?


Who are you?


Who are these men in my house with white coats?
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Tue May 01, 2018 1:24 am

Yes Mountain the only way I have a conversation at the same level is to talk to my alto ego :)

It's going to be one of those days.
The voices in my head are fighting.
My imaginary friend is running with scissors,
and at one point one of my personalities wandered off.

My favourite song is the lunatics have taken over the asylum :wink:

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Thu May 03, 2018 9:37 am

Today have been working on the hand controller, hoping to connect it to the master Arduino using Bluetooth for the comms but will still have to have it plugged in for power, or might try direct Ethernet connection or may try true RS232. All depends what works best on the day.

User avatar
TimberSurf
Posts: 2019
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby TimberSurf » Thu May 03, 2018 12:43 pm

I was just looking at NRF24L01 for SPI!
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Fri May 04, 2018 7:02 am

TimberSurf wrote:I was just looking at NRF24L01 for SPI!


That is not a bad idea using that set-up, pretty quick compared to Bluetooth which is limited to about 9600 baud and is attached to the serial port.
Today went back to investigate my original plans of using the CAN-BUS to connect everything together instead of the serial port set-up I have working at the moment. Ran out of serial ports on the master Arduino to add the hand controller.

I purchased all the CAN-BUS bits a couple of years ago when in the planning stage, got lost in the bit bucket, bad habit of not writing things down, so always have to start from scratch as I can't remember what my previous thoughts were.

Will order some of those NRF24L01 never order 1 as it will be faulty and when you order to many you never will need them :wink:

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Sun May 06, 2018 11:27 am

Well this Can-Bus stuff is easier than I thought it was going to be, and it is very fast. At the moment have the hand controller having a conversation with the master Arduino. And one of the pluses for me is that the data is easier to send and receive in hex format so I can get more information in a single byte.
So this makes it even quicker to send and receive data.
The hand controller is set up to send the button presses and the rotary encoder information to the master, then the master sends the data received back to the hand controller . Where the hand controller acknowledges the data then updates the 20 x 4 LCD, a bit of error checking.
The hand controller won't let you apply power without releasing the brake and setting either forward or reverse. It also won't allow you to change direction until you are stopped, much like the prototype ( no Ronny roll-backs or Clive click-backs allowed :wink: )
So during the week I will be able to actually control a train properly, without having to type at the keyboard :D

User avatar
TimberSurf
Posts: 2019
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby TimberSurf » Sun May 06, 2018 12:26 pm

Could you share some snippets of CANbus code so I can see how easy it is?
I still have not got my head around how two Arduino's "share" data!
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!

timbologist
Posts: 362
Joined: Wed Sep 18, 2013 6:39 am
Location: Hazeldene Victoria Australia ( in the bush )

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby timbologist » Sun May 06, 2018 1:02 pm

This is a pretty straight forward explanation and example on the Can-Bus and the Arduino, this is one of the simplest I have seen. Uses SPI so pretty quick, and the Can-Bus is probably the most robust way to connect the Arduinos together. As Bufferstop pointed out in your thread it is used in most modern cars.
http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-can-bus-module-1st-network-tutorial/

With the Can-Bus all devices read the data that is sent, you just filter out which data who needs to act on. An example is in the testing phase I can send one message out from the master and depending on my data structure one message can be acted on by all 3 module controllers at the same time. or the data might tell only one to act on the data.

I a car the instrument cluster could send out a message to flash right indicator so the front and rear modules will act on that data. Whereas pushing brake pedal will only be acted on by the rear module.

User avatar
TimberSurf
Posts: 2019
Joined: Wed Jan 08, 2014 5:47 pm
Location: N.Wales
Contact:

Re: MY NEW LAYOUT ARDUINO CONTROLLED

Postby TimberSurf » Sun May 06, 2018 4:17 pm

I immediately see that CANbus takes up 4 I/O which is double the headroom of SPI!
I am sure it is very robust. Still not convinced it is a better option for me, than the RF cards.
Once you get the buffer data, can you then store it by converting to a known set of named variables (VAT)?
Image
Lumsdonia <--- Hit link to go to my website for full story and wiring advice!


Return to “Personal Layouts - Under Construction”

Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests