Reef Central Online Community
The Filter Guys

Home Forum Here you can view your subscribed threads, work with private messages and edit your profile and preferences View New Posts View Today's Posts

Find other members Frequently Asked Questions Search Reefkeeping ...an online magazine for marine aquarists Support our sponsors and mention Reef Central

Go Back   Reef Central Online Community > General Interest Forums > Do It Yourself
Register Blogs FAQ Calendar Mark Forums Read

Notices

Reply
Thread Tools
Old 10/30/2013, 08:02 AM   #101
rott
Registered Member
 
Join Date: Nov 2005
Location: Toledo ,Ohio
Posts: 702
The 2 10v pwm pins what can they control? Are they for mean well drivers D series


rott is offline   Reply With Quote
Old 10/30/2013, 02:08 PM   #102
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
Quote:
Originally Posted by sdtimer View Post
The LED is own Diy, have 5 channel:
1, Cree white 7000-8300K 8pcs;
2, Cree blue 465-470nm 8 pcs;
2, PHILIPS deepblue 450-455nm 8 pcs;
3, Purple 415-420nm 4 pcs;
Purple 400-410nm 4 pcs;
4, Yellow 585-595nm 2pcs;
Green 515-530nm 4pcs;
Red 655-660nm 4pcs;
Per cnannel 1 Meanwell LDD-1000H. The power is Meanwell 360W 36V.
I am using arduino 2560 pin 2,3,9,11,12 Control PWM is OK.

And how much wp25&wp40 in USA.
nice LED.

I am currently coding Jebao PWM to use 11,12,44,45. If you only need 2 PWM for Jebao, then you can use 11,12 for the LED. I am using the standard PWM settings, so the standard analogWrite will continue to work.

I paid $76 for WP-25. I think it is $90 for WP-40. The lowest price I found from China sellers is $69 for WP-25 on aliexpress. Not worth the $7 difference and have to wait one month for the pump to arrive.


d0ughb0y is online now   Reply With Quote
Old 10/30/2013, 02:13 PM   #103
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
Quote:
Originally Posted by rott View Post
The 2 10v pwm pins what can they control? Are they for mean well drivers D series
I can only say the circuit for the 2 10v pwm pins provide 0-10v PWM signal as shown in the schematic diagram. If your LED driver needs 10v analog, you need to add an RC to the output signal. If your LED drive accepts 5v PWM, then you can omit the OP-AMP circuit. You will need to research what works for the D series.


d0ughb0y is online now   Reply With Quote
Old 10/30/2013, 02:29 PM   #104
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
I've got the basic code for all 7 modes of the Jebao controller working.
H1 - 100% constant
H2 - 75% constant
H3 - 50% constant
W1 - pulse
W2 - 6 steps up 6 steps down
W3 - 6 steps up 8 steps down
ELSE - random value between 50%-100%

In my previous comment, I mentioned I measured voltage higher than 50% and 75% for H3 and H2. I see now that the PWM duty cycle is 50% and 75%, but the measured RMS voltage will be a little higher than 50% and 75%, which now makes sense.

I was looking at the waveform on my oscilloscope for the 7 modes, and noticed something interesting with W3 mode. The way it works looks interesting.
So on the first part, the speed of the pump will ramp up fast, to push water hard. Then it fades slowly back down to 50%. I think this is the equivalent of Lagoon mode in Ecotech pump. And ELSE is the equivalent of Reef Crest.

I see a lot of potential in the ability to define your own waveform mode. the design is you define each mode by setting the level value for 16 steps. And the program will use those values to control the pump speed on each time period.

for example, if you define 1 time period as 1 second, and you define your 16 step pattern as (this is W1 mode)
255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0
Then the pump will be at 100% for 0.5 seconds, and then off for 0.5 seconds, then repeat the cycle. If say you want the pulse to be at 25% duty cycle, then just use 255 for the first 4 steps, then 0 for the rest.
And also, it does not have to be an array of 16 fixed values. For ELSE, it returns the value of random(128,255). You can write your own waveform function.

I will be testing the program to control the pump this weekend.

other waveform suggestions welcome.


d0ughb0y is online now   Reply With Quote
Old 10/30/2013, 02:35 PM   #105
wgraham
Registered Member
 
Join Date: Aug 2004
Posts: 292
That sound great can't wait to use your new code on my pumps
Thanks


wgraham is offline   Reply With Quote
Old 10/30/2013, 06:34 PM   #106
kepheus
Registered Member
 
Join Date: Oct 2013
Posts: 3
Hi,
can you tell me why you added the 8 channel 5v relay module in the basic setup (without the extra 8 outlets)?
Isn't the Chauvet SR-08 Relay pack enough?
I'm currently trying to get my head around controlling outlets myself like you do.
Thanks!


kepheus is offline   Reply With Quote
Old 10/30/2013, 06:58 PM   #107
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
good question. my objective was to build everything in one box. in order to do that, I have to remove/replace the chauvet relay board with the smaller 8 channel relay board in order to fit the other parts inside the chauvet. This is completely optional of course, as some choose to build with another box and connect to an unmodified chauvet, and another chose not to use chauvet altogether and just build his own relay box using outlets and the 8 channel relay board.


d0ughb0y is online now   Reply With Quote
Old 10/30/2013, 07:40 PM   #108
kepheus
Registered Member
 
Join Date: Oct 2013
Posts: 3
Ah, ok get it. Thanks!


kepheus is offline   Reply With Quote
Old 11/01/2013, 12:44 PM   #109
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
I just finished the test code for jebao pump control. I will merge it to the main project once I verify it to work. (the web page UI will then come next, that is usually the hardest part to code)

The current design is (I tried to keep it simple).
I divide the day into 6 time segments (user definable time, currently at hour resolution, unless someone can convince me going down to minutes is needed)
These are the variables
time for the time segment
wave mode to run in that time segment (7 to choose from + you can define more)
speed to run in that segment (will ramp if values between two time segment is different)
frequency (or time per cycle) to run the selected wave (e.g. 2 seconds to run the W1 pulse)

so for instance, from midnight to 6am, you can run fixed speed at 50%, then from 6am to 9am you ramp from 50% speed to 100% on waveform W1, etc.

I coded pump1 to be the master, and you can specify pump2,3,4 to run independently, in sync or antisync (opposite) that of pump1.

since I only have one pump, I will not be able to test any of that sync feature, but in theory it should work.

Since I will be opening up my chauvet to modify the connections, I am thinking of converting my currently 2 generic IO lines to 2 12V output lines for controlling 12v peristaltic pump. I am thinking of using that either for dosing 2 part, or for automatic water change. The advantage of my code is everything is executed from interrupt so I can control the pump down to 1ms (actually less than that, like 100us). Once calibrated on the volume per unit time, I can add feature to dose x ml over 24 hours evenly. For water change, it will be like you specify the gallons (or liters) and the pump will run according to the calibration rate (with pause every few minutes, as I think these $15 peristaltic pumps from ebay are not designed to run continuously)

I will be converting the lines I originally designated for use with X10 to control 2 jebao PWM pumps.

I will update the schematic diagram once these are all done.


d0ughb0y is online now   Reply With Quote
Old 11/01/2013, 01:31 PM   #110
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Hello!

If you interested take a look at my code for DC pumps.

https://github.com/FernandoGarcia/Fe.../Wavemaker.ino

to "modo_selecionado" equal 3 I get it:



Like "Tidal Swell mode"" from Vortech.



Fernando Garcia

Sorry for english.



Last edited by fefegarcia1; 11/01/2013 at 01:59 PM.
fefegarcia1 is offline   Reply With Quote
Old 11/01/2013, 02:27 PM   #111
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
Hi Fernando,

nice!
the way I coded is the wave definition will call a "callback" function. So I suppose a function using your sine wave formula can be written. I don't think my 16 intervals per cycle will be sufficient though. I think your interval is period (or periodo) right? is that in milliseconds? I see the range is 100-10000 for mode 1 and 2, and mode 4 is fixed at 400.

is that tidal swell mode 2 or is it mode 4?

can you explain the different modes?
mode 1 pumps run on opposite of sine function
mode 2 both pumps run on same value from sine function
mode 3 based on the array value
mode 4 looks like the tidal swell mode?
mode 5 looks like it runs the fixed value from touch screen input?

are you using this on jebao or tunze pumps?


d0ughb0y is online now   Reply With Quote
Old 11/01/2013, 03:17 PM   #112
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Hello!

To modes 1 and 2 "periodo" is the period of a wave in milliseconds.

Like this:



Tidal Swell is Mode 3 with array values.

With mode 4 I get this:



I tried to do as reefcrest mode from Vortech.



In mode 5 the pwm is selected manually.

Still have not bought the pumps, but I'll buy the WP40.


Fernando Garcia


fefegarcia1 is offline   Reply With Quote
Old 11/01/2013, 04:02 PM   #113
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Here have 2 small videos to demonstrate.

http://youtu.be/ADi1phUzfkU

http://youtu.be/nEdB4NeWbzM

Here is the version of my friend Vadim that served as a reference.

http://youtu.be/F6ctsVC_UTQ

Big thanks to Vadim.


fefegarcia1 is offline   Reply With Quote
Old 11/01/2013, 04:04 PM   #114
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
ok, so you use period in the sine function, and you just call WaveMaker() function as many times as possible in the loop()?

I have to figure a better resolution for my code, since it is running inside an ISR, it is not practical to do all the calculations on every interrupt (once every 1024us). Hence I split the period (same thing as your period) into 16 intervals and only call the function 16 times per period. Which obviously will not be enough resolution to handle something like the tidal swell. For the Jebao pump modes, 16 intervals is good enough. I guess I'll add an interval (or resolution) parameter so user defined functions can define how many times to call it per period. So if the period is 4000ms and the interval is 400, the function will be called every 10ms. My code right now will just divide 4000ms by 16.

thanks for sharing. great work.


d0ughb0y is online now   Reply With Quote
Old 11/01/2013, 04:10 PM   #115
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
I think Vadim is the same person that contacted me, doing that jarduino project. Is yours based on jarduino also like Vadim? I think he was interested in my web interface.


d0ughb0y is online now   Reply With Quote
Old 11/01/2013, 04:44 PM   #116
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Quote:
Originally Posted by d0ughb0y View Post
ok, so you use period in the sine function, and you just call WaveMaker() function as many times as possible in the loop()?
Yes, you're right.


fefegarcia1 is offline   Reply With Quote
Old 11/01/2013, 04:50 PM   #117
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Quote:
Originally Posted by d0ughb0y View Post
I think Vadim is the same person that contacted me, doing that jarduino project. Is yours based on jarduino also like Vadim? I think he was interested in my web interface.
Yes, Vadim has a version based on Jarduino.

His nickname in Reefcentral is Svyaz.

My code is based on version 2.1 of Stilo.

Available here: https://code.google.com/p/stilo/

Some things related with LEDs control I used Jarduino as reference.

My web interface is very simple.

https://xively.com/feeds/69337


fefegarcia1 is offline   Reply With Quote
Old 11/01/2013, 07:49 PM   #118
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
is your webserver running on ethernet shield? it push data to an external server or all the pages served from the arduino? its just status and no control?

I use web interface for all UI, it keeps the arduino code small. everyone has a smartphone nowadays.


d0ughb0y is online now   Reply With Quote
Old 11/02/2013, 02:07 AM   #119
asid61
Registered Member
 
Join Date: Apr 2011
Location: Cupertino, CA
Posts: 1,113
Nice! I hope one day my controller can get to this level. I'm checking out the code right now.


asid61 is offline   Reply With Quote
Old 11/02/2013, 12:04 PM   #120
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
Fernando,

I am working on revising my code to increase resolution, you know you can optimize your code for speed by just converting your sin function formula into a lookup table similar to mode 3. the table lookup will run several times faster than using the sin function.

this function

value = int(128 + 127 * sin(2 * PI / periodo * times));

you can just create a 30 value array and map the time to an index just like in your mode 3.
since you use the same function in modes 1,2 and 4, you can use that same array for the 3 modes.



d0ughb0y is online now   Reply With Quote
Old 11/02/2013, 12:15 PM   #121
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Quote:
Originally Posted by d0ughb0y View Post
is your webserver running on ethernet shield? it push data to an external server or all the pages served from the arduino? its just status and no control?

I use web interface for all UI, it keeps the arduino code small. everyone has a smartphone nowadays.

Hi!

I haven't a webserver. My ethernet shield only send values to Xively.

This is just status. I don't find interesting the control via web.


fefegarcia1 is offline   Reply With Quote
Old 11/02/2013, 12:51 PM   #122
fefegarcia1
Registered Member
 
fefegarcia1's Avatar
 
Join Date: Jul 2011
Location: Sao Paulo, Brazil
Posts: 190
Quote:
Originally Posted by d0ughb0y View Post
Fernando,

I am working on revising my code to increase resolution, you know you can optimize your code for speed by just converting your sin function formula into a lookup table similar to mode 3. the table lookup will run several times faster than using the sin function.

this function

value = int(128 + 127 * sin(2 * PI / periodo * times));

you can just create a 30 value array and map the time to an index just like in your mode 3.
since you use the same function in modes 1,2 and 4, you can use that same array for the 3 modes.
My code spends 3.9 milliseconds at every turn with Wavemaker () in the loop and 3.7 without.

So he spends about 0.2 millisecond to make this calculation. It's not much.


fefegarcia1 is offline   Reply With Quote
Old 11/09/2013, 03:27 AM   #123
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
I just finished testing the program.

pwm signal without RC filter works just fine.

The program can be configured to control 2 or 4 pumps. (makes me want to buy a second wp-25).
I have programmed H1,H2,H3,W1,W2,W3,ELSE, Feed and 4 custom waveforms.
(actually H2 and H3 are not needed since you can control level of H1 so I will probably drop them to reduce program and memory space usage)
you can control the pulse width and level for any wave mode.
level can be controlled from 128 to 255
pulse width can be controlled from 0-10 (translates to 200ms to 650ms per pulse).
Each pump can be programmed into 6 intervals.
you specify the following for each interval
start and end time, start and end level, wave mode, pulse width

pump0 is always master. you can define pumps 1-3 to run in sync or antisync of pump 0, on any wave mode.

I'll be running the test program while I figure the web interface code to program and control the pumps.

I ordered 2 peristaltic pumps. I will be writing the code for controlling the two pumps for dosing or for auto water change once I complete the jebao pump code.


d0ughb0y is online now   Reply With Quote
Old 11/09/2013, 10:53 AM   #124
wgraham
Registered Member
 
Join Date: Aug 2004
Posts: 292
That is great, do you still need the controller that came with the pumps to control it with your code


wgraham is offline   Reply With Quote
Old 11/09/2013, 11:42 AM   #125
d0ughb0y
Registered Member
 
d0ughb0y's Avatar
 
Join Date: Mar 2008
Location: sf bay area
Posts: 4,805
no need for the stock controller anymore, as my code replicates all modes. H1, H2, H3, W1, W2 and W3 are perfect replica (it's actually ironic to be reverse engineering a Chinese product). ELSE I just randomize between 128 and 255 (that seems to be how it works for the controller). The controller Feed simply turns off the pump, on my code, I kick up the pump to 128 for 200ms every 1.6 seconds.

I do not recommend to unsolder and use the cable from the controller, just in case you want to sell the pump later. I got a cable from ebay for $0.99 shipped (seller probably realized he lost money, and is now listed at $6). The connections fit, but the locking nut thread does not. If anyone can find the exact kind of cable on ebay, let me know. I also ordered the DC connector. It was either $0.99 for one, $1.49 for two, or $1.99 for 10, I ordered the 10, but has not yet arrived.


d0ughb0y is online now   Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT -6. The time now is 04:19 PM.


TapaTalk Enabled

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Powered by Searchlight © 2017 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-2014