Bitcoin Forum

Bitcoin => Hardware => Topic started by: invader on July 14, 2013, 01:29:26 PM



Title: Avalon F/W for inverted PWM fans
Post by: invader on July 14, 2013, 01:29:26 PM
Hi all.
I want to share finished firmware that allows to use some fans like TFC1212DE-SP07 and alike which have inverted PWM regulation. In general this firmware is simular to ckolivas 20130703, but also with my changes in cgminer included. Some options redefining constants added (see github readme). Also, as a little bonus, i included this patch (https://bitcointalk.org/index.php?topic=254331.0), that shows % of HW errors.

https://github.com/re-invader/avalon-fw

My changes to cgminer also present here if you want to build it from sources

https://github.com/re-invader/cgminer

Next goal is to improove temperature regulation algorithm, as powerful fans seems to produce temperature  oscillations that is hardly converged ( temp up -> fan up -> temp down -> fan down -> temp up ) in some cases, especially on large min/max range.

If you find it useful you can say "thanks" by mining on default pool settings.
Feel free to ask any questions.


Title: Re: Avalon F/W for inverted PWM fans
Post by: dogie on July 14, 2013, 01:36:32 PM
I can help with the logic side of the oscillation damping if you want - not a clue what language you compile cgminer in, but I can provide the framework.


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 14, 2013, 01:43:02 PM
Thanks for your help and answer, cgminer is written in C and compiled by gcc :)
In general i have some ideas that i'll try to implement later, but it's not a quick fix. Im thinking on a simple and effective solution. For now i just increased a little avg temperature collection / fan regulation interval ( by option --avalon-fanwait ) and it seems working.


Title: Re: Avalon F/W for inverted PWM fans
Post by: titomane on July 14, 2013, 08:01:20 PM
Good job & good news for Avalon owners & future clone owners.

Thanks


Title: Re: Avalon F/W for inverted PWM fans
Post by: uuidman on July 15, 2013, 12:05:17 AM
Do you use your avalon with the  TFC1212DE-SP07 to get it cooler or to have the same temp but maybe more quiet ?


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 15, 2013, 10:13:33 AM
I have it in a remote location, so i can't compare the noise really. But i made some observations initially while i was installing this fans. Guessing it can be more quiet at the same cooling level, but at full rpm they loud as hell (so the cooling efficiency). In general i decided to install them because of high ambient temperatures and overclocking at the same time.


Title: Re: Avalon F/W for inverted PWM fans
Post by: stfnnn on July 18, 2013, 06:34:15 PM
I've installed 3 TFC1212DE (http://www.aliexpress.com/item/Free-Shipping-Delta-3-9A-violent-fan-12CM-the-best-TFC1212DE-oversized-air-volume-four-wire/787435543.html), flashed your 20130714 firmware and set the --avalon-invert-pwm option. But for some reason the fans do not seem to speed up when the temp is getting up. The fan RPM stays stable at around 2580 RPM, and my temp2 and temp3 sensors are 60C.

Do you have any ideas why my fans don't run any harder when the temp is getting up? According to specs fans are 5500 rpm. When I only connect +12V and ground fans spins at 4800RPM, so they can spin harder dan this 2580 rpm.

Also option  --avalon-fan 100 does not seem to work.


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 19, 2013, 09:26:22 PM
Quote
Are there other people here who tried some of those inverted pwm fans? I've installed 3 TFC1212DE (http://www.aliexpress.com/item/Free-Shipping-Delta-3-9A-violent-fan-12CM-the-best-TFC1212DE-oversized-air-volume-four-wire/787435543.html), flashed the modified 20130714 firmware with inverted pwm support (https://bitcointalk.org/index.php?topic=256003)  and set the --avalon-invert-pwm option. But for some reason the fans do not seem to speed up when the temp is getting up. The fan RPM stays stable at around 2580 RPM, and my temp2 and temp3 sensors are 60C.
Also option  --avalon-fan 100 does not seem to work.

Maybe you have normal non inverted PWM fan? :) Did you tried to run it without --avalon-invert-pwm option?

Quote
Any ideas why my fans don't run any harder when the temp is getting up? According to specs fans are 5500 rpm. When I only connect +12V and ground fans spins at 4800RPM, so they can spin harder dan this 2580 rpm.

This is why i added --avalon-fanfactor option.

Im currently using with this options, just for reference.

Quote
--avalon-invert-pwm --avalon-fan 30-90 --avalon-fanwait 5 --avalon-fanfactor 160


Title: Re: Avalon F/W for inverted PWM fans
Post by: stfnnn on July 20, 2013, 08:19:00 AM
Maybe you have normal non inverted PWM fan? :) Did you tried to run it without --avalon-invert-pwm option?

Without this option the fans starts at around 2500 rpm, and it slowly drops to 0 rpm, so looks like inverted pwm to me ;)

Quote
This is why i added --avalon-fanfactor option.

Im currently using with this options, just for reference.

--avalon-invert-pwm --avalon-fan 30-90 --avalon-fanwait 5 --avalon-fanfactor 160

Thank you, will give it a try and let you know!


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 20, 2013, 01:53:07 PM
Also PSU must be selected accordingly.
Power to fans must be supplied directly from PSU by the additional wire(s) that is capable of 8A current (~100w @ 12v).
Can you also try the following settings for a moment and tell me your fan rpm sensor reading for every case?

Quote
--avalon-invert-pwm --avalon-fan 99-100 --avalon-fanfactor 160
--avalon-invert-pwm --avalon-fan 9-10 --avalon-fanfactor 160
--avalon-fan 99-100 --avalon-fanfactor 160
--avalon-fan 9-10 --avalon-fanfactor 160


Title: Re: Avalon F/W for inverted PWM fans
Post by: stfnnn on July 21, 2013, 04:43:35 PM
I indeed took power straight from the PSU (I'm still using the standard Enermax GX850 PSU). Pulling ~700watt at the wall, so plenty of room for the 2 fans.

This options:
--avalon-invert-pwm --avalon-fan 30-90 --avalon-fanwait 5 --avalon-fanfactor 160
--avalon-invert-pwm --avalon-fan 99-100 --avalon-fanfactor 160
--avalon-invert-pwm --avalon-fan 9-10 --avalon-fanfactor 160
--avalon-fan 99-100 --avalon-fanfactor 160
--avalon-fan 9-10 --avalon-fanfactor 160

Give me those readings:

Status   MHS5s   MinerCount   AsicCount   Frequency   Fan1   Fan2   Fan3   Temp1   Temp2   Temp3   NMW   Firmware
                                    
Alive   79276.71   24   10   350   0   2720   2720   34   52   54   10   20130714
Alive   85793.17   24   10   350   0   2560   2560   35   56   57   4   20130714
Alive   73036.38   24   10   350   0   0   0   36   56   58   2   20130714
Alive   64177.27   24   10   350   0   0   0   36   57   59   0   20130714
Alive   1823.91   24   10   350   0   1920   1920   36   57   59   0   20130714

Extended the fan cable, because the original was only 5cm. I even redid it and use thicker cable:

http://i39.tinypic.com/r1lb0i.jpg

Can this somehow cause incorrect readings on the sense- or control-wire?


Title: Re: Avalon F/W for inverted PWM fans
Post by: rammy2k2 on July 21, 2013, 04:59:13 PM
thanks, good work


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 21, 2013, 07:32:51 PM
Quote
Can this somehow cause incorrect readings on the sense- or control-wire?
If your fan have the same ground with avalon controller via PSU and wires connected properly, as far as i can tell from this picture, everything is fine.

I don't get it, why with the option --avalon-invert-pwm you have 2560 rpm @ 100% fan, and with 90% fan = 2720 rpm ..
Thats a really strange issue, fan is looking exactly the same like mine ( Can you also make a picture of it's label from other side just for reference? )

I can guess you have a batch 2 unit, and maybe there is some difference in avalon controller fpga code related to fan pwm ..
( I still not received mine so i can't tell now for sure. )

To figure out what is really happening, can you make more tests with altering --avalon-fan option by 10% steps and post rpm sensor result?
( Try to find values where you have max fanspeed. )

--avalon-invert-pwm --avalon-fan 100 --avalon-fanfactor 160
--avalon-invert-pwm --avalon-fan 90 --avalon-fanfactor 160
...
--avalon-invert-pwm --avalon-fan 20 --avalon-fanfactor 160
...
( Also try the same without --avalon-invert-pwm option )


Title: Re: Avalon F/W for inverted PWM fans
Post by: stfnnn on July 22, 2013, 08:11:56 PM
Quote
I don't get it, why with the option --avalon-invert-pwm you have 2560 rpm @ 100% fan, and with 90% fan = 2720 rpm ..
Thats a really strange issue, fan is looking exactly the same like mine ( Can you also make a picture of it's label from other side just for reference? )
That is indeed very strange. If 1 fan was having this issue it could be a faulty fan, but all 3 have this issue.

Maybe this is a cheap copy of HP fans? Yours are genuine HP, or also genuine China made?

http://i42.tinypic.com/2crmz5i.jpg

Quote
I can guess you have a batch 2 unit, and maybe there is some difference in avalon controller fpga code related to fan pwm ..
( I still not received mine so i can't tell now for sure. )

It is indeed a batch 2. To my best knowing, there is only 1 firmware for all batches. batch 2 has some minor hardware changes though. I do read about updated FPGA controller firmware at the Avalon wiki (https://en.bitcoin.it/wiki/Avalon#FPGA_controller)

Quote
To figure out what is really happening, can you make more tests with altering --avalon-fan option by 10% steps and post rpm sensor result?
( Try to find values where you have max fanspeed. )

--avalon-invert-pwm --avalon-fan 100 --avalon-fanfactor 160
--avalon-invert-pwm --avalon-fan 90 --avalon-fanfactor 160
...
--avalon-invert-pwm --avalon-fan 20 --avalon-fanfactor 160
...
( Also try the same without --avalon-invert-pwm option )

When I have time I'll go test. I'll get back to you with the results.


Title: Re: Avalon F/W for inverted PWM fans
Post by: invader on July 23, 2013, 08:23:51 AM
Quote
Maybe this is a cheap copy of HP fans? Yours are genuine HP, or also genuine China made?

I checked, and it's exactly the same! Only difference is the code near triangle - mine is "7807a24R", "7808A24R". Looks like it's a serial number.

Quote
When I have time I'll go test. I'll get back to you with the results.

Ok. Then we'll see if it can be fixed via software. You can also try to plug it somewhere else like in motherboard and play with PWM value to see if you can really control them, to exclude the possibility of difference in avalon controller.

ADD:

Im starting to think that it could be a controller related issue.
I have controller v1.52 , and i can't stop the fans (for example) with option --avalon-fan 0.
Which effectively mean, that in inverted pwm mode you can't reach max fanspeed.
Seems like controller can't pass low pwm values redefining it to some min_pwm constant, or have some internal regulation depending on sensor reading temperature ( i noticed that once fan rpm value was less than 2000 , but i can't set it now less than 2400, which is very strange )
It just my thoughts based on observation of b2 unit behavior, i would try to install fans later and see if i got the same issue as yours.

ADD:

I have found a "workaround". Seems that controller is indeed going into some "helper" mode to control the fans if the temp2 sensor is present. So i unplugged it, and seems that now i can control the fans like i want.

So, in short, the solution is to unplug temp2 sensor! (closest to unit intake side)

ADD:

I tested new fans with temp2 sensor unplugged, it seems to be working as in b1 unit.


Title: Re: Avalon F/W for inverted PWM fans
Post by: stfnnn on July 27, 2013, 05:09:44 PM
I've had some time today and tried your suggestions. It seems to work partially. Fans start at around 2000-2500RPM, as the temp3 slowly climbs to 50C the RPM increases. When the temp is at 51C the fans are at 6000RPM and the temp3 slowly drops to 47C where the fans stay at 5760RPM. I assumed the RPM would drop more, since 47C is 3C below target temp of 50C. For now I'm using "--avalon-fan 30-70" to keep temp at 50C and fans not to noisy.

Code:
--quiet --avalon-invert-pwm --avalon-cutoff 60 --avalon-temp 50 --avalon-options 115200:24:10:36:350 --avalon-fanfactor 172 --avalon-fan 30-70  --avalon-fanwait 5


Title: Re: Avalon F/W for inverted PWM fans
Post by: Dalkore on July 28, 2013, 04:44:51 AM
If it helps, I got the 4400 RPM model from that company and I have had no issues and they all run great with the avalon OC firmware.