Page 1 of 1

PWM Help!

Posted: Sun Dec 16, 2012 12:46 am
by Zechenia
Hi,

I recently got some Rapid LEDs that I am constructing. I got the PWM drivers, and have it all put together. I am able to power my fixtures if I use a couple AA batteries as my "dimming" signal.

However, I am unable to get the controller to light them up. I believe that I am not doing something correctly with the PWM ports.

Here is my simple code I have on the reef angel:

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 869 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );

    ////// Place additional initialization code below here
    

    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.PWM.SetDaylight( PWMSlope(0,0,0,0,100,100,60,100) );
    ReefAngel.PWM.SetActinic( PWMSlope(0,0,0,0,100,100,60,100) );
    ////// Place your custom code below here
    

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.AddWifi();
    ReefAngel.ShowInterface();
}

The menu SHOWS my PWM for both channels being at 100.... however, neither channel is actually delivering any signal. HELP!

Re: PWM Help!

Posted: Sun Dec 16, 2012 5:38 am
by Sebyte
It looks like you may not be setting the PWM Slope function correctly. The start and finish times look like they are set to 0.

Here is the list settings list, check to see that you have set the right parameter for what you want to happen.


startHour - Hour of the start the slope/ramp
startMinute - Minute of the start the slope/ramp
endHour - Hour of the end of the ramp/slope (when end value is reached)
endMinute - Minute of the end ramp/slope
startPWM - Beginning PWM value
endPWM - Ending PWM value
Duration - Amount of time (in minutes) it takes to go from the startPWM to endPWM (and vice versa). If the duration is 30 minutes. Then if it starts at 8a, from 8 - 8:30a it will go from startPWM to endPWM. If it ends at 5pm, from 4:30p - 5p it will go from endPWM to startPWM.
oldValue - Should be the existing/current PWM value (ReefAngel.PWM.GetActinicValue() or GetDaylightValue())

Re: PWM Help!

Posted: Sun Dec 16, 2012 9:27 am
by Zechenia
I also tried with ending time of 23:59 with same result.

Re: PWM Help!

Posted: Sun Dec 16, 2012 10:32 am
by rimai
Just for testing purposes, try this:

Code: Select all

    ReefAngel.PWM.SetDaylight( 50);
    ReefAngel.PWM.SetActinic( 50);
This should put it to 50%

Re: PWM Help!

Posted: Sun Dec 16, 2012 11:01 am
by Zechenia
Ok, I will give that a quick try.

Also, I tried:

Code: Select all

    ReefAngel.PWM.SetDaylight(100);
    ReefAngel.PWM.SetActinic(100);
Originally, but thought I was doing something wrong when it failed, so I used the wizard which didn't give a static option.

Additionally, I believe I have the most recent libraries installed.

Re: PWM Help!

Posted: Sun Dec 16, 2012 11:07 am
by rimai
That should have worked too.
Make sure you are using the same polarity shown in the user manual.
Do you have a multi meter to test the output voltage?
Also, just to be sure, you have a gen2 relay box and you are using the original RA svga cable, right?

Re: PWM Help!

Posted: Sun Dec 16, 2012 11:09 am
by Zechenia
Original Cable is being used (NOTE: I bought this unit used. So I am using the original cable they provided - cable is labeled "30v vw-1 low voltage computer cable jamer").


I have tried using either polarity (started with one in the manual).

Not sure which version of the relay box I have.

Doing it to 50% didn't change anything :/

Re: PWM Help!

Posted: Sun Dec 16, 2012 11:48 am
by Zechenia
Just completely removed the controller from my aquarium (was needing to do this anyway as I am moving it to the 90 gallon tank I am building that should be started next week)

Reconnected the relay box (and nothing else). Still not getting any Voltage out of the PWM ports.

Re: PWM Help!

Posted: Sun Dec 16, 2012 12:09 pm
by Zechenia
Another addition. If you remember a few months back I had to replace all the guts out of the head unit of the Reef Angel. Just in case that could have anything to do with it.

Re: PWM Help!

Posted: Sun Dec 16, 2012 2:42 pm
by rimai
That shouldn't affect the dimming signal.
Can you send me a photo of your box?

Re: PWM Help!

Posted: Sun Dec 16, 2012 2:54 pm
by Zechenia
rimai wrote:That shouldn't affect the dimming signal.
Can you send me a photo of your box?
Let me know if you need any other angles:

Image

Image

Re: PWM Help!

Posted: Sun Dec 16, 2012 3:00 pm
by rimai
You definitely have one of the older models of relay box.
At that time, the PWM booster was an optional item. If you did not purchased it, you will not get the signal out to the ports.
Can you open the box and see which board revision you have?

Re: PWM Help!

Posted: Sun Dec 16, 2012 3:08 pm
by Zechenia
Ok, I've got the box open... but not sure what I am looking at as far as getting you a board revision.

Image

Re: PWM Help!

Posted: Sun Dec 16, 2012 3:09 pm
by rimai
Ok, good.
I can tell it will be very simple fix.
We need to add the PWM booster add-on board to your box.
It goes into the header pins located close to the dimming ports.
PM me for details on how to get one.