Jump to content
 

DCC Controlled (PECO) Turntable Project using a Arduino Uno


Recommended Posts

  • RMweb Premium

Thanks Simon.

 

I can see your logic and was going to adopt the one way round idea until I suddenly remembered that despite it not really mattering whether diesels were turned or not, the majority of the stock on the layout is fitted with Dingham couplings which means they'd need to be turned twice.

Link to post
Share on other sites

  • RMweb Premium

Update:

 

I originally purchased an A4988 driver and then discovered that the DRV8825 driver handled more current, so I purchased one of those and have been using that for the testing.

 

Trawling through numerous Internet pages yesterday trying to find something that might give me a clue as to how I could address the problems I've been experiencing led me briefly to a forum post or response to a post somewhere suggesting there were reported problems with the DRV8825 driver.

 

And so, on the off chance that it might be better, I swapped the DRV8825 for an A4988 driver and BINGO! My problems disappeared.

 

I've now had the A4988 running for a while during which it has performed some 120 or so randomly generated push button combination move simulations in groups of 40. It returns to the starting position at the end of each set - at least I can't see any deviation from that position on the test bed.

 

Problem apparently solved, thankfully.

  • Like 2
Link to post
Share on other sites

  • 5 months later...
  • 2 weeks later...
On 07/09/2023 at 01:45, 38Durum01 said:

Hi Ternder/Ray

I am following this 6 part project and can read the text but connot open the variou jpeg files. I have tried several browsers but nnone will open hem. Can yo send me copies of the jpegs.

Regards

Ken (30Durum01)

Ken,

 

See post ref pics a couple of pages back.

 

Rgds,

Link to post
Share on other sites

  • 9 months later...

Hi,

 

I posted a request for some advice elsewhere on the forum as I thought this thread was dormant.  I probably made an impossible request as I didn't get any responses.   However I managed to work out my issue myself.  I am planning to build myself a DCC Peco turntable with a closed loop stepper motor as opposed to the open loop motor in the original post.  I have generated some new control code for the closed loop encoder using Chatgpt as I am not a programmer . I have also designed a pcb board (my first ever electronics design for anything) to interface with the stepper motor.  All this is still virtual at the moment but I was wondering if there is any interest in me sharing what I am doing or am I the last one to the party as far as using a closed loop stepper controlling a Peco turntable is concerned?

Link to post
Share on other sites

  • RMweb Gold

Yes, please post.

 

I am always interested with the various "solutions", to model railway requirements, submitted to RMweb.

Please post the proposed schematic and the PCB layout.

 

There are a few very good electronics engineers, on here, who can give your design the once over.

Although, I suspect, the software will be the greatest challenge and the part that we (collectively) will be least able to debug/help.

 

 

Kev.

 

  • Agree 1
Link to post
Share on other sites

Hi,

 

I am using Fritzing to design this so please bear with me as I am learning as I go along on both electronics and Fritzing.  The schematic is hopefully attached and readable.  I will try to get the pcb layout uploaded in the next post.  There are numerous files created when the design is exported, I need to work out which ones are the most useful for review.  I will post the code once the pcb design gets reviewed.  The aim of the PCB is to make a neat way of connecting the turntable motor to the dcc system and power supply.   There is an emergency stop included for now.  I am not sure I need it but I included it as ChatGPT included an option in the code to have one probably based on what 3d printers need.

 

Thanks.

stepper TT control circuit schematic.jpg

Link to post
Share on other sites

OK here is the PCB design.  Yellow track are top layer.  Brown tracks are bottom layer.  The auto Fritzing review says its OK for connectivity.

PCB TT version 3.1_pcb.jpg

Link to post
Share on other sites

  • RMweb Premium

Just a comment

The usual device for opto coupling DCC is a 6N137, it's used by most manufacturers of DCC devices and all of the DCC projects I have built use it.

Any reason for the 4N35 instead?

 

Data sheet:

6n137_vo2601_vo2611.pdf

  • Like 1
Link to post
Share on other sites

  • RMweb Gold
Posted (edited)

The LED, parallel to the opto LED, needs to be the other way round. (According to the schematic - I have not checked the PCB component/PAD assignments.)

The Electrolytic capacitor values need to be slightly bigger, depending upon the Power-On-Reset circuitry of the Arduino - say 100uF on the input to the 7805 and 10uF on the output. (The disc ceramic caps are fine.)

The Schottky diode is only protecting the 7805, (and subsequent circuitry), and not the hall sensor. electrolytic capacitor (0.22uF not on the schematic), or the MK42d interface.

 

Does the opto output need a pull-up resister or is this being done/part of the Arduino input pin?

 

The PCB can be "optimised" a little too.

 

 

Kev.

(Quick edit to add the LED checks.)

 

Edited by SHMD
Link to post
Share on other sites

  • RMweb Premium

Why have a 7805 at all, when the only thing it is powering is the Arduino?

The Arduino will happily run off 12v, as it already has a 12v > 5v LDO regulator on board (AMS1117).

 

  • Informative/Useful 1
Link to post
Share on other sites

OK, thanks for the comments. 

 

Agree I should be using the 6N137 as my latest understanding is that it is faster and matches the DCC signal better. Also when I was trying to buy some, all the UK suppliers I could find were all sold out so I bought the 4N35 instead.  Maybe I will have to resort to buying from China unless anyone knows a UK supplier with stock of the 6N137.

 

The 7805 circuit is included because my original TT from Ian Jeffery has one and as  far as I could  tell from scrambling about under the base board, that's its purpose so I just continued with that  idea in my PCB design. My aim was minimum change as far as I could determine.

 

The values for the capacitors were taken from typical voltage regulator circuits posted on the internet.  I will update the values as advised by SHMD.  I think I may have added the stepper power supply conditioning capacitor on the PCB and forgot to add it to the schematic so I will fix that as well.  I will move the connection from the 0.22 capacitor to the other side of the schottky diode.

 

I don't understand the comment about the pull up resistor (literally). I am a rank novice re electronics.  What do I need to do and what is the pull up resistor for?  I had intended to use a commercial  optocoupler board just to prove some test software code is OK but I haven't connected it up yet but I can see a resistor on the output side and I assumed that was something to do with the VCC which will not be connected to the arduino unless I have that wrong?

 

Once I update the schematic and PCB layout I will re-post.

 

Thanks for the very constructive comments. Much appreciated.  Keep them coming.

Link to post
Share on other sites

  • RMweb Premium
9 hours ago, jp1 said:

don't understand the comment about the pull up resistor (literally). I am a rank novice re electronics. 

A transistor, which the output of the 4N35 is, needs a load or pull up resistor taken to VCC (the circuit posted by Trevora using the 6N137 already has one with R3).

You can switch an internal pull up resistor into circuit on an Arduino input pin, I normally don't bother and use the external circuitry as with the 6N137

 

BTW pins 5 & 8 on a 6N137 are not "no connections", they go to the internal circuitry which is a lot more than what the basic schematic shows and must be used.

 

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