Jump to content
 

Arduino and Peco Point motor problem


Titanius Anglesmith
 Share

Recommended Posts

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

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 by Brian
URL to item added
  • Like 2
Link to post
Share on other sites

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. 

  • Like 1
Link to post
Share on other sites

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

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

 

  • Like 1
Link to post
Share on other sites

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

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. 

  • Like 1
Link to post
Share on other sites

  • RMweb Premium
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.

 

  • Like 1
Link to post
Share on other sites

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

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.

  • Like 1
Link to post
Share on other sites

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 :blink:

 

5 hours ago, Junctionmad said:

1N4001 or any 1N400x series 

 

Thanks

Link to post
Share on other sites

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.

  • Like 1
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...