Dimming module not working
Posted: Wed Aug 08, 2012 10:33 pm
Roberto,
I got my Meanwell LPF (LPF-90D-36) series drivers today which are three in one dimming (potentiometer/0-10V Analog/10V PWM) choose one. When I ordered my RA+ you customized a Dimming module for me to run channels 0/1/2 (PWM) and 3/4/5 (Analog). I'm probably doing something wrong but it seems as if the module does not work. I have tried hooking up my Dim+/- leads observing proper polarity and I get a fairly dim output from the LED's. I have tested the drivers by shorting and opening the dim +/- leads. Shorted shuts LED's off completely open turns LED's on 100%. When hooked up to the Dimming module I get a mostly dim output. I tried ports 0 and 3 and get the same results. If I pull the dim +/- wires off the dimming module and hook them to a AAA battery the light output from the drivers seems about half of the brightness from the dimming module. I did some testing with slopes and parabola on channels 0/3 and noticed no change in brightness at all during my test period. I have attached my test code.
I have measured my voltage with my DVM on all 6 of the Dimming module ports and they all read about 3.8V DC no matter what my dimming percentage displays on the RA+ display or on the Portal. I have also made sure I have the 12V included supply connected to the dimming module. I noticed when I unplug the power from the dimming module the LED's get a little bit brighter and when I plug the 12V adapter back in the brightness goes back down to where it was. i also noticed that when I unplug the data cable and plug it back in to the dimming module the LED brightness goes way up for a second or two then goes back down by itself to where it was.
Not sure what is going on and it may be something else in my code. Any Ideas anyone has would be helpful.
Thanks
Nick
I got my Meanwell LPF (LPF-90D-36) series drivers today which are three in one dimming (potentiometer/0-10V Analog/10V PWM) choose one. When I ordered my RA+ you customized a Dimming module for me to run channels 0/1/2 (PWM) and 3/4/5 (Analog). I'm probably doing something wrong but it seems as if the module does not work. I have tried hooking up my Dim+/- leads observing proper polarity and I get a fairly dim output from the LED's. I have tested the drivers by shorting and opening the dim +/- leads. Shorted shuts LED's off completely open turns LED's on 100%. When hooked up to the Dimming module I get a mostly dim output. I tried ports 0 and 3 and get the same results. If I pull the dim +/- wires off the dimming module and hook them to a AAA battery the light output from the drivers seems about half of the brightness from the dimming module. I did some testing with slopes and parabola on channels 0/3 and noticed no change in brightness at all during my test period. I have attached my test code.
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 <ReefAngel.h>
// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
byte atoflag=0;
////// 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;
ReefAngel.FeedingModePortsE[0] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port3Bit | Port4Bit;
ReefAngel.WaterChangePortsE[0] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port4Bit | Port5Bit | Port6Bit;
ReefAngel.OverheatShutoffPortsE[0] = 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( 850 );
// Ports that are always on
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Box1_Port5 );
ReefAngel.Relay.On( Box1_Port6 );
ReefAngel.Relay.On( Box1_Port7 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardFan( Port1,790,820 );
ReefAngel.StandardATO( Port2,60 );
ReefAngel.Relay.DelayedOn( Port4,5 );
ReefAngel.WavemakerRandom( Port5,30,100 );
ReefAngel.StandardHeater( Port6,750,760 );
ReefAngel.StandardLights( Box1_Port1,7,5,19,50 );
ReefAngel.StandardLights( Box1_Port2,7,5,19,50 );
ReefAngel.StandardHeater( Box1_Port3,750,760 );
ReefAngel.StandardHeater( Box1_Port4,750,760 );
ReefAngel.PWM.SetChannel( 0, PWMParabola(23,0,23,15,1,100,1) );
ReefAngel.PWM.SetChannel( 1, PWMParabola(23,0,23,15,0,100,0) );
ReefAngel.PWM.SetChannel( 2, PWMSlope(0,1,10,0,0,100,1,0) );
ReefAngel.PWM.SetChannel( 3, PWMSlope(23,30,23,40,0,100,5,0) );
overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
atoflag = InternalMemory.read( ATO_Exceed_Flag );
buzzer = overheatflag + atoflag;
if ( buzzer >= 1 ) buzzer = 100;
ReefAngel.PWM.SetDaylight( buzzer );
ReefAngel.PWM.SetActinic( buzzer );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "00Warpig00" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Dimming Expansion
x = 15;
y = 2;
for ( int a=0;a<6;a++ )
{
if ( a>2 ) x = 75;
if ( a==3 ) y = 2;
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
y += 10;
}
pingSerial();
// I/O Expansion
byte bkcolor;
x = 14;
y = 34;
for ( int a=0;a<6;a++ )
{
ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE; else bkcolor=COLOR_GRAY;
ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
}
pingSerial();
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 44, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,76, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,76, ReefAngel.Params.Salinity );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 90, TempRelay );
pingSerial();
// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 104, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}
I have measured my voltage with my DVM on all 6 of the Dimming module ports and they all read about 3.8V DC no matter what my dimming percentage displays on the RA+ display or on the Portal. I have also made sure I have the 12V included supply connected to the dimming module. I noticed when I unplug the power from the dimming module the LED's get a little bit brighter and when I plug the 12V adapter back in the brightness goes back down to where it was. i also noticed that when I unplug the data cable and plug it back in to the dimming module the LED brightness goes way up for a second or two then goes back down by itself to where it was.
Not sure what is going on and it may be something else in my code. Any Ideas anyone has would be helpful.
Thanks
Nick