EMC2102 Inverted Speed Setting

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Zeloz
 
Posts: 32
Joined: Tue Nov 15, 2016 4:44 pm

EMC2102 Inverted Speed Setting

Post by Zeloz »

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.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

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

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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 499 times

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

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

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

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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 457 times

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

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.

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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 413 times

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

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?

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

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?

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

Glad to hear you got things working. Happy hacking!

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

Re: EMC2102 Inverted Speed Setting

Post by Zeloz »

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.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2102 Inverted Speed Setting

Post by adafruit_support_mike »

Thanks for the follow-up!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”