Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

EMC2102 Inverted Speed Setting
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

EMC2102 Inverted Speed Setting

by Zeloz on Sun May 02, 2021 8:10 pm

For the EMC2101, I seem to be getting the opposite speed as what I put in with the manual speed option. When I set "emc.manual_fan_speed = 0", it gives me 5800 rpm and with "emc.manual_fan_speed = 100", it gives me no fan spin at all. I have tried putting "emc.invert_fan_output = True" after creating the emc = EMC2101(i2c) object and before the manual speed setting to no avail. Not sure if that's the right command for it, but any help would be appreciated, thanks.

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Mon May 03, 2021 11:41 pm

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Mon May 03, 2021 11:55 pm

Hello, it's a bit more complicated since I'm using the chip in a different/custom circuit, so I could use a fan header. I do have a GPIO Expander Bonnet working flawlessly on the same system however (via I2C). The temperature reports correctly as does the fan speed, just doesn't seem to have the speed setting.
Attachments
EMC2101.png
EMC2101.png (915.64 KiB) Viewed 311 times

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Mon May 10, 2021 12:01 am

Hrm.. let's reduce the number of variables.

Does the fan work properly if you connect it directly to the EMC?

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Mon May 10, 2021 1:52 am

The fan is essentially plugged directly into the EMC2101 chip. The chip was integrated into a circuit board. I can set the speed to 100%, actual speed 0
70% in code, actual speed 30
50% in code, actual speed 50
20% in code, actual speed 80
and so on.
Attachments
Fan_EMC2101.PNG
Fan_EMC2101.PNG (92.32 KiB) Viewed 269 times

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Mon May 10, 2021 9:10 pm

Try the direct connection please. I'm trying to collect comparative information, and want to start from the baseline of the factory board with no modifications.

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Tue Jun 08, 2021 7:55 pm

Finally got around to getting the board set up. It appears to have the same problem. Setting speed to 0 nets 4900 rpm and setting it to 100 nets 82 rpm.
Attachments
EMC2102.png
EMC2102.png (861.98 KiB) Viewed 225 times

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Tue Jun 08, 2021 9:54 pm

Okay, let's collect some baseline information.

What voltage do you see on the fan's PWM pin when you disconnect it from the EMC2102?

What does the fan do when you connect the PWM pin directly to GND?

What does the fan do when its PWM pin isn't connected to anything?

What does the fan do when its PWM pin is connected to the voltage measured when the pin is disconnected?

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Wed Jun 09, 2021 2:19 am

When the PWM pin is disconnected between the fan and the EMC2102, I read 2.8v on the fan PWM pin.

When I put the fan PWM pin to ground the fan stops spinning.

With the fan PWM disconnected, the fan spins to full speed.

Not sure what you mean by the last one, when it's disconnected from PWM it spins to full speed and is 2.8v

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Wed Jun 09, 2021 8:31 pm

The third one amounts to "what does the fan do when the PWM input is connected to 2.8V?" It should run at full speed, but the first rule of debugging is, "don't believe anything you haven't verified by testing".

It sounds like the motor responds to a normal PWM signal, so let's look at the EMC2102's output.

What voltages do you see on the EMC2102's PWM output at 0% and 100% duty cycles when invert_fan_output is set to false, and then to true?

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Thu Jun 10, 2021 10:31 pm

Looks like it was a simple fix. It must save the "invert" value to the chip, when I used "emc.invert_fan_output = 0" and then tried it, it worked correctly. I thought it was at startup of the chip that it needed to be set from the default should you want it to be inverted rather than something that was pulled from the chips onboard memory. Not sure if/how I got it to be inverted to begin with however since I only looked up that command after it started in an inverted state. So far so good though, thanks for the help!

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Fri Jun 11, 2021 8:37 pm

Glad to hear you got things working. Happy hacking!

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

by Zeloz on Mon Jun 14, 2021 8:40 pm

I think another point of confusion that I had was switching between libraries, I believe I had set a function using the LUT library which saved to the chip which the normal library couldn't access. So when I went to the normal library again, no matter what I did, I couldn't get it to work (I think). I didn't look into it too far but it may be that initialize() doesn't reset all values interchangeably between the libraries. In any case, working great now, taking in the temperature reading from the Raspberry Pi CPU and changing fan speed to match.

Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

Re: EMC2102 Inverted Speed Setting

by adafruit_support_mike on Mon Jun 14, 2021 9:53 pm

Thanks for the follow-up!

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.