Jump to content

SMART Power Board

Recommended Posts

I have been conducting various motor tests and quite a bit of attempted “destruction†testing!


Firstly, I have connected nearly all the different motors, I bought recently, and they were 'controlled' successfully. However, the motors actual usefulness are definitely in doubt.


As N15class, Peter has mentioned elsewhere, the very small motors used to cause mobile phones to vibrate, are quite useless. They got hot quickly and they were quite digital in operation – stopped or running! Normal DC motors were well behaved and controllable though.

I haven’t connected the little servo yet and that is on this weekends list of things to do.

The other item I want to prove/test/control is the 2 phase stepper motor. Although the board does have the ability to 'sense' the current on the motors windings I want to control the current to the windings by 'chopping' the voltage in an open loop current control scheme. This may prove quite useful in the future and I have high hopes of this approach.

The last item on this weekends list of things to do is to visit the ShangHai rail museum. ;)



As for the “attempted destruction testing†session on Thursday.

Firstly, I overslept – I next to never do this.

Then, after starting a series of automatic tests going on the Instrument I was working on that lasted for more than 5 hours, I settled in to do some “extra†work on my project.


Previous tests were all powered by the USB port from my Laptop but this morning I decided to connect my challenge to a 'proper' power source. This turned into a series of blunders, mistakes and a sprinkling of gross stupidity!


I, at least, had the sense to disconnect the little LCD display and my Laptop before proceeding, but then I connected the smoothed DC 12v mains adaptor to my project across the logic and motor supply inputs! Nothing happened and after a few seconds of nothing happening I switched off the power so that I could jump to a stupid stupid conclusion and reconnect the 12volts across the 5 and 0 volt terminals!!

Why? Go on ask me why? Stupid.

Anyway this, surprisingly enough, did not work either – but the 5 volt regulator got very hot very quickly. (A sure fire way of showing that you have “messed up†big style!)

Then, I decided to put my glasses on and 'see' where I had 'randomly' connected the power.

I was mortified.

So, fearing the worst, I removed the PIC IC and connected the 12v dc to the ac inputs – this should be safe and ok, and then I measured and checked for heat/damage all over the board. The result was wrong voltages everywhere. I then decided to re-insert the PIC IC and use the Laptop to check things were OK – they were not and the PIC got very hot too. I then got a new PIC IC and powered the board, correctly this time, from the 12v mains supply. Still the voltages were wrong.

I then noticed, this time wearing both pairs of glasses, that I had the PIC in the wrong way!!!

A whole catalogue of errors by me.


I put everything right and tried again. Success!

The damned thing survived all my best efforts to destroy it!


I now think that this design, and choice of components, is indestructible!

Why I did this, I don't know, but I really wasn't “up to speed†that morning!



One problem has emerged and that is that the Bridge Rectifier does not work.

I know I have a 'dodgy batch' of the damned things and I really can not see how I could have damaged it with how I applied power.

One things for sure, it ain't going to be easy to remove it and when I solder future Bridge Rectifiers onto PCBs, I will stand the rectifier off the PCB so that if I do need to remove it I can!



(Hopefully with lessons learned!)

  • Like 1

Share this post

Link to post
Share on other sites

Tested the servo with SDB and the servo did what I asked of it.


Just a simple routine that gave out a series of pulses of 1250us, 1500us or 1750us updated every 10ms. Each position lasting for about half a second.

This it did.


The 1500us pulse puts the servo arm into its mid, or neutral, position. Reducing the pulse will cause the servos arm to go to travel in one direct, (I should know which but for this test I didn't care), and increasing the pulse moves it in the opposite direction. The exact angle of deviation, from the neutral position, depends on the servo/manufacturer used – but is usually +/- 1ms, (NOT ALWAYS), from the 1.5ms mid position.

If you put a signal demand beyond the physical limits of the servo then what happens depends on the individual servos design. In this case it breaks the POT feedback and converts the servo from position control to speed control!!! :(

Not a problem as I have spare servos and this does give me the perfect opportunity to pull it to bits to see which micro controller is used in the controls circuit, and how the tiny little motor performs when connected directly to my SDB challenge.


So servo dismantling and Stepper Controlling is on tomorrows agenda.



(The visit to the museum was extremely disappointing...)

  • Like 1

Share this post

Link to post
Share on other sites

I pulled apart the little Servo, as can be seen in the photo below, and found that my experimenting with the timing to the Servo had caused it to travel beyond its mechanical limits.

The “mechanical limits†in this case are the end stops on the little – tiny – feedback POT. The shaft into the POT had sheared off resulting in the Servo travelling continuously in one direction.

The lesson learned is “use a scope†to check timings to a Servo before trying to program anything fancy. I didn't have a scope with me and the initial tests did prove successful.


The little motor, when connected directly to SDB and controlled with the DC-motor software, showed some initial promise.

I gave it a 5v pk-pk PWM wave BUT only varied the RMS voltage from 0.25 to 1.5 volts.

It seemed to give quite a good speed range and showed much less heating effects than the little phone vibration motors. (To be a true comparison with the phone vibration motors, I will need to remove the little counterbalance weights on their output shafts.)

This little motor is way-too-small to drive my “hand held tacho†and my “strobe light†is only of any use when it is connected to a car engine! (You can guess when I last used that!) So I think I might start a little project to “strobe†an LED whilst displaying the flashes/second, speed or whatever on a LCD display. May be useful now and again?


The Servo's IC, I think, is a variation on the DRV8801 H-Bridge Driver IC and thus is NOT programmable – except by the use of component changes. Not as useful as microcontroller but a damned site cheaper AND smaller.


Spent the rest of my time since reading, digesting and contemplating the 408 page Data Sheet on the PIC16(L)F1847 IC so no real progress on the stepper test software yet.




Share this post

Link to post
Share on other sites

Finally got all the bits sorted (sic) to run a 2 phase stepper motor successfully with SBD.


But for some reason, the stepper would not work – at all – off the 5 volt supply. I need to check resister values and logic voltage levels so this will have to wait until I get home and have some time in my shed with a scope. (The misses has a list of jobs, you would not believe, before I will be allowed anywhere near model railways!)


However, the 5volt stepper worked brilliantly on ~14volts supply with the PWM limiting (controlling) the current as if it was being fed 5volts RMS.

This is much more desirable than running the motor from just 5volts though. (Increased speed AND reduced heat dissipation.)


I am, once again, very pleased.



This leaves the DC shuttle test and DCC tests to prove before making a serious attempt at each application.

For the DCC tests, I think I might start by getting SDB to “listen in†to what’s on the rail lines and convert/check/tally/and pass on the DCC messages to a PC.


Might be interesting!



Share this post

Link to post
Share on other sites

Not much work done since coming back to the UK.

(Except attacking the garden jungle, laying new kitchen floor t&g, a ton of paper work, sourcing a Plumber, etc etc.)


So in the short periods of “free†time I'm going to do some more work on the stepper side of things. Maybe even get SDB talking to a PC so that the PC can either program, adjust parameters or directly control the Stepper. Displaying various read back parameters would also be useful.


I think RS232 will be the way to go here.

Or I could feed the power via a 14v (ish) square wave with the stepper position commands being encoded in the power signal. Anyone for a DCC controlled Turntable Driver?


The plan, at the moment, is for me and SDB to visit the RMweb Members day on the 7th of July where I will be only too pleased to answer any questions but nothing is confirmed yet.



Share this post

Link to post
Share on other sites

Had a fun day programming SDB, with a Stepper attached, doing super things like spin the motor around and then stopping dead, spin around but stopping every 90 degrees, ramping up in speed and then slowing down, etc.


But enough of this frivolity. I really must get SDB connected to a scope so that I can check waveforms, timings and power settings.


But playing with the SDB and a Stepper motor is so much fun.

Maybe I should contemplate a micro layout with a turntable, two roads, a shed and a coaling stage.

Hmmm. Can I do this in BR blue with yellow ends!



Share this post

Link to post
Share on other sites

More stepper testing with some rather good results.


I've upped the “chopping†frequency from and annoying 4.9kHz to a silent, (it is to my deaf ears – half past two I said!) - 19.6kHz. With no appreciable loss in performance! Chuffed!


The next thing I did was swap the small stepper for a much larger “Industrial†stepper – albeit 0.5A at 5.0volts. I was, as usual, cautious but I needent be. The “big†stepper gave much more torque, as expected, but at a much reduced current, un-expected! Accuracy and speed were very good.


Another improvement, was to add a 1 milli-second “Boost†to the beginning of each step – selectable of course. The “Boost†signal applies %99 power for the first mili-second of each step change. This gave really good results with upped speed and torque.



So, apart from the DDC listening and DCC controlling tests, I have finished the initial testing phase of SDB.


I think the first application for SDB will be a DC controller.

I have started to draw up a list of features I would like it to achieve and then make a start on it.


Thinking of (yet) more applications for SDB, how about a DCC to DC converter with manual, on the fly, adjustments so that the branch line can run all those old locos that are sensitive to DCC? (Yes I know you can select 0 to run 1 DC loco on DCC or you could even just use a loco decoder at the side of the track but I was thinking more in terms of parameter adjustment, with POTs, as the loco is in use. PWM frequency, boost, stagger, stiction, readbacks, etc



Share this post

Link to post
Share on other sites

Press Release, Friday the 13th of July 2012:-


SDB now controls Lamps Shock Horror!


In the latest batch of exhaustive testing, by SHMD usually in the secrecy of his back garden shed (but this time done in Nantes, France), a commercial lamp was lit for the first time. The project, known by the code name “Light Dimmer 1.0â€, took almost one hour to complete. No damage was reported and the test lamp(s) came through unharmed – as did the hero of the moment SDB. Yet again!


“ I'm dead chuffed!†was the only comment made.


More pictures to follow...

Share this post

Link to post
Share on other sites

Light Dimmer 1.0 pictures.

(This should really be called a "Light Brightener!".)



This shows the frequency of the PWM signal.

(Not to be confused with the Duty Cycle which you adjust to get the required power.)



I used the POT VR1 as the power "Knob" and scaled it to give a 0 to 100% power selection.



At 25% the Lamp, (a Philips 12v 20W), took 0.588 amps from SDB which was being powered from my Laptops 19v PSU!



At 21% the Lamp took 0.509 Amps.



At 21% power the Driver IC (L298) was at 48.3'C!

(A better heat sink required I think!)


All in all a quick and easy test and it let me see how SDB performed at higher power loads.

I tried to force 1.2 amps into a 75W Lamp but the L298s internal thermal circuit started to limit the current! Again, a better heat sink and bonding required.


Another test ticked off the list.



Share this post

Link to post
Share on other sites

Following on from yesterdays success, with the “Light Dimmer†project, I started today off by implementing an idea that’s been rattling around my head all week.


It first came to me when I was playing with testing the Steppers with SDB.

Initially I had set the 'chopping' frequency to 4.9kHz for no particular reason other than it was easy to implement. This produced a rather annoying whistling/high pitched whining noise in the Motor. A familiar and well known phenomenon with an easy solution of just 'upping' the chopping frequency to a value just above what the human ear can detect. In the stepper test case 19.6kHz. (Easy to do as, in this case, it only required the changing of one bit in one byte in the whole program! The difficult bit was finding it in the 408 page data sheet!)


What got me thinking was “what about deliberately setting the chopping frequency to values we can hear?

Pitch, tempo and volume can then be added as the waveform, to the motor, is by its very nature a repeating signal.


Thus, my goal this weekend is to add Sound to my DC loco remotely using only SDB!



So first thing this morning, I started writing software.

A simple routine to get my, (now much travelled Bachmann 08 243 dc only loco), to emit a noise – any noise really – but one that had a regular 'beat' to it so that I could see hear that something was happening and that the project was worth proceeding with.


I am dead chuffed no ecstatic that it worked first time!

Even the volume knob worked!


My much tested/abused 08 sat there ticking over!

OK, a fair amount of imagination is required here and, (with my first ever attempt at sound editing), it is probably better if you had never heard a Gronk tick over before – but it did sound like an engine idling.


The initial repertoire of sounds, that can be sent to the loco, appear to be made up of clicks, ticks, buzzes, whirrs, whines, whistles and of course silences.

Chuffing sounds, class 20/40s and idling sounds would appear to be the easiest to achieve.

(I can see my poor abused Gronk becoming quite the schizophrenic!)




Free, no decoder electronics in the loco, controllable on the fly



Crude, limited, quiet, only one loco at once, more heat induced into the motor, plays havoc with directional lighting, will probably scramble any DCC CV's it comes into contact with,



This really is at the very beginning of this little experiment but free loco sound has got to be worth pursuing!




(Now with even more work to do and I haven't even started with the DCC – which I was saving for last and much looking forward to.)


PS. How do I post videos?

Apart from the Gas and BT web sites, (which don't host videos as far as I know), I'm not a member of anything that I can upload a video to.



Don't forget to use your imagination!

Share this post

Link to post
Share on other sites

I'm Trying to get my video on RMweb.

I've changed the file extesion from .3GP to .txt so don't forget to change it back again.


Hope it works!



Share this post

Link to post
Share on other sites

I've been thinking about what is required in the “2012 Innovation Challenge†and the most important criteria appears to be - “is it good?â€.


With this in mind I have decided that it is important for me to actually produce something with SDB.


But what?


A DCC Controller or Booster?

A DC Controller?

A Programmable Shuttle unit?

How about Encoder less Loco Sound? (FreeSound©)?

Stepper controller anyone?



My initial remit for this project, (the innovative bit), was to marry a standard Motor Controller to a Programmabuble controlling Chip to produce a VERY-FLEXIBLE “Standard†PCB. This, I believe, I have done. This, as expected, has also proved both flexible and great fun!

It has also led me down unexpected and novel routes of exploration. Which, although extremely tempting, are much better served, with more resources, to future projects.


Thus I have decided to commit to one full product – that works – and build it, Demon-straight it and make it available to the membership.



I have decided to build the best, flashiest, fanciest, useful, affordable, ...




(I feel another press release coming!)

Share this post

Link to post
Share on other sites

Press Release:-


Introducing the :- SDB Deluxe DC 'Throttled CAB controller'©





1/ 1 Primary Manual or PC Control with a secondary control available for either PC Shuttle or PC Control.

2/ Built in Shuttle Unit.

3/ FreeSound©* Horn/Whistle.

4/ Record Trip and Repeat.

5/ Programmable.

6/ Easily made (All parts visible to the naked eye!).

7/ All parts commonly available, (Honest – as of 2012), nothing exotic or expensive.

8/ Variable Inertia, (Simulated-Heightened-Inertial-Train Response©*)

9/ Hard-Shunt-Enabler, (Brake Reducer©*).

10/ Recipes (Loco/Train profiles saved/loaded).

11/ Senseless Operation©* (for :- Diagnostics, Shuttle Stop© detection, Curves, Real time open-circuit LED, Real time short-circuit LED).

12/ Auto-Fail©* Anyone? Train coasts to a stop, refuses to move for 5minutes, some banging is heard and then things work normally again! (This can be done!!)

13/ Addressable for multiple PC control.

14/ Direction selectable.

15/ Speed settable.

16/ DCC unfriendly.





10 to 16 volts Regulated DC input.

2 times PWM variable outputs.

0 to 1A for the Primary output.

0 to 1A for the Secondary output.

Silent to just about audible, (in a quiet room), FreeSound©***.

Senseless operation© in the 0.25 to 1.0A range.



Soon not to be available near you but plans, documentation and firmware to be made exclusively available from RMweb before October sometime – DON'T MISOUT!


*FreeSound©, Simulated-Heightened-Inertial-Train Response©* referred to as S.H.I.T – Response© for short, Brake Reducer© and Senseless Operation©, Shuttle Stop©, Auto Fail© are all copyright by me and any one I can palm them off onto.

**Features / Specifications subject to whimsical, eccentric, random, vindictive, copied/good research, brain waves, suggestion, wants, availability and time constraints.

*** FreeSound© available in an un-modified standard DC loco dependent on motor type and gear chain.

Share this post

Link to post
Share on other sites

Development work on the “Throttled Cab Controllerâ€Â© has begun.


And seeing that the FreeSound© System was showing so much potential I decided that some more development work, (using SDB, which utilises my own Creative-Rapid-Advanced-Prototyping – Technology©), was required.


Horns were my first target and so I wrote a routine where I could 'command' the software to produce a tone for the specified time. (Frequency and Duration.)

Using a scope, to check timings, the simple routine worked as desired.

Not having my Gronk to hand, at the time, I connected my MP3 earphones – via a 1k Ohm resister - to SDB. The test signal of 1kHz, 500Hz and 250Hz all came through load and clear.

It was at this point that I realised I could use the sound example, (from the Compilers Help Files), to get SDB to play a simple Melody. Copied the Example across and ran it.

The Tune was clearly audible and clear!

Then followed some experimentation to produce a 2 tone horn and a simple shuttle routine.


Back at the Hotel I compiled the program and down loaded it into SDB, applied power and sat back to enjoy the fruits of my labour.


It not only worked but the tune is very clear and quite loud!


Low notes are not a loud as notes in the 500 to 1000Hz range so maybe I will run the Diesel Horn a bit more high pitched than it should be.


The attached file has had its extension changed from “.3GP†to “.txt†so that I could load it into RMweb – so don't forget to change it back if you down load it.



Maybe this could be adapted to help find bad electrical track-to-wheel contacts by having a wagon, with a speaker mounted on it, and SDB producing a fixed tone which the wagon will play whilst you concentrate on the wheel to rail location and dynamics, (you can't do that easily if you are looking at the indicator at the same time).




(Can anybody name that tune?)

Share this post

Link to post
Share on other sites



Forgot to add the file.





Yes I know the Gronk's steps have fell off - and I'm pretty sure it had nothing to do with FreeSound - I hope! ;)

Share this post

Link to post
Share on other sites

This week I’ve populated another SDB PCB ready to be made into my Throttled Cab Controller.

I’ve also bought some POTs, switches, connectors and a box ready to be assembled.

(Which could be a problem as I have not finalised the design yet! Worse still, it looks like I will be using what ever wire I can find to wire up the panel to SDB.)


Much more thought has been put into its operation, features and firmware.





Share this post

Link to post
Share on other sites

SDB does not have a great deal of spare IO.

Yes I know that I can expand the IO by using I2C, SPI or even RS232 but I have decided to use what is there on the 'standard' board – as this is really what my innovation challenge entry is all about.


With this in mind I have been designing the layout of the controls for my 'Throttled CAB Controllerâ€, again using the DIPTRACE PCB CAD package – (Not really what it does but its good enough for a rough layout!).


For the front panel of the controller I will print out a 'better' version of the panel layout and then laminate it at work. I will have various cutouts in the paper so that the laminator will seal the whole of the panel even where holes are punched through it.


After a few attempts, below is roughly what I have settled on as the layout.

This will change as dimensions are checked and clearances are left for wiring, switches, components, heatsinks, connectors, etc.


Anyway, not to scale:-





Share this post

Link to post
Share on other sites

I have printed out the panel and placed the cut out ontop of the controller's box lid so that I can get an idea of space and to look for errors, improvements and errors.


Work in progress but progress!





Share this post

Link to post
Share on other sites

I'm away from the office (I mean shed) at the moment in Helsinki so it's a little difficult to make the front panel for my “Throttled CAB” Controller.


However, I did bring the newly built SDB board, various leads and my faithful Gronk.

So the first job was to make sure that the board worked.

I connected everything up, selected a program to download and – Nothing! Not a beep or a twitch!

Ok, my fault, wrong program selected. Try again.

This time the 08 went mad!! It started jiggering, singing(!) and juddering back and forth up and down the track – Seemingly at random.

Ok, my fault, wrong program again but this program, I downloaded into SDB, was the Stepper test routine.

(I don't think my much abused Gronk will myther me for a raise in pay, or even ask for a transfer. I think it's just going to leave!)

This time I loaded the FreeSound2 program and all worked well proving that the newly built Smart Driver Board was all working, as it should do, and was ready to be installed into the controller.


So then I started work on creating a data format that I can use to store (record) a shuttle movement for later playback. This feature, I hope, will be one of the 'useful' innovations that will be incorporated into this controller. Not just a shuttle unit but a train movement with as many, (within reason), speed ups and slowdowns as you want.

I'm aiming for a maximum record length of about a minute. This should be Ok for back and forth shuttling within the average UK home!


One other thing I achieved today was to visit the Finish national railway musem in Hyvinkää.

It was brilliant!

Well recommended, if your in that neck of the woods! (doh!)



Share this post

Link to post
Share on other sites

Today I have worked on the front panel for the controller.

I'm thinking of using “Traffolyte” as it has a high contrast, is tough and hard wearing.

(Wander how much it costs?)


Also, White Text on a Black Background or Yellow Text on a Black Background?



The panel with markings for cut-outs and angle positions.



A 3D representation of the panel.



(I also visited the Helsinki Tram museum - it's very small with only 6 Trams! but still ok/good.)

Share this post

Link to post
Share on other sites

More progress, but it seems a bit complicated for such a small front panel.

Just as well I have drawn it out first!


To wire up, (and check), the front panel of the “Throttled CAB Controller” I needed to produce a table(s) listing all the SDB I/O in relation to the “Throttled CAB Controller” I/O.

I really needed to know if it would all fit and that the necessary PIC functions were still available.



This first table lists the required Functions to the Wires and Cables.



This table lists the required Functions in relation to SDBs Schematic and PCBs.



The, (latest!), final circuit diagram for the wiring-up and resister placements.



This final table was used to calculate, (and check), the resister values required to get the 'right' voltage levels to select the “TRAIN TYPE” and also so that the “STOP” push button would always work, (in analogue input AND digital input modes), even if the Rotary SW is half way in between ANY of the available positions!

(I could have arranged the resisters into a simple voltage divider network. That would have been easier to calculate but more difficult to solder to the Rotary SW as this would require two resisters being soldered to each terminal instead of one!)


Now all I need to do is make it!



Share this post

Link to post
Share on other sites

Having put in all the work on the schematic for the front panel, I was looking for the ribbon cable that I intended to use from J7 to the various front panel controls.


Although, I didn't find my 'stash' of ribbon cable, I did come across this 'Gem' hidden away in my many “useful-in-the-future” junk piles!



It has probably come from either a scrap printer, scrap VRC or a scrap photo copier! All good sources for 'mechatronics' parts and places of great interest when I was a student!


Anyway, the workmanship on this ribbon cable is superb. (OK, it's probably automated but still, just look at that stitching!)

I want this on my 'Throttled CAB Controller' project, so I am going to re-assign the colour codes to J7 and update the drawing to match.


Out of interest, that same scavenged PCB has two IR proxy-sensors, a small stepper motor, that ribbon cable and a mercury tilt switch!

How could I resist that 25+ years ago?




Share this post

Link to post
Share on other sites

Today I got the front panel printed off and laminated.

Now I'm cutting/drilling/aligning/swearing/re-drilling all evening so that tomorrow I can start soldering the wires and resisters to the POTs and switches.


Not much time left now.

Must get on.




As a little extra, I've seen a Foam Hot Wire Cutter in a catalogue but it needed a seperate PSU to run it.

I think I will look into this as another use for SDB!



Share this post

Link to post
Share on other sites



Just wondering if i've turned the "Throttled CAB Controller" project into a kit?

NO I Haven't - but it is now a kit! (Except for the software developing...)





Share this post

Link to post
Share on other sites

Yesterdays progress.

The cello tape is just temporary to be replaced with neater cello tape!






Today I don't feel like doing anything!


Share this post

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

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.