PWM Fan works in re...
 
Notifications
Clear all

PWM Fan works in reverse

3 Posts
2 Users
0 Likes
973 Views
(@jelleh)
New Member
Joined: 2 years ago
Posts: 2
Topic starter  

Hi,

 

I connected 2 fans to Arduino UNO, PWM to pin 9 and 10.

12v source directly to the fans, and GND also to the Arduino

 

In SKETCH SETUP, i use "SHAKEIT PWM FANS Outputs", everything on default but relais disabled.

When i turn on the Arduino and the fan power source, the Arduino is detected in Simhub, and the fans are blowing at 100%

On ShakIT Motors, at the motors output, when i click test now, the fans are going to idle RPM, so it looks like that the fans reacting in reverse.

 

0 PWM > FAN is at full speed

255 PWM > FAN is at idle speed

 

On the internet, they solve this by changing the Arduino digital pin to HIGH? but how can i do this in SimHub?

So the FANS are working and reacting on PWM change, but in reverse.. also tested it in iRacing.

at 0km/h fan is blowing fullspeed, and at 120km/h the fans are in idle speed. its like driving downwind now 🙂

 

FANS: Sunon PMD1209PTB1-A

 

This topic was modified 2 years ago by Jelleh

   
Quote
(@admin5435)
Prominent Member Admin
Joined: 7 years ago
Posts: 728
 

Hi ! Out of box such reverse logic is not supported, but with a quick hack it should be doable : 

In file : C:\Program Files (x86)\SimHub\_Addons\Arduino\DisplayClientV2\SHShakeitPWMFans.h

Find line (117) :

Timer1.pwm(pins[motorIdx], (int)(((float)value2 / 255.0) * 1023.0));

And add a "1023 - ": 

Timer1.pwm(pins[motorIdx], 1023 - (int)(((float)value2 / 255.0) * 1023.0));

This should be enough to match your fan "special" logic.

Then you just have to go again through the arduino setup process to reopload the sketch.

PS : This will reverse the logic for any fans connected to this arduino, not only a single one.


   
ReplyQuote
(@jelleh)
New Member
Joined: 2 years ago
Posts: 2
Topic starter  

@admin5435 Works!

Thanks alot! 

 

Feature request: reverse checkbox for "special" logic fans 🙂 


   
ReplyQuote
Share: