Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 30-03-2024, 11:13   #151
Registered User

Join Date: May 2019
Location: Everywhere
Boat: Razzle Dazzle - 61ft Simpson / Crowther Daggerboard Cat ‘93
Posts: 375
Re: Open Source Arduino Alternator Regulator

My WS500 was very unhappy with noise on the Temperature probe (thermistor) or the Current Shunt. As one is near the battery and the other is at the alternator, wherever the controller is located it got sad. In the end I pulled a new shielded thermistor cable and gave the WS a dedicated shunt as it really didn't like sharing with the Victron BMV712.

Very noise sensitive and very limited damping led to erratic behaviours as it changed modes. It seems it was "sampling" both inputs rather than averaging, and noise spikes made it unhappy. It could have been inducing it's own noise, as the signal wires share the cable run with the high current alternator wires.
nfbr is offline   Reply With Quote
Old 30-03-2024, 12:14   #152
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

@Freaky, thank you

@nfbr, I think the use of digital temperature sensors is going to be a huge upgrade vs. thermistors. Here's the first one I built using a method someone suggested earlier in this thread- epoxying the TO-92 package into an electrical terminal.

wiring is borrowed directly from SailorHat. I had a slightly different arrangement but this is proven, so why not.

These are so cheap, and all attach using "1 wire" per the name, so there's no reason not to measure temperature anywhere you're curious, add redundancy, etc. I have a thermal camera to create a rough correlation between the location of this sensor and the maximum external case temperature, on the to-do list. I expect there will be some delay in response, but the same is the case for the thermistors.

I won't be supplying any shunt with this kit, current is intended to be read with a hall effect sensor. The signal level is 0-5V or 0-12V (not decided yet) so it will not be as affected by noise. I might supply two of these, one for the battery, and one for the alternator, depending on the final cost.
If people already have a shunt, they can read it using the INA3221, which is engineered specifically for this purpose, and has built in averaging. It might do better than other controllers, won't know until we test.
Another option is to just read current directly from Victron VeDirect, or NMEA2K, if you are happy with either of those signals.

There will be damping and "slow changes" in the control scheme, I'm working on that now.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 30-03-2024, 12:52   #153
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

Why is it that people want a slow response? I want to make sure I understand the reasons so I can try to code it correctly. Right now with a slightly different but almost the same chip (I don't have the final choice on hand yet), I can switch the regulator off->on and hit the target field voltage in less than 5ms. This is obviously way faster than necessary, but better than being too slow..


I imagine too fast a ramp up could cause a belt to slip, or an engine to stumble.
But ramping down, let's say when an induction stove top is turned off, I think that should be as quick as possible? Not ramping down quickly enough could, in the worst case, trip a BMS to shut down without adequate warning, if the battery bank was small, and "damping" too great. I don't think this is likely with lithium and reasonable settings, just trying to understand worst case scenarios.

If damping was only applied to "ramping up", the worst scenario for ramping down too fast seems to be that the engine speeds up abruptly, which isn't really a bad thing. If you're in gear, it's damped by the drivetrain, and if you're in neutral, I suppose the rev limiter is the worst case scenario.

To be more complicated but best of all worlds, I suppose a slow "ramp down" could be used until a voltage threshold is met, and above that, no damping?
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 30-03-2024, 13:34   #154
Registered User

Join Date: May 2019
Location: Everywhere
Boat: Razzle Dazzle - 61ft Simpson / Crowther Daggerboard Cat ‘93
Posts: 375
Re: Open Source Arduino Alternator Regulator

Quote:
Originally Posted by markxengineerin View Post
Why is it that people want a slow response? I want to make sure I understand the reasons so I can try to code it correctly. Right now with a slightly different but almost the same chip (I don't have the final choice on hand yet), I can switch the regulator off->on and hit the target field voltage in less than 5ms. This is obviously way faster than necessary, but better than being too slow..


I imagine too fast a ramp up could cause a belt to slip, or an engine to stumble.
But ramping down, let's say when an induction stove top is turned off, I think that should be as quick as possible? Not ramping down quickly enough could, in the worst case, trip a BMS to shut down without adequate warning, if the battery bank was small, and "damping" too great. I don't think this is likely with lithium and reasonable settings, just trying to understand worst case scenarios.

If damping was only applied to "ramping up", the worst scenario for ramping down too fast seems to be that the engine speeds up abruptly, which isn't really a bad thing. If you're in gear, it's damped by the drivetrain, and if you're in neutral, I suppose the rev limiter is the worst case scenario.

To be more complicated but best of all worlds, I suppose a slow "ramp down" could be used until a voltage threshold is met, and above that, no damping?
Response can be quick, but the issue with digital is sampling. Say you "measure" voltage. If you sample for 0.1ms every second, you may pickup up noise spikes, load transients etc. So you might see battery voltage low, and then make a change, that generates another different spike etc.

So when I use the word damping, you could call it sampling etc.

The WS500 tends to ozcillate in temp control. It's pullback is too harsh. It seems to shed about 30% and then dump 90% very soon after. Then ramp up again. Repeat. I fixed it by physically moving the sensor to a location with different thermal response, but you get the idea.


BTW - Temp numbers are a bit of a black art. Electric motors have well documented standards with their insulation ratings and operating behaviours. None of the alternator mfr's I have seen refer to these standards. So operating temp really means what part of the unit?
nfbr is offline   Reply With Quote
Old 30-03-2024, 13:36   #155
Registered User

Join Date: May 2019
Location: Everywhere
Boat: Razzle Dazzle - 61ft Simpson / Crowther Daggerboard Cat ‘93
Posts: 375
Re: Open Source Arduino Alternator Regulator

Questions I recently sent to a regulator vendor with the aim of simpler installation -

Battery voltage sense - can this come from Cerbo via CAN or Ve.Smart via Bluetooth?

Battery Current and Battery Temp sense - see above. Objective is no extra wires if Victron is monitoring this already.

Tach - Can this come from CAN/N2K/J1939?

Can it detect / alarm / reduce field / shut down on belt slip if CAN and Alternator RPM diverge?

Is the CAN galvanically isolated?

Is there 1 or 2 CAN inputs, if the Engine and Electrical buses are isolated, or is a YD Bridge required?

Is there a battery backed RTC so that Bulk/Adsorb can be limited to once every (x) hours / days rather than every engine start?

Charge stop for BMS disconnect. How is this CAN integrated with REC or JKBMS?

Charge control, if connected to CAN with BMS, how is charge control prioritized between internal profile and BMS requests?

Is there present / planned Victron DVCC integration?

Alternator temperature management. The WS has very little hysteresis and tends to be “jumpy” with power control. Is the temperature damping adjustable?
(Currently fixed by moving probe to more stable temperature location with WS)

In Gear input - is there an option for a switched input to limit engine loads when in gear? (User installed Microswitch on gear lever)

Does the unit limit alternator field when tach is not received / low to limit rotor heating with engine.

If the unit is powered off 48v, how are the “on” and “input” options triggered? 12v? 48v? Ground
nfbr is offline   Reply With Quote
Old 30-03-2024, 13:53   #156
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

Quote:
So when I use the word damping, you could call it sampling etc.
Ok, that part I'm well familiar with and will not be a problem.

Quote:
So operating temp really means what part of the unit?
Yes, it's pretty frustrating that not a single alternator manufacturer can provide temperature vs. lifetime data. It wouldn't be that difficult to measure. It will be up to the user to determine where to measure and what's safe. I have been running mine up to 185 degrees F at the "hottest part I can see from the outside". The 1wire temp sensor runs about 30 degrees colder where I have it mounted on an extra threaded hole on the back (not an exact number, going from memory).

Quote:
Cerbo via CAN or Ve.Smart via Bluetooth?
CAN yes, VeDirect (wired) yes, Bluetooth no. I personally think bluetooth is bad idea, I have not found it to be reliable. Does any Victron equipment continuously communicate with bluetooth?

Quote:
Tach - Can this come from CAN/N2K/J1939?
I hadn't thought of that, but yes, it's there already with the CAN data, I will implement it.

Quote:
Can it detect / alarm / reduce field / shut down on belt slip if CAN and Alternator RPM diverge?
Another great idea, yes!

Quote:
Is there 1 or 2 CAN inputs, if the Engine and Electrical buses are isolated, or is a YD Bridge required?
1 CAN input, I asked earlier and nobody had a reason for two. I could add another if you can explain. It's fully isolated by design.

Quote:
Is there a battery backed RTC so that Bulk/Adsorb can be limited to once every (x) hours / days rather than every engine start?
Yes

Quote:
Charge stop for BMS disconnect. How is this CAN integrated with REC or JKBMS?
. Yes, but the only BMS disconnect signal suggested so far is a 3V to 18V "stop" signal. Please share more about how this would work through CAN and what REC and JKBMS mean. I'm not familiar with them, but most likely can add what you want.

Quote:
Charge control, if connected to CAN with BMS, how is charge control prioritized between internal profile and BMS requests?
Your choice. I would lean towards trusting the BMS and only using the Alternator Regulator to limit the amperage setpoint based on things it knows about (RPM for small engines, temperature, etc)

Quote:
Is there present / planned Victron DVCC integration?
Never heard of it, but if it's documented and "open", I'll look into it.

Quote:
Alternator temperature management. The WS has very little hysteresis and tends to be “jumpy” with power control. Is the temperature damping adjustable?
Yes, adjustable. I think the best algorithm, the one I've been using, targets an amperage that's known (through testing) to run steady state at just below the temperature limit. Then use temperature for minor adjustments. I think targeting a temperature alone to "max out" the charging is a silly way to do it, you're getting a little faster charge until steady state is reached, but you're risking overheating something internally depending on the response of the temp sensor and how close to the edge you're pushing. But I'm willing to try when I have time, and I'm sure someone else will prefer it and implement.

Quote:
In Gear input - is there an option for a switched input to limit engine loads when in gear? (User installed Microswitch on gear lever)
Yes, there is high/low charge external switch, you could re-purpose that, or add another. Any extra channels on the ESP32 remain open for user customization, not sure how many yet.

Quote:
Does the unit limit alternator field when tach is not received / low to limit rotor heating with engine.
Yes

Quote:
If the unit is powered off 48v, how are the “on” and “input” options triggered? 12v? 48v? Ground
I do not understand the question. The only difference between the different modes now is the setpoints which are user adjustable.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 30-03-2024, 15:09   #157
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,352
Re: Open Source Arduino Alternator Regulator

I believe epoxy doesn’t conduct heat well unless you use the specialized heat conducting epoxy
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 30-03-2024, 15:27   #158
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

Good call, I just used JB Marine, thermal conductivity not specified, not thinking about that. At least the electrical terminal is copper, can't do much better than copper.

It would be nice to find some epoxy that's not too "runny" (JB products are nice for that unless it's real hot out), thermally conductive, electrically not conductive (in case any is spilled on the output pins), and good to 250 maybe 300F to be safe.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 30-03-2024, 15:36   #159
always in motion is the future
 
s/v Jedi's Avatar

Cruisers Forum Supporter

Join Date: Feb 2009
Location: in paradise
Boat: Sundeer 64
Posts: 19,352
Re: Open Source Arduino Alternator Regulator

Quote:
Originally Posted by markxengineerin View Post
Good call, I just used JB Marine, thermal conductivity not specified, not thinking about that. At least the electrical terminal is copper, can't do much better than copper.

It would be nice to find some epoxy that's not too "runny" (JB products are nice for that unless it's real hot out), thermally conductive, electrically not conductive (in case any is spilled on the output pins), and good to 250 maybe 300F to be safe.
Stuff is made exactly for this: https://www.amazon.com/MG-Chemicals-.../dp/B07D18R5Z5
__________________
“It’s a trap!” - Admiral Ackbar.

s/v Jedi is offline   Reply With Quote
Old 31-03-2024, 10:21   #160
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator



Here is what I'm thinking for the main control scheme. According to Wikipedia, this is a combination of what's called "Cascade Control" and "PID with Feed Forward".

It is Cascade Control because there are two PID loops cascaded together. The first one is not shown here, the one done by the SiC450 chip. This chip takes in a desired alternator output current, and continually adjusts the field current to make it so. This control is so fast and works so well, we don't need to worry about it.

The second loop is shown here, which will be run on the ESP32. Based on the engine speed, a starting point for the output amps is selected from the table. It is a conservative, value, so if your alternator is rated for 125 amps (and can run 60 amps steady state at 2000 RPM, which you know from experience), you might put 40 amps in the 2000 RPM box. The controller then runs a PI (probably heavy on the P, light on the I) control to slowly work from 40 amps up to 60. I see this taking minutes, no reason to be too quick, as most boats are keeping a steady RPM for long periods of time, and we want to avoid overheating/oscillation.

I think the 20 amp "cut back" for 5 minutes is a good way to handle the asymmetry of the situation (we can proportionally heat, but not cool), and those values can be tuned.

Things I don't like about this idea
-requires some user knowledge to fill out the feed forward table, which might be a turn-off for some, unless we can develop some rules of thumb based on alternator spec sheets and experience
-I think that's it? Any other downsides, or is there a better way? I do like that it's simple to understand, simple to program. It could still work with no RPM signal, it would just be slower/more conservative, as I'm guessing alternators can tolerate higher charge rates at higher speeds, due to higher fan air flow. Does anyone have data on this?

And a question, assuming the above is a good strategy
How to handle a change in RPM? I think we could ignore small changes in RPM, and only grab a new value from the table if the change is >300, for example. At the same time as updating a setpoint, the P and I values would be zeroed out to start over.

All of the above assumes bulk charging mode, trying to maximize current into the battery.
I won't personally use the regulator to Absorb/Float (default to solar for that), so I'm not prioritizing thinking about those aspects yet.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 31-03-2024, 16:28   #161
Registered User
 
Jon Hacking's Avatar

Join Date: Sep 2010
Location: Currently cruising the Philippines, just got back from PNG & Solomons
Boat: Wauquiez 45' (now 48') catamaran
Posts: 1,115
Images: 1
Send a message via Skype™ to Jon Hacking
Re: Open Source Arduino Alternator Regulator

"-requires some user knowledge to fill out the feed forward table..."

Would it make more sense to make this table proportions of the nominal alternator maximum output?

That is, the user would only need to enter their max-alternator-output in one place, & the controller would generate this table based on fractions of that number?

I presume the user is going to have to enter the size of their battery as well, in order for the controller to do a proper tail-current charge, to know when the battery is full & it's supposed to switch down to "Float" mode.

FWIW, our Yanmar 4JH2 engines idle at about 800 & max out at 3400 (which I never run at). 1600 seems to be my sweet spot where my alternator is putting out max current.

While I haven't had to use my alternators to charge my batteries in years (1200W solar) nobody is going to want to run their engine revs too high to get the most out of their alternators. I think this table should max-out around 1600-2000 rpm, as most boats won't want to go higher while sitting at anchor & having to charge their batteries.

Maybe make it a straight-line "curve" from, say, 600-1800 rpm?
__________________
-- Jon Hacking s/v Ocelot
Jon Hacking is offline   Reply With Quote
Old 31-03-2024, 16:49   #162
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

Quote:
Would it make more sense to make this table proportions of the nominal alternator maximum output?
Yes that could be a default suggestion, but it's going to be different for every alternator. The best would be to make it "smart" so that it learns the most aggressive feed forward table over time, and maybe corrects for ambient temperature. I haven't thought about how to do that yet, probably a fun future upgrade.

Quote:
I presume the user is going to have to enter the size of their battery as well, in order for the controller to do a proper tail-current charge, to know when the battery is full & it's supposed to switch down to "Float" mode.
I am only implementing a "bulk" mode which will charge up to 14.5V (or similar value) and the rest is done by solar. I don't think many boats are using an alternator to get to 100% charge or feel this is an important feature, so I'll leave that for someone else to figure out.

Quote:
FWIW, our Yanmar 4JH2 engines idle at about 800 & max out at 3400 (which I never run at). 1600 seems to be my sweet spot where my alternator is putting out max current.
I have the same engine. The pulley ratio also matters, and the table I posted was made up values just to show the idea.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 31-03-2024, 18:51   #163
Registered User
 
Jon Hacking's Avatar

Join Date: Sep 2010
Location: Currently cruising the Philippines, just got back from PNG & Solomons
Boat: Wauquiez 45' (now 48') catamaran
Posts: 1,115
Images: 1
Send a message via Skype™ to Jon Hacking
Re: Open Source Arduino Alternator Regulator

In fact, I think you could simply ramp the field current up & note where the alternator output flattens out, & take that as the maximum alternator output. This would eliminate the user having to enter that data. Assuming you have the code-space for that sort of thing.

I'm distressed that you don't seem to be planning to complete the charge cycle. While I agree with you that finishing the charge with solar is the best way, not everyone has that option. Furthermore, you need SOME sort of end to the charging cycle. We have to do a LOT of motoring here in SE Asia, as there's often no wind.

Simply bringing the battery voltage up to 14.5v (or whatever) & leaving it there is seriously detrimental. I destroyed a $3000 bank of Sonnenschein gel batteries at only 13.8v when they went into thermal runaway.

You'll have temperature probes to prevent that, but still, you can destroy a battery very quickly by overcharging it, & alternators sometimes run for extended periods.
  • What are you planning to do then?
  • How do you decide that the battery is full & no more charge should be added?
  • Why are you even bothering with shunt inputs if you're not planning to implement a tail-current charge?
IMO, a tail-current charge is the best way to charge most boat-batteries, including LiFePO4s.

I feel that I must be missing something obvious & vital here.
__________________
-- Jon Hacking s/v Ocelot
Jon Hacking is offline   Reply With Quote
Old 01-04-2024, 04:04   #164
Registered User

Join Date: Aug 2020
Posts: 940
Re: Open Source Arduino Alternator Regulator

Sorry my post was unclear. At 14.5V I have been manually turning the regulator off, and turning it back on when I want to re-start a bulk cycle. Requiring manual input is obviously a pain, so you're right, something must be done. It's just something I've de-prioritized in my own thinking, but I'll do some re-reading and propose something better.
__________________
Contribute to OpenSource Alternator regulator for LiFePO4 XEngineering . net
markxengineerin is offline   Reply With Quote
Old 01-04-2024, 08:03   #165
Registered User

Join Date: Mar 2007
Location: Santa Cruz
Boat: SAnta Cruz 27
Posts: 6,940
Re: Open Source Arduino Alternator Regulator

I have been too busy to read all 900 posts, but somewhere this project has morphed into controlling the field current based on the alternator output current rather than the battery post voltage? Don't reinvent the wheel. Use output current and temp to modify your voltage setpoint.

Realize that when you sail with your average autopilot on wind angle, it is still sailing to a compass setpoint, and using the wind data to slowly adjust the compass setpoint.

If you use a network like canbus to provide inputs, remember that when the network fails the alternator fails.
donradcliffe is offline   Reply With Quote
Reply

Tags
alternator, regulator


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arduino based alternator regulator Epicurean Marine Electronics 3 18-02-2023 05:36
Arduino based Alternator Regulator Project wayne.b Electrical: Batteries, Generators & Solar 11 11-03-2021 10:16
[SOLD] Balmar Regulator, 100A Alternator & 35A alternator JimJohnston General Classifieds (no boats) 0 07-10-2018 19:36
A DIY barograph based on an Arduino shield PauloOnArbutus Marine Electronics 5 23-01-2016 04:58
3 stage regulator or internal regulator for AGMs? sgtPluck Electrical: Batteries, Generators & Solar 13 05-09-2008 08:50

Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 00:13.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.