Page 1 of 1

PMSLOPE QUESTION

Posted: Tue Aug 30, 2011 5:22 pm
by divingdon
I would like to know if I can give the PMSLOPE command a starting power point instead of letting the RA start @ Zero when the meanwell controller dont come on until the the PWM signal reaches about 1.5v?

Re: PMSLOPE QUESTION

Posted: Tue Aug 30, 2011 6:01 pm
by rimai
yeah, the function has start and end values.

Code: Select all

PWMSlope(14,0,21,30,15,45,90,PWMChannel[LEDPWM1])
The function above starts at 15 and ends at 45

Re: PMSLOPE QUESTION

Posted: Sat Sep 03, 2011 8:03 pm
by divingdon
Thanks Roberto,

Since I changed my sketch to the following commands, the timing seems to be off during the shutdown it appears the whites getting bright and stay on approx 30 mins longer then they should and the blues also dont go off properly. Please review my commands and let me know what you think could be wrong.

PWMChannel[WhitePWM1]=2.55*PWMSlope(06,45,21,00,14,35,60,PWMChannel[WhitePWM1]);
PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,14,40,60,PWMChannel[BluePWM1]);
PWMChannel[WhitePWM2]=2.55*PWMSlope(06,46,21,00,14,35,60,PWMChannel[WhitePWM2]);
PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,00,14,40,60,PWMChannel[BluePWM2]);
PWMChannel[WhitePWM3]=2.55*PWMSlope(06,47,21,00,14,35,60,PWMChannel[WhitePWM3]);
PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,14,40,60, PWMChannel[BluePWM3]);

thanks

Re: PMSLOPE QUESTION

Posted: Sat Sep 03, 2011 8:47 pm
by rimai
It's probably because you got used to it being cutoff at 15% and from 15% to 0%, it was always off.
According to the code above, the whites turn off at 9pm. Are you saying they are staying on until 9:30pm?

Re: PMSLOPE QUESTION

Posted: Sun Sep 04, 2011 3:25 am
by divingdon
Yes that is what i'm saying and today I had to get up early and the whites and blues where on at 6. When the turn on time is not until 6:45. I checked the time on the RA and it is corrected. Any ideas

Re: PMSLOPE QUESTION

Posted: Sun Sep 04, 2011 8:07 am
by rimai
Can you post your entire code?
I think it is not within the piece you posted.

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 7:26 am
by divingdon
Here is the sketch you ask for Roberto

// Autogenerated file by RAGen (v1.0.4.92), (08/25/2011 17:16)
// RA_082511_1716.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File:
#define wifi
#define StandardLightSetup
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

ReefAngel_TimerClass ParamTimer;



//Give labels to your PWM channels

#define WhitePWM1 0
#define BluePWM1 1
#define WhitePWM2 2
#define BluePWM2 3
#define WhitePWM3 4
#define BluePWM3 5

byte PWMChannel[]={
0,0,0,0,0,0};



void setup()
{
ReefAngel.Init(); //Initialize controller

// Initialize and start the Parameter timer
ParamTimer.SetInterval(15); // set interval to 15 seconds
ParamTimer.Start();

ReefAngel.FeedingModePorts = B00111111;
ReefAngel.WaterChangePorts = B00111111;
ReefAngel.OverheatShutoffPorts = B00110000;
ReefAngel.LightsOnPorts = B11000100;

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

void loop()
{
ReefAngel.ShowInterface();


// Specific functions
ReefAngel.StandardFan(Port4);
ReefAngel.StandardHeater(Port5);
ReefAngel.StandardHeater(Port6);
ReefAngel.StandardLights(Port7);
ReefAngel.StandardLights(Port8);

if ( ParamTimer.IsTriggered() )
{
ParamTimer.Start();
ReefAngel.PCLogging();
}
// Setup relay 7 to turn on at 06:00aM and off at 10:15AM
ReefAngel.StandardLights(7,06,0,22,15);
ReefAngel.Relay.Write(); //Writes the value of RelayData to the RelayBox

// Setup relay 8 to turn on at 18:00PM and off at 00:00AM
ReefAngel.StandardLights(8,18,0,00,00);
ReefAngel.Relay.Write(); //Writes the value of RelayData to the RelayBox

//This section calculates the slope
//calculate slope for 0 to 50% starting at 12:30pm with duration of 60min, then from 50% to 0 from 17:00pm with duration of 60min
PWMChannel[WhitePWM1]=2.55*PWMSlope(06,45,21,00,14,35,60,PWMChannel[WhitePWM1]);
PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,14,40,60,PWMChannel[BluePWM1]);
PWMChannel[WhitePWM2]=2.55*PWMSlope(06,46,21,00,14,35,60,PWMChannel[WhitePWM2]);
PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,00,14,40,60,PWMChannel[BluePWM2]);
PWMChannel[WhitePWM3]=2.55*PWMSlope(06,47,21,00,14,35,60,PWMChannel[WhitePWM3]);
PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,14,40,60, PWMChannel[BluePWM3]);

// this section sends the data to the PWM expansion module
PWMExpansion(WhitePWM1,PWMChannel[WhitePWM1]);
PWMExpansion(BluePWM1,PWMChannel[BluePWM1]);
PWMExpansion(WhitePWM2,PWMChannel[WhitePWM2]);
PWMExpansion(BluePWM2,PWMChannel[BluePWM2]);
PWMExpansion(WhitePWM3,PWMChannel[WhitePWM3]);
PWMExpansion(BluePWM3,PWMChannel[BluePWM3]);
}
void PWMExpansion(byte cmd, byte data)
{
Wire.beginTransmission(2); // transmit to device #2
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send(cmd); // sends a value
Wire.send(data); // sends 255
Wire.endTransmission(); // stop transmitting}
}

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 10:53 am
by rimai
Where is the LED drivers connected to?
All 6 drivers on port 7?

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 10:55 am
by rimai
One more question, do you really use the function PCLogging()?

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 2:24 pm
by binder
PCLogging shouldn't be used under normal circumstances. It just dumps the values on the serial cable at the specified interval. It's only major use now is via the wifi interface when you request the status of the controller (ie, a /r99 GET request).

curt

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 4:38 pm
by divingdon
The 6 Meanwell's are connected to 2 seperated timers on 2 different power strips what is plugged in on RA outlet 7 is the DC power supply which supplys the PWM volatage.

No I dont use the PC logging function I just put it into the sketch was I was having problems making the client 2.2 work correctly but that problem wasn't the fix so I will remove that line.

Any ideas why the timers maybe functioning incorrectly??

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 4:45 pm
by rimai
Try this code:

Code: Select all

// Autogenerated file by RAGen (v1.0.4.92), (08/25/2011 17:16)
// RA_082511_1716.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File: 
 #define wifi
 #define StandardLightSetup
 #define SIMPLE_MENU
 */


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

ReefAngel_TimerClass ParamTimer;



//Give labels to your PWM channels

#define WhitePWM1 0
#define BluePWM1 1
#define WhitePWM2 2
#define BluePWM2 3
#define WhitePWM3 4
#define BluePWM3 5

byte PWMChannel[]={
  0,0,0,0,0,0};



void setup()
{
  ReefAngel.Init(); //Initialize controller

  // Initialize and start the Parameter timer
  ParamTimer.SetInterval(15); // set interval to 15 seconds
  ParamTimer.Start();

  ReefAngel.FeedingModePorts = B00111111;
  ReefAngel.WaterChangePorts = B00111111;
  ReefAngel.OverheatShutoffPorts = B00110000;
  ReefAngel.LightsOnPorts = B11000100;

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

void loop()
{
  ReefAngel.ShowInterface();


  // Specific functions
  ReefAngel.StandardFan(Port4);
  ReefAngel.StandardHeater(Port5);
  ReefAngel.StandardHeater(Port6);
  // Setup relay 7 to turn on at 06:00aM and off at 10:15AM
  ReefAngel.StandardLights(7,06,45,22,00);
  ReefAngel.Relay.Write(); //Writes the value of RelayData to the RelayBox 

  // Setup relay 8 to turn on at 18:00PM and off at 00:00AM
  ReefAngel.StandardLights(8,18,0,00,00);
  ReefAngel.Relay.Write(); //Writes the value of RelayData to the RelayBox 

  //This section calculates the slope
  //calculate slope for 0 to 50% starting at 12:30pm with duration of 60min, then from 50% to 0 from 17:00pm with duration of 60min
  PWMChannel[WhitePWM1]=2.55*PWMSlope(06,45,21,00,14,35,60,PWMChannel[WhitePWM1]); 
  PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,14,40,60,PWMChannel[BluePWM1]); 
  PWMChannel[WhitePWM2]=2.55*PWMSlope(06,46,21,00,14,35,60,PWMChannel[WhitePWM2]);
  PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,00,14,40,60,PWMChannel[BluePWM2]); 
  PWMChannel[WhitePWM3]=2.55*PWMSlope(06,47,21,00,14,35,60,PWMChannel[WhitePWM3]);
  PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,14,40,60, PWMChannel[BluePWM3]); 

  // this section sends the data to the PWM expansion module
  PWMExpansion(WhitePWM1,PWMChannel[WhitePWM1]);
  PWMExpansion(BluePWM1,PWMChannel[BluePWM1]);
  PWMExpansion(WhitePWM2,PWMChannel[WhitePWM2]);
  PWMExpansion(BluePWM2,PWMChannel[BluePWM2]);
  PWMExpansion(WhitePWM3,PWMChannel[WhitePWM3]);
  PWMExpansion(BluePWM3,PWMChannel[BluePWM3]);
}
void PWMExpansion(byte cmd, byte data)
{ 
  Wire.beginTransmission(2); // transmit to device #2
  Wire.send('$'); // sends $ 
  Wire.send('$'); // sends $ 
  Wire.send('$'); // sends $ 
  Wire.send(cmd); // sends a value 
  Wire.send(data); // sends 255 
  Wire.endTransmission(); // stop transmitting}
}
I think your problem was this:

Code: Select all

ReefAngel.StandardLights(7,06,0,22,15);
This line turns on at 6:00AM and off at 10:15PM
I think 14% still doesn't cut off your meanwells, so as long as the drivers have power, they were lighting up at 14%.
I change the above code to match the same as your PWMSlope schedule.

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:07 pm
by divingdon
thanks I just load that sketch will 1 change I changed the starting PWM voltage from 1.4 to .8 to make sure the LEDs go off and I notice after loading that the red status light is staying lite??

any ideas

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:12 pm
by rimai
Don't see how the red status would stay on, but I did forget to remove some stuff. I don't know where I had my mind.
Updated:

Code: Select all

// Autogenerated file by RAGen (v1.0.4.92), (08/25/2011 17:16)
// RA_082511_1716.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File: 
#define wifi
#define StandardLightSetup
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

//Give labels to your PWM channels

#define WhitePWM1 0
#define BluePWM1 1
#define WhitePWM2 2
#define BluePWM2 3
#define WhitePWM3 4
#define BluePWM3 5

byte PWMChannel[]={
  0,0,0,0,0,0};



void setup()
{
  ReefAngel.Init(); //Initialize controller

  ReefAngel.FeedingModePorts = B00111111;
  ReefAngel.WaterChangePorts = B00111111;
  ReefAngel.OverheatShutoffPorts = B00110000;
  ReefAngel.LightsOnPorts = B11000100;

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

void loop()
{
  ReefAngel.ShowInterface();


  // Specific functions
  ReefAngel.StandardFan(Port4);
  ReefAngel.StandardHeater(Port5);
  ReefAngel.StandardHeater(Port6);
  // Setup relay 7 to turn on at 06:00aM and off at 10:15AM
  ReefAngel.StandardLights(7,06,45,22,00);

  // Setup relay 8 to turn on at 18:00PM and off at 00:00AM
  ReefAngel.StandardLights(8,18,0,00,00);

  //This section calculates the slope
  //calculate slope for 0 to 50% starting at 12:30pm with duration of 60min, then from 50% to 0 from 17:00pm with duration of 60min
  PWMChannel[WhitePWM1]=2.55*PWMSlope(06,45,21,00,14,35,60,PWMChannel[WhitePWM1]); 
  PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,14,40,60,PWMChannel[BluePWM1]); 
  PWMChannel[WhitePWM2]=2.55*PWMSlope(06,46,21,00,14,35,60,PWMChannel[WhitePWM2]);
  PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,00,14,40,60,PWMChannel[BluePWM2]); 
  PWMChannel[WhitePWM3]=2.55*PWMSlope(06,47,21,00,14,35,60,PWMChannel[WhitePWM3]);
  PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,14,40,60, PWMChannel[BluePWM3]); 

  // this section sends the data to the PWM expansion module
  PWMExpansion(WhitePWM1,PWMChannel[WhitePWM1]);
  PWMExpansion(BluePWM1,PWMChannel[BluePWM1]);
  PWMExpansion(WhitePWM2,PWMChannel[WhitePWM2]);
  PWMExpansion(BluePWM2,PWMChannel[BluePWM2]);
  PWMExpansion(WhitePWM3,PWMChannel[WhitePWM3]);
  PWMExpansion(BluePWM3,PWMChannel[BluePWM3]);
}
void PWMExpansion(byte cmd, byte data)
{ 
  Wire.beginTransmission(2); // transmit to device #2
  Wire.send('$'); // sends $ 
  Wire.send('$'); // sends $ 
  Wire.send('$'); // sends $ 
  Wire.send(cmd); // sends a value 
  Wire.send(data); // sends 255 
  Wire.endTransmission(); // stop transmitting}
}

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:25 pm
by divingdon
the whites just shut off @ 2019 just under 30 mins early

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:26 pm
by divingdon
Sorry posted before I saw your new sketch I will download and try that..

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:33 pm
by divingdon
loaded your sketch white LEDs still off and Status LED stilled turned on???

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:36 pm
by rimai
I think they are just going below the cutoff.
You better off leaving it above the cutoff and leaving it to be totally off when the relay turns the drivers off
.

Re: PMSLOPE QUESTION

Posted: Mon Sep 05, 2011 5:59 pm
by rimai
Do you have overheat setup on your features file?
I think that's the reason you are getting status led.

Re: PMSLOPE QUESTION

Posted: Tue Sep 06, 2011 3:37 pm
by divingdon
Roberto,

The status light issues is fixed but since i loaded the sketch you fixed for me I cant use the client software it doesn't connect. Did I do something wrong or is some code missing??

Re: PMSLOPE QUESTION

Posted: Tue Sep 06, 2011 5:30 pm
by rimai
Can you post your features file?

Re: PMSLOPE QUESTION

Posted: Wed Sep 07, 2011 3:58 am
by divingdon
// AutoGenerated file by RAGen (v1.0.4.92), (08/25/2011 17:53)

/*
* Copyright 2010 / Curt Binder
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define wifi
#define StandardLightSetup
#define SIMPLE_MENU

#endif // __REEFANGEL_FEATURES_H__


that was all of it

Re: PMSLOPE QUESTION

Posted: Wed Sep 07, 2011 9:30 am
by rimai
Everything seems correct.
Maybe the wifi got a different ip address while doing all the changes?

Re: PMSLOPE QUESTION

Posted: Wed Sep 07, 2011 6:33 pm
by divingdon
IP was the same as before. Rebooted everything and now it works.

Thanks for your help.

Have you tried the optiboot upgrade with the homemade cable. I have one and I'm waiting to do the update.