Battery Pack all finished and mounted. Plenty of room. I’ve decided to go ahead and wire up everything since I have the thing torn apart like this. I’ll be adding a Wixel that will be able to share control with the 2.4Ghz radio via a Pololu R/C multiplexor. I’m also planning on adding a set of Kadee Couplers controlled by a microservo. The final touch will be a Sparkfun ID-20 RFID reader which will interface with the onboard Wixel. By placing tags around the layout, this will let the locomotive know where he is in real-time.
Sound card is working, now have sounds playing via radio control but I need to revise the clips and control algorithms. The amplifier/mixer is also still in the construction phase, these boards do drive a headset quite well, but don’t have the power to drive the speaker in the locomotive. Plus, just wiring the output of the two boards together works ok for debugging purposes but you get a drop in db when both are playing so that needs to be evened out. Nevertheless, the sound is quite good, I’ve been running it through my sound system here and it has the dog looking around for the train when I trigger the airhorns 🙂
I’ve been working on a home-made set of widgets to convert this locomotive to R/C and battery power. It’s a chance to do some circuit design, soldering and a bit of embedded software engineering for fun. The idea is to completely replace the insides of the locomotive with inexpensive, off the shelf components. I will use those to drive the main motive power- a 15v 3500mah Nimh battery array, and tap off that to provide stereo sound and lighting control.
While the motor controller was easy- I’m using the Pololu 18v7, the sound and R/C switches for the lights and the reversing power relay was where the fun was so I designed my own board. It uses an Atmel Attiny84 microprocessor, two mp3 player cards, a 3A power relay and two power mosfets.
Anyhow, the innards of the Aristocraft RS3 were not impressive. Complicated rats nest if you ask me. I have no interest in track power nor DCC so I just gutted the entire thing down to the leads on the motor trucks. I did save the two small circuit boards that plug into those but everything else with the exception of the 7805 power regulator got tossed.
I have the sound/relay card almost finished, as things progress I’ll post more details. Here it is stripped all the way down:
And a picture of the motor truck, the colored wires are the motor leads, the two black wires go to the track pickups:
Here is everything I’ve been playing with for the past few months in preparation for the RS3 battery conversion project. The hacked up R/C transmitter is in the back, note the pocket for my android tablet. The two buttons will be for sounds, the toggle switch is the reversing switch for the power relay.
The 3D print fellow is in front of that, I have a sitting version of him to replace the out of scale cartoon figure in the cab. The soundcard/relay/mosfet board is to the left and the pololu 18v7 motor controller is on the right in front of the switch harness. The power relay is wired and working off the intercepted servo signal of channel two.
The smoke generator is the black box at the far right, I think it needs its own hack. Sync’d to the motor control would be cool? I’m not sure about this one, not even sure it’s worth it to put it into the model at all. Obviously I need some testing on that first.
The Pololu USB AVR programmer/ttl serialport/sloscope widget is at the front with the red clip connected to the back. This is my ‘scope’ probe. An amazing board for the price! I tell you what, I am absolutely sold on the AVR series of chips and this programmer. The ATTiny84 does not have a serial port, yet I found a nice software uart for free at AVR freaks. I can hook one pin of the micro up to the serial input on the Pololu and that combined with an LED on one of the port pins gives me a decent set of debugging tools. Super cheap too, ATtiny84s are like $3 in singles, way less in qty.
Anyhow, the sound algorithms need to be fleshed out, the mounting of the boards is not right yet and I need to put together a solid battery pack. But I’m getting there 🙂
I’ve been playing with the Atmel series of micro processor chips lately, specifically the ATtiny84 microprocessor. This is a 14 pin DIP chip that despite it’s size is actually quite powerful. You can download the free Atmel Studio 6 and use a low cost programmer like the Pololu AVR usb programmer ($20) and do C code. Quite a lot of fun.
I’ve managed to get a small code set working that uses nothing but the standard libraries included with Atmel Studio. It reads 6 channels of R/C from a generic airplane type radio control and breaks each channel down to an integer between 900 and 2000. I get a micro second resolution using the stock internal 8mhz clock, no external components at all! Very cool.
One thing that I thought was very handy- the Pololu USB AVR programmer has this nifty little application called SLOSCOPE. It turns two pins on the programmer into inputs for a light duty oscilloscope! Works great, I can see the R/C pulses and watch them change widths as I move the joysticks.
Here is my motor controller design for my Alco RS3. I basically gutted the entire thing and rewired it using a Pololu 18V7 simple motor controller. I’ll combine that with a 2.4Ghz radio and my home brew sound card and it should be really cool. Not quite finished with it but it’s coming out quite nicely. I plan on wiring up a battery pack using C sized 3500mah NiMh batteries for motive power.
Actually, I think I’ve changed my mind on the wire harness a bit. I was going to use the Pololu Motor controller in the traditional way, ie, center joystick is off, all the way up is forward max, all the way back is reverse max. But after some contemplation, and getting the R/C decoder to work, I think I’m going to put a mosfet and DPDT power relay in play here. I’ll use one channel to flip the direction back and forth and then I can utilize the entire range of the joystick (a knob in the case of my hacked transmitter box) for applying power.
Here is a pic of my latest 3D print, the foreman in 1:29 scale. This time I upped the polygon count x 100 and he looks a bit better detail wise. I now have a simple way to get a figure from Makehuman into DAZ3D. This is great because now I don’t need the DAZ meshes anymore- I can create a nice variety of young/old/short/tall/fat/skinny people and pose them as I like for a 3D print. Very nice!
I’m working on a new design, a sound card for a G scale diesel locomotive. Since I will be running this with R/C, I need a sound card that accepts servo pulses from a standard R/C receiver. I think I’ve finally settled on a design, so here is a pic as I’ve laid it out on a Radio Shack breadboard. On it are two stereo mp3 boards, an Atmel ATTiny84 microprocessor, a 4 channel mixer based on a LM3900 and a 8 pin power amp.
I’ve taken an old airplane radio and hacked it down to train size. Channel 1 is now a pot for speed and the two push buttons alternate a servo ‘position’ on channel 2. Not enough I know but this is just a quick prototype.
The tray has my Android tablet where I’m running an html5 page talking to a tornado instance on the server. The page takes finger presses and sends them via tornado back to the server. It turns them into servo movements out ‘in the field’ via Wixel wireless and Python to change the turnouts. Whew. Long path there but it works quite well.
You can try out the actual program by clicking ON THIS LINK
To use this, click a symbol from the palette on the right and then click where you want that symbol to be placed. To erase a symbol, left click on that spot. Since this is meant to be a control surface for a real time web implementation, the ‘wixel’ button at the top is used to set the number of the slave widget (0-63) and the r/c servo that widget controls (0-5). Note this is not implemented completely in this demo, however I will be using the tornado code base I’ve posted in my other posts here, realtime control of servos, see the side bar for a link to that post.
UPDATE: October 28, 2013
I’ve released all of the wixel and html5 code for this project, you can find details here: HERE
FINALLY, the power returns and I have a chance to test my breakouts! First test is great. I have the Raspberry Pi driving the master Wixel via USB. This slave Wixel, soldered into my breakout board, sits on the other side of my shop. A 5v wall wart provides the power. This is a nice mix of micro servos, minis and three standards. Works great!
In case you have not followed all my posts, what I have here is a master wixel plugged into the Raspberry Pi. Using the built in packet addressing mode of the TI processor (check out the Data Sheet), it sends servo commands to each slave in a round robin sort of protocol. Each slave can control up to 6 servos and return 3 analog inputs to the master.
I’m getting a really good update rate of about 4ms per slave. Once started, it just keeps running, the Raspberry Pi, via the USB to the master, just has to write a servo value into a table and on the next turn for that slave, it’s updated. This frees the Pi from any work at all in maintaining the network, it’s all auto-magic.
Here are some more pics of the widget.
I’ve decided that standing it up at 90 degrees like in other pics is not worth it. Much easier just to solder it in like this:
Here is a LINK to a previous post about the breakout boards. And ANOTHER that has some s/w details. Note, I have NOT released the internal code apps for the Wixels yet, I’m not sure if I will or not, depends on the results of my next project.