Jump to content
 

DCC Controlled (PECO) Turntable Project using a Arduino Uno


Recommended Posts

On 20/01/2019 at 15:45, alangdance said:

A question for Ian Jeffery.

Just seen the vid of the traverser. Would the be code available

to use

 

Alan

 

On 21/01/2019 at 11:58, ianjeffery said:

just emailed you Alan.

 

Could you do the same for me please?

Link to post
Share on other sites

On 05/02/2019 at 22:23, Simond said:

Just playing with my turntable control, as I’m installing i2c remote control, and whilst I’m at it, I wanted to stop the damn thing whining, so I started to look for the data sheet for the A4899 driver.

 

found this in case anyone else is searching

 

http://html.alldatasheet.com/html-pdf/338780/ALLEGRO/A4988/2974/10/A4988.html

 

It’s not ideal (at least I couldn’t download it) but at least explains the not-enable and not-sleep pins, which I have now connected to the slave Arduino that controls it.  More in my Arduino thread linked in my signature.

 

atb

Simon 

 

 

if you upgrade to the slightly more expensive TMC2208 driver, its almost completely silent, and no longer requires to disengage the "Enabled" pin...

 

the downside to turning off the "Enabled" pin is that the bridge can jump back/forward to the nearest whole step, taking it out of alignment. Plus its free to move, so the controller no longer "knows" where the stepper motor is.

Link to post
Share on other sites

3 hours ago, ianjeffery said:

 

Trying again as my last reply was blocked for some reason....probably for drifting off-topic (Arduino)...

 

Not really Ian as my stereo jack/socket carries both 360 degree movement and uninterupted power to the table rails via the stereo segments for both bed polarity and led indicators.

 

I tried soldering a wire down the centre of the jack plug but it was too whippy for accurate positioning. The socket is affixed to the TT base and the jackplug to the table. This allows the table to simply lift out for detailing work, etc.

 

I had thought of boring out the centre of a large gear to clear the socket but so far have not been able to locate a suitable size cog on the interweb, and  aligning it dead centre would be essential as I would also like it under the layout not above ground.

Rob.

 

Link to post
Share on other sites

5 hours ago, ianjeffery said:

 

if you upgrade to the slightly more expensive TMC2208 driver, its almost completely silent, and no longer requires to disengage the "Enabled" pin...

 

the downside to turning off the "Enabled" pin is that the bridge can jump back/forward to the nearest whole step, taking it out of alignment. Plus its free to move, so the controller no longer "knows" where the stepper motor is.

 

Ian,

 

thanks for the thoughts.  I’ve adopted microstepping, and this seems to have made it much quieter.  Not quite sure why.  I haven’t used the Enable option yet, as I was aware that I may suffer a loss of position, and I’m already suffering that, but at least whilst I had it all in bits, I soldered the links in place for it, and for the microstepping pins.  

 

Re the strange loss of accuracy, please see (and comment if you’re so inspired!) in my Arduino thread - link below - I’ll add more info there to keep it all in one place.

 

best

Simon

Link to post
Share on other sites

  • 1 month later...

Hello from the Netherlands.

I found this topic a while ago and I`am very pleased with it cause i wanted a turntable control without motor/gear noises.

Built it up from stage 1 to 7 and it works great exept fot one thing , the beep of the stepper when he is supposed to do nothing.

Now I found out when you press the buttun for or bachwards and the bridge is at his destination and you press the same button again the beep stops.

This will work for my Roco Multimaus  , maybe also for other controllers.

P.S.  I hope I spell all of this right.

Adrie

 

Link to post
Share on other sites

Adrie,

 

when the English speak Dutch as well as the Dutch speak English, we’ll discuss your spelling.  :)

 

I’m assuming when you say “beep”, it’s a continuous noise like a whine or whistle.  It’s interesting that this stops on a second press of the button.

 

best

Simon

Link to post
Share on other sites

59 minutes ago, Simond said:

Adrie,

 

when the English speak Dutch as well as the Dutch speak English, we’ll discuss your spelling.  :)

 

I’m assuming when you say “beep”, it’s a continuous noise like a whine or whistle.  It’s interesting that this stops on a second press of the button.

 

best

Simon

Yes , that`s what I mean the costant whine.

Link to post
Share on other sites

I had the same issue, until I enabled microstepping.  That stopped it, but I don’t understand why.

 

im just doing the new driver board (see my Arduino thread, link below) so will report when it’s running.  Maybe tonight, certainly this week.

 

best

Simon

Link to post
Share on other sites

Hi folks,

 

I also, have been reading this thread with interest for several months, and following a few Utube videos by Massimo, so I decided to do the decent thing, and buy my 1st Arduino, as last Saturday was World Arduino Day,  - or was that just in Massimo’s head or just in Milan ?

 

I have a few questions, and knowing this is not a question thread, perhaps someone will direct me to the right path if this is not allowed here, but I’ll continue anyway....

 

I currently have a Peco 00 turntable, driven from ECoS as a loco, through the usual plastic gearbox Jobbie, with worm drive, and using a basic Hornby loco decoder. I have a loop changeover which takes care of the polarity change as the bridge passes the dead spot, and it all works well, if you don’t mind aligning by eye, with an iPhone running Touchncab! The turntable is some distance from ECoS, hence the thoughts about Ray’s lovely scheme here.

 

Q1. Will this project work ok with my ESU ECoS 50200 ?

  - presume, as I have 4/5 roads off my Peco 00 TT, that I make the necessary 4/5 accessories on the ECoS, with say, 200, as the dead-spot / reference, then, say 201,202,203,204,205,and 206 as the outgoing roads.

 

Q2. Once all the programs have been edited, tweaked, and are working to one’s satisfaction, does one still need a PC connected to the arduino? 

I suspect the answer is yes, as subtle tweaks seem to an overriding theme on this thread!

As I don’t (yet) own a laptop, and my PC is a floor below my layout, can the arduino be manipulated with something like a Windows tablet, with USB port? 

(I understand that separate power is required for the motor, and / or adafruit motor-shield.)

 

Q3. Does the Arduino Uno r3 have a large enough memory to hold all the coding, libraries, etc., and still perform the tasks, or does one require additional memory, eg: SD card or similar?

 

Great thread so far, and I’d love to get my kit up to scratch and join in, not to mention, make my Turntable work properly,

 

Regards,

 

Alan.

  • Like 1
Link to post
Share on other sites

Hi Alan, 

Glad to see that some six years after my original post that this is still attracting interest.

 

In answer to your questions.

 

Q1. I can't think of any reason why this shouldn't work with your ECoS system.

Q2. Once set up there shouldn't be any requirement to have a PC connected. My turntable has been working happily without a Pc for several years.

Q3. I've not had any memory shortage problems with the Arduino Uno for this project.

 

Good luck.

Ray.

Link to post
Share on other sites

Hi Ray,

 

Those are very encouraging answers, thanks.

 

I’m part way through my build, I’ve got the UNO R3, Adafruit Motor Shield, and Adafruit stepper motor, and all tests run and the stepper is stepping like a gud ‘n!

 

My next step (!) is to set up the DCC interface, as your per your original, I’ve sourced an opto coupler and diodes from RS in Stockport, and am currently fiddling with a Hall Effect Sensor, that I’ve had for quite a few years, originally purchased for the turntable, but I’ve never managed to make any sense of it.

 

Mine were bought from that sadly missed place Maplin, and are much smaller than the Honeywell (?) one that you show in your ongoing photos. I have a lot of small but powerful magnets from Magnets 4 You, which I use under locos for switching reed sensors, (for Routes on the ECoS). Would these work OK on the TT bridge?

 

I see that DCCInterface now sell fully made boards etc, and they show the Keyes Hall Effect board, which has the same sort of small H E Sensors as mine, - I do wonder how one would get that board to sit close enough to the Peco TT well ?

 

I see that DCCI also sell the bellows connector for a ‘proper’ price, rather than RS or Farnell at massive prices!

 

Do you think the small H E sensor that I have would work in your original situation?

 

And, being really cheeky, can anyone advise me which way round to wire the Hall Effect Sensor?

There are conflicting pictures and guides on t’interweb, and I’d hate to blow things up by powering the wrong legs!

 

Regards,

 

Alan.

Link to post
Share on other sites

  • 2 weeks later...

I have been following this thread for a couple of years and it is good to see some new activity, and that Ray is still following and answering queries.

 

I have been developing my own version of this using a scratch built turntable deck but as I use analogue control for the layout, I have built a system using a series of push buttons for the landing positions.  This is based on Ray's original sketch with the DCC commands removed and positions defined for each push button.  Does anyone know if there is a non DCC version of this thread that would cover this alternative?

 

I would like to once again thank Ray for starting this thread and publishing his code which has been invaluable.

 

Regards,

 

Colin.

  • Like 1
  • Thanks 1
Link to post
Share on other sites

Colin

 

I am also not using DCC to operate my points and turntable.  You might some bits & pieces of inter3st on my Arduino thread - link below.  I’m not making much progress at the moment, but I do have push-button control

 

best

Simon

 

 

 

Link to post
Share on other sites

Simon,

 

Thanks for the response.  Yes I have been following your Arduino thread.  I'll have a look back at your posts regarding the turntable and maybe posts any comments in there.

 

I also now recall that I was also influenced by some of the postings by CambrianCoaster on this thread.

 

Regards,

 

Colin.

Link to post
Share on other sites

Thanks Colin, 

 

I hope to make some progress with my t/t over the next week or two.  

 

My points are working reliably, using i2c comms from the control panel.

 

The t/t works from the computer using the serial link to the Arduino and using the little button pad I built some years back, but I’d be very happy if I can get the i2c working with the t/t.

 

Once I have something I’m happy with, I’ll post the code, which you’re welcome to use, modify, whatever, if it helps.

 

best

Simon

Link to post
Share on other sites

  • 4 weeks later...

Help !!!

 

I've got as far as Step 4 on Ray's first page, and i'm struggling.

 

I have Uno, and Adafruit Motor Shield V2.3 and wired that to 5v, Grnd, I/o 2 and I/o 3 as per Ray's diags, ... I have not wired Reset, it didn't seem neccesary?

 

I've got the Stepper Test to work fine, and I've made the DCC Decoder board, (on BreadBoard) following the diagram and Ray's photo, and all i get on the serial monitor is four rows ending in zero....

 

I've double checked all the bits on my breadboard using my multi meter, and all the connections seem to be ok, all giving full responses as far as i can detect, my Sprog is sending instruction to a loco on my small length of track, which is connected to the breadboard, but all i'm getting is scrolling rows of zeros on the serial monitor.

 

I suspect i've got the libraries and/or scripts in the wrong folders, or i'm missing bits of libraries. - for example where on earth should 'Wire.h' be? i can't find anywhere on my PC...

 

Any suggestions, anyone?

I could add a photo of this temp setup if required.

 

Regards,

 

Alan.

Edited by bigal10
Link to post
Share on other sites

  • 1 month later...

I am very new to this, just got my first Arduino last week, so still very confused.  I would like to ask a few questions if I may, as a turntable for an OO gauge layout is my goal.

 

I see that you are using a direct drive. As the motors seem to have 200 steps, this gives a resolution of 1.8 Degrees. At the outer edge of a 325mm dia TT this is a step of about 5mm, dose this not make it a bit jerky??

I was planning on a 5:1 belt drive.??, would this not be an improvement??.

My ideal way of operating would be to have a button to press for each position. A maximum of 8 positions. The TT moving from wherever it is, to the required position.

Is this possible/practical.

I feel that the chances of me being able to write the required program (sketch?) for this is about 1000:1, so is here anyone out there who has done this and could supply me a copy of said program.

Please be gentle with me...

 

Many thanks for any help that you may be able to give.

 

Barry Cole

Link to post
Share on other sites

Barry,

 

read about “microstepping”.  This technique allows the motor to move in fractions of a step.  1/16 is popular.  There are options to go beyond this.

 

yes I have done a similar program, it’s “in bits” at the moment, if you bear with me, I will share it.

 

others have also done so, they might be quicker than I will be!

 

atb

simon

  • Like 1
Link to post
Share on other sites

Simon,

Thanks for that, I will do some reading. I have a little stepper motor with the starter kit that I bought. I will have a play with that first.  I am in no particular hurry, so I can wait for your help.

 

Thanks for taking the time to reply.

 

BC

  • Like 1
Link to post
Share on other sites

Er, yes, there is one posted.  Mine is not direct drive but has a built-in gearbox with a ratio of 99-and-a-fraction to 1.  No, I don’t know why.

 

 

I’ll try to find the link in the morning.

 

best

Simon

Link to post
Share on other sites

Barry, some links here

 

 

 

 

 

 

 

this is all a bit of history,  if you look at my Arduino thread (link below), you'll see the state of play a couple of months back, with a new TT driver, points control, and I now have the bits to do the layout lighting control too.

 

hope it helps

Simon

Link to post
Share on other sites

  • 1 month later...

Ray, Ian, Simon et al, 

 

Been reading up on all the Arduino posts on RM Web and I think this is the right thread to post in. Thanks for all the work you have done. Makes life a lot easier for us late comers. I have dabbled in various computers dating back to the Commodore 64 and done a bit of programming in the past, but have spent a lot of time since then as a project manager, so pretty rusty. However with the various sketches out there I sure I can modify the TT sketch to do the Traverser. Ordered a Arduino starter kit to get up to speed.

 

I am looking to do a Traverser but for O Gauge. It will be 1.2m long (4ft) and have 3 tracks so a fair amount of weight. I was thinking of doing two stepper motors driving two toothed belts. The traverser ser will be supported on drawer runners. 

 

I am going to buy one of Ian’s boards. However will the NEMA stepper motors be strong enough to push the weight? 

 

Looking to to start building the traverser next week. 

 

Cheers

 

Brian

Link to post
Share on other sites

Brian

 

welcome on board

 

I have written a traverser sketch for a two position traverser for Paul Ashton.  You’ll be able to download it from Western Thunder, I think I posted it in his Moor St thread, though I have an Arduino thread over there too.

 

i think it would be reasonably easy to adapt it to three positions.  Paul found a very nice stepper & leadscrew assembly on Amazon, you should certainly check it out.  I doubt you’ll have any issues with power.

 

hope this helps

simon

Link to post
Share on other sites

8 hours ago, Simond said:

Brian

 

welcome on board

 

I have written a traverser sketch for a two position traverser for Paul Ashton.  You’ll be able to download it from Western Thunder, I think I posted it in his Moor St thread, though I have an Arduino thread over there too.

 

i think it would be reasonably easy to adapt it to three positions.  Paul found a very nice stepper & leadscrew assembly on Amazon, you should certainly check it out.  I doubt you’ll have any issues with power.

 

hope this helps

simon

Thanks Simon, 

 

Pauls Moor St thread was a good read, but I see he hasn’t finalised the traversers. 

 

I have applied to join Western Thunder so I can grab the sketch, awaiting the email.

 

I don’t think I can use a screw as my layout in on a shelf and it will go one way. See below diagram of intended plan. The bridge is 250mm wide and the baseboard is 350mm. The total travel is about 240mm.

traverser.jpeg.e5676e2731272c8e8351c911bc22ab36.jpeg

I need to measure the stepper and joiner to see what is the minimum length to see if it can fit just inside the frame.

 

Thats why I was considering two toothed belts one at each end. Open to other suggestions.

 

Regards

 

Brian

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...