Feedback on controlling an anchor windlass

Hello,

I'm very new to Arduino development (I got my first starter kit etc. yesterday) and it's more than 20 years since I did anything more complicated with hardware than basic computer maintenance, so I might be a wee bit rusty. Hopefully this is the correct place to ask, please let me know in case it's more appropriate in some other sub-forum.

I own a ship and she has en electric anchor windlass (35kg anchor and 100m chain…) with a cabled hand-held "remote". Now I want to change this to something wireless and add a rode counter which counts how much chain is "out", this is important when anchoring.

The current design is an Arduino that controls and detects windlass movement, connected with ethernet to an WiFi AP and an app on my phone to control the windlass and display the amount of anchor chain that's "out".

As I develop iPhone apps in my job, I don't see that part as being a problem, but I would like feedback on the electrical control and sensor parts of the design. Basically, have I missed anything?

The windlass engine and the big solenoid are components I already have.
RY3 and RY4 are relays I got with my started kits, they are rated 10A but I'm quite sure the big solenoid does not use close to 10A.
The engine is a bit mis-labeled. It has two (+) inputs, one for each direction.

Combining Arduino with high current motor circuits is a learning experience for most people.

It is a bad idea to have direct connections from the motor leads to the Arduino inputs, as diagrammed. High voltage transients are certain to destroy the inputs. You also need relay controllers with flyback diodes and spike protection, and the Arduino plus its power supply will need to be well shielded and decoupled from the motor power supply and wiring.

If you want to safely monitor motor current, use a Hall effect current sensor like these Pololu - Current Sensors.

jremington:
Combining Arduino with high current motor circuits is a learning experience for most people.

It is a bad idea to have direct connections from the motor leads to the Arduino inputs, as diagrammed. High voltage transients are certain to destroy the inputs.

So the motor may cause >24V to appear on the leads? The power source I am very sure will not exceed 24V (when charging the batteries it could go up to 28-29V). Is this for all motor types?

I could of course skip the direction sensing and determine that based on what control signal is sent out, but then a lose the option of the current "remote" updating the rode counter.

I could move the sensing to the inputs of the main solenoid, but as it is directly connected to the same +24VDC as the engine I don't think that would solve anything.

The hall effect sensor you linked is rated at max 75A, so I can't use that one on the motor leads. But I could use a pair of smaller ones on the leads to the main solenoid.

jremington:
You also need relay controllers with flyback diodes and spike protection, and the Arduino plus its power supply will need to be well shielded and decoupled from the motor power supply and wiring.

If you want to safely monitor motor current, use a Hall effect current sensor like these Pololu - Current Sensors.

I have two relays soldered onto two "mini boards", how do I know if these have flyback diodes and spike protection?

And what is a good way to isolate the Arduino from the motor, if I power it from he same 24VDC? The other options are PoE or taking 24VDC from the "main" system that is not connected to any motors that are so powerful.

And thank you very much for the feedback so far!

So the motor may cause >24V to appear on the leads?

More likely, 100's of volts, positive and negative. Electrical noise created by motors and relays (anything with an inductor, really) is a serious problem for electronics, and the higher the voltage/current, the worse it gets.

You will need an additional voltage regulator to power the Arduino from 24V and it should be well protected against electrical transients.

As for relays, post a link to the product page or data sheet.

jremington:
More likely, 100's of volts, positive and negative. Electrical noise created by motors and relays (anything with an inductor, really) is a serious problem for electronics, and the higher the voltage/current, the worse it gets.

You will need an additional voltage regulator to power the Arduino from 24V and it should be well protected against electrical transients.

As for relays, post a link to the product page or data sheet.

OK, so I did a redesign, just have to measure how many amps are used by the main solenoid to pick an appropriate sensor.

The relays should be these.

Note that they are controlled by 5V from the Arduino, and any "noise" will only be on the current they control. Will that noise still be a potential problem?

Can't say I have much confidence in those relay modules. The schematic diagram is clearly wrong, but at least it has a flyback diode across the relay coil.

You would be better off with an optoisolated relay module, like these. I would power the relay modules with a separate 5V power supply than the Arduino.

If you are reversing the winch via the motor direction you need to work out how the supply negative connects to the motor. Your diagram only shows how you switch positive supply to either motor pole. Does the windlass also have an electric brake and variable speed.

jremington:
Can't say I have much confidence in those relay modules. The schematic diagram is clearly wrong, but at least it has a flyback diode across the relay coil.

You would be better off with an optoisolated relay module, like these. I would power the relay modules with a separate 5V power supply than the Arduino.

There is something about the relays I don't understand. Can "noise" on the switched 24V "jump" to the switching 5V and cause problems? And is opto-isolation the solution for this? Is the problem the common ground? If I change RY3 and RY4 to take the ground from the Arduino, and I power the Arduino from my 12V system (it will have a voltage drop of up to 1V because of the distance, but that should be fine) would that solve the problem?

I don't mind having to buy a opto-isolated relay, but I really want to understand why.

And thank you very much for the input.

There is something about the relays I don't understand. Can "noise" on the switched 24V "jump" to the switching 5V and cause problems?

Electromagnetic emissions from the 24V side can effect all sensitive pins and the MCU itself ... usually results in lockup and a reset is needed. This can happen whether opto-isolators are used or not.

The motor and solenoid (not shown on diagram?) should be clamped appropriately with diodes. The motor should have a diode connected to each switched wire (anode at wire, cathode at 24V). The solenoid should have a diode connected across its coil, cathode facing 24V supply.

And is opto-isolation the solution for this?

No.

Opto-isolation isolates the control and power lines from spikes. These spikes would come from switching the relay coils. Also isolates switching noise on the power rails.

Is the problem the common ground?

Partly ... resolved above.

If I change RY3 and RY4 to take the ground from the Arduino, and I power the Arduino from my 12V system (it will have a voltage drop of up to 1V because of the distance, but that should be fine) would that solve the problem?

Opto-isolation will totally resolve this.

I don't mind having to buy a opto-isolated relay, but I really want to understand why.

Resolves the problems described above.

The diodes on the 24V side will greatly reduce relay contact arcing and the EMI/RFI emissions it creates. Also prolongs the life of the relays.

5V Two 2 Channel Relay Module With optocoupler ... needs separate 5V supply.

dlloyd:
Electromagnetic emissions from the 24V side can effect all sensitive pins and the MCU itself ... usually results in lockup and a reset is needed. This can happen whether opto-isolators are used or not.

Does physical separation help? How much separation?

dlloyd:
The motor and solenoid (not shown on diagram?) should be clamped appropriately with diodes. The motor should have a diode connected to each switched wire (anode at wire, cathode at 24V). The solenoid should have a diode connected across its coil, cathode facing 24V supply.

I have to go and look at the motor and see if I can find a diagram, perhaps it includes diodes already. What power rating would I need on the diodes if the motor uses <100A 24VDC?

dlloyd:
No.

Opto-isolation isolates the control and power lines from spikes. These spikes would come from switching the relay coils. Also isolates switching noise on the power rails.
Partly ... resolved above.
Opto-isolation will totally resolve this.
Resolves the problems described above.

The diodes on the 24V side will greatly reduce relay contact arcing and the EMI/RFI emissions it creates. Also prolongs the life of the relays.

5V Two 2 Channel Relay Module With optocoupler ... needs separate 5V supply.

The engine solenoid is (if we use the term to mean the same thing) labeled Windlass Solenoid, it's one of these.

And if I use 5V opto-isolated relays and power the arduino from a separate 12V supply you would still recommend the diodes on the motor and main solenoid?

The 12V is rather isolated from the 24V:

12V<—[12/24 DC/DC converter] —>24V main system, 15kWh batteries <— [charger/inverter] —> 230VAC <— [Booster/Charger] —> 24V, 1.5kWh batteries <—> windlass engine

Oh, sorry ... I thought this was lower power ... diodes might not be the most practical. I'm more familiar with arc-suppression across relay contacts using MOV's.

Separation from the relay board, motors, solenoid to the controller board does help ... I would try at least 2 meters if possible.

The engine solenoid is (if we use the term to mean the same thing) labeled Windlass Solenoid, it's one of these.

It is difficult to image a less informative product data sheet. Why do they even bother?

High current solenoids like the one he's using are commodity items. It's for 24V systems, 150A, and continuous duty and that's about all you need to know.

OP, you might be missing a pullup on your "S1 hall sensor". Those sensors typically sink current on their output pin. Provide a part number for that sensor so we can ensure you're using it properly.

You still haven't addressed the question as to how you reverse the motor by switching the battery negative supply line
Your drawing shows "ground" or "earth" connections. Are these meant to represent the battery negative supply. If so then they are confusing. When dealing with 24v marine battery systems you should clearly detail battery negatives. Any "earth" symbols generally relates to the casing of a device which should not be connected to either positive or negative supply lines

Interesting project similar to what I have been tinkering with. I have successfully used Opto-isolators to return operation feedback to the arduino. This allows the arduino to sense when the anchor is operated by any of the remote stations as well as the Android app. At the winch I am using a proximity sensor that enables me to count literally every link of chain. To drive the solenoids from the Arduino I have used exactly the same opto-isolated relays as suggested by dlloyd

I'd be interested hear how you got on with your project.

Like many OPs, this one also asked for assistance and then disappears into obscurity
It would be courteous if they simply responded with "project abandoned" or "project completed and here's how it went"
But perhaps manners doesn't necessarily maketh the man