Skip to main content

Stan, I'm reviewing component values as we speak to see where I can change things.  I also am looking at a small glue-on heatsink, my ad-hoc one is working pretty well, it's just an aluminum 5/16 tall stand-off with some thermal grease.

 

The opto for headlight input is because the headlight drive for TMCC boards is negative in respect to frame ground, so I needed to isolate it.  It also becomes full-wave AC in conventional mode, hence the protection diode.  However, I probably don't need to have that kind of drive for the port, so maybe I'll bump that one up.

 

The transistor driving the cab lights may be called on to supply quite a bit of current, so I wanted to drive that one a bit harder.  The same for the motor.  On reflection, I could probably get away with 1K for those and drop the power 10ma and not incur any problems.

 

I had already changed the 330 to a 680 for the chuff output opto in my production schematic.  Since I don't know the characteristics of what I'd be driving with that one, I figured to be on the safe side and have reasonable drive available, but I did decide that 330 was a bit much.

 

Now that I have one built up with the real parts, I can change a couple of values and see what effect it has.  Thanks for the suggestions Stan, you make some good points.  Where were you before I built up the production one?

 

 

What made you think the video showed the regulator getting hot?  That prototype has a larger regulator, and I didn't have an issue with that one.

 

 

Originally Posted by gunrunnerjohn:
The opto for headlight input is because the headlight drive for TMCC boards is negative in respect to frame ground, so I needed to isolate it.

Well, that an input signal is "negative" with respect to a common reference does not mean you need to isolate it.  It just means you need to adjust the biasing positive which can be done with a resistor.  Isolation is generally used when you don't have a common or stable reference; but in this case it the frame ground IS a common and stable reference.

The transistor driving the cab lights may be called on to supply quite a bit of current, so I wanted to drive that one a bit harder.  The same for the motor.  On reflection, I could probably get away with 1K for those and drop the power 10ma and not incur any problems.

It appears you're using the 12F1601 INTOSC mode and you probably notice from that 300 pg datasheet that the PIC itself draws a miserly 2 mA at full speed.  It just doesn't seem patriotic for the biasing components to draw more than 10 times the processor current   For example, the IRLML2060 is about 15 cents at DigiKey.  That's a 60V 1 Amp N-FET which would draw essentially 0 gate current.  I don't know what constitutes "quite a bit of current" but I'd think it would be nice to eliminate the need for a heat-sink.  I realize you're probably using some 5 cent NPN's so hard to second-guess your design.  Perhaps if you have the board space you could insert a gate-to-ground resistor should you choose to go the N-FET route.  You'll need this for the brief interval when the PIC starts before you set the I/O pins and the FET gate needs to be defined or else the motor/light will briefly turn on.

I had already changed the 330 to a 680 for the chuff output opto in my production schematic.  Since I don't know the characteristics of what I'd be driving with that one, I figured to be on the safe side and have reasonable drive available, but I did decide that 330 was a bit much.

I am ignorant about TMCC interfaces but I was simply doing a back-of-envelope calculation.  So at 330 driving a 1.2V LED from 5V, that's about 11 mA.  Ouch!  Even a "crummy" opto would have a CTR of 50% so the output transistor driving RS CHUFF (whatever that is) has 5 mA of trigger current.  Presumably RS CHUFF is some digital input and shouldn't require 5 mA to reliably switch it.  Or maybe it does.  Anyway, 680 gets you down to 5.5 mA loading 5V which is still quite burdensome considering the PIC is drawing many times less than that running millions of instructions per sec!

Now that I have one built up with the real parts, I can change a couple of values and see what effect it has.  Thanks for the suggestions Stan, you make some good points.  Where were you before I built up the production one?
What made you think the video showed the regulator getting hot?  That prototype has a larger regulator, and I didn't have an issue with that one.

Well, I don't follow the TMCC sub-forum but happened to see the video topic in the Recent Posts box on the right.  In it you mentioned the regulator getting hot. So apparently you're using the plastic pkg in the production board and used a TO-3 in the photographed prototype board.  I'm sure we both agree it would be nice to get by with a TO-92 for your production board without a heatsink.

 

BTW, I'm sure you realize that I'm only trying to help you reach the red zone and then the end zone.  I don't use TMCC but I can see how this is quite a contribution you're making to the hobby! 

Stan, I take all your valuable contributions willingly.   I'm actually thinking I may change horses and go with the FET outputs.  I wasn't thinking small when I prototyped this project, so it's a learning experience.  I would indeed stick in the gate resistor for the FET.  It probably wouldn't be a big deal to have a momentary flash or motor run as the power is applied, but why not fix that since it's simple?

 

FWIW, the PIC is the 12F1501 that I'm using.

 

As far as the lighting input from the TMCC board, with it's characteristics, I just figured that using the opto was the easy and safe play.

 

I'm a little reluctant to drop the drive for the chuff output much, as I mentioned, I don't know the characteristics of all the places it might go.

 

I don't see a TO-92 regulator being used here, remember the motor power is supplied by the board in many cases, depending on what smoke unit is used.  With the Lionel smoke units with the TO-92 just to drive the motor, I've seen those regulators cook from overheating.  I've hung heatsinks on several of them for that reason.  Since I'm driving other logic and lighting from the power, I think the TO-92 isn't going to happen. 

 

 

Originally Posted by gunrunnerjohn:
FWIW, the PIC is the 12F1501 that I'm using.

Oops. Typo on my part.  I did look at the 1501 datasheet.

I don't see a TO-92 regulator being used here, remember the motor power is supplied by the board in many cases, depending on what smoke unit is used.  With the Lionel smoke units with the TO-92 just to drive the motor, I've seen those regulators cook from overheating.  I've hung heatsinks on several of them for that reason.  Since I'm driving other logic and lighting from the power, I think the TO-92 isn't going to happen.

Didn't know that.  So if motor power is supplied from your regulator then I guess trying to save the last few mA is not as critical. 

 

My next question wrt component selection is wrt momentary track voltage interruptions.  I don't know what cap values you've settled on, but if the motor happens to be on when you take a dropout, the PIC will go into reset fairly quickly.  I glanced at your code and didn't see any special handling or use of the PIC Brown-Out detector.  For example, if you see you're losing voltage you can immediately turn off any outputs to preserve the PIC state that much longer hopefully riding out the momentary loss.  Another technique if this is a problem (other than bumping up the input capacitor size) is to split off the 5V with a diode so the PIC runs at 5V less a diode-drop.  So when you lose track voltage, the fan motor loses its 5V fairly quickly but the PIC continues running on its diode-isolated capacitor.  I realize that even if you do take a full Power-On Reset the functionality of your board is such that the PIC timers will immediately restart and the re-initialization of the PIC will probably go un-noticed so this may be at the splitting-hairs level...which is a good thing if this is all the Peanut Gallery can throw at you!

 

The motor has to run from the internal supply if you have something like the MTH PS/1 smoke unit, or any smoke unit without a regulator for the motor.  The PS/1 smoke unit uses a full wave bridge so the 5V has no common ground, hence I can't use it to power the motor.  For Lionel units with the regulator, my instructions will cover powering the motor from the external supply.  That also kills the smoke motor when you turn off the smoke.  If I run internally, I don't turn off the smoke motor, though it's not really a problem unless it annoys you running.  I didn't have an extra I/O pin to do that, and I didn't want to move to the 14 pin part at this point.  I'm thinking I could provide an input for the smoke voltage output and just disable the motor drive outside the processor, I'll have to think about that.

 

Saving a few MA is helpful, as it'll reduce the issue of the regulator temperature.  I dropped a couple of FET's in in place of the transistors, and that did have a noticeable effect on my regulator temperature.  The FET's also work fine in the SOT-23 package, where I was looking at enlarging the transistors for proper operation.  They will stay!

 

FWIW, the transistor drive was required to properly run the motor, I went up to 2.2K, then back to 1K, and neither ran the motor properly at low speed.  I had to drop back to the 470 base resistor.  Since the FET's are in there now, that's a moot point.

 

I thought about power interruptions, but the board comes back so fast that you'd really have to be staring at it non-stop to even notice.  I do have 300uf of bulk capacitance on the board before the regulator, so it should ride out short blips.  The brownout protection is enabled in the config registers using the #pragma statements, I'm assuming that gives me a consistent startup if the voltage drops low enough.

 

In a curious twist of fate, I found out that I don't need to debounce the chuff switch, and doing so actually screws things up at high rates of speed!  I had a 8ms debounce interval, and when the chuffs got closer than that, the program though the switch never stopped bouncing, so the board dropped into stopped mode!  I then realized that the debounce was redundant by the way I am using the switch, and removing it fixed the issue for fast running.  I guess that's one of the laws of unintended consequences.

 

Originally Posted by gunrunnerjohn:
In a curious twist of fate, I found out that I don't need to debounce the chuff switch, and doing so actually screws things up at high rates of speed!  I had a 8ms debounce interval, and when the chuffs got closer than that, the program though the switch never stopped bouncing, so the board dropped into stopped mode!

 

That must be have been a temporary head-scratcher!  Anyway, I realize that you will have component tolerance variations but with a short enough debounce interval (reed switches are very fast) perhaps you can estimate the speed of the engine by measuring how long the switch is closed.  This may be a way to generate more than 1 chuff or puff that some guys are asking about.  It will not be perfect but will self correct on each full revolution so may be acceptable. Somewhere you mention sensing the motor voltage so obviously that would be another candidate to estimate motor speed via back-emf voltage to generate more chuffs and puffs per revolution.   The bigger question is how does the user actually select 1,2,or 4?

 

G earlier brings up a good point about dynamically braking the motor to generate a more distinct puff ending rather than having the motor slow down which dribbles out the smoke.  I don't know how many of the guys care about this but you can implement a brake in external hardware-only (vs. requiring another PIC pin which you don't have) by putting in a RC timed gate to turn on a P-FET to short the motor windings (freeze the motor) some number of millisec after the last puff command. Since you're going with SMT parts you can get fairly tiny single or dual gate chips.  If you're interested I will sketch a schematic but would probably add, say, 50 cents in parts.  The creeping-feature syndrome can run you out of business so it's your call!

 

 

Perhaps we're talking apples and oranges, but if you're using PWM to drive the motor FET, a simple gate would not work.  You'd be braking the motor between the ON pulses and the motor would never spin.  What I'm talking about (which may be oranges to your apples) is a simple RC time delay that brakes the motor after several PWM-periods have elapsed with no pulses.  So if your PWM rate is 1 kHz or 1 millisec between pulses, the RC would be set to brake the motor, say, 3 millisec after the pulses stop. Even though this time constant is set in hardware it is short enough to give you the flexibility to adjust the motor puff time which apparently is in the 100 millisec range.

 

The inability to smoothly control the motor at slow speed using PWM is puzzling.  Was this when you used a possibly under-driven NPN which couldn't switch on the current fast enough?  I know you have a scope, so if you have a chance probe the voltage on an MTH PS2 fan motor.  It is PWM driven and changes speed - and from what I can tell people seem happy with its puffing and idling behavior.

 

 

That might work Stan, it's an interesting idea.  It probably would be cool to stop the fan between chuffs.  My one worry was screwing it up at higher speeds.  Right now I have the chuff duration at 60ms.  When the chuffs start coming in at that rate or greater, the fan runs continuously.

 

As far as the slow speed PWM, as you so correctly observed, I was driving the snot out of the transistors, so it wasn't under-driven.  I could see the pulses at the motor, but the little motor just didn't like to run at slow speed for some reason.  By the time I got it slow enough, it was prone to stopping and not having the torque to get going again.  What I do now when I go into idle is to give it a full power shot for a few milliseconds to insure it starts, then drop back to the slow speed drive.

 

I haven't looked at the MTH motor drive on the 'scope, but I don't think the motor run all that slowly at idle, it looks pretty speedy at idle to me.  I think MTH reversing the voltage to stop the motor for chuffs is one of the reasons the chuffs work well.  I'm not unhappy with the performance of my little board, but there's always room for improvement.

I am going to post about a conversion I did with attaching the smoke fan to the NC terminal on the cherry switch.  It doesn't work well which is why Lionel connects it to the NO terminal with the chuff wire on models that use that method.  The fan coast too much and you don't get a distinct (actually no) puff.

 

MTH uses a FET to place 5VDC on the PCB Ground terminal that is being PWM to control fan speed.  That 5VDC against the 5VDC must dynamically stop the fan, coupled with processor control to trigger when the fan starts.

 

If you watch the fan motor bulbs on the bench tester as you start the engine, the first thing you see is the heater bulb go brighter (more smoke generation) and the fan goes off.  Than when the fan is pulsed at the first chuff, you get a huge plume of smoke.  As the engine moves along the heater goes back to normal, but you have clear on and offs on the fan, with the fan actually stopping.  G

Last edited by GGG

GGG, I'm at a loss why connecting to the NO or NC terminal would make any difference.  When you're moving, the common is continually being connected to the NO and the NC as the switch activates.  Also, it's quite possible, and happens all the time, that you can stop with the NO contacts closed.  Electrically, there would be no difference.  I'd love to hear an alternate explanation, but for the life of me, I can't imagine it being any different.  If you have additional information, I'm all ears.  The only possible reasoning I can come up with is a difference in the contact bounce between the NO and NC contacts, but that's a reach.  In any case, that's not significant for my design, as any contact bounce is accounted for in spades by the fact that I have a timed chuff that started on the first sensed contact closure.

 

I'll freely agree that having complete control of the heater and the fan would be a superior solution.  However, it's more work and expense.  I'm quite happy with what I have now with this board, and it's a huge step up compared to other available solutions for TMCC locomotives and TMCC upgrades.  Obviously, this board isn't targeted to Lionel Legacy or PS2/3 users who already have complete smoke unit control. 

 

There comes a point in every engineering job where you have to stop changing and start producing.

John,  The point is that Lionel puts the fan on the normally open contact which remains open for about 330 degree of rotation.  It only turns on for about 30 degrees of rotation when the cam pushes up and engages the cherry switch.  That much off times allows smoke to build up and actually puff when the fan starts even if the fan motor doesn't stop completely when the switch goes open.  When I had it on the NC side (partially to isolate it from chuff and hoping that the short off time would work) the fan coast right through and you never knew it had no power.

 

So as Gary states, to make this work, especially at higher chuff rates (speed and count), you have to dynamically stop the fan.

 

I am not speaking specifically to your design, which seems to puff well, but in general at higher revolutions and possibly higher chuff counts, the motor never stops rotating unless you dynamically stop it.  G

Now I understand what you were getting at, I didn't think about the duration of the cam.  It's not the contact, merely how it was done mechanically that makes the difference.  I actually accomplish the same thing as Lionel in software, as I time the chuff independently of the chuff input switch.  That was one of the primary improvements over many of the wheel magnet schemes that I've seen and used.  If necessary, it would be pretty easy to dynamically change the chuff time as the chuff switch input pulses get closer together, that's a software change.  I didn't feel the need, but it might be interesting to fool around with that a little.  Maybe that'll be the "Deluxe" version.

 

I agree that in an ideal world, I'd add the logic to stop the fan.  However, I can get pretty good smoke performance as is, and that would be yet another spin of the boards.  If I was doing it again, I might go with the 14 pin part and have more I/O pins.  Maybe the next project...

OK, I was thinking about this issue, and I think I figured out a way to get an extra I/O port without changing processor parts.  If I just pipe the headlight drive through the opto-isolator that enables the headlight, I can eliminate the program control of the headlight.  That frees up a pin to use to control stopping the fan.  I might try to mock this up on the prototype and see how it works.  Turns out that for other reasons, I will have to do boards again anyway, so I might as well consider these improvements.

 

Now I just have to figure the best way to use that output to put the brakes on the fan...

 

 

Last edited by gunrunnerjohn

Oooh. This can get tricky. I recall that I had to redo the on/off timing for Sunset engines when they bought the circuit from TAS because they had a different smoke unit than the smoke unit Atlas used which was what the original design was for. Bottom line different smoke units have different requiremnents.

Best method is what somebody already mentioned. MTH used, I think, an AC motor (I'm real fuzzy on this) and could lock up the motor. This is better than trying to figure out how much reverse time.

The MTH motor is a standard DC motor, just like the Lionel motor.  AAMOF, I've replaced a number of Lionel motors with the MTH motor.

 

I was thinking of something simple like just using a FET to short out the motor and let dynamic braking stop it.  I'm not planning on reversing the voltage, that would be somewhat tricky and indeed have to be customized for different motors.

 

Since your motor only goes 1 direction, you only need a half-bridge drive.  So that's 1 P-FET switching +5V to the motor (S=5V, G=PIC output), D=motor) and 1 N-FET switching ground to that same point (S=Grd, G=other PIC output, D=motor).

 

In this case you absolutely need to add those pulldown/pullup resistors to the FET gates; 10k ohms to Grnd for the N-FET, and to +5V for the P-FET.  Otherwise during the albeit brief interval when the PIC is in reset (such as on powerup or during those momentary track voltage interruptions) the FETs will not simultaneously turn on which would short the 5V supply.

 

Then, in your code, you brake the motor by turning on the P-FET (driving the gate low).  Of course you absolutely must insure the N-FET is first turned off before braking!  I didn't look at your code so if you're using the internal PWM generator, you need to delay at least one period before braking since (unless you explicitly check it) you don't know where the generator is in its cycle.  That is, even if you stuff "0" into the PWM generator, these usually complete its present cycle before turning off.  Then to start a new puff, you must first release the brake (set the P-FET gate high) and then load a non-zero value to the PWM generator.

 

You should have no problem finding a "logic-level" P-FET that will turn on hard with 5V on the gate in SOT-23...though probably cost a dime more than the complementary N-FET.  There are also paired 6-pin SMD packages that have 1 P and 1 N together.

 

That's exactly what I was thinking, and I agree that I'll add the resistors on those, sure wouldn't want them fighting it out.  Thanks for turning me on to the FETs, I always viewed them as a bit fragile, but that's old-school thinking I can see.  They worked out well in my current boards.

 

I did free up the pin to control the brake, and I also put in George's other suggestion to vary the chuff length based on speed.  I go between 20 and 60 ms right now, and a run the motor for 1/4 of the running average of the chuff spacing.  I think I'll need the motor braking to actually see the effect properly, so I'll have to hack up a board and skywire that in.  Right now, I don't see much difference than my fixed 60ms chuff duration, but I suspect stopping the fan quickly will change that.

 

Good point about the PWM, I'll have to check and make sure I don't step on my toes.  The paired package might be interesting, I'll cruise over to Digikey and see what I can find.

 

I did resolve the regulator getting hot issue, I bit the bullet and put a Recom R-78E5.0 DC-DC converter on the board, they're about $2.50, but they'll deliver 500ma without breaking a sweat.  I had one on the bench at 250ma for about an hour, it managed to make it to 41C externally.  The linear regulator is running around 65-70 with a heatsink, and I just couldn't see running that close to the edge.  If someone wants cab lights powered from the board, now it's not an issue.

 

Thanks for all your input, it's been invaluable.  I'll update the thread when I get a test run of the braking feature.

Originally Posted by gunrunnerjohn:
I think I have all the alterations in.  This is the schematic with the dynamic braking of the motor added.

Direct from the Peanut Gallery...

 

1) Q3 P-FET per schematic will not brake the motor.  You show Src going to Motor and Drn going to ground.  It should be S=+5, D=motor.  As the other motor lead always has +5V, the P-FET switches +5V from source to drain thereby shorting the motor. 

 

2) Unless you a optioning going back to NPN's, you don't need R3,R6,R8.  There is essentially zero gate current to switch the FETs so there is no need to "limit" the gate current as you would with an NPN.  But if for philosophical reasons you want to keep them, drop the FET input values to, say, 1K or less.  With 4.7K you only get 2/3rds of the supply voltage applied to V(gs).  While this should adequately switch the FETs for the relatively low currents involved, the harder you drive them the better - the "on" resistance improves with increasing V(gs).

 

3) I promise not to drone on about C4, but it's too bad you can't get rid of it.  I won't argue the point any further since your results indicate otherwise. Note that with a half-bridge using FETs, the body-diodes of the FETs provide the diode-clamping for driving an inductive load.  With just the N-FET in the original design, C4 limits the V(ce) excursions from the inductive kick when you switched the motor OFF.

Stan, you're right about Q3, a big oops. 

 

As far as the resistors, I was reading some stuff on FET's, and it appeared I might need some current limiting there, I guess that there's a limit to what the PIC can supply.  Since I'm not going back to transistors, I guess I'll kill them off and save the parts.

 

Maybe I'll go back and try the experiment again, when I put the cap in I was using transistors.  I ordered a few thrugh-hole FET's to experiment on the proto board, should be here Monday.  I was surprised that the motor didn't react like I expected with the bare PWM.

 

 

Originally Posted by gunrunnerjohn:
Double edit:  Stan, I did try the motor drive without the capacitor, no go with the FET.  Don't know why it doesn't like the PWM, but for this go-around I think I'll just keep it.

Makes sense.  You can always just not install it if the PWM mystery is solved. 

 

I might try to duplicate the experiment since this sort-of bothers me...like someone telling me the earth is round when all this time I thought it was flat.  So tell me the following:

 

1. PWM carrier frequency

2. Duty cycles tried for the slow idle without C4

3. Motor was an MTH PS1/PS2 smoke motor with impeller...or equivalent?  I don't have a Lionel smoke unit.

4. What exactly was the behavior when it didn't work?

5a. What C4 value and duty-cycle produced the desired "idle" speed?

5b. Did you actually measure the idle RPM whether via optical tach, scoping the brush commutation, back-emf, whatever?

 

But don't let this de-rail your progress on the boards...just if you get a spare moment I'd be interested.

It's a mystery Stan.

 

I'm trying to get the boards ordered, but I do intend to go back and try my experiment again, as I'm somewhat mystified why it doesn't work as well.  Basically, I could not get the motor running slowly with the bare PWM output, it would just stop.  I didn't actually measure the RPM, I have an MTH smoke motor with a tape flag on the rotor for my testing.  It was obvious that I could get it going much slower with the cap than without the cap.  With the DC supply, I could practically count the revs!

 

I did not tinker with the PWM carrier frequency, it's around 15khz now.  It took a 50% duty cycle to keep the motor running without the cap, and it was running pretty briskly.  I can run the motor with about a 12% duty cycle with the cap, and it's much slower, though not as slow as I can run it with a DC supply.  Truthfully, the range of control with the bench supply is what prompted me to try the cap on the circuit, and after seeing the vast improvement, I decided to go that way.

 

I'd like to get the motor running even slower, but it has to be reliable at that speed.  I want the idle to have a much slower velocity than when the chuffs are working.

 

BTW, the braking seems to work very well, stops the motor on a dime!  I think that will be a nice improvement in the circuit.

 

Originally Posted by gunrunnerjohn:

It's a mystery Stan.

 

I'm trying to get the boards ordered, but I do intend to go back and try my experiment again, as I'm somewhat mystified why it doesn't work as well.  Basically, I could not get the motor running slowly with the bare PWM output, it would just stop.  I didn't actually measure the RPM, I have an MTH smoke motor with a tape flag on the rotor for my testing.  It was obvious that I could get it going much slower with the cap than without the cap.  With the DC supply, I could practically count the revs!

 

Well sorry for the continued nagging (and keep going on ordering boards first) but,

 

1. When you removed the cap in the original single-transistor configuration, did you have a diode or other device to limit the voltage across the transistor when switching an inductive load?

 

2. If you only have a flag on the motor, how do you know what slow speed you want for idle smoke?  Are you thinking the MTH "idle" smoke is too fast?  For videos I've seen of "idle" engines, there's still quite a draft at idle with a well-defined column of smoke going skyward. If you can count the revs (not that you're going THAT slow), I'd think the smoke would dribble out the stack which would look lame - in my opinion of course. 

 

3. So using a DC-supply, what voltage gives you the desired idle target motor speed?  I can put that voltage on a PS2 smoke motor so we can get to apples-and-apples.  I can also measure the motor RPM with an optical tach bouncing off the impeller or something.

Stan,

 

I tried it with and without a snubber diode.  I also tried the DC supply with a real Lionel smoke unit connected to power and running the fan from the bench supply.  That's where I found out that I really liked the idle smoke with the low voltage on the fan.

 

I found that between around .6 and .9 volts was really nice, I had a stream of smoke, but it didn't blast out.  I have been unable to achieve that with the PWM, even with the cap.

 

My plan, if the PWM had worked as I planned initially, was to test a variety of smoke units (I have about ten of them) and have an idea of what the minimum reliable voltage was.

For the new MTH smoke motor, .6 volts on the motor looks great, but a couple of the older smoke units needed a bit more to start and run reliably, so I'd have probably been up around .8 volts.

 

I hooked up an MTH smoke motor/impeller using optical tach. With bench supply:

 

0.5V -> 2700 RPM, 0.75V -> 4200 RPM, 1V -> 5800 RPM

 

So my sample of 1 may be a bit more efficient which makes it difficult to get apples-apples with your results as impeller RPM is the relevant parameter. Somewhere between 0.3V-0.4V was where it would start/sustain spinning without assistance.

 

Using 10 kHz PWM with N-FET, 5V supply, with diode, NO cap:

 

10% -> no spin,    15% -> 2600 RPM,  20% -> 5200 RPM

 

Same but using a Schottky diode:

 

10% -> 1500 RPM, 15% -> 4000 RPM,  20% -> 6000 RPM

 

Using a current probe, I can see the recirculation current for this motor decays in the ballpark of the PWM period at 10 kHz; my bench generator only goes up to 10 kHz for PWM or I would have tested for smoother low-speed performance at your 15 or even 30 kHz.  Perhaps obvious but the average motor current for the same duty-cycle increases when using a Schottky diode. 

 

As the textbooks say, it is left to the student to determine how using a capacitor rather than a diode for snubbing affects re-circulation currents in a PWM-driven motor.

Interesting experiment!  I just stuck a silicon diode across it, but since there's a 1206 pad there, I could easily change the capacitor for a Schottky diode. 

 

What current probe do you use?  That's one useful piece of test equipment that I don't have.  I don't have a bench generator that generates PWM, that's another useful tool I suspect.

 

My motor would start spinning on it's own at .425 volts, but my benchmark was if I could stop it and it wouldn't start again on it's own, that was too low a voltage.  It would actually run at .5 volts and start when stopped by hand, but I liked the look in the smoke unit at .6 volts on the motor.

 

As you say, this has to account for variables in the characteristics of the smoke motors.  I'm still going to pursue this as I'd like to get it working slower at idle.  I like your results with the Schottky diode, if I could get that I'd be pretty satisfied.

 

Originally Posted by gunrunnerjohn:

I just stuck a silicon diode across it, but since there's a 1206 pad there, I could easily change the capacitor for a Schottky diode. 

 

What current probe do you use?  That's one useful piece of test equipment that I don't have.

 

Your cap goes from motor to ground while the diode goes from motor to +5V (parallel'ing the body diode in the P-FET).

 

I used a Tektronix AM503 current probe which is out of the ballpark for hobbyists.  I have watched for decades waiting for someone to come out with a reasonably priced DC-current probe for electronic applications...I'm still waiting.

I forgot to note that the average motor currents were between 40 and 50 mA ... with the Schottky bumping up the average currents by less than 5 mA for a given duty-cycle. In other words small current variations translate to large RPM variations. 

 

This reminds me of engines before speed/command control where you diddled with the transformer to find the magical minimum track voltage that would keep the engine running slowly without stopping. Without feedback it's a tricky proposition given track resistance drops, motor variations, gearbox friction, track geometry, etc..

 

A tach would be overkill for a fan motor but this class of PIC has A/D converters. The smoke motor only spins in one direction which means back-emf will always be positive and in fact will be much less than 5V given your desired speeds can be obtained with a motor voltage of less than 1V.  So if you can't get the slow-speed performance you want open-loop, you could use an A/D to sample the back-emf voltage.  As to whether this forces you into a bigger PIC or some other way to free-up or re-configure I/O on-the-fly to multiplex the back-emf sampling with another function is a consideration.

You're right, I don't think I want to spring for the AM503 current probe.

 

I don't have any free I/O pins, so measuring back-EMF would be somewhat out of the question.  I think muxing pins would quickly get pretty messy.  I think I'll stick with the best performance I can get with an open-loop approach.  The good thing about smoke fan motors is you don't have quite as many variables influencing the speed.  The biggest issue is probably the individual characteristics of the motors.  Being a retrofit board, it has to handle them all unless I ship a new smoke motor with each board.

 

In the future, it might be fun to explore back-EMF speed control, but that's not in the cards for this project. 

 

As for the diode connection, I guess I could do one hack to wire it in place of the cap if it really made a large difference.  There's always the option of an upgraded version of the board in the future.

 

 

What will the projected selling price be and what will the board size be?

I deal in S gauge conversion so I need small boards.

I have been using Lionel Smoke unit boards that I cut down. They are small and cheap but may become hard to get so I am looking for other options.

I have a simpler analog design of my own but have not put into production yet.

It's features are:

Works with conventional non TMCC or TMCC.

If loco stops with switch closed motor does not run on Hi Speed.

Fan runs on low speed if loco is stopped.

Does not skip beats like the Lionel serial smoke  board does at certain speeds.

Fan runs full speed at high loco speeds.

Is cheap.

 

Carl

The board is 1.1" x 1.2" and about .6" high at the tallest place.  I'm building them now, I'll have them in about a month from what it looks like.

Works with conventional non TMCC or TMCC.
If loco stops with switch closed motor does not run on Hi Speed.
Fan runs on low speed if loco is stopped.
Does not skip beats like the Lionel serial smoke  board does at certain speeds.
Fan runs full speed at high loco speeds.
Is cheap.

There's no reason this won't work with conventional or TMCC, it was designed with TMCC in mind.  However, none of the features depend on TMCC, all it needs is the input chuff switch and around 6 volts or more AC track power.  Should work on DC track power as well, but it would require a full wave bridge to correct polarity reversals.

 

The switch open or closed when it stops has no bearing on the fan motor speed, when stopped it always runs at low speed.  When moving, the chuffs are at full motor voltage.

 

I can't imagine a reason this would skip beats and any speed, and I haven't observed that with the prototype in a locomotive.

 

Once you get past the minimum chuff duration and speed, the fan runs at full speed continuously.  The chuff duration varies based on locomotive speed until it reaches a minimum chuff duration, then they stay constant.

 

Probably not as cheap as your board, pricing and sales outlets are still being worked out.

 

Dropped the PWM gate to 250Hz, the slowest I can go without changing stuff around much more.  It makes a significant difference, so clearly the 15khz was too fast.  The smoke motor is a bit nosier now, you can hear the growl faintly as it runs.  I'm sure you won't hear that in the real environment, but with the smoke motor clamped in a vice and out in the open it's more apparent.

 

I did a bench test of the smoke motor braking with a real smoke unit on the bench, that is really cool!  I had to make significant changes in the timing of the chuffs, when you stop the motor immediately, you need a lot longer chuffs to get good looking puffs!  However, up to around 12-14 chuffs / second, the smoke puffs are apparent, then I get close to the continuous running and it's hard to tell after that, but I can still hear the motor stopping and starting up to around 18-19 chuffs/sec.

 

Can't wait for the Rev. 2 boards so I can install this in a locomotive!

Add Reply

Post

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

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