RMweb Premium Ray H Posted March 26, 2023 RMweb Premium Share Posted March 26, 2023 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 More sharing options...
RMweb Premium Ray H Posted March 26, 2023 RMweb Premium Share Posted March 26, 2023 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. 2 Link to post Share on other sites More sharing options...
38Durum01 Posted September 7, 2023 Share Posted September 7, 2023 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) Link to post Share on other sites More sharing options...
leopardml2341 Posted September 15, 2023 Share Posted September 15, 2023 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 More sharing options...
jp1 Posted July 7 Share Posted July 7 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 More sharing options...
RMweb Gold SHMD Posted July 8 RMweb Gold Share Posted July 8 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. 1 Link to post Share on other sites More sharing options...
jp1 Posted July 16 Share Posted July 16 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. Link to post Share on other sites More sharing options...
jp1 Posted July 16 Share Posted July 16 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. Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted July 16 RMweb Premium Share Posted July 16 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 1 Link to post Share on other sites More sharing options...
RMweb Gold SHMD Posted July 16 RMweb Gold Share Posted July 16 (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 July 16 by SHMD Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted July 16 RMweb Premium Share Posted July 16 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). 1 Link to post Share on other sites More sharing options...
jp1 Posted July 21 Share Posted July 21 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 More sharing options...
jp1 Posted July 21 Share Posted July 21 Quick update, I just found some 6n137 on ebay from UK but they have 8 pins so I may need some help in wiring them. Link to post Share on other sites More sharing options...
jp1 Posted July 21 Share Posted July 21 Updated schematic. Struggling with optocoupler, Fritzing does not seem to have an 8 pin optocoupler in its parts bin Link to post Share on other sites More sharing options...
jp1 Posted July 21 Share Posted July 21 Updated PCB Link to post Share on other sites More sharing options...
smokebox Posted July 21 Share Posted July 21 This may help Link to post Share on other sites More sharing options...
trevora Posted July 21 Share Posted July 21 this is from Geoff Bunza used in all his A DCC Front End for Arduinos 1 Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted July 21 RMweb Premium Share Posted July 21 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 More sharing options...
jp1 Posted July 22 Share Posted July 22 thanks guys. Will update and repost. Link to post Share on other sites More sharing options...
jp1 Posted July 22 Share Posted July 22 Updated schematic Link to post Share on other sites More sharing options...
jp1 Posted July 22 Share Posted July 22 Updated pcb. Not confident I have all the track connections correct on the output side of the optocoupler. Link to post Share on other sites More sharing options...
jp1 Posted July 30 Share Posted July 30 Now fully updated to Geoff Bunza circuit and PCB tracks tweaked. Link to post Share on other sites More sharing options...
RMweb Gold SHMD Posted August 1 RMweb Gold Share Posted August 1 Sorry for the delay... I would now recommend making a prototype of your circuit. I would use "Vero" strip board here but others would have different recommendations for prototyping circuits. For example, a "Breadboard" prototype, would be quick and easier AND changes can be made instantly. The Stripboard has many advantages though... It WILL find/show-up areas that don't quite work right - with the "then" obvious requirement to make changes to the PCB. It will allow you to "practice" component handling and identification. It will improve your soldering no-end. You will learn about component procurement. (Buy at least 2 of everything but the resisters will only be sold in bigger quantities - you can never have too many 10k resisters!) Your will learn how to plan/follow tracks on a PCB.* It will allow you to "develop" the code AND to get things moving - whilst you are waiting for the (latest version) PCB to arrive. I say this, because the chances of getting this "right first time" - especially for a novice - is pretty remote. *PCBs are easier to work with is you can "follow" the tracks from pin-to-pin WITHOUT having to swap sides all the time. Your PCB is "very large" and can be optimised quite a bit. If you want the PCB this big, then you may as well make use of all that space to make it easier to follow the track. I would put as many of the tracks on the Bottom side of the PCB as possible (but you can put them all on the Top side if you prefer but. On the PCB, make the PADs "bigger". This aids soldering and, if you need to change components, then the PADs have more chance of "surviving" the de-soldering process. A quick note on the 5k resister - make it a 4k7 or 5k1 Ohm as you have more chance of finding them and the difference is absolutely irrelevant. Regards, Kev. 1 Link to post Share on other sites More sharing options...
jp1 Posted August 5 Share Posted August 5 Hi Kev. I will be using a breadboard. I already proved the 7805 circuit. Next is the DCC circuit and Nano with some test software. You are absolutely correct about component procurement, particularly the values of capacitors. I found it very easy to get mixed up between my micros, nanos and the raw values as there seems to be no common way of describing values by the various vendors. I think I have got the correct components now and I bought in quantity 10 per packet for each component where I could. I have made a small change to the PCB to remove the "crossing" tracks on the DCC input which was a working solution but it did vex me somewhat as to what should look right (reason was incorrect use of the Fritzing software on the original) and I have also changed the value of the conditioning capacitor on the stepper motor supply to a more suitable value as advised by ChatGPT which did the calculation for me. I got 5K1 resistors as you suggested. I am just waiting the arrival of the conditioning capacitor(s) to make sure I have made enough space for it on the PBC and if the bread boarding proves successful I will order the PCB's. Regards, John 1 Link to post Share on other sites More sharing options...
jp1 Posted August 5 Share Posted August 5 Kev, and thanks for all the comments. Regards, John 1 Link to post Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now