Skip to main content

I'm not sure what a video will do, it's just going to control lights and in one of them, the sound board.  The two are going to be "stripped" motherboards, they won't have anything but the three small caps that load the lighting and smoke triacs so my LED lighting will work.  Other than that, they have the 10 pin connector, the four pin sound connector, and the two pin track power connection.  I just jumpered the serial data buffer as the R2LC on the one with sound is only driving the ERR RS Commander and nothing else, so no buffering needed.

Obviously, this is only the motherboard, you do need an R2LC (or R4LC-C08), and all the other stuff.  Here are the first two boards, the 3rd will get all the parts and be my true beta test.  I just needed a couple motherboards for this job, and these happened to come in the door.

Attachments

Images (2)
  • mceclip0
  • mceclip1

Testing was... interesting.  Got it all assembled and connected the transformer.  Applied power and POP, the breaker tripped!  OK, that's not good!  Turns out that Digikey sent me silicon diodes instead of the TVS diodes I ordered!  Same physical package size, and since the package has the correct part number and the faint numbers on the device didn't mean anything to me, I "assumed" they were correct.  I "assumed" wrong!  Removed the TVS and things got back to normal, the power LED came on, I had good serial data through the buffer circuit, and of course lights and couplers appear to work just fine, they're just wires.  I then took the "TVS" diodes over and tested them independently, they are ordinary silicon diodes.  I couldn't find any match to the numbers on them on Digikey or even the rest of the Internet, I just assume they're probably 3-4 amp silicon diodes from the size.

One down, let's do some actual testing.

Sadly, my circuit that detects when the train is stopped or moving, and which direction, didn't work at all.  I did see very small indications on the LED's that it was sensing direction, but the stopped light stayed on all the time.  I broke out the scope and made a little revelation, I should have looked more closely in the design phase.  The PWM circuits do a very odd thing, which explains why I was having a problem.  The direction you're going has the line sitting at 5V and going to ground for the variable pulse width time.  However, the other direction has the line sitting at ground.  Actually, it was open and just floating, I found that out soon after!  I had been looking at the active PWM output and falsely "assuming" the other one just sat positive when it wasn't active.

Given that behavior, I had to swap the trigger input pins on the multivibrator chip to get it working properly.  Well, that entails changing four wires on a small SMT chip, cutting tiny closely spaced traces, etc. with everything already soldered to the board!  It's not pretty, but I did get the wires rerouted.  I also noticed that I had a couple orders of magnitude error in my computations for the pulse width out, so I had to lengthening it 100x for it to cover the 10 millisecond time span between the PWM pulses, time for a much bigger resistor.  OK, all that's done and the reverse direction works great, the reverse movement LED comes on, and the stopped LED goes off.  Cool, I have it working!  Try it in forward, not so good.  Both the reverse and forward LED's come on!  That's not right!  I put my 'scope on the two PWM inputs to see what's happening and it starts working correctly!  Take the 'scope off and it screws up again.  Ah Ha!  Remember those "floating" PWM outputs?  Enough noise was getting coupled to the very low power input of the multivibrator reverse trigger to trigger it when I was going forward.  Obviously just a product of how the board traces were routed for that side.  A 1 meg resistor to ground fixed it, so that's the issue.  I decided to actually go with 100K to ground in the next spin to insure this doesn't rear it's head.

Now with all the wires hanging off and the extra resistors hanging off the back, it works like I originally intended.  The only minor quibble I have is when you switch directions, both direction lights momentarily flash and then everything is normal.  This is a byproduct of the fact that the active direction changes the state of the PWM output from floating to +5V and the other direction goes from +5V to floating.  That would be harder to fix, so I'm going to ignore it, it really isn't a major issue.

Timing was good, I used up the three boards I got from OSH Park, so now I'll order a slightly larger quantity of the next spin, maybe from SEEED Studio, they have a pretty cheap deal.  I don't want to spend too much on boards yet until I get one fully working with no hacks.

Not too bad for the first cut, but I should have been a bit more careful in my initial design and I could have avoided most of this except for the bad TVS.

Very interesting John, a steep "development curve" for sure! Very strange that digikey would have shipped the wrong part for the tvs's. That doesn't seem to happen often. I have only ever ordered tvs's from Mouser, and they have been correct. Good lesson there I guess.

Good that you were able to make the other circuit mods and get the logic working as intended. The short flash of forward and reverse leds doesn't sound too serious. Overall the outcome sounds great! Looking forward to the next installment for sure! 👍

Rod

I've only had a couple of instances of incorrect parts from Digikey, they're normally very good about accuracy.  No worries, I'll have the TVS before I have board blanks again.

I did find one more issue I have to think about.  Everything works perfectly "until" I connect a DCDR to run a motor from the MB.  Then the forward/reverse circuit doesn't work until you have considerable speed.  The reason is that the DCDR has opto-couplers to receive the PWM signals and this hammers the amplitude of the PWM signals sufficiently so that the trigger inputs of the '123 multivibrator don't reliably trigger.    I think the only way around this is to buffer those outputs to the DCDR output so they don't affect the R2LC signals.

This should be the last issue (famous last words).  The sound boards work, the 5V power is fine, and all the basic R2LC signals don't have any issue.  With the fix for the motion feature, that's the one remaining issue I have to look at. 

Someone had asked if you could parallel DCDR boards off one R2LC, I think from my observations, the answer is probably no.

I did find one more issue I have to think about.  Everything works perfectly "until" I connect a DCDR to run a motor from the MB.  Then the forward/reverse circuit doesn't work until you have considerable speed.  The reason is that the DCDR has opto-couplers to receive the PWM signals and this hammers the amplitude of the PWM signals sufficiently so that the trigger inputs of the '123 multivibrator don't reliably trigger.    I think the only way around this is to buffer those outputs to the DCDR output so they don't affect the R2LC signals.

 

John, how about using something similar to your serial data buffer circuit to amplify the PWM signal amplitude to mitigate this problem? Or would that be too many patches?

Also I think a single DCDR/S is good for 10 amps total motor output, so maybe running two from one output is a moot point?

Rod

I'm putting a buffer in to drive the DCDR outputs, and taking the internal signal from the R2LC.  That solves the problem without having to worry about the voltage drop.  I'm thinking this has gotten to the point where the only practical way to use it is to get them assembled, it's a lot of fine part soldering if you build it yourself!

R2LC Smart Motherboard Rev. 1.1 Schematic

R2LC Smart Motherboard Rev. 1.1 3D Top

R2LC Smart Motherboard Rev. 1.1 3D Bot

Attachments

Images (3)
  • R2LC Smart Motherboard Rev. 1.1 Schematic
  • R2LC Smart Motherboard Rev. 1.1 3D Top
  • R2LC Smart Motherboard Rev. 1.1 3D Bot
Last edited by gunrunnerjohn

I just made a scratch file set and changed all the footprints from SMT to thru-hole.  Not a perfect conversion, but close enough to see what you'd be up against.  You can see the original board on the left, and all the components are yet to be placed.  I'm not going to bother because I can see how big it would get.  Also, the router has more issues with thru-hole as the parts go through, so you can't run wires on the other side.  The width of the board is limited to what's there, 1.25", you can't make them wider and fit in many locomotive shells.  So, the board would be about twice as long, around 5".

Now you see why the stuff is surface mount, even the old 1990's stuff.

Attachments

Images (1)
  • mceclip0

There is solder paste that is used for volume SMT production.  The problem is, to really use it you need the stencil and you put it on with something like a rubber putty knife, the stencil just allows it to coat the actual pads.  Then you just carefully position each part in place and use IR or a hot air tool to bond them.  The solder paste is expensive, it needs to be refrigerated, and it only has a shelf life of a few months. 

If you ever get to visit a PCB fabrication plant, it is interesting how they do this in volume.

For hand assembly, what I do for most SMT parts is tin one contact, bring the part into alignment while heating that pad.  When it's aligned, I remove the iron and then just solder down the rest of the leads.  For chip resistors and caps, I get the one side soldered, then apply gentle pressure and touch the bond again to seat them on the board, then solder the other side.  Needless to say, this requires a very fine tip for some of the chips.  I also limit myself whenever possible to the .95mm lead spacing or larger for my designs.  I can hand solder those, the parts with 1/2mm lead spacing are just too difficult to do repeatedly.  I've put a few audio amps on PS/2 boards, but it's a royal PITA, and I don't look forward to it.

Last edited by gunrunnerjohn

I'm going to have to do one more prototype I think, I made a number of changes.  I added the buffer for the DCDR signals, hopefully that puts that issue to bed.  I also need to do one more experiment, I think I may have a way to eliminate the random triggering of my outputs, and it's the proper way to do it anyway.  I think if I just pull the DCDR outputs to 5V instead of tying them to ground, I'll eliminate the floating line issue, and since they're always high, I won't get the flashing of the outputs.  I have to chance my hacked MB to put that fix in and see how it works.  I also fine tuned some spacing issues that I had.

I'm also toying with an idea of upgrading the motion outputs...

Attachments

Images (2)
  • mceclip0
  • mceclip1

There's a way, but I don't have time to write the code to do that.  It's on my "to-do" list, I'd like that capability as well.  That certainly won't make it into this project.

On the bright side, I did swap my load resistors from ground to the 5V supply, solved the problem of the blinking outputs when switching directions as I expected. 

The remaining thing I'm looking at is a opto-coupler for the forward and reverse outputs.  This would allow automatic Rule-17 lighting control, it would just add a resistor in series with an LED headlight when stopped and jumper it out when moving.  My existing FET design doesn't allow that capability, so I'd like to have that included.  This would give you automatic cab light control and Rule-17 lighting capability, something I like to add to upgrades.

Last edited by gunrunnerjohn

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×