RPiAqua (Raspberry Pi Light Controller - In Progress) - Page 7 - The Planted Tank Forum
 6Likes
Reply
 
LinkBack Thread Tools Display Modes
post #91 of 106 (permalink) Old 03-16-2019, 03:58 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
It currently only supports a single board.

The issue is that right now, the service only supports a single output “device”. It also doesn’t support setting the I2C address of the board in the config file.

My thoughts are that it would be best to make it possible to “combine” multiple outputs together. So you could use the built-in PWM with a board to get 18 channels, or multiple boards together to get more.

It just wasn’t high on my priorities, and I’m in the middle of splitting out the hardware configuration from the schedule configuration for the remote control features. It’d be easier to implement once that is done, I think.


Sent from my iPhone using Tapatalk


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
Sponsored Links
Advertisement
 
post #92 of 106 (permalink) Old 03-24-2019, 08:17 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
Quote:
Originally Posted by penitent_tangent View Post
With the code in its current state, would adding a second PWM/Servo bonnet allow you to address 32 channels of PWM? I know the Adafruit site specifies that you can stack up to 62 of them together for 992 channels of control. I didn't see anything quickly looking through the source code, but I haven't really spent any time learning the syntax of Swift.
Just a follow up to my previous answer that might be interesting:

I’ve been tempted to see if I can control 0-10V light systems with this setup. Say, a Kessil light. The easiest way to prototype this would be using I2C DACs, and to control both the intensity and color spectrum channels, I would need to do the work that would make it possible to control more than one PWM Bonnet.

So this sort of hardware configurability might be something I work on pretty soon while I wait for the DACs to show up.

UPDATE:

I've made the changes to support multiple outputs in the vNext branch. It's not quite ready for human consumption because that branch also requires a specific build of Swift 4.1.3 when using 32-bit Raspbian as the OS, and I haven't setup the bootstrap scripts to grab the right build yet, I don't think.

I also want to run it on my tank for a little while before I declare this "good" to be tagged and released.

This also does the work needed to split the hardware configuration from the schedule, which is needed for the MQTT work going forward. And it shouldn't take me long to write up something to support the MCP4725 0-10V DAC boards that exist. With a couple of those, I could have full control of a Kessil light or two.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Kaiede; 03-26-2019 at 06:57 PM. Reason: Status Update
Kaiede is offline  
post #93 of 106 (permalink) Old 03-29-2019, 05:52 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
I've made some further progress. I've got the code pretty much ready to go for when I get my DAC boards to see if I can start controlling a 0-10V light like a Kessil.

So the good things coming down the pipe once I've tested this:
  • Support for multiple outputs, including the ability to mix-and-match output types. So you can use the GPIO PWM along with the Bonnet at the same time (or multiple bonnets). This can be useful especially if you have 1-2 channels that make up most of your light output, you can put them on the higher frequency PWM of the GPIOs to reduce flicker effects.
  • Schedule and Hardware configuration files have been split apart. This will help enable remote control using MQTT.
  • You now name your channels, making the schedule a little easier to work with.
  • Support for outputting 0-10V using MCP4725 boards that output 0-10V (i.e. amplified from 0-5V on the board) from Aptinex or ncd.io. Multiple outputs is useful here since the MCP4725 is a single-channel DAC, and Kessil needs two. It's also possible to use the unamplified 0-5V breakout from Adafruit, but that requires you build your own voltage doubler.
  • In progress work to support Swift 5 (just released) on the Raspberry Pi 3 using Ubuntu Bionic 64-bit. I'm not holding out much hope that Swift 5 will work on 32-bit Raspbian, but a couple folks are trying anyways.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
 
post #94 of 106 (permalink) Old 03-29-2019, 08:15 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
What is the current available to the 10V analog output..
Had problems w/ this before w/ Meanwell drivers..
Doing passive voltage doubling led to current losses and lack of dimming..
Though this was w/ a Typhon that had 10V PWM "reversed" so a normal R/C circuit failed.
Doubling the 5v PWM and smoothing to analog created too much current loss..

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is online now  
post #95 of 106 (permalink) Old 03-29-2019, 09:11 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
Quote:
Originally Posted by jeffkrol View Post
What is the current available to the 10V analog output..
Had problems w/ this before w/ Meanwell drivers..
Doing passive voltage doubling led to current losses and lack of dimming..
Though this was w/ a Typhon that had 10V PWM "reversed" so a normal R/C circuit failed.
Doubling the 5v PWM and smoothing to analog created too much current loss..
That's something I'll have to experiment with. While the boards available are meant to drive industrial control signals that are 0-10V, they don't specifically say what the max current of the output signal is. ncd.io in particular claims theirs is good for "light fixture controllers". So we shall see if that's true, since that is what I have on order.

To be clear though, this is control of a 12-bit DAC, not PWM. The MCP4725 itself has an embedded DAC + OpAmp to output 0-5V that can sink 25mA max. The boards themselves spend most of the circuitry ramping that up to 0-10V, and only support a single channel per board, as a result. Not the cheapest way to do it, TBH.

The Adafruit board is pretty much useless for this unless you intend to prototype your own multi-channel output board.

EDIT: In general, the current range for the 0-10V signal I'm seeing is around 10uA to 2mA according to Lutron, which sounds about right. While my memory of voltage doubler circuits is spotty at best, it seems like there's still plenty of overhead in most cases unless someone's requiring a lot more than 2mA for some goofy reason.
Kaiede is offline  
post #96 of 106 (permalink) Old 03-29-2019, 10:03 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
Quote:
Originally Posted by Kaiede View Post

EDIT: In general, the current range for the 0-10V signal I'm seeing is around 10uA to 2mA according to Lutron, which sounds about right. While my memory of voltage doubler circuits is spotty at best, it seems like there's still plenty of overhead in most cases unless someone's requiring a lot more than 2mA for some goofy reason.

Pretty sure Meanwell ELN-60-48D's wouldn't work w/ that.. At least not for me..
D for dimmable, P for PWM (which worked w/ both 10vanalog and 10v PWM)

Obsolete now ..well the "d" series..

Used some IC (I'll have to dig it out) and an R/C circuit on the 5V PWM to create a pseudo-DC signal to be doubled..


Believe current ended up about 10mA or so (roughly 1/2 of a Typhon (Aduino) output.)
Didn't work though output spec'd about 9V at full. About a 1V loss w/ a Zener diode in the circuit..


So it may just "depend"..


(Knowing just enough to be dangerous)..

HISTORY:
Quote:
I have and use both the Apex and the RKE. Four 0-10v channels (for dimming) come standard on the Apex, but for the RKE/RKL line you would need to purchase an extra module called the RKM-ALC, which has two 0-10v channels per module.

The Apex channels are also a bit more versatile than the RKM-ALC channels. For example, you can run multiple meanwells on the same channel with an Apex, but cannot with an RKE/RKL ALC module, at least not properly.

The problem is that the ALC module does not supply enough current to properly control the dimming channels on the meanwell drivers. You will not get a full 10V out of the interface without a fix. One guy here posted he was maxing at 9V with multiple meanwells on a stock ALC. Kind of odd that they designed a module that does not function properly with the most popular driver line on the market right now. Anyway, here is a fix that someone came up with on the DA forum.....

http://www.forum.digitalaquatics.com...it=ALC+circuit

If the choice comes down to these two controller options, get the Apex. Take it from someone who owns and uses both, and has experience with LEDs on both as well. The Apex is a superior product with more options/features, and it would actually end up costing you less than a similar RKE package.

Anyway, good luck whatever the choice.

Hope this helps,
Landon

"A man with a watch knows what time it is. A man with two watches is never sure."

Last edited by jeffkrol; 03-29-2019 at 10:45 PM. Reason: edit
jeffkrol is online now  
post #97 of 106 (permalink) Old 03-29-2019, 10:47 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
Quote:
Originally Posted by jeffkrol View Post
Pretty sure Meanwell ELN-60-48D's wouldn't work w/ that.. At least not for me..

<snip>

Believe current ended up about 10mA or so (roughly 1/2 of a Typhon (Aduino) output.)
10mA and it still didn't work? That's an awful lot of current being sunk for a dimming input. Now I'm curious what it did do when you hooked it up.

EDIT: The more I read, the weirder this gets, since the "input" in this case is really a sink to pull down the voltage that the driver should be placing on the wire. So there should be very controllable current levels running through the dimmer circuit, and those current levels are controlled by the driver, and the resistance of the dimmer circuit.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Kaiede; 03-29-2019 at 11:08 PM. Reason: More Comments
Kaiede is offline  
post #98 of 106 (permalink) Old 03-29-2019, 11:48 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
Sorry.. memory failed me...


Quote:
by pebe » Sun Aug 18, 2013 7:31 am

Using a 1K resistor:
V Bat= 7.57 V
V between Dim- and Dim + after the resistor 6.08
and 1.5V between ends of the series resistor



That’s what I wanted to know. So the DIM+ pin is drawing 1.5/1000 = 1.5mA. And that is at an applied 6.08V. It’s probably going into an NPN bipolar, and that would agree with the fact that (according to the ELN spec) you get no output for the first 1.1V input. That being so, the current with 10V applied would be 1.5mA x (10-1.1)/(6.08-1.1) = 2.68mA

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is online now  
post #99 of 106 (permalink) Old 03-30-2019, 12:26 AM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
That current level seems reasonable and doable with these boards. I’m tempted to bench test a Meanwell driver now just to see.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #100 of 106 (permalink) Old 03-30-2019, 02:19 AM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
Quote:
Originally Posted by Kaiede View Post
That current level seems reasonable and doable with these boards. I’m tempted to bench test a Meanwell driver now just to see.
I abandoned Meanwell ac/dc drivers due to this "issue". and 0-10V though a "standard" is one of those things that should never have been..




Even industrially , the use of current dimming is far superior to voltage dimming..
Just another "ease of use " thing ...
http://www.ti.com/lit/an/slua119/slua119.pdf
https://automation-insights.blog/201...0v-vs-4-20-ma/


Quote:
A 4-20 mA or 0-20 mA signal, on the other hand, offers increased immunity to both electrical interference and signal loss over long cable runs. And most newer industrial controllers will accept current signals. As an added bonus, a 4-20 mA signal provides inherent error condition detection since the signal, even at its lowest value, is still active. Even at the extreme low end, or “zero” position, the sensor is still providing a 4 mA signal. If the value ever goes to 0 mA, something is wrong. The same can not be said for a 0-10V sensor. Zero volts could mean zero position, or it could mean that your sensor has ceased to function.

PERSONAL vendetta..

FOR historical reference:
The IC I attempted to use to double the smoothed 5V PWM..
https://www.renesas.com/us/en/www/do...icl7660s-a.pdf
Quote:
Positive Voltage Doubling
The ICL7660S and ICL7660A may
be employed to achieve
positive voltage doubling using
the circuit shown in Figure
18. In this application, the pump inverter switches of the
ICL7660S and ICL7660A are used to charge C1 to a voltage
level of V+ -VF, where V+ is the supply voltage and VF
is the forward voltage on C1, plus the supply voltage (V+) is
applied through diode D2 to capacitor C2. The voltage thus created on C2
becomes (2V+) - (2VF) or twice the supply voltage minus the combined forward voltage drops of diodes
D1 and D2.
The source impedance of the output (VOUT) will depend on the output current, but for V+ = 5V and an output current of 10mA, it will be approximately 60 Ohms
Oh and Schottky diodes not Zeners..
Quote:
Output voltage was :
"no load output" from VOM of circuit using the Typhon 5v PWM outputs:
New diodes in.. dimming down to zero w the Typhon..
0%=0
10%=0.51v
20%=1.08v
30%=3.05v
40%=4.06v
50%=4.99v
60%=5.93v
70%=6.78v
80%=7.66v
90%=8.46v
100%=9.32v
IF I remember correctly one could adjust the Meanwell driver to compensate for the lack of "real" 10 volts.
Like I said though... it became a current issue I believe..

"A man with a watch knows what time it is. A man with two watches is never sure."

Last edited by jeffkrol; 03-31-2019 at 04:40 AM. Reason: edit
jeffkrol is online now  
post #101 of 106 (permalink) Old 04-08-2019, 04:12 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
O/T and things you generally never think about..

https://hackaday.com/2019/04/08/give...ak-log-to-ram/

Quote:
The fragility of SD cards is the weak link in the Raspberry Pi ecosystem. Most of us seem to have at least one Pi tucked away somewhere, running a Magic Mirror, driving security cameras, or even taking care of a media library. But chances are, that Pi is writing lots and lots of log files. Logging is good — it helps when tracking down issues — but uncontrolled logging can lead to problems down the road with the Pi’s SD card.
Kaiede likes this.

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is online now  
post #102 of 106 (permalink) Old 04-08-2019, 04:36 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
RPiAqua (Raspberry Pi Light Controller - In Progress)

When I was scrounging in the guts of Swift itself, I was noticing how many folks were burning out SD cards doing these big expensive builds (with swap files) instead of using a USB drive for the kind for stuff that thrashes the SD card. Faster too.

My dev board has a pocket USB drive hooked up to it for that reason.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #103 of 106 (permalink) Old 04-11-2019, 05:56 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
Just because I can..
https://www.tomshardware.com/news/ra...ate,39037.html

Quote:
The update brings with it the Chromium 72 web browser, version 3.0.6 of the VLC media player and a grab bag of other package updates and quality of life improvements for the platform.

Phoronix said the Raspbian 2019-04-08 update also includes "SD Card Copier tweaks to reduce copy failures, various bug fixes" and the introduction of Ethtool and RNG-tools.

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is online now  
post #104 of 106 (permalink) Old 06-16-2019, 03:44 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 10,938
https://www.tindie.com/stores/Ranthalion/

Fun hardware..

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is online now  
post #105 of 106 (permalink) Old Yesterday, 07:05 AM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 247
Quote:
Originally Posted by jeffkrol View Post

Not only that, reef-pi looks like a fairly complete project at this point, beyond what I was intending. Although using some sort of pub/sub IPC to coordinate different modules with a front end would make them interchangeable and less coupled. Neat that my code likely would work with the HAT as-is, though.

Wonder why they use channels 4-15 and ignore 0-4 on the 9685 for the HAT. Interesting.

Wish I knew more Go so I could understand what their light controller supported. Not a bad choice for a back-end though.

At this point, my light controller has been operating without intervention for 3+ months, without a service restart. Memory usage is constant but not very low, about 23MB resident. That’s probably the main drawback.


Sent from my iPad using Tapatalk


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may 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 On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome