PWM Dimming module and Meanwell ELN 60-48P driver

Expansion modules and attachments
Post Reply
NatesFamousDogs
Posts: 3
Joined: Thu May 03, 2012 9:20 pm

PWM Dimming module and Meanwell ELN 60-48P driver

Post by NatesFamousDogs »

Hi everybody. I have a custom, 8 driver, 5 dimming channels DIY LED setup. I have adjusted svr2 on all drivers, and I have it up and running and it dims well from 100% to about 15%. At low PWM %, the leds start blinking off and on every second or two for the channel with 8 XP-E royal blue leds and also the true violet leds. I realize that maybe i dont have enough leds on the string to account for the lower range of total voltage of the driver. However, on my other channels, with 10, 12 or 16 drivers on each circuit, they still dont dim all the way down to 1% PWM. All of them stay on until the relay for the drivers turns off for the night. I wanted to have 100% control of all channels and be able to simulate a full ramp up from zero at sunrise and the reverse for sunset. Can you take a look at my code and tell me if something is wrong, and give me any pointers for the LED drivers? I have heard people talk about adding a resistor at the end of the circuit to eat up some of the voltage at the end of the led string before the driver (-). I did not adjust svr1 because i was told by several people it is unneccessary for the meanwell drivers.

Also, I have a second question about my ATO function. I have a weak pump for my top off pump, and i specified a 300 second ATO cutoff time in the internal memory and uploaded it, so it wouldn't cut off so early at the 60 second mark. However, my ATO still cuts off at 60 seconds. I'll post my internal memory and ino code after everything. Thanks anyone for any help. It works as follows

Dimming channel 0: dims two Meanwell ELN 60-48p drivers running 20 Cree white XP-G leds at 1000mA
Dimming channel 1: dims two Meanwell LPF-60D-54 drivers running 32 Cree blue and royal blue XP-E leds at 700mA
Dimming channel 2: dims two Meanwell ELN-60-48p drivers running 4 Ocean Coral White triple star LEDs each (24 leds total) at 500mA
Dimming channel 3: dims one meanwell ELN-60 48p driver running 8 true violet LEDs at 500mA
Dimming channel 4: dims one Meanwell ELN-60-48p driver running 8 Cree XP-E royal blue leds at 700mA

Code: Select all

 // Autogenerated file by RAGen (v1.2.2.171), (05/01/2012 23:38)
// RA_050112_2338.ino
//
// This version designed for v0.9.0 or later

// The following features are enabled for this File: 
#define WavemakerSetup
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define DisplayLEDPWM
#define StandardLightSetup
#define WDT
#define FONT_8x8
#define ATOPump             1  
#define ActinicT5           2  
#define DaylightT5          3  
#define Refugiumlight       4  
#define Koralia1            5  
#define Koralia2            6  
#define Heater              7  
#define Return              8 

#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.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
    ReefAngel.Relay.On(Return);  //Turn Return on at startup
    ////// Place additional initialization code below here
    

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

void loop()
{
    // Specific functions that use Internal Memory values
    ReefAngel.SingleATOLow(ATOPump);
    ReefAngel.StandardLights(ActinicT5,10,0,20,0);
    ReefAngel.StandardLights(DaylightT5,10,0,20,0);
    ReefAngel.StandardLights(Refugiumlight,20,0,10,0);
    ReefAngel.WavemakerRandom(Koralia1,15,45); // Turn Port5 on/off random cycles that lasts from 15 to 60 secs
    ReefAngel.Relay.Set(Koralia2,!ReefAngel.Relay.Status(Koralia1));
    ReefAngel.StandardHeater(Heater,798,802);
    ////// Place your custom code below here
    

    ////// Place your custom code above here
  ReefAngel.PWM.SetChannel(0,PWMSlope(10,0,20,0,1,70,60,1));
  ReefAngel.PWM.SetChannel(1,PWMSlope(10,0,20,0,1,70,60,1));
  ReefAngel.PWM.SetChannel(2,PWMSlope(10,0,20,0,1,70,60,1));
  ReefAngel.PWM.SetChannel(3,PWMSlope(10,0,20,0,1,70,60,1));
  ReefAngel.PWM.SetChannel(4,PWMSlope(10,0,20,0,1,70,60,1));
 

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

Code: Select all

// Autogenerated file by RAGen (v1.2.2.171), (08/02/2012 23:05)
// Memory_080212_2305.ino
//
// This file sets the default values to the Internal Memory
//


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>


RA_NokiaLCD e;

void setup()
{
    e.Init();
    e.Clear(COLOR_WHITE,0,0,132,132);
    e.BacklightOn();

    InternalMemory.MHOnHour_write(10);
    InternalMemory.MHOnMinute_write(0);
    InternalMemory.MHOffHour_write(20);
    InternalMemory.MHOffMinute_write(0);
    InternalMemory.StdLightsOnHour_write(9);
    InternalMemory.StdLightsOnMinute_write(0);
    InternalMemory.StdLightsOffHour_write(21);
    InternalMemory.StdLightsOffMinute_write(0);
    InternalMemory.WM1Timer_write(45);
    InternalMemory.WM2Timer_write(45);
    InternalMemory.DP1Timer_write(10);
    InternalMemory.DP2Timer_write(10);
    InternalMemory.FeedingTimer_write(540);
    InternalMemory.LCDTimer_write(30);
    InternalMemory.OverheatTemp_write(825);
    InternalMemory.LEDPWMDaylight_write(50);
    InternalMemory.LEDPWMActinic_write(50);
    InternalMemory.HeaterTempOn_write(798);
    InternalMemory.HeaterTempOff_write(801);
    InternalMemory.ChillerTempOn_write(810);
    InternalMemory.ChillerTempOff_write(785);
    InternalMemory.ATOTimeout_write(300);
    InternalMemory.PHMax_write(840);
    InternalMemory.PHMin_write(550);
    InternalMemory.MHDelay_write(5);
    InternalMemory.DP1OnHour_write(20);
    InternalMemory.DP1OnMinute_write(0);
    InternalMemory.DP2OnHour_write(22);
    InternalMemory.DP2OnMinute_write(30);
    InternalMemory.ATOHourInterval_write(0);
    InternalMemory.ATOHighHourInterval_write(0);
    InternalMemory.ATOHighTimeout_write(300);
    InternalMemory.DP1RepeatInterval_write(0);
    InternalMemory.DP2RepeatInterval_write(0);
    InternalMemory.SalMax_write(2550);
    InternalMemory.PWMSlopeStartD_write(15);
    InternalMemory.PWMSlopeEndD_write(100);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(15);
    InternalMemory.PWMSlopeEndA_write(100);
    InternalMemory.PWMSlopeDurationA_write(60);
    InternalMemory.RFMode_write(0);
    InternalMemory.RFSpeed_write(100);
    InternalMemory.RFDuration_write(10);
    InternalMemory.PWMSlopeStart0_write(15);
    InternalMemory.PWMSlopeEnd0_write(100);
    InternalMemory.PWMSlopeDuration0_write(60);
    InternalMemory.PWMSlopeStart1_write(15);
    InternalMemory.PWMSlopeEnd1_write(100);
    InternalMemory.PWMSlopeDuration1_write(60);
    InternalMemory.PWMSlopeStart2_write(15);
    InternalMemory.PWMSlopeEnd2_write(100);
    InternalMemory.PWMSlopeDuration2_write(60);
    InternalMemory.PWMSlopeStart3_write(15);
    InternalMemory.PWMSlopeEnd3_write(100);
    InternalMemory.PWMSlopeDuration3_write(60);
    InternalMemory.PWMSlopeStart4_write(15);
    InternalMemory.PWMSlopeEnd4_write(100);
    InternalMemory.PWMSlopeDuration4_write(60);
    InternalMemory.PWMSlopeStart5_write(15);
    InternalMemory.PWMSlopeEnd5_write(100);
    InternalMemory.PWMSlopeDuration5_write(60);
    InternalMemory.IMCheck_write(0x5241494D);
}

void loop()
{
    // display success screen
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, "Internal Memory Set");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, "Now load your");
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, "   RA code file");
    delay(5000);
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: PWM Dimming module and Meanwell ELN 60-48P driver

Post by rimai »

The meanwell drivers can't dim down to 1%.
It is in their datasheet. They cut off right about 15%.
So the problem is the driver limitation. If you want to dim to 1%, I heard Steve's LED drivers can do that. Never tried them myself though. Just heard from other people.
The ATO timeout was cahnged to allow it to have more than 255 sec in a later library and by looking at your code, you are using an older set of libraries.
I suggest you download the newest RA Installer and also try the new Reef Angel Wizard on menu Tools->Reef Angel Wizard.
Roberto.
NatesFamousDogs
Posts: 3
Joined: Thu May 03, 2012 9:20 pm

Re: PWM Dimming module and Meanwell ELN 60-48P driver

Post by NatesFamousDogs »

thank you Roberto. I'll give it a try. I didn't think my libraries could already be out of date. It's only been a few months since I got my reef angel :D
Post Reply