Titanius Anglesmith Posted February 16, 2020 Share Posted February 16, 2020 Greetings All, On my layout I am using an Arduino Mega as an interlocker and interface to throw the points. The point motors are Peco PL-10WEs fed from a CDU. When a point movement is required the Arduino energises a relay for 0.5 seconds (mimicking a momentary-action button) which connects the appropriate motor to the CDU output. More often than not, if the point is single-ended then the Arduino crashes and restarts as soon as the interface relay energises. I don’t have the same problem with the double-ended crossovers. I have recently made some alterations to the layout meaning that some existing crossovers have become single-ended, and they are now also causing the same problem. Can anyone suggest a reason why this is happening? It is clearly something to do with the CDU discharge into single point motors. If I turn off the CDU supply the Arduino behaves itself (but obviously no points move). The Arduino is supplied from a dedicated regulated PSU and the CDU is supplied from a Gaugemaster controller. Therefore the Arduino and CDU circuits are electrically isolated as far back as the 230v mains socket (but the wiring is loomed together in close proximity). The only solution I can think of is to wire some resistors in parallel with the single point motors as dummy loads. Thanks in advance Link to post Share on other sites More sharing options...
Brian Posted February 16, 2020 Share Posted February 16, 2020 (edited) As the Arduino and CDU are using totally separate power supplies, I'm wondering if its the Bemf being produced by the relays coil when power to that coil is cut off? Have you wired a diode in inverse across the relay coil? Any Diode such as a 1N4001 or 1N4002 or similar or even a smaller 1N4148 will be fine, just ensure its wired the correct way around though. it must be inverse to the normal supply to the coil. See for example... Link to wiring Also are you using a Transistor to switch the relay rather than direct Arduino switching? Edited February 16, 2020 by Brian URL to item added 2 Link to post Share on other sites More sharing options...
Theakerr Posted February 16, 2020 Share Posted February 16, 2020 My assumptions, when you say a single ended point you mean just one point and when you say double ended you mean two point motors. First question would be, are you using an arduino compatible relay? Next, are you using the Arduino to power the relay? Next if you are using an external source for the relay are you using the opto isolator input? I suspect you need to use the opto isolator circuit for the Arduino. This circuit is specifically designed to eliminate back feed from the relay. I am not sure but I think you can use the opto circuit even with the Arduino as the relay power source. Incidentally I use something similar and I inert an auto relay to carry the CPU power and have never had a problem except burning out one of the auto relays in 20 years. 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 16, 2020 Author Share Posted February 16, 2020 Thank you @Brian and @Theakerr for your replies. Theakerr, your assumption is correct regarding single- (1x motor) and double-ended (2x motor) points. I am using opto-isolated relay boards that are designed to be used with Arduino. Sorry for forgetting to mention this. The boards are powered from the same regulated PSU that powers the Arduino, and I am using the Arduino’s 5v outputs to trigger the relay board opto-isolator inputs. I am only experiencing the problem when the CDU is powered. Link to post Share on other sites More sharing options...
Junctionmad Posted February 17, 2020 Share Posted February 17, 2020 Have you flyback diodes on the point motors. It sounds like the inductive spike is coupling into the power line 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 17, 2020 Author Share Posted February 17, 2020 1 hour ago, Junctionmad said: Have you flyback diodes on the point motors. It sounds like the inductive spike is coupling into the power line I don’t, I’ll give that a try. What rating should I use? Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 17, 2020 Author Share Posted February 17, 2020 Veering off topic, but a thought occurs (dangerous, I know).... As I am using an Arduino already, would I have saved myself a lot of trouble had I just learnt how to use servos?? Link to post Share on other sites More sharing options...
Nigelcliffe Posted February 17, 2020 Share Posted February 17, 2020 Assuming these "relay boards" are the typical Ebay/Amazon units, how have you connected the various jumpers around powering them? The relay coils can take power either from the Arduino (typically via the header connection where there is +, Gnd and a row of data pins for each relay on the board), or from external power. You might have been better controlling the high current CDU from a Mosfet, or similar high current transistor switch (also available as a cheap Ebay/Amazon pre-made board), rather than a relay board. The Mosfet can stay active as long as your Arduino output code wishes it to be. Servo motors, different kettle of problems, which you solve with similar approaches to isolating the causes of noise. - Nigel 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 17, 2020 Author Share Posted February 17, 2020 19 minutes ago, Nigelcliffe said: Assuming these "relay boards" are the typical Ebay/Amazon units, how have you connected the various jumpers around powering them? The relay coils can take power either from the Arduino (typically via the header connection where there is +, Gnd and a row of data pins for each relay on the board), or from external power. Yes they are are the typical boards seen on Amazon etc, though not an “arduino shield” (is that the right term?) that plugs straight into the arduino header pins. The boards are powered from an external regulated PSU, although the PSU is shared with the arduino. 19 minutes ago, Nigelcliffe said: You might have been better controlling the high current CDU from a Mosfet, or similar high current transistor switch (also available as a cheap Ebay/Amazon pre-made board), rather than a relay board. The Mosfet can stay active as long as your Arduino output code wishes it to be. Could you explain the benefit in this application please? Thanks Link to post Share on other sites More sharing options...
Theakerr Posted February 17, 2020 Share Posted February 17, 2020 I was going to post more or less the same thing as Nigelcliffe. Some descriptors on Arduino friendly relay boards can be a bit misleading in that they say it is an opto isolated board but the normal connection does not use the opto isolating circuit. In the case of the boards I use, to use the opto circuit you do not use the header pins on the relay board but remove the jumper pins an a three pin board to the left of the header pins and connect to them. Do you have a picture. 1 Link to post Share on other sites More sharing options...
Stuart Birks Posted February 17, 2020 Share Posted February 17, 2020 Have you tried this type pf relay board https://www.umtmedia.com/collections/relays They have opt isolators so the Arduino is totally isolated from anything the relay or solenoid do. Stu 1 Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted February 17, 2020 RMweb Premium Share Posted February 17, 2020 4 hours ago, Titanius Anglesmith said: Veering off topic, but a thought occurs (dangerous, I know).... As I am using an Arduino already, would I have saved myself a lot of trouble had I just learnt how to use servos?? An Arduino board for 16 servos is pretty cheap, either a shield or an I2C add on. You can drive servos straight from the pins of Arduino as well. Plenty of sketches out there to get you going. 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 17, 2020 Author Share Posted February 17, 2020 33 minutes ago, Stuart Birks said: Have you tried this type pf relay board https://www.umtmedia.com/collections/relays They have opt isolators so the Arduino is totally isolated from anything the relay or solenoid do. Stu Those are the very ones that I am using 18 minutes ago, melmerby said: An Arduino board for 16 servos is pretty cheap, either a shield or an I2C add on. You can drive servos straight from the pins of Arduino as well. Plenty of sketches out there to get you going. Once the layout starts taking shape I'd like to build some working semaphores, I'll definitely consider using servos for those. Thanks all for the replies so far Link to post Share on other sites More sharing options...
AndyID Posted February 17, 2020 Share Posted February 17, 2020 I suspect the problem is caused by your nice neat wiring looms. Try running the wires (rat's nest fashion) direct to one of the offending point motors and see if it makes a difference. You could also twist or braid the three wires. 1 Link to post Share on other sites More sharing options...
Junctionmad Posted February 18, 2020 Share Posted February 18, 2020 11 hours ago, Titanius Anglesmith said: I don’t, I’ll give that a try. What rating should I use? 1N4001 or any 1N400x series 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 18, 2020 Author Share Posted February 18, 2020 6 hours ago, AndyID said: I suspect the problem is caused by your nice neat wiring looms. Try running the wires (rat's nest fashion) direct to one of the offending point motors and see if it makes a difference. You could also twist or braid the three wires. My OCD will not be pleased 5 hours ago, Junctionmad said: 1N4001 or any 1N400x series Thanks Link to post Share on other sites More sharing options...
cliff park Posted February 18, 2020 Share Posted February 18, 2020 Another is to use screened cable/ I have some twin core screened (no idea where from). I use the screen as the common to the two coils, and one wire to each of the coils. To be really secure you should use 3 core screened and earth the screen. 1 Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 20, 2020 Author Share Posted February 20, 2020 I’ve just found some IN4004s in my stash so I’m going to trial those on one of the problematic sets. I suspect AndyID is right about it being coupling via the loom, but it’s easier to solder in a pair of diodes than untangle the wire tree. Link to post Share on other sites More sharing options...
Titanius Anglesmith Posted February 22, 2020 Author Share Posted February 22, 2020 I am pleased to announce that the flyback diodes across the peco solenoids has done the trick. Thank you all for your help 1 Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted February 22, 2020 RMweb Premium Share Posted February 22, 2020 Excellent. It's something that should always be done where there are solenoids and switched DC power as with a CDU. The back EMF caused by the collapsing magnetic field can be hundreds of volts. 1 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