Jump to content
 

DCC Controlled (PECO) Turntable Project using a Arduino Uno


Recommended Posts

Hi Guys,

Having issues with this project atm.

 

Got the DCC circuit up on a bread board, plug my DCC controller in (Hornby Elite) and all I get is 'error' on the Elite.

Did some investigation:

Took out the 6N137 chip so all I have is the 1k resister and the 1N4148 Diode

I STILL I get an error. It detects it as a DCC short.

I assume the resister is unidirectional?

I am aware the diode is one direction only (and I have swapped it around just in case).

With the diode disconnected there is no error (as it is an open circuit).

 

Been over the whole damn thing testing for shorts and anomalies but this is as simple as it gets.

 

HELP!

 

Kind Regards,

Link to post
Share on other sites

Have you tried the Locomotech project here ?

http://www.locomotech.com/

I have tried this. I sourced all the parts, but the real issue here was the DCC chip and slow running. I tried several chips but getting the damn things to run nicely at slow speeds was tricky to say the least. They seemed to suffer with hiccups and 'funny turns' periodically.

Link to post
Share on other sites

I have tried this. I sourced all the parts, but the real issue here was the DCC chip and slow running. I tried several chips but getting the damn things to run nicely at slow speeds was tricky to say the least. They seemed to suffer with hiccups and 'funny turns' periodically.

 

I haven't tried it with a Dcc chip yet as I'm building a terminus which the turntable will be part off.

I just fitted my turntable with the Locomotech gear to try it out & make sure it worked.

I ran it with an old H & M Clipper & got it running so slow I could hardly see it move.

Did you try the Locomotech motor on Dc to see if it worked properly ?

Link to post
Share on other sites

hi amdaley

I haven't yet but looking at it, it's just more expense. May have to re-think the layout, which is a shame as the main part is the loco shed and the rest is just starting to come together nicely. 

Link to post
Share on other sites

i agree re the smellchequer.

 

the Metalsmiths t/t has a PCB deck, (at least in 7mm) and I would recommend this as a very solid starting point.  Adding plastic girders shoudl be very easy.  There are really only two challenges, IMO - the  rails on the deck must be parallel to the centre line of the deck, through which the  pivot must pass - this is a marking out exercise, with a bit of careful soldering, and the rail around the pit must be flat & concentric with the table pivot, for which Metalsmiths provide a jig, a piece of bar with a hole at one end and a slot for the rail at the other.  If you achieve these, then the cosmetics will be easy to add.

 

Do post progress photos!

 

best

Simon

Link to post
Share on other sites

Hi Guys,

Having issues with this project atm.

 

Got the DCC circuit up on a bread board, plug my DCC controller in (Hornby Elite) and all I get is 'error' on the Elite.

Did some investigation:

Took out the 6N137 chip so all I have is the 1k resister and the 1N4148 Diode

I STILL I get an error. It detects it as a DCC short.

I assume the resister is unidirectional?

I am aware the diode is one direction only (and I have swapped it around just in case).

With the diode disconnected there is no error (as it is an open circuit).

 

Been over the whole damn thing testing for shorts and anomalies but this is as simple as it gets.

 

HELP!

 

Kind Regards,

 

Sorted my issue. Turned out to be a faulty resister!

Link to post
Share on other sites

For what it's worth here's mine running off a Multimaus and decoder. No issues with the Locomotech motor.

 

Just waiting for the upgrade indexing to arrive this morning.

  • Like 1
Link to post
Share on other sites

For what it's worth here's mine running off a Multimaus and decoder. No issues with the Locomotech motor.

 

Just waiting for the upgrade indexing to arrive this morning.

 

That looks very good bgman.

Let us know how the new indexing system goes.

Will be looking into getting that myself.

 

What decoder did you use on the turntable motor ?

Link to post
Share on other sites

That looks very good bgman.

Let us know how the new indexing system goes.

Will be looking into getting that myself.

 

What decoder did you use on the turntable motor ?

Thank you, I used a spare TCS T2 decoder to address the motor. No whine whatsoever and very smooth slow running. If you're an existing customer of Locomotech you will get a discount off the indexing unit too!

 

Here's a quick photo of the motor in place with the decoder attached using double sided foam tape.

 

 

post-20303-0-14230300-1460718617_thumb.jpeg

 

I will update when I've received and fitted the indexing unit.

 

Cheers

Grahame

Link to post
Share on other sites

Anyone else having issues with motor whine?

# 287 using the Locomotech motor in a " conventional" sense ( just dcc decoder running off a Multimaus ) silky smooth and quiet.

Link to post
Share on other sites

p.s.

 

I also included a Hex Frog Juicer ( to some they are the Marmite of electrics - love 'em or hate 'em !) for the polarity changes and works fine too.

Link to post
Share on other sites

i think the whine is inherent of the stepper motors, the rev 17 software powers down the stepper after it has rotated, it also has a provision for a servo brake which i intend to use, i'm just going to make a foot shape on a bit of rod to push against the opposite side of my contact plate to act as a brake. 

 

on a separate note, i'd have a good play and using a relay controlled by the Arduino works perfectly

 

 

started building up the rest of the bridge now

 

2016-04-15%2021.43.32.jpg

Link to post
Share on other sites

  • 4 weeks later...

Finally had the last items delivered for this project, so back home for a few weeks and within the wiring of the DCC bus and the setting up of the MegaPoints servo controllers in the fiddle yard I hope to progress this project.

The Peco turntable has been started the hole at the end of the fiddle yard has been cut, so there is nothing stopping me now ;-)

Link to post
Share on other sites

i think the whine is inherent of the stepper motors, the rev 17 software powers down the stepper after it has rotated, it also has a provision for a servo brake which i intend to use, i'm just going to make a foot shape on a bit of rod to push against the opposite side of my contact plate to act as a brake. 

 

on a separate note, i'd have a good play and using a relay controlled by the Arduino works perfectly

 

 

started building up the rest of the bridge now

 

 

Note that the servo needs a separate power supply as a stalled or loaded servo will overload the ada-fruit board and reset the unit. (I found this out the hard way).

 

Glad you like the servo brake.  It worked really well.

Link to post
Share on other sites

  • 2 weeks later...

Hi guys,

It’s been a while since I was on this thread but in my defence I have been productively busy.

 

Firstly I would like to thank ‘tender’. His initial thread and project build guidelines have spurred me on to where I am now. His guide and code has been the starting point for a good deal of fun and have introduced me into the whole world of electronics.

Anyway, talking of where I am now, here goes…

 

You may have seen my comments about motor noise from the stepper motor. I went off and did some research and found that microstepping seems to be the bain of all and sundry when it comes to quiet/smooth running of stepper motors. Another issue I found was that the Adafruit Motor Shield is OK, but not great. It is very limited on the current it can handle (and therefor the steppers it can drive) and whilst it is a ‘plug and play’ option for Arduino Uno users it is still going to require a board being made up to house the DCC control components. I was left with the feeling that the Uno/Adafruit combination is OK for tabletop ‘tinkering’ but for a dedicated single motor project it is not really the tool for the job. I really didn’t need to drive two steppers, four DC motors and a handful of servos. I needed to drive one stepper well and with the minimum of fuss.

More research showed that powering the Arduino would take a dedicated and regulated 5v power input as well as a separate 12v power supply for the motor shield (as the Arduino cannot and should not be used to power a stepper motor on an Adafruit shield). I also had issue with the Adafruits choice of stepper driver. An H-Bridge driver is about as basic as it gets. This left me feeling like the whole thing could be improved. So I did (I think).

 

Firstly, ditching the Uno. I got a Nano instead. At £3.50 it can be mounted on a bread board and easily mounted on PCB headers. You use the same code as you do for the UNO. Trust me; it just works. At approximately 1/6 the footprint of the UNO I was already making progress with a view to shrinking everything onto one breadboard.

 

With ditching the idea of microstepping in mind, the stepper motor was a no brainer; just nipped onto eBay and get a Nema14 12v/0.8amp with a 100:1 planetary gearbox. The motor has a 1.8-degree step, which equals 200 steps per revolution. Multiply that by 100 and you are looking at 20,000 steps per revolution. Microstepping is for wimps! Plus, you get little or no whine, a cooler motor and little/no danger of uneven microsteps/missed steps. Happy days.

 

The next thing was the stepper driver. I opted for good old A4988 Stepstick driver. No bigger than a postage stamp and drives a motor up to 2amp with voltages from 8-35v. Now that is a flexible bit of kit.

 

It operates in a much more technical way than the H-Bridge. Effectively over supplying the motors voltage, but sensing and then chopping the power before it gets too much for it. That way when the motor warms up and the coils have more resistance it is able to adjust the power accordingly. Add to this that you can adjust the power cut off so you can under power the motor, reducing torque but also saving power and reducing any heat (If you have any).

 

So ultimately I ended up using a 18v 2amp power supply for my 12v stepper motor with no issues. The next obstacle was getting the power to the Arduino Nano. It was staring me in the face (it was on the internet); use a 7805 5v power regulator and a couple of capacitors to regulate a feed from the 18v 2amp supply on my breadboard to the 5v pin on the Arduino. That resulted in a nice clean regulated 4.8v. Job done!

 

The Hall sensor and DCC side of things I left untouched from ‘tenders’ original design.

 

So… now I had a breadboard that looked like a rats nest. Sooner or later one of those little wires is going to come loose and I am going to have to get under my layout with a torch and bad eyesight and fix the damn thing in-situ. How do I get this mess into a practical bit of kit that will be robust enough?

 

IMG_4241.jpg
 

The answer was a dedicated PCB with headers to take the Nano, A4988, 6N137 and the other components required. I spent a day getting the design together onto a single sided PCB that is 5mm bigger than a credit card and sent it to China for prototype production on a 5 day turn around. I guess with a bit more time I could have shrunk the damn thing down even further, but space is not a real issue.

 

pcb-design.jpg

 

Whilst my design was having the time of its life in China I did some tweaking to the AccelStepper code libraries to introduce a ‘setBacklash’ parameter (I found details buried on the internet). This deals with any gearbox backlash (which is actually pretty minimal anyway). That way you can set the backlash in the same way as you set the other AccelStepper parameters e.g.

 

 

…
stepper1.setMaxSpeed(20.0);
stepper1.setAcceleration(10);
stepper1.setSpeed(20);
stepper1.setBacklash(20);
…

 

It just senses the direction and adds the backlash steps accordingly.

 

So there we have it a dedicated PCB with all the inputs and outputs to allow full DCC control of a stepper motor from 8-30v and up to about 1.5a with no additional cooling (or 2a if you fancy some active cooling).

 

IMG_4253.jpg

 

IMG_4255.jpg

 

IMG_4259.jpg

 

IMG_4256.jpg

If you are interested in one of my boards to simplify a DCC/Stepper project like the ones on this thread, then please PM me, as I have some available. If you would like details of my modified AccelStepper libraries, again, PM me.

 

If you are reading this thinking that it is all a little beyond you I can assure you that it is not as complicated as you would think. With a decent soldering iron and a little practise I got the first board fully assembled in approximately 1 hour (allowing a suitable amount of paranoid double checking between the assembly of each component). I had zero electronics exposure or experience a few weeks ago, now I have built a robust solution to run my project, learnt to solder and designed/produced my own PCB.

 

Any questions? :)

Edited by Rigid Collision
  • Like 3
Link to post
Share on other sites

Liking that lots. Can I purchase a clone of your board, or copy your artwork?

Thanks

Simon

Simon,

No problem. I have 6 boards from the prototype run (there was a minimum quantity). You will need some header socket strip, some 2 and 3 pin terminals and a total of eight components (some capacitors, resistors, diodes and a 7805) but we are talking a few quid for the lot. I am getting a build spec sheet together for the boards for diy assembly with clear instruction to avoid mishaps and the links for eBay that I used to purchase components. I will also be posting the modified libraries and my code for anyone wanting to use the A4988 stepper driver. The libraries I used are v1.6 (the very latest ones) and are heavily commented to ensure that the code I added can be identified easily and can be applied to subsequent releases painlessly.

 

Also keep you eyes open for power supplies. Basically anything from 7-30v is fine. Don't go too mad, just make sure it has more voltage than your intended motor. Avoid having the same voltage as your motor, as the A4988 works best if it has over voltage to chop correctly. It took me a while of hunting to find an old power supply that did the trick (felt a bit weird to actually buy a power supply when so many are thrown away).

 

PM me and we can have a chat about boards...

 

P.S. The artwork is only part of the story, you need PCB design software like 'Eagle' to enable you to layout and produce the 'Gerber' files required for all the layers that the PCB industry requires. A Gerber format file is produced for each layer on the board and even a simple board can have seven or eight different files for top silk screen, top copper, bottom copper, various masks and the CNC drill sizes and hole locations.

Edited by Rigid Collision
Link to post
Share on other sites

Thanks to all who have contributed to this thread.  I have learned a lot in the past few days by reading it all!  My own turntable will be Arduino (Pro Mini) controlled but not DCC.  Just a push button to index it 180 degrees at a time--one incoming road and just a short over-run track opposite.  I don't plan on any sensors--just hold the table in alignment to the incoming road with a little jig that fits between the railheads during power-up.  The stepper will have a belt reduction to the table, so snapping to the default full-step position at power-up will not move the table perceptibly.

 

In my professional life, I've been using stepper motors since the L/R-driver days.  In all the laboratory equipment I've been involved in designing, we dropped the holding current to the steppers after a move was completed.  Steppers produce much higher holding than running torque for a given current, so this is a safe way to decrease power dissipation.

 

None of the Arduino motor shields, nor any single-board stepper drivers seem to have this feature.  But last night I discovered a new board from Polulu, the DRV8880 based on a TI chip.  This has two digital inputs that allow selecting 25%, 50%, 75% or 100% of the operating current which is itself adjusted by the typical trim pot.  Polulu's webpage for the board is https://www.pololu.com/product/2971

 

Two digital lines from the Arduino will allow selecting full current at the beginning of a move, and reducing the current at the end of the move.  Since a turntable spends the vast majority of its time in a static position, this driver has the potential of decreasing the motor and driver power dissipation and thus heating.  I have ordered one and am eagerly awaiting it.

 

Randy

Edited by zephyr9900
Link to post
Share on other sites

Thanks to all who have contributed to this thread.  I have learned a lot in the past few days by reading it all!  My own turntable will be Arduino (Pro Mini) controlled but not DCC.  Just a push button to index it 180 degrees at a time--one incoming road and just a short over-run track opposite.  I don't plan on any sensors--just hold the table in alignment to the incoming road with a little jig that fits between the railheads during power-up.  The stepper will have a belt reduction to the table, so snapping to the default full-step position at power-up will not move the table perceptibly.

 

In my professional life, I've been using stepper motors since the L/R-driver days.  In all the laboratory equipment I've been involved in designing, we dropped the holding current to the steppers after a move was completed.  Steppers produce much higher holding than running torque for a given current, so this is a safe way to decrease power dissipation.

 

None of the Arduino motor shields, nor any single-board stepper drivers seem to have this feature.  But last night I discovered a new board from Polulu, the DRV8880 based on a TI chip.  This has two digital inputs that allow selecting 25%, 50%, 75% or 100% of the operating current which is itself adjusted by the typical trim pot.  Polulu's webpage for the board is https://www.pololu.com/product/2971

 

Two digital lines from the Arduino will allow selecting full current at the beginning of a move, and reducing the current at the end of the move.  Since a turntable spends the vast majority of its time in a static position, this driver has the potential of decreasing the motor and driver power dissipation and thus heating.  I have ordered one and am eagerly awaiting it.

 

Randy

 

Hi Randy,

As far as I am aware the A4988 has an 'enable' pin. On my PCB design I took the liberty of connecting it to the Arduino I/O 6, but as yet have not had time to put any code behind it to test it.

Interesting that we have a new driver. I had looked at the DRV8825 but reports from users indicated less than satisfactory results and many users were going back to A4988's at they are tried and tested.

I will get one and pop it onto the test rig here and see what happens.

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
 Share

×
×
  • Create New...