Large Scale Central

Train Control by Xbee, Pololu, and Battery. Phase 1: Motor Cont

As mentioned elsewhere, I have resolved to start my garden RR with a battery system. Because I have more time than sense (and who among us does not), I plan to control the train with a system of my own design. The architecture is as follows: Bachmann Big Hauler, driven by NiCad battery. Motor speed by Pololu speed controller Speed controller managed by Xbee wireless link Xbee will be controlled by either an arduino in a dedicated device, or a pc or browser thing. We shall see. For today, step 1. I opened up the Loco, cut a coupla wires (feeding the smoke unit and holding the boiler to the chassis anyway), and connected them to the speed controller. The controller can be driven by PWM, USB, an analog signal, or Serial. For the test, we use USB and a 12V Bench Power supply. Success! Using the supplied program, I was immediately able to control speed very finely (3200 steps), as well as program in a really cool acceleration rate that should look good. Woo hoo! As a bonus, the controller looks like it’d fit perfectly in the front part of the boiler. Next step: Control it with serial commands like the xbee will use.

Very interested to see your progress.
So maybe you can you a smartphone browser to control the train?

Alec

I’m sure that is possible. One step at a time, of course.

In fact, the next step is not the XBEE step, but the “wire the chassis correctly” step. Yeah, that’s the ticket!

Battery Pack arrived today. Installed it in the chassis. Good news! It fits between the two bosses that had held the iron weight perfectly. I went for NiMH since, after all, weight is no issue. Supposedly a 14.4 volt pack for a Roomba, it shows 16 volts when resting. I have it on the charger now, waiting for the red light to go out. In other wiring news, I have clipped the leads to the front truck and was about to clip the leads to the axle pickup when I started to wonder about chuff sounds. So that one will wait a moment. Anybody know the wiring on these? In the plan-ahead stage, the Pololu speed controller has a provision for a forward and a reverse limit switch, as well as a kill switch. I have a mercury switch coming for the kill switch, in case of overrturn. Thinking of hall effect device for forward limit switch and magnets at things like bumpers and bridges that are out, or up, or something. Here’s a picture of the battery block strapped on place with some heavy copper wire.

(http://freightsheds.largescalecentral.com/users/cayenne/_forumfiles/xbeerail2.jpg)

Michael,
I think you’ll be real happy with the “Roomba” battery.
I have one in my Annie. I’ve run it for 6 hours one day, and then run it several more hours the next day without recharging.
No sound, but I do have steep grades to pull.
I mounted mine in the tender. I have another Annie and battery pack that I plan to mount as you have.
Ralph

Yeah, it was sort of a “what’s cheap and easy to understand” choice. And last night I remembered. There are two dead roombas at mom’s place, and I am clearing it out this month. Hmmm.
Of course, they may be “all the way dead” rather than just “a little bit dead”. Apparently, she was storing them in an unused bathtub, and the cat… well, you get the rest.

But it’s worth checking. Also, just found a wiring diagram on the bachmann site. It’s for a later version, but it provides some good hints. http://www.bachmanntrains.com/home-usa/dwg/dwgs/81099.pdf

Nice to see someone else that spends money at Pololu. Be curious to see how this pans out for you.

Pololu just had a sale over Thanksgiving. I bought 3 of these for ~$17: http://www.pololu.com/catalog/product/1451

I’m replacing the original ones that only went to 19 volts: http://www.pololu.com/catalog/product/706

With the RC receiver I built I’ve been able to read BEMF and get really slow speed performance.

I’ll enjoy reading about your progress! Very fun stuff!

Yeah, I ordered my controllers on sale too. $20 each. Got two, so I have another loco coming. The slow speed feature (assuming high torque) will provide for some nice performance. What are you using for the RC link?

I made my own radio control system using 434 MHz radios. Each transmitter can control 32 locos and 99 track accessories. Trying to cram all the functionality into the 2K of code space on the receiver was the real fun! Here is a link to my build log: http://www.kronosrobotics.com/forums/viewtopic.php?t=894

Wow. That looks like a well-thought-through setup. I’m going with Xbee mainly because I want to learn Xbee and I want to use some of its extra pins. Early in your log, you talk about collision avoidance. Have you implemented that?

Thanks. I was going to go with a Xbee/Zigbee setup at one time. I even did a little work using the TI MSP430 line with their radios and SimpliciTI stack. The Xbee controllers have processing power on them that you could use for quite a few things. When I started the stuff was a little too pricy, it has come down quite a bit now.

I never implemented collision avoidance. I focused on the low speed operation and refining the user interface. I may eventually make something but it always seemed like a solution looking for a problem. I do know a few who have a collision problem! :slight_smile:

Update: As I am new to XBEE, I have yet to get that part working. However, last night, I uploaded the Arduino sketch for controlling the Pololu controller and, by Jove, it worked, with the train merrily running backwards and forward in one-second intervals. (http://www.pololu.com/docs/0J44/6.7.1)

So, we have external, programmable control of the train. Next step… WIRELESS!

Sweet! Makes you feel good to get things physically moving on the rails!!!

Yeah, and I finally actually got some rail! Cheap plastic, but it’s something to keep the wheels on!