Go Down

Topic: Brushless pumps; tacho(speed)-signal problems (Read 3774 times) previous topic - next topic

Hi,
...I'm working on a problem for a few days, but I can't get rid of it. I'm really clueless at the moment. I attached two pictures. On picture "Pic1" you can see the project. It is consisting of a barrel with rocks, water and seven brushless pumps (with integrated control). The pumps have three cables: phase, ground and tacho. As the pumps don't like unfiltered pwm as supply, I'm using the following elements to be able to control the speed of the pumps:

Arduino micro pwm pins -> TD62783AP(darlington array; current source; 8x) -> RC-member(530 Ohm; + 1uF ceramic capacitor to gnd + 2,2kOhm to gnd) -> lm317 -> pump

Additionally the ground of the pumps is connected to gnd via a mosfet (IRL3803) to be able to completely switch off the lm317s.
As the tacho is a signal between supply voltage (<=11V) and gnd I connected it with a schottky diode to the micro's input pins with activated pullups.
I'm using the following code (modified extract of a bigger program) to print out the duration of the half waves of the tacho-signal (in microseconds) on the serial monitor:
Code: [Select]

byte pump[] = {13, 10, 5, 11, 6, 9, 3}, pumpTacho[] = {0, 4, 12, 1, 8, 7, A0},
     pumpNo, xorVal[7] = {0};
unsigned long mics[7] = {0}, dMics[7] = {0}, time, time2wait = 0, micsNow;

void setup()
{
  pinMode(2, OUTPUT);  // pin for Mosfet
  pinMode(3, OUTPUT);  //seven pins for PWM (->lm317)
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(0, INPUT_PULLUP);  //seven inputs with pullup for tacho
  pinMode(1, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  pinMode(A0, INPUT_PULLUP);
  pinMode(A1, INPUT_PULLUP);  //input with pullup for button
  pinMode(A2, OUTPUT);  // output for led
  digitalWrite(2, HIGH);  //Mosfet "on"
  digitalWrite(A2, HIGH);  //led on
  Serial.begin(9600);
  for (pumpNo = 1; pumpNo < 7; pumpNo++) analogWrite(pump[pumpNo], 80);
  analogWrite(pump[0], 240);
  delay(500);
  pumpNo=0;
}

void loop()
{
  while(1)
  {
    if (digitalRead(pumpTacho[pumpNo]) ^ xorVal[pumpNo])
    {
      micsNow = micros();
      dMics[pumpNo] = micsNow - mics[pumpNo];
      mics[pumpNo] = micsNow;
      xorVal[pumpNo] ^= 1;
    }
    time = millis();
    if (time > time2wait)
    {
      Serial.println(dMics[pumpNo]);
      time2wait = time + 1000;
    }
  }
}

The very strange thing is that an arduino uno which is connected to a tacho-pin of the arduino micro (s. "pic1") with exactly the same program, but only the one pin connected, shows good values. Attached you can find a screenshot ("pic2") with two serial monitors running simultaneously with tacho-values of the micro ("com15") and the uno ("com13") which shows that the values are completely different. I tried this on two different tacho-pins on the micro("A0" and "0") with the same result. I tried it with an external pullup resistor (2kOhm), but no change. The only thing that helps is to connect the pumps' ground directly to gnd, without the mosfet in-between. With this the values of the micro are good except a few seldomly occurring unfitting ones. The values of the uno are still good (of course). So the mosfet is the disturbing factor, but only for the micro, not for the uno - why????? I tried it with a different mosfet (irliz44n), but the same result. What is wrong with the micro? ;)
The mosfet's gate is connected to pin2 of the micro with a 220 Ohm resistor and to gnd with 10 kOhm. The drain is connected with hte pump's grounds and source is connected to gnd. The voltage drop, with 8.7V between VCC of the pumps and gnd, at the mosfet is 0.3 volts. With a current of 1.3amps this gives a inner resistance of the mosfet of ~0,23 Ohms.

THANKS FOR THE ANSWERS IN ADVANCE!

...I found the problem (but I still don't know why it is only a problem for the micro)!
I conected the pump's grounds first via a white cable into the first breadboard and from there via a blue cable to the mosfets drain. I now removed the blue cable and connected the white one directly to the drain. Now the tacho values are good. Seems that the arduino micro does not like the conection of white and blue cables!? ;)
There are seldomly still wrong values, but I can filter out those in software easily. Nevertheless I had the idea, that to not beeing dependent on the "quality" of the mass through the pump and the mosfet I decided to connect a 10 kOhm pulldown resistor in front of the diodes (looking from the pump's side), so that when the tacho signal goes low the current that comes from the arduino's pullup resistors can "exit" to gnd without having to flow through the pump and the mosfet. With 10k Ohms I still get a few wrong values (as before), so I would like to try it with a pulldown resistor with lower resistance, but as during the high cycle of the tacho-signal the voltage is as high as the pump's supply voltage (<=11V) I don't know, if the hall sensor of the pumps can stand the current. As those few wrong values also might not be caused by ground problems, I think I will live with those wrong values and remove the pulldown resistors.

MarkT

I think you may be in danger of damaging your circuitry.

You seem to be low-side switching the power to the pumps (MOSFET to the ground lead),
yet have the tacho signal running from pump to Arduino?

That's going to put the motor supply voltage straight into an Arduino pin, and these pumps
are normally 12V??  Not good.

You should be high-side switching the power to the pumps is you also run signal
wires to the pumps.

That means the standard NPN - p-MOSFET high-side switching arrangement controlling
the positive pump supply, all grounds permanently commoned.

Like this:

but with a 1k base resistor between the Arduino pin and NPN base and 1k for
R1
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


I think you may be in danger of damaging your circuitry.

You seem to be low-side switching the power to the pumps (MOSFET to the ground lead),
yet have the tacho signal running from pump to Arduino?

That's going to put the motor supply voltage straight into an Arduino pin, and these pumps
are normally 12V??  Not good.


...I put schottky diodes in-between tacho from the pumps and the input pin of the arduino, so the supply voltage of the pumps won't reach the pin, but with high side switching I could get rid of the resistance in gnd caused by the mosfet, which could help to get rid of the erratic tacho values! - THANKS!

MarkT

So you'll just back-power the pump from the schottky, pulling the 5V rail
higher than it should be in the process?  No, high-side switching is needed,
or proper level-shifting/opto-isolation is needed in the tacho line I think.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


So you'll just back-power the pump from the schottky, pulling the 5V rail
higher than it should be in the process?  No, high-side switching is needed,
or proper level-shifting/opto-isolation is needed in the tacho line I think.

...maybe there is a missunderstanding! I don't use pwm on the mosfet, I just switch it "on" at the beginning of the program and switch it off, when the user presses a button to stop all pumps. The speed of the seven pumps is controlled via seven lm317 which are accessed by the arduino as follows:

pwm -> TD62783AP (as level shifter) -> lowpass -> lm317

As the lm317 cannot be driven to 0V, I use the mosfet to be able to switch the power off completely!
The Tacho works as follows: When there is a HIGH on the tacho there is e.g. 12V at the diode, but it won't pass (because it's inverse direction). When the tacho is LOW the voltage sourced by the arduino input pin's pullup resistor will pass the diode and cause the input pin to go low! - and this works. I just created a program that controls the pump's speed just via tacho, so the individual pump is set to full speed when the tacho-signal length is higher than desired and is set to lowest possible speed when the tacho-signal length is lower than desired. Doing this with high frequency lets the pumps create a fountain height as desired.
The advantage of this compared to working with pwm values is that you can have higher dynamics, because the pumps are always fully on until they reach the desired tacho ( = speed = fountain height)!
The desired tacho-signal length (pump speed) is controlled by an animation sequence in an array. I wrote a pump (fountain) animation program with processing that creates the animation arrays.

MarkT

Perhaps a diagram then we can figure out whether the diode will work as
you hope (if so then its OK).

One thing I forgot to mention before is layout - the switched power to the pump should
be twisted pair if you want to reduce interference.  The tacho signal should also be
twisted-pair to ground, but you don't have a common ground so you can't do that
(could account for misbehaviour seen perhaps?)

As I said, high side switching and common ground is how to do this...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Perhaps a diagram then we can figure out whether the diode will work as
you hope (if so then its OK).

...attached please find a picture with the diagram for one pump (the mosfet and the darlington array are for all pumps, everything else is there 7 times)!

...now the Arduino micro is dead! Attached you can find a picture which I took with my digital microscope. Seems that there is something burned. It happened after I moved some of the pumps a bit and those then produced more splatter, so I think that a little drop hit the micro (although it seems not to be wet) and caused a short. The water is a bit salty, caused by the rocks, so the resistance of the water is low I assume.
It happened after I switched off the pumps with the button. The grounds of the pumps were not connected to the mosfet (at the moment), but were connected directly to gnd. I checked the rest of the circuitry by connecting the inputs of the TD62783AP(darlington array) directly to 5V and all pumps went on as expected, so there is nothing wrong with the darlington array or the voltage regulators or the pumps. The only thing left (beside the water drop) that could be the reason (for my taste very unlikely) is that the 12V tacho signal has something to do with the killed atmega. Would be nice, if someone could comment on the digram I posted (especcially the connection of the tacho), before I connect another (my last) micro to the breadboard (and then move the breadboard completely under the barrel to prevent it being hit by drops)! - Thanks in advance!

MarkT

You probably created a large inductive spike when you switched off the pump.

You do have a free wheel diode don't you?  Always needed with inductive loads.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


You probably created a large inductive spike when you switched off the pump.

You do have a free wheel diode don't you?  Always needed with inductive loads.

...I expected the electronics inside the pumps to have diodes, but to be on the save side i installed diodes - Thanks for the hint!

dc42

Check your BAT47 diode. If the pump produced an inductive spike, it may have exceeded the voltage rating of that diode and fused it.

I assume that the pump has only 3 wires (+ve supply, -ve supply and tacho), in which case you will have a problem with noise on the common ground wire. Instead of the BAT47, I suggest using an NPN transistor. Connect emitter to Arduino ground, collector to Arduino input pin (with pullup resistor enabled), 4K7 resistor between base and emitter, and 47K resistor between base and tacho output from the pump. That will give you much better noise immunity, and better protect the Arduino from any spikes on the tacho output.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


Check your BAT47 diode. If the pump produced an inductive spike, it may have exceeded the voltage rating of that diode and fused it.

I assume that the pump has only 3 wires (+ve supply, -ve supply and tacho), in which case you will have a problem with noise on the common ground wire. Instead of the BAT47, I suggest using an NPN transistor. Connect emitter to Arduino ground, collector to Arduino input pin (with pullup resistor enabled), 4K7 resistor between base and emitter, and 47K resistor between base and tacho output from the pump. That will give you much better noise immunity, and better protect the Arduino from any spikes on the tacho output.

...I checked the diodes, they are o.k.!
Your idea with the transistor is definitely the better choice, but I want to have as little to solder (on the pcb that I will create at the end of the test period) as possible. I now let the pumps run for hours and often stopped and restarted them with the button without problems. One thing I might change is that I will switch to high-side switching. Especcially after I recognized that when I set the pwm values of the pumps to zero so that there is less than 2V at the output of the regulators, and also "switch off" the mosfet, but keep the pullup resistors of the inputs, where the tacho is connected, activated, that then (still) current flows from the arduino-pin through the diodes. This current must flow via the + cable of the pump backwards through the regulator. From there it will flow through the 2,2kOhm resistor, that is connected to adjust, to gnd!(?)

Go Up