Stuggling with the LDD Drivers

newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

Code: Select all

  ReefAngel.ActinicLights( Port5 );
  ReefAngel.MoonLights( Port4 );
  ReefAngel.PWM.DaylightPWMSlope();
  ReefAngel.PWM.ActinicPWMSlope( 60 );
  
  //Moon output
  moonPWM = Moon.MoonPWM(0, 20);
  if (moonPWM >= 1)
  {
    ReefAngel.Relay.On( Port3 );
  }
  else
  {
    ReefAngel.Relay.Off( Port3 );
  }

  //light temp
  int lightTemp = ReefAngel.Params.Temp[T2_PROBE];
  if(lightTemp > 1200) lightOverHeat = true;
  if(lightTemp < 900)
  { 
    lightOverHeat = false;
  } 

  //fan control
  if(lightTemp > 950)
  {
    //turn on fans when over 95 degrees
    ReefAngel.Relay.On( Port8 );
  } 
  else if(lightTemp <= (ReefAngel.Params.Temp[T1_PROBE] + 50))
  {
    //turn off fans when in five degrees of room temp;
    ReefAngel.Relay.Off( Port8 );
  }

  //driver control
  if (lightOverHeat)
  {
	  ReefAngel.PWM.SetChannel(0, 0);
	  ReefAngel.PWM.SetChannel(1, 0);
	  ReefAngel.Relay.Off( Port5 );
  }
  else
  {
	  ReefAngel.PWM.Channel0PWMSlope();
	  ReefAngel.PWM.Channel1PWMSlope(60);
	  ReefAngel.Relay.On( Port5 );
  }
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

Oh and the code worked fine with my older meanwell drivers.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

This code doesn't use the dimming expansion.
Try adding this to see if it works:

Code: Select all

ReefAngel.PWM.SetChannel(0,100);
ReefAngel.PWM.SetChannel(1,100);
ReefAngel.PWM.SetChannel(2,100);
ReefAngel.PWM.SetChannel(3,100);
ReefAngel.PWM.SetChannel(4,100);
ReefAngel.PWM.SetChannel(5,100);
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

Isn't this the dimming expansion code?

//driver control
if (lightOverHeat)
{
ReefAngel.PWM.SetChannel(0, 0);
ReefAngel.PWM.SetChannel(1, 0);
ReefAngel.Relay.Off( Port5 );
}
else
{
ReefAngel.PWM.Channel0PWMSlope();
ReefAngel.PWM.Channel1PWMSlope(60);
ReefAngel.Relay.On( Port5 );
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

Oh. :oops:
My bad. I didn't scroll down the code.
I just looked the top part.
You are correct. They are for the dimming module.
What do you see in the screen for the channels 0 and 1?
Is it showing 0 or some other number?
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

Its 100 as it should be.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

I'm thinking it is something in your wiring or your driver.
Can you post a sketch of how you connected stuff together?
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

Image
Attachments
wiring.png
wiring.png (9.89 KiB) Viewed 4970 times
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

If you disconnect the white ch0 wire, what voltage do you get on channel 0?
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

I will have to check when I get back into work on Tuesday.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

I just checked it and I am getting zero volts out of each channel ( 0 - 5 ). To make sure my voltmeter was working, I then checked the ATO ports where I got 4.75 volts. So what am I doing wrong to only get zero volts?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

Run the I2CScanner code and send the results:
http://forum.reefangel.com/viewtopic.php?p=18831#p18831
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

I2CScanner ready!
starting scanning of I2C bus from 1 to 128...
addr: 1 addr: 2 addr: 3 addr: 4
addr: 5 addr: 6 addr: 7 addr: 8
addr: 9 addr: A addr: B addr: C
addr: D addr: E addr: F addr: 10
addr: 11 addr: 12 addr: 13 addr: 14
addr: 15 addr: 16 addr: 17 addr: 18
addr: 19 addr: 1A addr: 1B addr: 1C
addr: 1D addr: 1E addr: 1F addr: 20 found!
addr: 21 addr: 22 addr: 23 addr: 24
addr: 25 addr: 26 addr: 27 addr: 28
addr: 29 addr: 2A addr: 2B addr: 2C
addr: 2D addr: 2E addr: 2F addr: 30
addr: 31 addr: 32 addr: 33 addr: 34
addr: 35 addr: 36 addr: 37 addr: 38
addr: 39 addr: 3A addr: 3B addr: 3C
addr: 3D addr: 3E addr: 3F addr: 40
addr: 41 found! addr: 42 addr: 43 addr: 44
addr: 45 addr: 46 addr: 47 addr: 48
addr: 49 addr: 4A addr: 4B addr: 4C
addr: 4D found! addr: 4E addr: 4F addr: 50 found!
addr: 51 addr: 52 addr: 53 addr: 54 found!
addr: 55 addr: 56 addr: 57 addr: 58
addr: 59 addr: 5A addr: 5B addr: 5C
addr: 5D addr: 5E addr: 5F addr: 60
addr: 61 addr: 62 addr: 63 addr: 64
addr: 65 addr: 66 addr: 67 addr: 68 found!
addr: 69 addr: 6A addr: 6B addr: 6C
addr: 6D addr: 6E addr: 6F addr: 70 found!
addr: 71 addr: 72 addr: 73 addr: 74
addr: 75 addr: 76 addr: 77 addr: 78
addr: 79 addr: 7A addr: 7B addr: 7C
addr: 7D addr: 7E addr: 7F addr: 80 found!

done
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

Remove the jumper in the dimming expansion module that is all by itself.
Roberto.
newtoke
Posts: 39
Joined: Wed May 07, 2014 12:11 pm

Re: Stuggling with the LDD Drivers

Post by newtoke »

That did it... What did the jumper do?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Stuggling with the LDD Drivers

Post by rimai »

Changes the address from 0x40 to 0x41.
Technically you can have 2 of those modules, but only one is supported with the current libraries.
Roberto.
Post Reply