Code for DC return pump

Do you have a question on how to do something.
Ask in here.
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Code for DC return pump

Post by Ismaclst »

jegillis wrote:I will just get the 6000 from amazon, easy return if it doesn't work out and no duties or brokerage charges. Last time I got a $25 car part from the UK UPS charged me $130 in brokerage charges for the inconvenience of prepaying $2.50 in duty charges. I will order the stuff this week and see how it goes.
Any updates?
Image
OceanWolf
Posts: 58
Joined: Sun Sep 22, 2013 4:59 pm
Location: Morgan Hill, CA

Re: Code for DC return pump

Post by OceanWolf »

Not on the DCT, but my DC6000 works perfect with the code that was in this thread.
An interesting note, when I used the DC6000 controller, 4 light out of 6 was getting my overflow to 98%. I thought it will be equal to 66% in the reef angle code. After playing a bit 77% gets me to 67% in the overflow. I am fine with it, since the waterfall sound is not very bad. I learned that you need to play with the control to find the best for each case.

http://forum.reefangel.com/status/banne ... nWolf&t=-8
Thanks
Onur

Image
jegillis
Posts: 86
Joined: Sat Jan 04, 2014 10:26 am

Re: Code for DC return pump

Post by jegillis »

Ismaclst wrote:
jegillis wrote:I will just get the 6000 from amazon, easy return if it doesn't work out and no duties or brokerage charges. Last time I got a $25 car part from the UK UPS charged me $130 in brokerage charges for the inconvenience of prepaying $2.50 in duty charges. I will order the stuff this week and see how it goes.
Any updates?
Sorry been busy the last few days with girl scout camping...I have the DCT pump waiting on a speed controller the cheap one I got was junk. Should have the new one on Monday.
Image
jegillis
Posts: 86
Joined: Sat Jan 04, 2014 10:26 am

Re: Code for DC return pump

Post by jegillis »

Got the new speed controller today, worked on figuring out how to use servo.write all day hopefully all will work out tomorrow :)

here is the code I am going to try out it compiled if anyone who knows better sees a problem with this let me know

First you need the servo libraries added to the ReefAngel libraries

Code: Select all

 #include <Servo.h> 
This gives our servo a name (placed after the last #include)

Code: Select all

Servo returnpump; // return pump control
placed this in setup to attach return pump to the low ato pin

Code: Select all

returnpump.attach(lowATOPin); //Attaches return pump to low ato
Placed this in loop

Code: Select all

pinMode(lowATOPin,OUTPUT);
returnpump.write(90); //value between 90 and 180
Image
jegillis
Posts: 86
Joined: Sat Jan 04, 2014 10:26 am

Re: Code for DC return pump

Post by jegillis »

So the code works to output the correct signal from the low ato port

Running into another problem in that I need to run through my loop as close as possible to every 20ms for this to work which is not happening.

otherwise all I get is random jitters from the motor

code examples I have found have sketches that control only the motor and add a 20ms delay in the loop. Is their a way to determine how long it takes to run through the loop?
Any other ideas?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code for DC return pump

Post by rimai »

What does the servo class do?
Isn't is just a simple PWM signal?
Roberto.
jegillis
Posts: 86
Joined: Sat Jan 04, 2014 10:26 am

Re: Code for DC return pump

Post by jegillis »

rimai wrote:What does the servo class do?
Isn't is just a simple PWM signal?

It is a PWM signal that is sent at a 50hz instead of 490hz of a standard PWM signal


I'm using the code servo.writeMicroseconds with a value of between 1000 and 2000 now instead of just .write (value in degrees) as its easier to understand the changes.. Basically the microsecond value is the length of time on high pulse and the low pulse needs to be about 20ms consistently which is where I am getting confused as I was under the impression that the low pulse length was determined by the frequency


Looking at the Servo.h comments it looks like I can use refresh() throughout the loop to ensure that the signal is refreshed every 20ms so I may have answered my own question.

I also just found a servo library someone wrote specifically to control these esc's so I may give that a try if this doesn't work.
Image
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Code for DC return pump

Post by Ismaclst »

Ok, so I found a design flaw in the DCT pumps. It doesn't retain the speed you had when you lose power to the pump. When it starts back up it is on max speed. This is a problem for me because I restrict my drain so I can create a full siphon. Thankfully, I used the code Roberto gave me to shut off my pump when my overflow reaches a certain height. But this just creates a cycle of off and on on my pump since it is running at max speed. Has anybody heard if Jebao fixed this in a new controller? I don't want to have this happen when I'm away for an extended period of time.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Code for DC return pump

Post by lnevo »

Thats horrible. That would be a deal breaker for most people.
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Code for DC return pump

Post by Ismaclst »

I know. I wish I had researched these before I bought mine.
Image
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Code for DC return pump

Post by Ismaclst »

Ismaclst wrote:Ok, so I found a design flaw in the DCT pumps. It doesn't retain the speed you had when you lose power to the pump. When it starts back up it is on max speed. This is a problem for me because I restrict my drain so I can create a full siphon. Thankfully, I used the code Roberto gave me to shut off my pump when my overflow reaches a certain height. But this just creates a cycle of off and on on my pump since it is running at max speed. Has anybody heard if Jebao fixed this in a new controller? I don't want to have this happen when I'm away for an extended period of time.

I contacted fish street, who I bought this from, about the problem. They are going to send me an updated controller that fixes this issue.
Image
Ismaclst
Posts: 250
Joined: Wed Jan 28, 2015 5:17 pm

Re: Code for DC return pump

Post by Ismaclst »

jegillis wrote:So the code works to output the correct signal from the low ato port

Running into another problem in that I need to run through my loop as close as possible to every 20ms for this to work which is not happening.

otherwise all I get is random jitters from the motor

code examples I have found have sketches that control only the motor and add a 20ms delay in the loop. Is their a way to determine how long it takes to run through the loop?
Any other ideas?
Did you ever get this to work correctly?
Image
Post Reply