Freerails Home 
Home Search search Menu menu Not logged in - Login | Register
Freerails > Model Railroad Forums > R.C. The Future Now If You Desire > 'Arduino' Based R.C. For Locos & Layouts

Freerails IS ACCEPTING new Members ... To join Freerails ... See how to Register as a Member in the 'Joining Freerails' Forum

'Arduino' Based R.C. For Locos & Layouts
 Moderated by: . Page:  First Page Previous Page  1  2   
New Topic Reply Printer Friendly
 Rating:  Rating
AuthorPost
 Posted: Fri Dec 27th, 2019 10:42 pm
  PMQuoteReply
11th Post
John Boshier
Registered


Joined: Tue Nov 26th, 2019
Location: United Kingdom
Posts: 23
Status: 
Offline

bobquincy wrote:
DRV8835 and 8838 will work down to 0 V (motor supply),
although they need 1.8 V logic supply.

I have used analog servo boards as ESCs,
they work ok although the deadband is sometimes too narrow to get the motor to stop

A dedicated microcontroller may be the way to go for low cost and small size.
Maybe you can even get by with an 8 pin chip.


Thanks Bob.

I didn't know about the DRV8838, which is single motor,
so much smaller, and may be ideal.

They only seem to be produced by Pololu,
so not so easy to find with cheap postage I think,
making them relatively expensive.

I've got a couple of Pololu DRV8833, that go down to 2.7v,
but I hadn't realised that, and they're smaller than the TB6612FNG!
This is so complicated, and my brain gets easily confused!
I'll have to do more research.

I'll try the servo board next, as they are very cheap, and I'm curious,
but I'll watch out for your warning.
The fixed Rx for layouts currently detaches point servos when they're not operating,
although I haven't got any connected up and working yet,
so can't be sure they will hold their position.
I think I'd do the same when using it as an ESC, so stop should be a real stop!

I think an ATtiny of some sort should do what I need, and be small enough.
I chose the ATtiny84 to try first as it seems to be a reasonable combination of size and available pins.
Having enough memory is a consideration too.
I've got some ATtiny85 development boards to try as well,
but the nRF24L01 uses 5 pins normally, not leaving enough for an H-bridge driver.
It can be made to work with 3 pins though, which would leave enough for an ESC.




____________________
John
Back To Top

 Posted: Sat Dec 28th, 2019 01:28 am
  PMQuoteReply
12th Post
bobquincy
Registered


Joined: Sun Jan 27th, 2013
Location: Florida USA
Posts: 303
Status: 
Offline
Hi John,

I am hoping to try the nRF24L01,
in place of my usual (very limited 4 function) infrared controller.

Onboard the train (monorail) I use a PIC 12F1572 for control,
it generates PWM which I port to a DRV8838 to run the motor.

I have used Deltang Rx and Tx,
but like you I would like to be able to have only what I need in the system.

DigiKey also sells some Pololu parts,
but I don't know if their shipping cost is any better.

boB




____________________
Monorail modelers have a one track mind.
Back To Top

 Posted: Sat Dec 28th, 2019 11:07 am
  PMQuoteReply
13th Post
John Boshier
Registered


Joined: Tue Nov 26th, 2019
Location: United Kingdom
Posts: 23
Status: 
Offline
I've also considered infrared. With my system it would be straightforward to use a mixture of technologies, so it has the potential to use whatever is most suitable for a particular job. Being new to electronics I want to stick with Arduinos, as they have been designed to make it as easy as possible to use microcontrollers, but the potential is still there to do the more advanced stuff, which I'm just starting to do, but still with most of the benefits of being an easy to use system.

If I look at any other technology I think it will be Raspberry Pi, as that can do things microcontrollers can't. I could, for example use a Pi to drive a full size computer screen as an information display, or build a fully computer controlled control panel, with lots of automation. They work with nRF24L01s, and apparently Python will handle the C structure that I use for transmitting data. Obviously no use in locos, unless I venture into garden scales, but fine for anything fixed to a layout. I may buy a couple of Pi Zeros one day to see what I can do, as they're a similar price to Arduinos. But it won't be yet, as I still haven't got into using the Pi 4 I bought a few months ago!



____________________
John
Back To Top

 Posted: Sat Dec 28th, 2019 05:42 pm
  PMQuoteReply
14th Post
Tom Ward
Registered
 

Joined: Tue Nov 14th, 2017
Location: Florida USA
Posts: 673
Status: 
Offline
John - This is a very cool thread. 

Thanks very much for sharing what you've been doing. 

I started out with Arduino for my On30 layout,
and have been using it for sound and animation. 

I had intended to use the DCC++ sketch to run the layout,
but ended up going with S-Cab. 

I'll be watching this with great interest.




____________________
Tom Ward


"When I die I want to go quietly in my sleep like my grandfather. Not screaming in terror like his passengers."
Back To Top

 Posted: Sun Dec 29th, 2019 01:27 am
  PMQuoteReply
15th Post
bobquincy
Registered


Joined: Sun Jan 27th, 2013
Location: Florida USA
Posts: 303
Status: 
Offline
 
I found a PIC 8 bit chip that supports SPI to use nRF24L01.

It is a large price increase from the ones I use, $0.68 to $0.97,
but I am going to order a few anyway.

;)

boB




____________________
Monorail modelers have a one track mind.
Back To Top

 Posted: Sun Dec 29th, 2019 10:36 am
  PMQuoteReply
16th Post
John Boshier
Registered


Joined: Tue Nov 26th, 2019
Location: United Kingdom
Posts: 23
Status: 
Offline
bobquincy wrote:  
I found a PIC 8 bit chip that supports SPI to use nRF24L01.

It is a large price increase from the ones I use, $0.68 to $0.97,
but I am going to order a few anyway.


Don't encourage me to get more toys to play with.

I've already got more than enough.  L:.




____________________
John
Back To Top

 Posted: Tue Dec 31st, 2019 02:18 pm
  PMQuoteReply
17th Post
bobquincy
Registered


Joined: Sun Jan 27th, 2013
Location: Florida USA
Posts: 303
Status: 
Offline
John Boshier wrote:
I've also considered infrared.


Since one of the models I modify is IR control,
I have some experience with IR systems. 

It is not a bad way to go for indoors,
and there are plenty of resources for common protocols.

The one I work on is a proprietary protocol,
but it was easy enough to decode, since it only has four functions
(but has enough data bits for 5 or 6).

As usual, I use a PIC to generate the 38 KHz pulsed IR signal.

boB




____________________
Monorail modelers have a one track mind.
Back To Top

 Posted: Tue Dec 31st, 2019 02:47 pm
  PMQuoteReply
18th Post
John Boshier
Registered


Joined: Tue Nov 26th, 2019
Location: United Kingdom
Posts: 23
Status: 
Offline
bobquincy wrote
Since one of the models I modify is IR control,
I have some experience with IR systems.

It is not a bad way to go for indoors,
and there are plenty of resources for common protocols.


I could add an IR LED to my Tx, and use it to send the same data as the radio. So potentially I could mix radio and IR on the same layout if I wanted. An IR sensor is much smaller than any radio receiver I could build, certainly smaller than an nRF24L01 board. The advantage of radio is not needing a line of sight to the receiver, so I don't need to worry about pointing it in the right direction. I think IR just limits placing obstructions in front of the track, and especially prevents hiding fiddle/staging yards.

Model railways don't need a lot of high speed data to operate. Everything is so leisurely compared to what the technology is capable of, that occasionally missing a signal doesn't matter, as long as sensible precautions are taken to avoid potential disasters. Someone on another forum suggested making the loco Rx stop the loco if it didn't receive a signal for a specified time, which makes sense. I had a few runaways when testing, although not caused by a lost signal, so know what can happen. My dog knows too, as the railcar landed on her when it ran off the end of the layout!! But this applies to radio and IR.

Another idea for IR I've had is replacing layout wiring. I'm using radio for point motors, and any other fixed devices on the layout to reduce wiring, but I think it could also be done with IR, maybe directed in tubing to avoid interference. Having almost complete control of the technology, rather than using commercial systems, makes what I'm doing very flexible.




____________________
John
Back To Top

 Posted: Fri Jan 24th, 2020 10:37 am
  PMQuoteReply
19th Post
John Boshier
Registered


Joined: Tue Nov 26th, 2019
Location: United Kingdom
Posts: 23
Status: 
Offline
 
Another Mk1 Rx is gradually appearing.

This one is going in an O-16.5 steam tram loco for my Wantish layout
(inspired by the terminus of the Wantage Tramway in England,
but a different gauge, and set in a parallel universe!).

The chassis is a Piko myTrain rubber band driven one,
and the body a knocked about Gnomy tram.

Apart from a few changes of Arduino pin for the motor driver,
it will be the same as the one in the railcar,
but laid out differently to suit the location.

I want to add headlights to this one,
so needed to free up another PWM pin.

I've hot glued the battery holders to either side of the motor.
It will use 10440 Li-ion batteries as before.





Here's the Gnomy tram before the vandalism started!







____________________
John
Back To Top


 Current time is 11:53 am
Page:  First Page Previous Page  1  2   

Freerails > Model Railroad Forums > R.C. The Future Now If You Desire > 'Arduino' Based R.C. For Locos & Layouts
Top



UltraBB 1.172 Copyright © 2007-2016 Data 1 Systems