Reef Discussion

macca_75

Member
Apr 22, 2012
2,125
844
Not sure what you mean by this ?
Html (or similar) GUI.

Some of the added benefits (off the top of my head)

You can check the status from anywhere

You can set/change program remotely.

Not big adds - as you say once it's set you will rarely change to anyway but I don't think building a web interface would be that hard.

Either way you've done the hard yards and the results are looking really good.
 

alan

Member
Jan 26, 2012
212
51
Hobart
i was just about to say offline edits. not as cool. but like you say, only need to edit them a few times. a wifi one would be cool, but not needed too much
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Html (or similar) GUI.

Some of the added benefits (off the top of my head)

You can check the status from anywhere

You can set/change program remotely.

Not big adds - as you say once it's set you will rarely change to anyway but I don't think building a web interface would be that hard.

Either way you've done the hard yards and the results are looking really good.
But this would require the controller to be linked to the internet, via cable or wireless - not something I want to toy with at this stage :)
 

macca_75

Member
Apr 22, 2012
2,125
844
But this would require the controller to be linked to the internet, via cable or wireless - not something I want to toy with at this stage :)
Understood and all good.

Can't wait for the release of this little puppy, or even Beta testing :-)
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Gradually getting the parts together to put a few of these together - unfortunately, the free shipping from China often takes 4-5 weeks :)

My original source for the screen/shield were out of stock when I was looking to buy a few more, so I had to do some searching - I was able to find a Mega, Screen and Shield from 3 different suppliers (and for a few dollars cheaper) but would they all work together as the quality control on some of these Chinese products leaves a little bit to be desired at times ??.

I am pleased to advise that they do all work :D

So, for the main components I have been able to source:

Arduino MEGA $17.24
MEGA LCD Shield $7.15
3.2" Wide Screen TFT LCD $26.73

Not too bad considering that the price of just an official MEGA in Australia can be over $64.

Now, how many hours did I spend searching for these products ...........
 

newbiereef

Member
Nov 8, 2011
874
154
gracemere
Gradually getting the parts together to put a few of these together - unfortunately, the free shipping from China often takes 4-5 weeks :)

My original source for the screen/shield were out of stock when I was looking to buy a few more, so I had to do some searching - I was able to find a Mega, Screen and Shield from 3 different suppliers (and for a few dollars cheaper) but would they all work together as the quality control on some of these Chinese products leaves a little bit to be desired at times ??.

I am pleased to advise that they do all work :D

So, for the main components I have been able to source:

Arduino MEGA $17.24
MEGA LCD Shield $7.15
3.2" Wide Screen TFT LCD $26.73

Not too bad considering that the price of just an official MEGA in Australia can be over $64.

Now, how many hours did I spend searching for these products ...........
with the amount of time you are putting it to this I think you could charge what u like I know I am very appreciative of the time and effort put in
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
A small update.

All of the existing controllers currently available (that I am aware of anyway) utilise a direct, or linear, mapping between the required output level and the resultant PWM output to the led driver. For example if you set the required output to zero, then the PWM will be set to zero; if you set the required output to 100%, then the PWM will be set to 256 (there are 256 PWM steps in almost all controllers); if you set the required output to 50% then the PWM will be set to 128.

This all sounds good, but the problem is that there is not a linear relationship between the led current and the lumens (light) ouput. Whilst each led is slightly different , the following graph represents the relationship between current and lumens for a CREE XP-G R5 Cool White led.

Graph 1.JPG


As can be seen, this is not a straight line but a polynomial - using some very complicated mathematics you can determine the equation for the line of best fit (or, you can use the Trendline option in Excel which is much easier ;) ). The resultant equation is shown on the graph. Using this equation it can be seen that 1 amp produces 347 lumens but 500mA (ie 50% of 1 amp) produces 193 lumens, or 56% of the maximum i.e. over 10% more light then we should be getting.

So, we need to come up with an equation which can be used to adjust the PWM to reflect this non-linear relationship.

Based on the datasheet for the Meanwell LDD drivers I know that there is a direct relationship between the PWM control and the resultant current. So, the current value was mapped into a PWM value based on a 1 amp being represented by a PWM value of 4,096 (I am using a 12 bit PWM source rather than the standard 8 bit PWM thus the use of 4,096 rather than 256). And, the lumens were mapped into a percentage basis with 0% representing zero output and 100% representing 350 lumens output (the CREE XPG R5 outputs 347.7 lumens, rounded up to 350, at 1 amp).

This may not make much sense, but stay with me just a bit longer...

By then plotting the Percentage Output against the PWM , and using the Trendline option again, we arrive at the following graph:

Graph 2.JPG


So, we arrive at an equation of : y = 0.07950x2 + 32.99810x where y = PWM and x = required percentage output. For those mathematically minded, you will notice that the R² value = 1 - this means that the equation is a perfect fit for the line.

Using this equation, the calculated PWM for 100% output is 4,095 i.e. the same we were originally getting. But, the calculated PWM for 50% output is now 1,849 and not 2,047 (which is half of 4,095).

And so, using this equation rather than a direct linear mapping, we know that for every 1% change in the percentage output selected on the controller the actual light produced by the leds will also change by 1% - this will be the same across the full 100% range of the led's.

Note - I acknowledge that this equation will only be accurate when used with an XPG R5 Cool White led driven at 1 amp. But, I am confident that different leds would not be significantly different and so this equation will be used for all leds.

Now, was it really worth the time and effort to calculate this equation rather than use the direct mapping methodology that everyone else uses o_0 Maybe not, but it does conform with my intention to make this the best controller available anywhere :)
 

Buddy

Member
Mar 13, 2012
3,142
1,526
Just...wow...
I feel like im in high school again :p
I dont see why this won't be the best controller around! :worship
 

Synodontis

Member
Aug 1, 2011
1,979
968
Melton, Victoria
I'm going to read this again tomorrow when I'm awake, because all though I understand the words, they make no sense a the moment. :confused:
I do know that this is going to be considered one of the best controllers around for DIY LED's.
Now where is the Reefuge Gold button because the author deserves a few clicks. :)

In answer to your question mate, yes it does conform, big time.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Now that it is morning Ken let's see if we can make some sense of this :)

The LED drivers are dimmed via a PWM (Pulse Width Modulation) control signal which basically turns the drivers on and off very quickly. The length of time the are on or off (called the duty cycle) determines how much light is generated by the LED.

Now, the standard contoller varies the PWM duty cycle in direct proportion to the selected percentage irrespective of the amount of lumens (light) generated.

For example, and assuming 4,096 PWM steps and a maximum output of 350 lumens:

At 0% - PWM = 0 and LED output = 0 lumens
At 10% - PWM = 410 and LED output = 42 lumens
At 20% - PWM = 819 and :LED output = 82 lumens
At 30% - PWM = 1229 and LED output = 120 lumens
At 40% - PWM = 1638 and LED output = 157 lumens
.
.
At 90% - PWM = 3685 and LED output = 320 lumens
At 100% - PWM = 4095 and LED output = 347 lumens

So, for each 10% increase selected on the controller, the PWM increases by 409.6 - but the actual increase in light varies i.e. an extra 42 lumens for the first 10% increase; 40 lumens for the second 10%; 38 lumens for the third 10% through to 27 lumens for the last 10%.

My methodology turns this around by working on the basis that each 1% increase on the controller needs to increase the light output by 3.5 lumens - the equation calculates the PWM to achieve this increase

So

At 0% - lumens = 0 and PWM = 0
At 10% - lumens = 35 and PWM = 338 i.e. an increase of 338
At 20% - lumens = 70 and PWM = 692 i.e. an increase of 354
At 30% - lumens = 105 and PWM = 1061 i.e. an increase of 369
At 40% - lumens = 140 and PWM = 1447 i.e. an increase of 386.
.
At 90% - lumens = 315 and PWM = 3614
At 100% - lumens = 350 and PWM = 4095 i.e. an increase of 481

In summary, the existing controllers just vary the PWM irrespective of the actual light outout - my methodology turns this around by puting the focus on the lumens produced which should result in a more even transition from 0% to 100%.