Analog signal for LED drivers

Expansion modules and attachments
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

Just a quick update on my previous post. Roberto has been testing a mod he came up with for the relay box (and pwm expansion module) to change the signal type from PWM to analog. He says this is a permanent change and I'll never be able to get a PWM signal from them again. However, given that my LED drivers are all analog anyway, I was willing to take that risk.

Sending mine back to him for mods and I'll report my results when I get them back. Should be a week or two til I get them, so don't worry if it looks like I forgot... I won't!
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

Well, Roberto sent me an email stating that I didn't need to return it. Luckily I saw the email before the UPS guy picked it up.

I'm waiting for further instructions so sorry to hog up the thread with misleading info. I guess just ignore the last post or two until I hear back from him.
miked
Posts: 86
Joined: Fri Feb 10, 2012 11:06 am

Re: Analog signal for LED drivers

Post by miked »

TanksNStuff wrote:Well, Roberto sent me an email stating that I didn't need to return it. Luckily I saw the email before the UPS guy picked it up.

I'm waiting for further instructions so sorry to hog up the thread with misleading info. I guess just ignore the last post or two until I hear back from him.
Any word on a solution.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

The PWM-to Analog lead wire works on D type meanwell as others have used them, but for some reason it wasn't working with the Apollo fixtures.
I came up with a work around until my next batch of relay boxes come in.
Two versions of relay boxes will be offered now: One with Analog and one with PWM output signal.
This way, anyone can choose which signal they want to have and will be compatible with all analog signal drivers.
Roberto.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

miked wrote:
TanksNStuff wrote:Well, Roberto sent me an email stating that I didn't need to return it. Luckily I saw the email before the UPS guy picked it up.

I'm waiting for further instructions so sorry to hog up the thread with misleading info. I guess just ignore the last post or two until I hear back from him.
Any word on a solution.
Yes, aside from what Roberto posted for future cases... he agreed to modify one of his PWM expansion modules to use analog signals instead, and will ship that to me for testing on my Apollo fixtures. When all is working, he wants me to ship back my original PWM module.

Roberto has been extremely helpful in figuring out a solution for this, and communication has been awesome along the way. Just wanted to add that to the info here.

I'll definitely post back once I get everything working.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Analog signal for LED drivers

Post by Mike S »

Hi Roberto,

I received the modified relay box today. Thanks for getting it out so quickly. I've taken a stab at the code for the expansion relay. Relays 1 and 2 on the expansion box are my blue lights, 3 and 4 are my white lights, and 5 and 6 are my moon lights. I'm going to set the time and slope for the blue and white leds with the android app. The moonlights aren't dimmable so I just want to put them on for a short time at the end of the day. Does this code look correct?

Code: Select all

 // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port3);
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Box1_Port7);
    ReefAngel.Relay.On(Box1_Port8);
 }

void loop()
{
    // Specific functions
    ReefAngel.StandardHeater(Port2);
    
    ReefAngel.StandardLights(Port5); //Fuge light set to come on when DT lights are off
    if (bitRead(ReefAngel.Relay.RelayData,2)) ReefAngel.Relay.Off(Port5); else ReefAngel.Relay.On(Port5); 
    
    ReefAngel.SingleATOLow(Port6);
    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Port6);
    
    ReefAngel.StandardLights(Box1_Port1); //Blue LEDs Right
    ReefAngel.StandardLights(Box1_Port2); //Blue LEDs Left    
    ReefAngel.StandardLights(Box1_Port3); //White LEDs Right
    ReefAngel.StandardLights(Box1_Port4); //White LEDs Left    
    ReefAngel.PWM.SetActinic(PWMSlope(InternalMemory.StdLightsOnHour_read(),InternalMemory.StdLightsOnMinute_read(),InternalMemory.StdLightsOffHour_read(),InternalMemory.StdLightsOffMinute_read(),InternalMemory.PWMSlopeStartA_read(),InternalMemory.PWMSlopeEndA_read(),InternalMemory.PWMSlopeDurationA_read(),ReefAngel.PWM.GetActinicValue()));    ReefAngel.PWM.SetDaylight(PWMSlope(InternalMemory.StdLightsOnHour_read(),InternalMemory.StdLightsOnMinute_read(),InternalMemory.StdLightsOffHour_read(),InternalMemory.StdLightsOffMinute_read(),InternalMemory.PWMSlopeStartD_read(),InternalMemory.PWMSlopeEndD_read(),InternalMemory.PWMSlopeDurationD_read(),ReefAngel.PWM.GetDaylightValue()));

    ReefAngel.StandardLights(Box1_Port5,21,30,22,30); //moonlight right on from 2130 to 2230
    ReefAngel.StandardLights(Box1_Port6,21,30,22,30); //moonlight left on from 2130 to 2230
   
I still have to work out the web banner and menus but am trying to get the basic functions down first. Thanks again for the help.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

Looks good.
Roberto.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

Thanks Mike. I'll be borrowing most of that too.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Analog signal for LED drivers

Post by Mike S »

You may want to hold off George. I didn't realize that the new libraries are out. I'm going to install them tonight along with the new version of ragen and see if there are other options.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Analog signal for LED drivers

Post by binder »

Mike S wrote:You may want to hold off George. I didn't realize that the new libraries are out. I'm going to install them tonight along with the new version of ragen and see if there are other options.
The PWMSlope function is shortened for you. We do the same thing that you are doing with those lines except it's just in an easier-to-read function. RAGen will add that for you if you want.

This line could be shortened inside the code:

Code: Select all

 if (bitRead(ReefAngel.Relay.RelayData,2)) ReefAngel.Relay.Off(Port5); else ReefAngel.Relay.On(Port5); 
and could be written as this:

Code: Select all

ReefAngel.Relay.Set(Port5, bitRead(ReefAngel.Relay.RelayData,2));
It functions exactly the same but it's a little simpler to type.

Note: You don't have to change any of the things I mentioned. I was just pointing them out as a reference.

The Web Banner is phased out. You use Portal(username) instead. Then you just put your labels inside the Portal on the Portal section of this site. Much simpler to use now.

Menus are still the same. I've almost got an update to make creating a menu simpler but haven't finished it yet. Just to give you a little "teaser" for the menu tab. It's not completed. I've still gotta add a few things and put in some of the standard functions for you to choose from to use, but here's a sneak peak.
Custom Menu tab
Custom Menu tab
Custom_Menu.png (16.81 KiB) Viewed 6681 times
Not sure when this will be released, but that's what is being worked on.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

As always, great stuff Curt!
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Analog signal for LED drivers

Post by Mike S »

I've been using the new version of RAGen and its pretty slick. Couple of newbie questions:

Code: Select all

ReefAngel.Relay.Set(Port5, bitRead(ReefAngel.Relay.RelayData,2)); //Turn fuge light on when main lights are off
If this is going to turn my fuge light on when my main lights are off and my main lights are plugged into ports 1, 2, 3, and 4 on the 2nd relay do I replace the "2" with a "Box1_Port1" at the end of that code?

I have a relay with the normal PWM ports and a 2nd relay that was modified to send analog signals through the old PWM ports for my LED drivers. Does the PWM slope function just send signals through both or do I have to direct it somehow to send it to the 2nd relay with the analog outputs?

Code: Select all

 ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope(); 
Is this really it to the new PWM slope code or do I need to call out the parameters within the () like the old code?

Thanks again for the help.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

I created a new function to make it easier :)
Try using:

Code: Select all

ReefAngel.MoonLights(Box1_Port1);
The signal will only work on the main relay box. The ports on the expansion box gets disabled.
So, what you want to do is make sure to use the analog box as your main box.
Yeah, that's all you need for new PWM slope.
You can set all the parameters with internal memory and off you go :)
At the moment, only Android can do it, but we can bug John to get him to update iPhone too :)
Roberto.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: Analog signal for LED drivers

Post by Mike S »

Thanks Roberto,

If I'm going to run my normal moonlights off of two of the ports do I need to have this in my loop

Code: Select all

ReefAngel.StandardLights(Port5); //Right Moonlights
ReefAngel.StandardLights(Port6); //Left Moonlights
along with this

Code: Select all

ReefAngel.MoonLights(Port5); //Right Moonlight
ReefAngel.MoonLights(Port6); //Left Moonlight
I'm guessing no and the moonlight function takes care of this.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

Use the second.
The first is for your main lights schedule.
The 2nd will just take the same schedule and use it in reverse cycle.
Roberto.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

rimai wrote:I created a new function to make it easier :)
Try using:

Code: Select all

ReefAngel.MoonLights(Box1_Port1);
The signal will only work on the main relay box. The ports on the expansion box gets disabled.
So, what you want to do is make sure to use the analog box as your main box.
Yeah, that's all you need for new PWM slope.
You can set all the parameters with internal memory and off you go :)
At the moment, only Android can do it, but we can bug John to get him to update iPhone too :)
I might be getting ahead of myself since you didn't get to finish it yet, but can I utilize this stuff when I use the modified PWM module (for analog) that you'll be sending me to control my blues/whites channels?

My plan is to have all of my LED power plugs controlled by my expansion relay box (ports 1-2 will be blues, 3-4 are whites, 5-6 are moonlights.) The moonlights are NOT dimmable (on/off only, based on power to the outlet port). The blues/whites outlet ports will get controlled by the standard lights? And the dimming of them controlled by the PWM slope memory values (which I'll be able to adjust via the android app)?

So, given that info above, my code would have these (?):
ReefAngel.MoonLights(Box1_Port5);
ReefAngel.MoonLights(Box1_Port6);

I guess what I'm asking is, what are the parameters for the ReefAngel.MoonLights function? And will it work if I use them on the expansion relay box instead of the main relay? I'm just not sure if that moonlights function is controlling power or if it's controlling dimming/intensity.

Also, if that won't work on the expansion box, would it work if I used that entire box as main box instead of expansion?

Sorry for all the questions... but this is the sort of stuff I'm not grasping entirely yet.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

Yeap. It works just like you typed :)
Roberto.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: Analog signal for LED drivers

Post by TanksNStuff »

You mean I really am learning something? :lol:
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Analog signal for LED drivers

Post by rimai »

Good job!!!
Roberto.
Post Reply