Reef Central Online Community

Go Back   Reef Central Online Community > General Interest Forums > Lighting, Filtration & Other Equipment
Blogs FAQ Calendar

Notices

User Tag List

Reply
Thread Tools
Unread 03/27/2013, 11:56 AM   #1801
bluewater921
Registered Member.
 
Join Date: Jul 2012
Location: melbourne fla
Posts: 605
mine are already on the USPS track


__________________
if i was a fish i would play on the reef & swim in the surf

Current Tank Info: 180 in the wall reef
bluewater921 is offline   Reply With Quote
Unread 03/27/2013, 12:03 PM   #1802
albano
SALTWATER since '73
 
albano's Avatar
 
Join Date: Apr 2006
Location: Katonah, NY/ San Fernando Ca./ Sea Isle City NJ
Posts: 6,210
Quote:
Originally Posted by moatdaddy View Post
wahoo, ordered 40...
??? Ordered a (wp)40 ?, or ordered 40 wp40s?

FWIW...I've heard that it takes more than 50 units if you want to create 'surfing' waves in your swimming pool!




__________________
______________________________________

Jan. '11 TOTM Manhattan Reefs

Current Tank Info: 500g & 200g acrylic DTs/2 separate reef systems
albano is offline   Reply With Quote
Unread 03/27/2013, 12:21 PM   #1803
andyrm66
Registered Member
 
Join Date: Feb 2009
Location: Colorado
Posts: 517
Quote:
Originally Posted by dgtron View Post
The pump is not PWM controllable, it is 0-5v Analog controlled.
Axe the factory controller add 0-10V Analog control 24VDC PWM module. Control with Apex, Problem solved. Detailed earlier in this thread


andyrm66 is offline   Reply With Quote
Unread 03/27/2013, 02:02 PM   #1804
Solov
Registered Member
 
Solov's Avatar
 
Join Date: Oct 2003
Posts: 44
Quote:
Originally Posted by albano View Post
FWIW...I've heard that it takes more than 50 units if you want to create 'surfing' waves in your swimming pool!



Solov is offline   Reply With Quote
Unread 03/27/2013, 02:08 PM   #1805
rrasco
Registered Member
 
rrasco's Avatar
 
Join Date: Jun 2011
Location: South Texas
Posts: 2,159
Anyone know what frequency dimming signal should be sent?


__________________
-You had me at PWM
rrasco is offline   Reply With Quote
Unread 03/27/2013, 02:20 PM   #1806
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
Quote:
Originally Posted by rrasco View Post
I will most certainly post my findings.



It's not always 24v. atmega328 is 5v PWM and I understand the Apex to be 10v. You are correct that PWM never changes the voltage.
I meant in this application it would always be 24v (which is what the power supply is) PWM can be ANY voltage at all, it's all about the frequency and duty cycle of the signal


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Unread 03/27/2013, 02:42 PM   #1807
Haxer
Registered Member
 
Haxer's Avatar
 
Join Date: Dec 2007
Location: Cross Hill, SC
Posts: 250
Quote:
Originally Posted by dread240 View Post
I meant in this application it would always be 24v (which is what the power supply is) PWM can be ANY voltage at all, it's all about the frequency and duty cycle of the signal
So are we doing any harm to the pump / Driver using the Dimmer but keeping it above 12V ... Can the dimmer linked above safely handle the loads we are putting on it ?


Haxer is offline   Reply With Quote
Unread 03/27/2013, 02:56 PM   #1808
rrasco
Registered Member
 
rrasco's Avatar
 
Join Date: Jun 2011
Location: South Texas
Posts: 2,159
Quote:
Originally Posted by dread240 View Post
I meant in this application it would always be 24v (which is what the power supply is) PWM can be ANY voltage at all, it's all about the frequency and duty cycle of the signal
Yeah, I knew what you meant, but you know how people are. They would read that and be all "PWM is always 24v, dread240 said so!" So I just wanted to put that in text.

Do you happen to know the required frequency of this pump? Setting it too low could damage the pump, if you are generating your own dimming signal, which I plan to do. If nobody knows, I'm going to hook up the wp-40 controller to a scope to figure it out what they use. Of course, the scope here at work was borrowed and we don't know when it's coming back.


__________________
-You had me at PWM
rrasco is offline   Reply With Quote
Unread 03/27/2013, 03:05 PM   #1809
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
I have a personal 2 channel scope lol.. collecting dust and rarely used since I do most of it with my fluke 1587...

However as for help on this... none at all. I don't have one.. I already have a 6095 on my own wavemaker setup for an arduino. I'm interested in these because I'd like to build 2 into external waveboxes for my 210 that I'm redoing though.. so if someone wants to donate one I'll give you all the info you want lol


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Unread 03/27/2013, 03:11 PM   #1810
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
Quote:
Originally Posted by Haxer View Post
So are we doing any harm to the pump / Driver using the Dimmer but keeping it above 12V ... Can the dimmer linked above safely handle the loads we are putting on it ?
I don't have a pump... but the problem will arise from amperage. If the pump is trying to sustain a certain wattage, but you're feeding it lower voltage, the current is going to increase, heat will increase, and you'll get some slip. How much is acceptable.. your guess is as good as mine.. without a pump to be testing thermals on and current draw I can't be of any assistance. It could be absolutely fine at 12v.

Driving the pump with a 24v pwm signal is above and beyond the most efficient and fail safe way to be doing it. The stator and magnet combo was built around the field that would be generated by 24v, and should be near it's peak efficiency which means less heat, less wasted energy, and most likely the best for longevity of the pump. I've already seen a few posts with people having issues of the rotor lined up with the mounting magnets... lower voltage is only going to increase that problem (or may be what's causing it for some if they're using the adjustable supply)


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Unread 03/27/2013, 04:17 PM   #1811
rrasco
Registered Member
 
rrasco's Avatar
 
Join Date: Jun 2011
Location: South Texas
Posts: 2,159
Quote:
Originally Posted by dread240 View Post
Driving the pump with a 24v pwm signal is above and beyond the most efficient and fail safe way to be doing it. The stator and magnet combo was built around the field that would be generated by 24v, and should be near it's peak efficiency which means less heat, less wasted energy, and most likely the best for longevity of the pump. I've already seen a few posts with people having issues of the rotor lined up with the mounting magnets... lower voltage is only going to increase that problem (or may be what's causing it for some if they're using the adjustable supply)
How would you run this pump off 24v PWM? I am of the understanding this pump has 3 wires: 24v, GND, and DIM (5v analog). How would this be accomplished with this setup?


__________________
-You had me at PWM
rrasco is offline   Reply With Quote
Unread 03/27/2013, 04:18 PM   #1812
SimonSKL
Registered Member
 
SimonSKL's Avatar
 
Join Date: Jan 2007
Location: Danville, IL
Posts: 1,918
LOL! With all the money they made in selling this pump, Fish-Street.com finally can afford to hire an English speaking national to write the product description for them on their site!


__________________
Simon

Mixed LPS and SPS corals
Camera - Canon T2i with EF100mm 2.8f USM macro lens

Current Tank Info: AG 92g corner tank and Marineland 125g, RKE controllers, Maxspect and Eshine LEDs, MP40WES, Jebo WP40 & WP25
SimonSKL is offline   Reply With Quote
Unread 03/27/2013, 04:30 PM   #1813
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
you would be replacing their driver with your own at that point, and controlling it however you see fit, ala arduino. Would be nice because at that point you could sync and anti sync various pumps, and program whatever features you want

http://hades.mech.northwestern.edu/i...ojectW2011.pdf

has some nice information on pwm and full h bridges and half bridges

Again, I'm really of no more use considering I don't have one sitting here to see what is what


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank

Last edited by dread240; 03/27/2013 at 04:38 PM.
dread240 is offline   Reply With Quote
Unread 03/27/2013, 04:49 PM   #1814
ebushrow
Registered Member
 
Join Date: Aug 2012
Location: Plymouth
Posts: 40
Quote:
Originally Posted by moatdaddy View Post
i ordered 40 so i could get my 2 cheaper plus 1 for my brother. was thinking of putting 10 into a bathtub for my son to see how they do. i will sell the rest to the local reef club and who ever else wants a cheaper unit. came to 77 bucks a unit shipped to me.
If you want to ship 2 I would buy 2 from you and pay shipping...LMK


ebushrow is offline   Reply With Quote
Unread 03/27/2013, 05:38 PM   #1815
nunodinis
Registered Member
 
Join Date: Aug 2011
Location: Portugal
Posts: 13
Sorry for the late reply, having some trouble with my wife's keyboard...
Here you go, i received some PMs asking for somethings, so i think i should post everything!
WP-40 has 3 wires connecting the controller to the pump:
- 24V
- -24V(or GND)
- va

The first two should connect directly from the power suply, the problem is the va! What the hell could this be?
It is the dimming channel! wich works with 0-5V analog signal, where 0 means the pump is stopped and 5V means full power(well not quite, the pump only starts around 2V more or less). This could be controlled through a Arduino PWM signal, wich goes from 0-256(where 0 means 0V and 256 would mean 5V)!

After understanding this, i tried to control just the va wire and it worked.

So, i did a full controler with leds and buttons to control the pump, here you go.
Material:
- Arduino Uno(that's the one i had lying somewhere in the house);
- 4 Leds;
- 4 220ohms resistor to connecto to the leds;
- 2 Push Buttons NO(Normally Open);
- 2 10k Resistors to wire to the pushbuttons;

I also tried a Low Pass Filter(Wish is a circuit to convert the Digital PWM signal to an analog signal), but with 1K Resistor and 4.7uF capacitor the max output voltage was 3.8V, wich is not enough...

So forget about the low pass filter and connect straight to the pump from the PWM!
If you dont want buttons nor leds, you can control the pump just with an arduino(just connect the PWM to va wire and Arduino GND to -24V of the pump) but you wouldn't have the ability to change mode through a simple button.

I'm working on a way to control max power trough a potentiometer, but its not finished yet.

Here is the code, most of the comments are in Portuguese, but i can give you some hints and try to help whoever have some doubts.
Code:
#include 
/*
 Software para controlar bomba WP-40 - 1 canal
 Arduino
 Bomba WP-40
 Transformador
 Reset do Arduino faz a função Feed(Para a bomba por 5m) e reinicializa passados esses 5m.
 */

// constantes
//const int ModoFuncionamento = 1;
const int maxModos = 6;
const int buttonPin = 7;
const int buttonPinF = 8;
const int PWMPinLPF = 3;
const int PinLed1 = 10;
const int PinLed2 = 11;
const int PinLed3 = 12;
const int PinLed4 = 13;


// Variaveis:
int ModoFuncionamento = 1;
int ModoFuncionamentoAnt = 0;
int EstadoPulse = 0;
long previousMillis = 0;
unsigned long currentMillis = millis();
int buttonState = 0;
int buttonStateF = 0;
int ValPoten = 0;

//Inicio Funções
void limpaLeds()
{
    digitalWrite(PinLed1, LOW);
    digitalWrite(PinLed2, LOW);
    digitalWrite(PinLed3, LOW);
    digitalWrite(PinLed4, LOW);
}
void activaLeds()
{
    switch (ModoFuncionamento){
        case 1:
            digitalWrite(PinLed1, HIGH);
            break;
        case 2:
            digitalWrite(PinLed2, HIGH);
            break;
        case 3:
            digitalWrite(PinLed3, HIGH);
            break;
        case 4:
            digitalWrite(PinLed4, HIGH);
            break;
        case 5:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed2, HIGH);
            break;
        case 6:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed4, HIGH);
            break;
        case 7:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed2, HIGH);
            digitalWrite(PinLed3, HIGH);
            digitalWrite(PinLed4, HIGH);
            break;
    }

}
void verificaPushButton()
{
    buttonState = digitalRead(buttonPin);
    buttonStateF = digitalRead(buttonPinF);
}

void timer(long milliSegundos)
{
    int sai = 0;

    if(buttonState == HIGH){
       return;
    }

    do {
       currentMillis = millis();
       verificaPushButton();
       if(currentMillis - previousMillis > milliSegundos) {
          previousMillis = currentMillis;
          sai = 1;
       }
    } while (buttonState == LOW && buttonStateF == LOW && sai == 0);
}

/*
Modo a utilizar dentro do ReefCrazy - Faz nX Pulse
 */
void PulseSingle(int Imax, int Imin, int MiliSegundos, int NrTimes)
{

  int Contador = 0;
  int sai = 0;

//  Imax = Imax - ((ValPoten * 255)/1023)
//  Imin = Imin - ((ValPoten * 255)/1023)

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  do {
    Contador = Contador + 1;
    analogWrite(PWMPinLPF, Imax);
    timer(MiliSegundos);
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }
    analogWrite(PWMPinLPF, Imin);
    timer(MiliSegundos);
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }
  }
  while (Contador <= NrTimes && buttonState == LOW);

}
/* Pulse(Imax, Imin, MilSegundos) - Modo 1
 Recebe de entrada:
 Imax: Intensidade máxima do Pulse
 Imin: Intensidade Minima depois do pulse
 MilSegundos: Nr de MiliSegundos de intervalo entre intesidade Máxima e Minima
 O Objectivo é variar directo, sem incremento gradual entre a velocidade máxima e velocidade minima pelo nr de segundos indicado
 Ex:
 Pulse(255, 100, 500)
 A Bomba deveria começar a cerca de 40%(100/255) durante 0,5 Segundos, em seguida faz 100% durante 0,5 Segundos
 */

void Pulse(int Imax, int Imin, int MiliSegundos)
{
  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  PulseSingle(Imax, Imin, MiliSegundos, 5);

}

/* RampUp(IntMin, IntMax, Increm, Percent) - Modo 2
 Recebe de entrada:
 IntMin: Intensidade Inicial
 IntMax: Intensidade Final
 Increm: Nr de MiliSegundos de intervalo entre intesidade

 O Objectivo é variar directo com incremento gradual entre a intensidade minima e máxima, com Increm segundos de intervalo entre o incremento
 Ex:
 RampUp(50, 225, 500, 15)
 A Bomba faria:
 Começa nos 20% e fica durante 0,5 Seg
 Incrementa 15 ao PWM(65/255) ficando a 25% durante 0,5 Seg
 Vai incrementando 5% durante 0,5 Seg até chegar a 88%(225/255)
 */

void RampUp(int IntMin, int IntMax, int Increm, int Percent) {

  int ValorPwm = IntMin;

//  IntMax = IntMax - ((ValPoten * 255)/1023);
//  IntMin = IntMin - ((ValPoten * 255)/1023);
//  ValorPwm = IntMin;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  analogWrite(PWMPinLPF, ValorPwm);

  do
  {
    currentMillis = millis();
    if(currentMillis - previousMillis > Increm) {
      previousMillis = currentMillis;
      if(ValorPwm > IntMax) {
        ValorPwm = IntMax;
      }
      analogWrite(PWMPinLPF, ValorPwm);
      ValorPwm = ValorPwm + Percent;

    }
    verificaPushButton();
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }

  }
  while(ValorPwm < IntMax && ValorPwm >= IntMin);
}

/* RampDown(IntMin, IntMax, Increm, Percent) - Modo 2
 Recebe de entrada:
 IntMin: Intensidade Inicial
 IntMax: Intensidade Final
 Increm: Nr de MiliSegundos de intervalo entre intesidade

 O Objectivo é variar directo com incremento gradual entre a intensidade minima e máxima, com Increm segundos de intervalo entre o incremento
 Ex:
 RampUp(50, 225, 500, 15)
 A Bomba faria:
 Começa nos 20% e fica durante 0,5 Seg
 Incrementa 15 ao PWM(65/255) ficando a 25% durante 0,5 Seg
 Vai incrementando 5% durante 0,5 Seg até chegar a 88%(225/255)
 */
void RampDown(int IntMin, int IntMax, int Increm, int Percent) {
  int ValorPWM = IntMax;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

//  IntMax = IntMax - ((ValPoten * 255)/1023);
//  IntMin = IntMin - ((ValPoten * 255)/1023);
//  ValorPWM = IntMax;

  analogWrite(PWMPinLPF, ValorPWM);

  do
  {
    currentMillis = millis();
    if(currentMillis - previousMillis > Increm) {
      previousMillis = currentMillis;
      if(ValorPWM < IntMin) {
        ValorPWM = IntMin;
      }
      analogWrite(PWMPinLPF, ValorPWM);
      ValorPWM = ValorPWM - Percent;
    }
    verificaPushButton();
    if(buttonState == HIGH || buttonStateF == HIGH){
       return;
    }
  }
  while(ValorPWM <= IntMax && ValorPWM > IntMin);

}

/* ReefCrazy(IntMin, IntMax, SegMud) - Modo 3
 Recebe de Entrada:
 Intensidade Minima: Intensidade minima a que a bomba Roda
 Intensidade Máxima: Intensidade Máxima a que a bomba roda
 Segundos entre as mudanças: Segundos até mudança de modo aleatório


 */
void ReefCrazy(int IntMin, int IntMax, int SegMud)
{
  int RNumber = random(IntMin, IntMax);
  int MidleR = (IntMin + IntMax) / 2;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  if(RNumber > (MidleR - 20) && RNumber < (MidleR + 20)) {
     PulseSingle(240, 100, 500, 3);
  }

  if(RNumber > MidleR) {
    RampDown(IntMin, MidleR, 500, 15);

  }
  else
  {
    RampUp(MidleR, IntMax, 500, 15);

  }

  RNumber = random(IntMin, IntMax);
  MidleR = (IntMin + IntMax) / 2;
}

/* Modo 4
 Sem parametros de entrada, sobe dos 0 aos 125PWM, faz Pulse 2X, continua a subir aos 255;
 Começa a descer dos 255 até 125, faz pulse, e continua até 0;
 */
void JumpingHorse()
{

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  RampUp(100, 175, 200, 5);

  PulseSingle(255, 150, 500, 2);

  RampUp(175, 255, 200, 5);

  RampDown(175, 255, 200, 5);

  PulseSingle(255, 150, 500, 2);

  RampDown(100, 175, 200, 5);
}

/* Modo 5
 - Nutrient Export Mode(5 Pulses a 0,5s, muito pequenos, mais 5 maiores, pulse grande para fazer onda, e o processo de pulses inverso).
 */
void NutrientZero()
{

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }


  RampUp(125, 240, 300, 15);
  timer(1000);
  RampDown(125, 240, 300, 15);

  PulseSingle(125, 225, 500, 8);
}

/* Modo Desligar - Modo 6 Para fazer por exemplo manutenção ao aquario, fica preparado para quem usar botão*/
void Desligar()
{
  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }
  analogWrite(PWMPinLPF, 0);
}

void alimentar(long milliSegundos)
{
    if(buttonState == HIGH || buttonStateF == HIGH){
       return;
    }
    
    analogWrite(PWMPinLPF, 0);
    timer(milliSegundos);
}

void setup()
{
  // Inicializa PWM
  Serial.begin(9600);
  pinMode(PWMPinLPF, OUTPUT);
  pinMode(PinLed1, OUTPUT);
  pinMode(PinLed2, OUTPUT);
  pinMode(PinLed3, OUTPUT);
  pinMode(PinLed4, OUTPUT);

  pinMode(buttonPin, INPUT);
  pinMode(buttonPinF, INPUT);

  previousMillis = millis();

  limpaLeds();
  activaLeds();

}

void loop(){

  if(buttonState == HIGH){
    if(ModoFuncionamento >= maxModos) {
      ModoFuncionamento = 1;
    } else {
      ModoFuncionamento = ModoFuncionamento + 1;
    }
    limpaLeds();
    activaLeds();
    buttonState = LOW;
    delay(200);
  } else {
      verificaPushButton();
  }
 //Verifica estado de FEED
  if(buttonStateF == HIGH){
    if(ModoFuncionamento == 7)
    {
      ModoFuncionamento = ModoFuncionamentoAnt;
    } else {
      ModoFuncionamentoAnt = ModoFuncionamento;
      ModoFuncionamento = 7;
    }
    limpaLeds();
    activaLeds();
    buttonStateF = LOW;
    delay(200);
  }

  if (ModoFuncionamento == 1) {
    Pulse(255, 150, 300);
  }

  if (ModoFuncionamento == 2) {
    RampUp(100, 245, 500, 15);
    RampDown(100, 245, 500, 15);
  }

  if (ModoFuncionamento == 3) {
    ReefCrazy(100, 245, 500);
  }

  if (ModoFuncionamento == 4) {
    JumpingHorse();
  }

  if (ModoFuncionamento == 5) {
    NutrientZero();
  }

  if (ModoFuncionamento == 6) {
      Desligar();
  }

  if (ModoFuncionamento == 7) {
     alimentar(300000);
     ModoFuncionamento = ModoFuncionamentoAnt;
     limpaLeds();
     activaLeds();
  }

}
At this point there are 7 modes:
Pulse - WaveMaker;
Ramp - increase the speed at fullspeed and then decrease;
ReefCrazy - Should mimic Vortech ReefCrest;
JumpingHorse - Just a mode i created where speed get to half, the pulses and then again, to max speed, and the other way down.
Nutrient Zero - Should mimic Vortech Nutrient Export

Then there is feedmode wich stops the pump for 5 minutes
and turn off that turns off the pump for maintenance of the tank.

Attached is a scheme(not technically designed), of the future controller(with the potentiometer already included, but the code its not adapted yet).



If you should have any doubts or thinkings be free to PM me, the deal is i'm not able to PM because i dont have yet 10 posts... but ill try to have them in a couple of days and try to anwser by then!

I think it is usefull info, so, be free to use it.

Although some comments are in portuguese, if you can read the code, you'll be able to understand it.

The picture is also designed to use only one power suplly, but its not tested the(this last part).
The test was Arduino + Leds + Pushbuttons(and respective resistors), with 24V Power suply to the pump, and arduino connected to the computer. So you should always test if the signal coming from arduinos PWM and GND is 5V when PWM = Max(256), so you wont burn the pumps internal circuit.

I've read people lowering the pumps power through Voltage, but that might burn the pump, or shorten its life...

As soon as i have the full circuit(one power supply and the potentiometer) done i'll post some aditions

All the best.


nunodinis is offline   Reply With Quote
Unread 03/27/2013, 05:48 PM   #1816
moatdaddy
Registered Member
 
moatdaddy's Avatar
 
Join Date: Mar 2006
Location: Panama City beach florida
Posts: 848
The maker has gotten back with some people. I was considering ordering a 1000 and listing them on amazon but still haven't heard back. Also Preorder 10% is back on at fishstreet. Add fishstreet in coupon and that's 13% off.


moatdaddy is offline   Reply With Quote
Unread 03/27/2013, 05:56 PM   #1817
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
max is actually 255 (it's 256 steps and starts at 0)

This actually becomes more interesting now though because you guys could actually use the exact circuit that I'm using to control my tunze... which is ran off an arduino however does not tie up clock cycles with delays for timing (delays are the devil and actually works totally independent... arduino only controls the digital pot for the circuit)

Give me a few and I'm going to wip up a paint drawing because I still suck at eagle and haven't made schematics and boards in it yet lol. The other beauty is it won't tie up pwm pins (which most of mine are tied up for led drivers) and also runs it's clocks totally independent of the arduino clock with a 556 timer.

It also provides you with a true analog signal and not a pwm signal

btw... looked at your program too, and kudos to you for not using delays as well too


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank

Last edited by dread240; 03/27/2013 at 06:04 PM.
dread240 is offline   Reply With Quote
Unread 03/27/2013, 06:08 PM   #1818
SimonSKL
Registered Member
 
SimonSKL's Avatar
 
Join Date: Jan 2007
Location: Danville, IL
Posts: 1,918
nunodinis, this is an incredible build you have there. I happened to have an Arduino Uno laying around trying to learn about this microcontroller. I may give it a try.

Just a couple questions if you don't mind. There are two push buttons and 4 LEDs in your schematics. Can you describe how the push buttons allow you to change modes, feed, and power off the pump? Also how do the LEDs relate to the different modes and functions.

Sorry, I don't understand how to interpret the codes as I am just a beginner but I know how to cut and paste and upload the codes. Thanks!


__________________
Simon

Mixed LPS and SPS corals
Camera - Canon T2i with EF100mm 2.8f USM macro lens

Current Tank Info: AG 92g corner tank and Marineland 125g, RKE controllers, Maxspect and Eshine LEDs, MP40WES, Jebo WP40 & WP25
SimonSKL is offline   Reply With Quote
Unread 03/27/2013, 06:14 PM   #1819
el aguila
Registered Member
 
el aguila's Avatar
 
Join Date: May 2005
Location: Alexis, NC
Posts: 497
nunodinis, Thanks alot for your post. It definitely helps some of us who are electronically challenged!


el aguila is offline   Reply With Quote
Unread 03/27/2013, 06:41 PM   #1820
dgtron
Registered Member
 
dgtron's Avatar
 
Join Date: Jan 2009
Location: North Carolina
Posts: 126
Quote:
Originally Posted by nunodinis View Post
Sorry for the late reply, having some trouble with my wife's keyboard...
Here you go, i received some PMs asking for somethings, so i think i should post everything!
WP-40 has 3 wires connecting the controller to the pump:
- 24V
- -24V(or GND)
- va

The first two should connect directly from the power suply, the problem is the va! What the hell could this be?
It is the dimming channel! wich works with 0-5V analog signal, where 0 means the pump is stopped and 5V means full power(well not quite, the pump only starts around 2V more or less). This could be controlled through a Arduino PWM signal, wich goes from 0-256(where 0 means 0V and 256 would mean 5V)!

After understanding this, i tried to control just the va wire and it worked.

So, i did a full controler with leds and buttons to control the pump, here you go.
Material:
- Arduino Uno(that's the one i had lying somewhere in the house);
- 4 Leds;
- 4 220ohms resistor to connecto to the leds;
- 2 Push Buttons NO(Normally Open);
- 2 10k Resistors to wire to the pushbuttons;

I also tried a Low Pass Filter(Wish is a circuit to convert the Digital PWM signal to an analog signal), but with 1K Resistor and 4.7uF capacitor the max output voltage was 3.8V, wich is not enough...

So forget about the low pass filter and connect straight to the pump from the PWM!
If you dont want buttons nor leds, you can control the pump just with an arduino(just connect the PWM to va wire and Arduino GND to -24V of the pump) but you wouldn't have the ability to change mode through a simple button.

I'm working on a way to control max power trough a potentiometer, but its not finished yet.

Here is the code, most of the comments are in Portuguese, but i can give you some hints and try to help whoever have some doubts.
Code:
#include 
/*
 Software para controlar bomba WP-40 - 1 canal
 Arduino
 Bomba WP-40
 Transformador
 Reset do Arduino faz a função Feed(Para a bomba por 5m) e reinicializa passados esses 5m.
 */

// constantes
//const int ModoFuncionamento = 1;
const int maxModos = 6;
const int buttonPin = 7;
const int buttonPinF = 8;
const int PWMPinLPF = 3;
const int PinLed1 = 10;
const int PinLed2 = 11;
const int PinLed3 = 12;
const int PinLed4 = 13;


// Variaveis:
int ModoFuncionamento = 1;
int ModoFuncionamentoAnt = 0;
int EstadoPulse = 0;
long previousMillis = 0;
unsigned long currentMillis = millis();
int buttonState = 0;
int buttonStateF = 0;
int ValPoten = 0;

//Inicio Funções
void limpaLeds()
{
    digitalWrite(PinLed1, LOW);
    digitalWrite(PinLed2, LOW);
    digitalWrite(PinLed3, LOW);
    digitalWrite(PinLed4, LOW);
}
void activaLeds()
{
    switch (ModoFuncionamento){
        case 1:
            digitalWrite(PinLed1, HIGH);
            break;
        case 2:
            digitalWrite(PinLed2, HIGH);
            break;
        case 3:
            digitalWrite(PinLed3, HIGH);
            break;
        case 4:
            digitalWrite(PinLed4, HIGH);
            break;
        case 5:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed2, HIGH);
            break;
        case 6:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed4, HIGH);
            break;
        case 7:
            digitalWrite(PinLed1, HIGH);
            digitalWrite(PinLed2, HIGH);
            digitalWrite(PinLed3, HIGH);
            digitalWrite(PinLed4, HIGH);
            break;
    }

}
void verificaPushButton()
{
    buttonState = digitalRead(buttonPin);
    buttonStateF = digitalRead(buttonPinF);
}

void timer(long milliSegundos)
{
    int sai = 0;

    if(buttonState == HIGH){
       return;
    }

    do {
       currentMillis = millis();
       verificaPushButton();
       if(currentMillis - previousMillis > milliSegundos) {
          previousMillis = currentMillis;
          sai = 1;
       }
    } while (buttonState == LOW && buttonStateF == LOW && sai == 0);
}

/*
Modo a utilizar dentro do ReefCrazy - Faz nX Pulse
 */
void PulseSingle(int Imax, int Imin, int MiliSegundos, int NrTimes)
{

  int Contador = 0;
  int sai = 0;

//  Imax = Imax - ((ValPoten * 255)/1023)
//  Imin = Imin - ((ValPoten * 255)/1023)

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  do {
    Contador = Contador + 1;
    analogWrite(PWMPinLPF, Imax);
    timer(MiliSegundos);
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }
    analogWrite(PWMPinLPF, Imin);
    timer(MiliSegundos);
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }
  }
  while (Contador <= NrTimes && buttonState == LOW);

}
/* Pulse(Imax, Imin, MilSegundos) - Modo 1
 Recebe de entrada:
 Imax: Intensidade máxima do Pulse
 Imin: Intensidade Minima depois do pulse
 MilSegundos: Nr de MiliSegundos de intervalo entre intesidade Máxima e Minima
 O Objectivo é variar directo, sem incremento gradual entre a velocidade máxima e velocidade minima pelo nr de segundos indicado
 Ex:
 Pulse(255, 100, 500)
 A Bomba deveria começar a cerca de 40%(100/255) durante 0,5 Segundos, em seguida faz 100% durante 0,5 Segundos
 */

void Pulse(int Imax, int Imin, int MiliSegundos)
{
  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  PulseSingle(Imax, Imin, MiliSegundos, 5);

}

/* RampUp(IntMin, IntMax, Increm, Percent) - Modo 2
 Recebe de entrada:
 IntMin: Intensidade Inicial
 IntMax: Intensidade Final
 Increm: Nr de MiliSegundos de intervalo entre intesidade

 O Objectivo é variar directo com incremento gradual entre a intensidade minima e máxima, com Increm segundos de intervalo entre o incremento
 Ex:
 RampUp(50, 225, 500, 15)
 A Bomba faria:
 Começa nos 20% e fica durante 0,5 Seg
 Incrementa 15 ao PWM(65/255) ficando a 25% durante 0,5 Seg
 Vai incrementando 5% durante 0,5 Seg até chegar a 88%(225/255)
 */

void RampUp(int IntMin, int IntMax, int Increm, int Percent) {

  int ValorPwm = IntMin;

//  IntMax = IntMax - ((ValPoten * 255)/1023);
//  IntMin = IntMin - ((ValPoten * 255)/1023);
//  ValorPwm = IntMin;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  analogWrite(PWMPinLPF, ValorPwm);

  do
  {
    currentMillis = millis();
    if(currentMillis - previousMillis > Increm) {
      previousMillis = currentMillis;
      if(ValorPwm > IntMax) {
        ValorPwm = IntMax;
      }
      analogWrite(PWMPinLPF, ValorPwm);
      ValorPwm = ValorPwm + Percent;

    }
    verificaPushButton();
    if(buttonState == HIGH || buttonStateF == HIGH){
      return;
    }

  }
  while(ValorPwm < IntMax && ValorPwm >= IntMin);
}

/* RampDown(IntMin, IntMax, Increm, Percent) - Modo 2
 Recebe de entrada:
 IntMin: Intensidade Inicial
 IntMax: Intensidade Final
 Increm: Nr de MiliSegundos de intervalo entre intesidade

 O Objectivo é variar directo com incremento gradual entre a intensidade minima e máxima, com Increm segundos de intervalo entre o incremento
 Ex:
 RampUp(50, 225, 500, 15)
 A Bomba faria:
 Começa nos 20% e fica durante 0,5 Seg
 Incrementa 15 ao PWM(65/255) ficando a 25% durante 0,5 Seg
 Vai incrementando 5% durante 0,5 Seg até chegar a 88%(225/255)
 */
void RampDown(int IntMin, int IntMax, int Increm, int Percent) {
  int ValorPWM = IntMax;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

//  IntMax = IntMax - ((ValPoten * 255)/1023);
//  IntMin = IntMin - ((ValPoten * 255)/1023);
//  ValorPWM = IntMax;

  analogWrite(PWMPinLPF, ValorPWM);

  do
  {
    currentMillis = millis();
    if(currentMillis - previousMillis > Increm) {
      previousMillis = currentMillis;
      if(ValorPWM < IntMin) {
        ValorPWM = IntMin;
      }
      analogWrite(PWMPinLPF, ValorPWM);
      ValorPWM = ValorPWM - Percent;
    }
    verificaPushButton();
    if(buttonState == HIGH || buttonStateF == HIGH){
       return;
    }
  }
  while(ValorPWM <= IntMax && ValorPWM > IntMin);

}

/* ReefCrazy(IntMin, IntMax, SegMud) - Modo 3
 Recebe de Entrada:
 Intensidade Minima: Intensidade minima a que a bomba Roda
 Intensidade Máxima: Intensidade Máxima a que a bomba roda
 Segundos entre as mudanças: Segundos até mudança de modo aleatório


 */
void ReefCrazy(int IntMin, int IntMax, int SegMud)
{
  int RNumber = random(IntMin, IntMax);
  int MidleR = (IntMin + IntMax) / 2;

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  if(RNumber > (MidleR - 20) && RNumber < (MidleR + 20)) {
     PulseSingle(240, 100, 500, 3);
  }

  if(RNumber > MidleR) {
    RampDown(IntMin, MidleR, 500, 15);

  }
  else
  {
    RampUp(MidleR, IntMax, 500, 15);

  }

  RNumber = random(IntMin, IntMax);
  MidleR = (IntMin + IntMax) / 2;
}

/* Modo 4
 Sem parametros de entrada, sobe dos 0 aos 125PWM, faz Pulse 2X, continua a subir aos 255;
 Começa a descer dos 255 até 125, faz pulse, e continua até 0;
 */
void JumpingHorse()
{

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }

  RampUp(100, 175, 200, 5);

  PulseSingle(255, 150, 500, 2);

  RampUp(175, 255, 200, 5);

  RampDown(175, 255, 200, 5);

  PulseSingle(255, 150, 500, 2);

  RampDown(100, 175, 200, 5);
}

/* Modo 5
 - Nutrient Export Mode(5 Pulses a 0,5s, muito pequenos, mais 5 maiores, pulse grande para fazer onda, e o processo de pulses inverso).
 */
void NutrientZero()
{

  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }


  RampUp(125, 240, 300, 15);
  timer(1000);
  RampDown(125, 240, 300, 15);

  PulseSingle(125, 225, 500, 8);
}

/* Modo Desligar - Modo 6 Para fazer por exemplo manutenção ao aquario, fica preparado para quem usar botão*/
void Desligar()
{
  if(buttonState == HIGH || buttonStateF == HIGH){
    return;
  }
  analogWrite(PWMPinLPF, 0);
}

void alimentar(long milliSegundos)
{
    if(buttonState == HIGH || buttonStateF == HIGH){
       return;
    }
    
    analogWrite(PWMPinLPF, 0);
    timer(milliSegundos);
}

void setup()
{
  // Inicializa PWM
  Serial.begin(9600);
  pinMode(PWMPinLPF, OUTPUT);
  pinMode(PinLed1, OUTPUT);
  pinMode(PinLed2, OUTPUT);
  pinMode(PinLed3, OUTPUT);
  pinMode(PinLed4, OUTPUT);

  pinMode(buttonPin, INPUT);
  pinMode(buttonPinF, INPUT);

  previousMillis = millis();

  limpaLeds();
  activaLeds();

}

void loop(){

  if(buttonState == HIGH){
    if(ModoFuncionamento >= maxModos) {
      ModoFuncionamento = 1;
    } else {
      ModoFuncionamento = ModoFuncionamento + 1;
    }
    limpaLeds();
    activaLeds();
    buttonState = LOW;
    delay(200);
  } else {
      verificaPushButton();
  }
 //Verifica estado de FEED
  if(buttonStateF == HIGH){
    if(ModoFuncionamento == 7)
    {
      ModoFuncionamento = ModoFuncionamentoAnt;
    } else {
      ModoFuncionamentoAnt = ModoFuncionamento;
      ModoFuncionamento = 7;
    }
    limpaLeds();
    activaLeds();
    buttonStateF = LOW;
    delay(200);
  }

  if (ModoFuncionamento == 1) {
    Pulse(255, 150, 300);
  }

  if (ModoFuncionamento == 2) {
    RampUp(100, 245, 500, 15);
    RampDown(100, 245, 500, 15);
  }

  if (ModoFuncionamento == 3) {
    ReefCrazy(100, 245, 500);
  }

  if (ModoFuncionamento == 4) {
    JumpingHorse();
  }

  if (ModoFuncionamento == 5) {
    NutrientZero();
  }

  if (ModoFuncionamento == 6) {
      Desligar();
  }

  if (ModoFuncionamento == 7) {
     alimentar(300000);
     ModoFuncionamento = ModoFuncionamentoAnt;
     limpaLeds();
     activaLeds();
  }

}
At this point there are 7 modes:
Pulse - WaveMaker;
Ramp - increase the speed at fullspeed and then decrease;
ReefCrazy - Should mimic Vortech ReefCrest;
JumpingHorse - Just a mode i created where speed get to half, the pulses and then again, to max speed, and the other way down.
Nutrient Zero - Should mimic Vortech Nutrient Export

Then there is feedmode wich stops the pump for 5 minutes
and turn off that turns off the pump for maintenance of the tank.

Attached is a scheme(not technically designed), of the future controller(with the potentiometer already included, but the code its not adapted yet).



If you should have any doubts or thinkings be free to PM me, the deal is i'm not able to PM because i dont have yet 10 posts... but ill try to have them in a couple of days and try to anwser by then!

I think it is usefull info, so, be free to use it.

Although some comments are in portuguese, if you can read the code, you'll be able to understand it.

The picture is also designed to use only one power suplly, but its not tested the(this last part).
The test was Arduino + Leds + Pushbuttons(and respective resistors), with 24V Power suply to the pump, and arduino connected to the computer. So you should always test if the signal coming from arduinos PWM and GND is 5V when PWM = Max(256), so you wont burn the pumps internal circuit.

I've read people lowering the pumps power through Voltage, but that might burn the pump, or shorten its life...

As soon as i have the full circuit(one power supply and the potentiometer) done i'll post some aditions

All the best.
I believe the VA is just a 0-5V analog signal.
0 = Pump OFF
5v = Pump High
1V = Pump Low
2.5V = Mid level

I believe, you can even connect a regular battery to the VA to supply the analog voltage. Why a PWM signal in this case? Have you tried just the 0-5V analog signal?


dgtron is offline   Reply With Quote
Unread 03/27/2013, 06:52 PM   #1821
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
ok... Believe me you'll see better schematics.. I actually rolled this out in mspaint! whoo

Quick breakdown of what it does... When it comes to fast repeated cycling items I prefer to have them on their own clock.. With as little of a program as I'm running right now on an arduino mega, it could easily handle it, however my goal by the end of it is full web server, controlling my generator, transfer switch and load shedding for the house, all the tank including lighting, outlet control, dosing pumps. When it's feeding a large web page it could throw a fast time out of sync.. hence why I built it this way

The 556 timer is just 2 555 timers packaged in one chip. The left side of the timer is wired for astable mode so it runs freely on it's own. You'll notice there are no resistor values in the drawing and that's because r1 and r2 (which set your duty cycle and frequency) are ran through 2 channels of the digital potentiometer. This allows the arduino to set the resistance on these circuits, which sets the adjustable period all the way from practically 0 up to 10 seconds. The output of this timer is ran to the trigger of the second timer on the chip.

The 2nd timer on the chip is wired for monostable. This means it runs one time for a set duration when it receives a trigger.. and then does nothing until the next trigger. r1 for this circuit is ran through channel 4 of the digital pot which will allow up to a 7 seconds pulse or so... The reason for this is that in astable mode, you cannot get below 50% duty cycle... so if I had a 5 second period at least 2.5 seconds of it is on. By running the second timer and making it adjustable as well too.. I can control the frequency (the astable side) and the duty cycle (the monostable side) independently. Now I'm not using this as a pwm circuit.. I'm actually using this as a switch between analog signals.

The control wire for the tunze pump first goes through channel 6 of the pot.. this sets it's low speed... less resistance = more current drain = slower pump. After that it has 2 paths... if the output on the 556 timer is low pulling down the base of the transistor.. the current will flow through it and straight to the control wire bypassing the next 2 pots (path of least resistance). If the output on the timer is high, the transistor breaks down and forces current through pot channel 5 and 3, which are also set values from the arduino which control it's high speed. These add further resistance to the circuit reducing the voltage sink and makes the pump run up to it's maximum.

Again, it's not an exact drawing, I don't have a resistor on the output for the transistor in the drawing and I didn't use actual diagrams.. it's mspaint for petes sake


Attached Images
File Type: jpg 556-ad5206.jpg (47.0 KB, 116 views)
__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Unread 03/27/2013, 06:55 PM   #1822
jrp1588
Registered Member
 
jrp1588's Avatar
 
Join Date: Nov 2009
Location: Evansville, IN
Posts: 1,864
That is all absurdly well aligned for mspaint. haha.


jrp1588 is offline   Reply With Quote
Unread 03/27/2013, 07:05 PM   #1823
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
Quote:
Originally Posted by jrp1588 View Post
That is all absurdly well aligned for mspaint. haha.
lol.. shift key while drawing a line keeps it horizontal or perpindicular


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Unread 03/27/2013, 07:12 PM   #1824
jrp1588
Registered Member
 
jrp1588's Avatar
 
Join Date: Nov 2009
Location: Evansville, IN
Posts: 1,864
I'ma graphic designer. Very familiar with the mighty shift key. I was more referring to how all the little boxes are perfectly aligned to the bigger box and the numbers are all perfectly centered.


jrp1588 is offline   Reply With Quote
Unread 03/27/2013, 07:16 PM   #1825
dread240
Registered Member
 
Join Date: May 2010
Location: Essex, MD
Posts: 979
that's my handy friends of the right mouse button... copy... and paste mr. watson!

(I should probably just take the credit and feel awesome... yea think Imma go with that)


__________________
BRB, Goldfish on fire
How much deeper would the ocean really be if sponges didn't exist?

Current Tank Info: 75 gallon mixed reef tank
dread240 is offline   Reply With Quote
Reply

Tags
buy a tunze, haters gonna hate, jeabo, jebao, jebo, mp40, wave maker, wp40


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 03:27 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2024 Axivo Inc.
Use of this web site is subject to the terms and conditions described in the user agreement.
Reef CentralTM Reef Central, LLC. Copyright ©1999-2022
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.