reef-pi :: An opensource reef tank controller based on Raspberry Pi.

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Ok wiring up my pwm to lights...my pca9685 puts out 1.577 khz and wont change, did i miss something in configuration...
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Look on the configuration page, should be a setting for the Pi pwm and the pca9685 frequency. :)
I have it set to 200hz, but its definitely not putting that out. It will only put out 1577hz and wont change, and thats too fast to dim the lights with the modules im using...i need to be abke to set it lower than 1khz...



Testing voltage at the pca pins im getting a voltage change corresponding with the slider setting...99 percent =3.27v, 50 perxent=1.64v etc...but my meter reads 1.577 khz and im sure its accurate...

Theres not something needed in config txt for the pca is there?
I see it on the i2c bus at address 40 and 70

I have deleted all lights, associated jacks and lighting and disabled pca9685, rebooted and added back in and get the same results

Do i need to start over maybe and delete reef pi and redo my card from scratch
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
I have it set to 200hz, but its definitely not putting that out. It will only put out 1577hz and wont change, and thats too fast to dim the lights with the modules im using...i need to be abke to set it lower than 1khz...



Testing voltage at the pca pins im getting a voltage change corresponding with the slider setting...99 percent =3.27v, 50 perxent=1.64v etc...but my meter reads 1.577 khz and im sure its accurate...

Theres not something needed in config txt for the pca is there?
I see it on the i2c bus at address 40 and 70

I have deleted all lights, associated jacks and lighting and disabled pca9685, rebooted and added back in and get the same results

Do i need to start over maybe and delete reef pi and redo my card from scratch
Everything else works...set light to 0 it goes off, set to anything else it comes on...because 1.577khz is too fast for my mosfet modules

I see the default in the reef pi pca driver is 1500hz which is what im seeing...hmm
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have it set to 200hz, but its definitely not putting that out. It will only put out 1577hz and wont change, and thats too fast to dim the lights with the modules im using...i need to be abke to set it lower than 1khz...



Testing voltage at the pca pins im getting a voltage change corresponding with the slider setting...99 percent =3.27v, 50 perxent=1.64v etc...but my meter reads 1.577 khz and im sure its accurate...

Theres not something needed in config txt for the pca is there?
I see it on the i2c bus at address 40 and 70

I have deleted all lights, associated jacks and lighting and disabled pca9685, rebooted and added back in and get the same results

Do i need to start over maybe and delete reef pi and redo my card from scratch
Nope.. this should work , if not its a bug. Let me test it out
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Nope.. this should work , if not its a bug. Let me test it out
Ive tried everything...but can not get frwquency to lower...
Pins all work on the pca9685...but can not get frequency to lower...i can set to 0 to turn lights off but any setting over 0 turns them on because my mosfets modules dont switch that fast.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Has anyone actually tested frequencies put out by pwm in reef pi.
I found some weird results.
On mine, the pca9685 only puts out 1577 hz...cant get it to change no matter what i put in the pca9685 frequency box.

So tried pi pwm and here is what i got with a good fluke. The setting is what in entered in the box on config page, and the reading I got in hz.

Setting 25=400hz
Setting 50=200hz
Setting 60=166hz
Setting 75=150 hz
Setting 100=100hz
Setting 150=66hz
Setting 200=50hz

Methinks theres a bug somewhere

I had this hooked up to a light when testing, my fish felt like they were in a disco...lol
 
Last edited:

brandon clow

Active Member
View Badges
Joined
Oct 22, 2017
Messages
121
Reaction score
151
Rating - 0%
0   0   0
Has anyone actually tested frequencies put out by pwm in reef pi.
I found some weird results.
On mine, the pca9685 only puts out 1577 hz...cant get it to change no matter what i put in the pca9685 frequency box.

So tried pi pwm and here is what i got with a good fluke. The setting is what in entered in the box on config page, and the reading I got in hz.

Setting 25=400hz
Setting 50=200hz
Setting 60=166hz
Setting 75=150 hz
Setting 100=100hz
Setting 150=66hz
Setting 200=50hz

Methinks theres a bug somewhere

I had this hooked up to a light when testing, my fish felt like they were in a disco...lol
I am really tempted to test this also but my fluke scope is sitting at work. Interesting find!
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Has anyone actually tested frequencies put out by pwm in reef pi.
I found some weird results.
On mine, the pca9685 only puts out 1577 hz...cant get it to change no matter what i put in the pca9685 frequency box.

So tried pi pwm and here is what i got with a good fluke. The setting is what in entered in the box on config page, and the reading I got in hz.

Setting 25=400hz
Setting 50=200hz
Setting 60=166hz
Setting 75=150 hz
Setting 100=100hz
Setting 150=66hz
Setting 200=50hz

Methinks theres a bug somewhere

I had this hooked up to a light when testing, my fish felt like they were in a disco...lol

That might explain why i had so much fun when I was playing with the rpi pwm, my meter wont give me the frequency like its supposed to, but that explains exactly what i saw, the higher the frequency gave me the strobe , I settle on 100Hz and works pretty well for me but glad to know why I saw what I saw.

Are you running version 2.2?
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
I am really tempted to test this also but my fluke scope is sitting at work. Interesting find!
I dont have a scope, but a fluke 179, which does ac and dc frequency.

Im hoping someone reproduces this, this has my pwm build stopped in its tracks...in all that testing with the pi pwm i found 200-300hz to be best setting for my lights. At least my proof of concept and the dfrobot mosfer modules work as i thought for my lights.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
That might explain why i had so much fun when I was playing with the rpi pwm, my meter wont give me the frequency like its supposed to, but that explains exactly what i saw, the higher the frequency gave me the strobe , I settle on 100Hz and works pretty well for me but glad to know why I saw what I saw.

Are you running version 2.2?
Yes 2.2 lol when i set pi pwm to 400, it was 25 hz, my lights were like a strobe, was testing on a blue channel, thought strippers were gonna walk in...lol

I temporarily dowmgraded to 2.0 but that didnt fix the pca9685, didnt test the pi pwm on 2.0
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Yes 2.2 lol when i set pi pwm to 400, it was 25 hz, my lights were like a strobe, was testing on a blue channel, thought strippers were gonna walk in...lol

I temporarily dowmgraded to 2.0 but that didnt fix the pca9685, didnt test the pi pwm on 2.0

That duplicates what I saw (minus the ladies walking in), I started around 400 and it was a really bad strobe effect. The lower I went the better it got, I settled on 100, but that explains what I was seeing, I just don't have a good meter to read the frequency.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Has anyone actually tested frequencies put out by pwm in reef pi.
I found some weird results.
On mine, the pca9685 only puts out 1577 hz...cant get it to change no matter what i put in the pca9685 frequency box.

So tried pi pwm and here is what i got with a good fluke. The setting is what in entered in the box on config page, and the reading I got in hz.

Setting 25=400hz
Setting 50=200hz
Setting 60=166hz
Setting 75=122 hz
Setting 100=100hz
Setting 150=66hz
Setting 200=50hz

Methinks theres a bug somewhere

I had this hooked up to a light when testing, my fish felt like they were in a disco...lol

On the pi pwm results...found a curious formula:
10,000 / pi pwm setting=actual output hz

Works out exactly with what i tested.
Wish I could get the pca9685 but that defaulted to 1.5k no matter what I entered in the pca pwm box
 

rushbattle

Valuable Member
View Badges
Joined
Oct 19, 2016
Messages
1,347
Reaction score
1,628
Location
Equality
Rating - 0%
0   0   0
On the pi pwm results...found a curious formula:
10,000 / pi pwm setting=actual output hz

Works out exactly with what i tested.
Wish I could get the pca9685 but that defaulted to 1.5k no matter what I entered in the pca pwm box
All of this explains some strange behavior when I was prototyping my 0-10VDC output via the pi PWM pins. If there is still confusion tomorrow I will get measurements for frequency via my pi 3B+ and post those up with reef-pi 2.2.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
And looking at the pca9685 driver for reef pi, seems it defaults to 1500, if it gets a 0 it makes the value 1500, if it doesnt get a value it makes it 1500, so somehow i think the value entered in the box isnt going to the driver correctly.
Id rather have the default a reasonable value, like 200...lol the adafruit board goes 1600 MAX anyways. Coding isnt in my skillset, but good troubleshooting is!
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
Has anyone actually tested frequencies put out by pwm in reef pi.
I found some weird results.
On mine, the pca9685 only puts out 1577 hz...cant get it to change no matter what i put in the pca9685 frequency box.

So tried pi pwm and here is what i got with a good fluke. The setting is what in entered in the box on config page, and the reading I got in hz.

Setting 25=400hz
Setting 50=200hz
Setting 60=166hz
Setting 75=150 hz
Setting 100=100hz
Setting 150=66hz
Setting 200=50hz

Methinks theres a bug somewhere

I had this hooked up to a light when testing, my fish felt like they were in a disco...lol

Yeah this is broken. I’ll look at the issue soon :)
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
And looking at the pca9685 driver for reef pi, seems it defaults to 1500, if it gets a 0 it makes the value 1500, if it doesnt get a value it makes it 1500, so somehow i think the value entered in the box isnt going to the driver correctly.
Id rather have the default a reasonable value, like 200...lol the adafruit board goes 1600 MAX anyways. Coding isnt in my skillset, but good troubleshooting is!

The PCA9685 has a limit 1526Hz to the PWM output using the onboard clock. If you feed it 50MHz on the clock pin you can double that to 3052Hz. I find both too slow for all cases especially if you have low duty cycle percents as you’ll get “nice” banding on some cameras.

At boot the PCA9685 is 200Hz (strobe city).

As for the driver let me confirm the settings value is making it all the way through.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I got a nasty flu, expect sporadic presence for next few days . I plan to continue working on the ph driver, it’s almost there. Some work on integrating the calibration logic /ui left.
Meanwhile I have now a full blown test setup :-) . I am loving my garage
90A0A51B-C26C-4CD4-88E8-6480E81E3441.jpeg


This is the controller I plan to giveaway during local coral farmers market
26B9F4ED-990A-4ADB-A798-F99993650B0B.jpeg

I’m thinking if I should give this handmade controller or a pico baseboard from theatrus. Suggestions?
I have now almost 4 complete set of reef-pi for testing , each with different specs (pi zero, pi b, pi 2 and pi 3). 2019 should be fine
EEF0B4DE-0EDC-494B-B996-B10B72566364.jpeg

On a side note ,I hooked up one of my son’s n scale locomotive with reef-pi, and it worked :/) , the circuit is exactly same as led strip , using a logic level power mosfet . I’ll post some pictures soon
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
The PCA9685 has a limit 1526Hz to the PWM output using the onboard clock. If you feed it 50MHz on the clock pin you can double that to 3052Hz. I find both too slow for all cases especially if you have low duty cycle percents as you’ll get “nice” banding on some cameras.

At boot the PCA9685 is 200Hz (strobe city).

As for the driver let me confirm the settings value is making it all the way through.
Thanks,
The lights I am running are basically the equivalent of 5630 led strips but with a common anode...the mosfet module I am using to control them have a slow optoisolator that drives a p channel mosfet. Thus the need to be under 1khz.
 

DO YOU THINK TECHNOLOGICAL ADVANCEMENTS ARE MORE HELPFUL OR HURTFUL TO REEFING?

  • More helpful.

    Votes: 60 42.6%
  • More hurtful.

    Votes: 5 3.5%
  • I think it depends mostly on the technology.

    Votes: 53 37.6%
  • I think it dependsmostly on the reefer behind the technology.

    Votes: 42 29.8%
Back
Top
Home
Post thread…
Market
What's new