Jump to content
 

Budget Battery Powered 00 Gauge Loco


Robin2
 Share

Recommended Posts

 

Hows the motor temperature with the higher frequency PWM?

I have no idea. I have only run it for a few seconds at a time. The current draw from the 1S LiPo is about 20 to 30mA so there are not many watts floating about.

 

...R

Link to post
Share on other sites

Hooray. (referring back to Replies #14 and #29)  I now have my loco working nice and slowly with the small N20 motor.

 

What had been preventing slow running was the 0.1µF suppression capacitors that I had connected to the motor terminals. In earlier trials they had appeared essential to prevent interference with the motor speed detection. I'm guessing that the capacitors were damping the effect of the PWM and this was even more pronounced when I increased the PWM frequency.

 

...R

Hi Robin

 

Glad to hear you got it sorted.

 

0.1 microfarad sounds a bit high for suppression capacitors. They are usually 1-10 nF. 0.1 microfarad is 100ohm at 16kHz, the sort of PWM frequency suggested for coreless motors. This is a bit on the low side and could affect the performance.

 

The usual advice is to remove the suppression caps when fitting radio control.

 

Frank

Link to post
Share on other sites

  • 2 weeks later...

I've just had another read through Robin's first few posts, and it all makes a lot of sense now! First time round it was almost incomprehensible gobbledegook, then a bit clearer than mud, and now I fully understand it (I think!) :).

 

Now I know how to program ATTiny chips (in theory, according to YouTube!), OO gauge RC is seriously on my to-do list, as I can't be bothered to wire the layout! Playing with Arduinos is more fun, and I can build the systems on my workbench in comfort, rather than doing it all on the layout. As I'm so far behind with my layout building plans, I think I'm going to build a quick and cheap combined O and O-16.5 layout, and as the O is planned to be BPRC anyway, I'll have a go at the O-16.5 too. Then I can work down to the similar sized or slightly smaller OO stuff. The O-16.5 will be very freelance, so I can build locos to fit the Rx if necessary! The OO will be RTR tank locos, either as they come, or with a major chassis rebuild.

 

I've got almost everything I need to start experimenting. Just waiting for another breadboard and a couple of breadboard power supplies to arrive, to make it easier. The first stage will be wireless remote control for one of my DC EM gauge layouts, so everything can be big, as it will be fixed to the layout, with the motor driver connected to the track. I can use an Uno and one of the big L298N boards with a heatsink with the Rx. I don't know about the handheld control panel yet though. The system will need to control a few point servos too, and relays for a couple of track sections. The Tx will be a good first step to the handheld control panel I want for the fully RC 7mm layout.

Link to post
Share on other sites

I have my loco running sufficiently well and the construction of the chassis and body sufficiently figured out that I have put all that to one side while I try to design a layout to run it on. I am limited to a space of about 155 x 34 x 15.5 cm (L x W x H). I also suffer terribly from indecision.

 

...R

  • Like 1
Link to post
Share on other sites

Robin, you said earlier about sharing the code when it was sufficiently advanced. Are you at that stage yet? I'm interested to see how you've done it, as the examples I've found online for the nRF24L01 are either just for demonstration purposes, or for non railway use. From what I can see, all that needs to be sent is a code to identify the function, and the required setting, needing just a few bytes when something changes. Is that all there is to it?

 

I think all the hardware now makes sense, and I just need to start putting it together, and gradually shrinking it, so I didn't need the blow by blow instructions I thought I'd need at the beginning :).

Link to post
Share on other sites

I have no objection to sharing but my program depends on having an optical detector to figure out the speed of the motor (and count the revolutions). And what my hand-set (or PC) sends to the loco is the required number of microseconds per revolution. The program in the loco then adjusts the power (the PWM value) to achieve the desired speed. It automatically maintains the same speed regardless of load (within reasonable limits). I am also hoping to be able to tell it to move N revolutions for precise positioning - but I have only done some very basic testing on that so far.

 

If you don't have that sort of motor speed detection then the program will not be much use to you.

 

On the other hand, if you just want to control the loco in the traditional way where the potentiometer of the hand-set is used to adjust the PWM value the code in my Arduino Forum tutorial has all that is needed to send and receive the value from analogRead(). The program in the loco can then adjust the PWM value in line with the received value from analogRead() just as if it was directly connected to the potentiometer.

 

I suggest you start with an Arduino that uses an Atmega328 chip (Uno, or Nano) or an Atmega328 on a PCB as that avoids some of the complexities of working with the Attinys.

 

...R

Edited by Robin2
Link to post
Share on other sites

Thanks Robin, I'd like to see your code. I've just been looking at what can be done with the optical detectors, and will be ordering some. I'd like the loco to stop itself before crashing into the end of the fiddle yard, and as the QRE1113s are used in line following robots, I thought one on the bottom of the loco might read markings on the fiddle yard, and put the brakes on at the right point. They may have other uses for automation too. I may well use them to detect motor speed as well!

 

I'll start off with simple code, but would like to gradually move up to something more sophisticated, so I'm interested to see what you've done. That's one of the things I like about using Arduinos, as it's straightforward to start simple, and add extra features later, as much of it is in software. It doesn't involve a major rebuilt of the control panel, or rewiring of the layout!

 

I'll be using Unos for my first trials, and I've got some Pro Minis to use for the next stage. I'll look at using just the chips when the pro Minis won't fit in the space available, but that will be later.

Link to post
Share on other sites

I discovered I can't upload ZIP files to this Forum so I have put it on Google Drive

 

I hope you can get it with this link

 

This is the latest code that I have on my Loco. I think the code in HandMaster.ino is what is on the hand-controller I am using for tests / demos. I have not used the LocoMaster.ino code recently. It takes data from my PC and sends it to the Locos.

 

...R

Link to post
Share on other sites

Thanks for the files Robin. I've downloaded them but not had a look yet. I'm still trying to get organised just to get to the stage where I can send a "Hello World" message!

 

A couple of quick, I hope, questions.

 

1) Have you looked at any other nRF24L01 boards, apart from the one that almost everyone sells? I found these that don't have the pins soldered on, so could take up less space.

 

2) I'm looking at building an O-16.5 loco on a Hornby 0-6-0 chassis. It looks as though there could be room for a Pro Mini, nRF24L01 and motor driver, with the first two boards either side of the motor. Do you think being that close to the motor would be a problem? I've got a 3 volt motor about the same size as the Hornby one that I might try in it. I don't know if there are suitable sized batteries to fit the remaining space, so will have to do some research.

Link to post
Share on other sites

I have not seen those nRF24 boards before. Do you get a good datasheet with them?

 

I think the only way to investigate interference is by trial and error. I like to keep the antenna clear of other metal.

 

I got my LiPos from HobbyKing. They have a good range of sizes and shapes.

 

...R

Link to post
Share on other sites

I've yet to buy anything that comes with a data sheet! I assumed they will work the same as the other boards. I think I may try an alternative plan for my first loco, that should give me more space, and keep the electronics well away from the motor. I'd rather try an O-16.5 loco first, as I'm reluctant to mess around with my O gauge ones until I'm more confident.

 

I hadn't looked at HobbyKing. There's a lot of choice, which is good in one way, but not so good when it involves deciding on size and capacity, and is hampered by my expertise at indecision :).

Link to post
Share on other sites

I assumed they will work the same as the other boards.

They may. But the pinouts are different from the nRf24L01+ modules I am familiar with so you will at least need a reliable guide for them from the nRf24L01+ modules I am familiar with. Wireless is great when it works, But when it doesn't it can be a devil to debug. Those things are cheap so they are certainly worth trying.

 

...R

Edit to correct some unfortunate mix-up in an earlier edit - apologies for any confusion

Edited by Robin2
Link to post
Share on other sites

They may. But the pinouts are different so you will at least need a reliable guide for them from the nRf24L01+ modules I am familiar with. Wireless is great when it works, But when it doesn't it can be a devil to debug. Those things are cheap so they are certainly worth trying.

 

...R

I suppose it's also practical to shorten the pins on the ones we've got, to save a bit of space, just leaving enough to solder to. Anyway, I've ordered two from China for £1.74.

 

I've got to stop spending money on electronics stuff, or at least keep the cost right down. Each order may be cheap, but it's totalling up to quite a bit now, and I haven't used much of it yet. As well as buying specific bits I need, I'm stocking up on the basics like resistors, LEDs, switches etc. at the moment, so I don't keep getting delays when I need parts.

Link to post
Share on other sites

  • 2 weeks later...

The post from China seems to have speeded up, as the mini nRF24L01s arrived today. Here's a comparison with the big ones. I haven't tried them, but the size difference, and lack of fitted pins, certainly makes a significant difference

 

post-7091-0-31975400-1497088896.jpg

 

 

Link to post
Share on other sites

And if you can saw the PCB antenna off the small board and replace it with a piece of wire ....

 

But there seems to be a connection to the left of the antenna - do you know what that is for?

 

...R

Link to post
Share on other sites

This is all I know about connections, pinched from the eBay seller I bought it from. Just to add confusion, the photo is reversed, but the diagram isn't! There doesn't seem to be anything connected to the connection to the left of the antenna.

 

post-7091-0-64992800-1497124276.jpg

Link to post
Share on other sites

This is all the other information provided by the seller:

 

NRF24L01 + wireless module
2Mbit / s 1Mbit / s 250Kbit / s transfer rate options
MultiCeiver hardware to provide the 6 receiver functions at the same time
+ / - 60 ppm crystal
Only need an external inductance when match antenna
No multi-layer PCB
5V input tolerance level
No need external level converter
Improved ShockBurst and serial interface can be easily connected with a variety of low-cost MCU
No MCU with SPI Interface
20 pin 4x4mm QFN leadless package very few external components
The 2Mbit / s rate when the peak current 12.5mA received
The 2Mbit / s rate @ 0dBm output current of 11mA peak
2Mbit / s rate of only a small average current
400nA Power-down mode, power consumption
Power consumption of 32uA in standby mode
130us fast switching and wake-up time
With on-chip voltage regulator oltage regulators
In the 1.9 to 3.6V low voltage operation
Possible to reduce noise

 

http://www.ebay.co.uk/itm/272370400466

Link to post
Share on other sites

Interestingly the photo in Reply #64, the photo in Reply #66 and the dimensioned drawing in Reply #66 are all different from each other (even after allowing for the fact that the photo in Reply #66 is a mirror-image).

 

But I am not for a moment suggesting that the little beast won't work.

 

...R

Edited by Robin2
Link to post
Share on other sites

Interestingly the photo in Reply #64, the photo in Reply #66 and the dimensioned drawing in Reply #66 are all different from each other (even after allowing for the fact that the photo in Reply #66 is a mirror-image).

 

But I am not for a moment suggesting that the little beast won't work.

 

...R

I had noticed! I'll find out if they work some time.

 

Anyway, I think I've found a nice little 4mm RTR loco conversion project to get me started, and a big nRF240L01 and a Pro Mini should fit inside. Just need to find a 6 volt or less motor with a fairly long shaft. It's EM gauge, so doesn't quite match the title of this topic, but the gauge has no bearing on the conversion, that could still be done to the original OO model. I don't want to touch my O gauge locos, until I know what I'm doing!

Link to post
Share on other sites

 Just need to find a 6 volt or less motor with a fairly long shaft.

Do tell if you find anything - none of my searches has been effective.

 

The motors I am using (which come from cheap servos) have very short shafts so I have had to extend them with a piece of brass rod drilled on my lathe to be a push fit on the motor shaft.

 

...R

Link to post
Share on other sites

I've just measured the existing motor shaft, and it's 2.3mm, which is rather annoying. Maybe new gears will be needed too. I've got a lathe, but haven't got it set up, so would like to avoid messing around with extending shafts, and opening up the holes in gears etc for now, if possible. Moving the motor forward is tempting, but it means cutting away part of the chassis casting that will weaken it.

 

The loco is an Airfix 61xx 2-6-2T. The Rx and motor driver fit in the bunker, the Pro Mini in the cab (with a shorter motor), and I've ordered a 180mAh round battery that should fit in the boiler/smokebox. I'm not sure how long the battery will last, but it's a bit bigger than yours, and the loco will only put in a couple of appearances during an operating session, with a passenger train that arrives, runs round and leaves, so it should be OK.

Link to post
Share on other sites

Do tell if you find anything - none of my searches has been effective.

 

The motors I am using (which come from cheap servos) have very short shafts so I have had to extend them with a piece of brass rod drilled on my lathe to be a push fit on the motor shaft.

 

...R

How about this? Double ended, with 17.5mm shaft one end, and an encoder for measuring the speed at the other. Only 2300 RPM at 3.7v though.

http://www.ebay.co.uk/itm/2PCS-Mini-130-Motor-Long-Axis-Carbon-Brush-Micro-Motor-Speed-Encoder-DC-3V-6V-/282258732803

http://www.ebay.co.uk/itm/2PCS-DC-3V-6V-Mini-130-Motor-Long-Axis-Carbon-Brush-Motor-Speed-Encoder-For-DIY/252501140617

Link to post
Share on other sites

I have some single-ended 130 size motors but they are too big for my 00 Gauge locos. The low voltage versions I have are much faster than 2300RPM with 3.7v - I can't remember but something like 12000 I think.

 

If those are low current motors they are unlikely to have much torque at 3.7v. If they are high current motors I would expect a much higher speed.

 

...R

Link to post
Share on other sites

If you have to extend the motor shaft, you can do this with a piece of brass tube with a suitable internal diameter - if of course you can find a suitable size.

 

You can use it to step from one size shaft to another as well.

 

Or you can just use it as a short collar to connect the motor shaft to an extension piece the same diameter.

 

Not all brass tube is the same, though, some makes are straighter than others - although this may not matter too much if using as a collar or if the extension is not very long.

 

You can fix it on with Loctite or similar - I use the non-permanent variety which works fine but can be removed if necessary.

 

Frank

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...