Help with directional lighting project, hall effect sensors etc

Thread Starter

Hoopdub

Joined Feb 23, 2015
23
i think you have read it wrong, its the contactless motion detection that's the problem when using relays :D if I had a switch physically mounted and the wheel operated it in whatever direction it was going, then using relays would be easy. as it is now having to electronically sense the direction of motion, that's whats making it difficult for me lol
 

pwdixon

Joined Oct 11, 2012
488
i think you have read it wrong, its the contactless motion detection that's the problem when using relays :D if I had a switch physically mounted and the wheel operated it in whatever direction it was going, then using relays would be easy. as it is now having to electronically sense the direction of motion, that's whats making it difficult for me lol
Even if you could do it with relays would that be the right thing to do on a vibrating moving object, wouldn't reliability and perhaps size possibly become an issue?
 

Alec_t

Joined Sep 17, 2013
14,280
I appreciate that a physical switch would enable direction determination, but how would that enable absence of motion to be detected in a relay-only system?
 

Alec_t

Joined Sep 17, 2013
14,280
In case anyone is thinking of a solution involving pulse-timing, what is the maximum speed these railcars are likely to go?
 

Thread Starter

Hoopdub

Joined Feb 23, 2015
23
no more than 15mph on a trailer and no more than 35 on a machine and that's very unlikely, quite frightening at 20mph on rails :S
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
The company we buy these switching boxes from has gone bust and we have yet to find anyone who makes them elsewhere, .
A long shot is if you know or can possibly contact someone from the old Co. to see if they have any construction info they may be willing to share, I realize the original info is most likely proprietary, but having gone bust they may let it go?
I have done this with some success in the past.
Max.
 

Thread Starter

Hoopdub

Joined Feb 23, 2015
23
Alec, would it be possible to change the time it takes to detect no motion to say 5 seconds?

or does anyone know of a way to make it instant when the wheel stops moving? using some other type of sensor ??
 

Alec_t

Joined Sep 17, 2013
14,280
Alec, would it be possible to change the time it takes to detect no motion to say 5 seconds?
Yes, .....but. The circuit I posted was designed around one wheel rotation per 10 secs as being the upper threshold regarded as 'no motion'. With the wheel dimensions you show, this equates to about 0.3mph. So, to get a 'no motion' detection in 5 secs would mean trebling the threshold to ~1mph. Would that be acceptable? If so, it's just a matter of reducing the circuit time constants by a factor of 3.
The only other way I can see of doing this using the existing sensor would be to go the microprocessor route (which I guess is what your existing unit does), but it would still take one whole wheel revolution to make the determination reliably.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
go the microprocessor route (which I guess is what your existing unit does), but it would still take one whole wheel revolution to make the determination reliably.
I don't think it would, using the rising/falling edge capture input method, you can set any window you want, IOW set any time window you need.
A Micro would be my choice to do this.
Max.
 

Søren

Joined Sep 2, 2006
472
Hi,

The polarity of the wheel magnets changes twice per revolution. Judged from the photos, this will happen roughly 130° apart. No further data to gain from the wheel in the current configuration of magnets and sensor.

From the pics, I'm estimating a diameter of 0,44m, which gives a circumference of 1.38m, which further lead to a pulse frequency of ~0.3Hz to ~11,3Hz for the interval of 1 mph to 35 mph.
This means that no pulse should happen for a bit more than 2.13 s to consider the wheel stopped (or rather to go less than 1 mph).

Had the frequency been much higher and the magnets more narrow, integration in a simple RC LP filter would give 4 easily discernible voltages for forward, back, stopped at a north pole and stopped at a south pole, but as things are, that would take an active circuit, a lot of work and might be hard to keep working to specs over the temperature range in question.


"Apologies the sensor is a 103SR18-1. but any variation to the system is acceptable as long as I can get it to do what its supposed to LOL"
(My emphasize)

Not sure how far you are willing to take that statement, as I'd guess backward compatibility to be a huge concern, but if I were to do this from square one, I'd use two sensors for easy direction info, magnets that covered less of the arc and place more sets (like 2 to 8 sets).
To halve the number of magnets, use only same polarity magnets and use 2 non-latching Hall sensors, spaced half a magnet width apart.
Eg. 10 magnets of around 2" width, spaced evenly around the wheel, sensed by two non-latching Halls, will give you 40 transients (edges) each wheel revolution, raising the previous frequency range estimate to 12Hz..452Hz with an equally shorter detection of a "stopped" wheel (car moves less than ~35 mm between each pulse).

To counter vibration, any circuit that you end up with should be potted, just as the original box - only way to keep it together.

Is this really just driving 50mA LED's? (I thought it was for "driving lights" rather than indicators).
If LED's are the sole target, no need for relays, any small signal transistor will do fine.

But... Apparently you seem adamant on not soldering up anything yourself and yet you still feed us information... Does that imply, that you want to get someone to make it for you and if so, are we talking a single unit, a few, or perhaps a large amount, and at what state of finish (like PCB only, or a complete potted box)?


Regards,
Søren
 

Alec_t

Joined Sep 17, 2013
14,280
Here's a variation of my previous design, using two ICs instead of the previous three. Response time for a moving/static determination is now ~5 sec with the component values shown, corresponding to a threshold track speed of ~1mph. There is a slight glitch in that for a few seconds during this period, while there is still some motion, some lights will turn on and off.
RailcarLights2.gif
 

Attachments

Alec_t

Joined Sep 17, 2013
14,280
@ Max
I don't think it would, using the rising/falling edge capture input method, you can set any window you want, IOW set any time window you need.
Because the sensor 'sees' the magnets for <10% of the wheel rotation, you might have to wait >90% of the rotation period to get a measurement. Any window would have to be set to allow for that, bearing in mind that two rotation directions are possible. If the rotation direction were always the same then I'd agree, once an edge is detected the static/moving determination could be made in much less than one rotation period. From a static start, the rotation direction is unknown.
 

Thread Starter

Hoopdub

Joined Feb 23, 2015
23
I dont mind having a go myself. I just dont think i will have the time in work. I deffo wont have the time at home with an 11month old child lol. Would need about 30 units as a kick off.

Thanks Alec i will look into the components on RS and see if i can get the stuff and have a go
 

Alec_t

Joined Sep 17, 2013
14,280
One thing that hasn't been mentioned: does the lighting system have to satisfy any particular legal requirements? If it does, then a home-brew system might have difficulty getting official approval.

Would need about 30 units as a kick off.
Before ordering parts for 30 it would be best to build a single protoype to make sure it does what you want ;). Excluding mechanical bits (connectors, housings etc) the cost should be < ~ £5 per unit.
 
Last edited:

Søren

Joined Sep 2, 2006
472
Hi Alec,

Here's a variation of my previous design, using two ICs instead of the previous three.
Sorry to say, but that won't work. If your assumption of a 10% pulse were good, it would work (sorta), but look at the second photo in post #39.
Assuming the wheel going CCW, the leading edge of the pulse is when the the magnet side at roughly 4 o'clock reach the sensor and the trailing edge is when the same side of the other magnet (at roughly 7 o'clock) reach the sensor. these edges are about 130° apart and the pulse will thus be ~36% of each rev. Throw that number after your circuit and you'll see it needs to be modified a bit.


There is a slight glitch in that for a few seconds during this period, while there is still some motion, some lights will turn on and off.
You should be able to fix that with some delays here and there, but it has some more important issues, that are hard to handle, as their solutions are mutually exclusive:
Never use high impedances in a circuit that is supposed to go near powerful (electric or gas driven) motors (or HF transmitters etc. for that matter).
Timing relying on caps, especially electrolytes, will be very unreliable over the temperature range involved.

Low impedances and NP0 caps would make it better, but then you'd need to add counters to get the long delays and the circuit grows while still being substandard.
While it may be fine for a puzzle in logics, or something for a model trin, a non-µController solution would really be cheating "the customer" here IMO.


Thinking further about it, here's how I imagine a (/the only?) sensible solution... Loosing the magnets and sensor and then replacing them with a cheap ($few) accelerometer chip feeding an even cheaper µController would lower the price substantially (programming would be the main part of the price) and raise the precision and speed of reaction to almost whatever degree may be wanted. Installation costs would be reduced to affixing a box - no more magnet and sensor installation and cost of same - and it will be fully backwards compatible with any previous system.

Regards,
Søren
 

Thread Starter

Hoopdub

Joined Feb 23, 2015
23
Heres what the standard asks for, basically as long as it works as it should it does not demand any BS or ISO numbers testing etc. these are the rail industry standards we have to work to for the vehicles/trailers to be used on network rail infrastructure.

5.14 Visibility and audibility
5.14.1 Rail mode lighting

5.14.1.1 Vehicles over 75 kg (gross weight) shall be fitted with two white marker lights and two red tail lights at each end, placed as far apart as the build of the vehicle allows. The vehicle shall always display white marker lights in the direction of movement along the track and red tail lights at the opposite end. During movement along the track it shall not be possible to display both red and white marker lights at the same time at the end of the vehicle.
The position of the lights should be as far apart as reasonably possible permitted by the particular design of the vehicle. This does not necessarily mean that the lights are required at the extremities of the width of the vehicle. A further consideration of the location of the lights should be made to minimise the risk of their being obscured by equipment when the vehicle is in both travelling and working modes.
It is recommended that the red and white marker lights should be visible during daylight on the track from 50 m away.
5.14.1.2 Except for type 0D vehicles and trailers weighing ≤ 0.5 t, the colour displayed by the marker and tail lights shall be automatically direction-controlled.
5.14.1.3 Vehicles over 75 kg (gross weight) shall be fitted with a headlight for use in the direction of travel.
Note the exception for trailers not to have to fit headlights set out in 7.2.1 o).
 

Alec_t

Joined Sep 17, 2013
14,280
@ Soeren
the leading edge of the pulse is when the the magnet side at roughly 4 o'clock reach the sensor and the trailing edge is when the same side of the other magnet (at roughly 7 o'clock) reach the sensor. these edges are about 130° apart
Not so. According to the OP, in post #14, "the magnets are placed right next to each other in one place on the wheel, so it has to do a full revolution for the sensor to pass them again."
Timing relying on caps, especially electrolytes, will be very unreliable over the temperature range involved.
There are no electrolytic caps in my design. Simulation shows negligible timing change over a -30C to +50C temperature range.

@ Hoopdub
During movement along the track it shall not be possible to display both red and white marker lights at the same time at the end of the vehicle.
The glitch I mentioned, during the static/moving determination period, would only fall foul of this reg if < ~1mph is regarded as movement.
My circuit makes no allowance for use in a 24V system. For that, additional components would be needed.
 
Last edited:
Top