PWM Exhaust valve controller project

Thread Starter

s200bym

Joined Aug 9, 2017
82
Hi all.

I have started a project which involves making an exhaust valve controller. I have an exhaust valve kit which I got from China. All works as it should and the quality is surprisingly good. The servo motors look identical to the BMW OEM valves.



https://drive.google.com/file/d/1kODZQRlraVWlBe_12k6P4q1tDN9BoG6L/view?usp=sharing

I could just fit them as they are and be done with it, but where is the fun in that.

I haven't opened the valves as I don't want to compromise the watertight seal. I did, however, find this picture online.



https://drive.google.com/file/d/1BSzoeBEYh86eMxuGCRtSuqhLYpue2kdc/view?usp=sharing

It's not the best picture but some of you pros may be able to work it out. I'm thinking maybe an H bridge?

I had a look in the controller itself and got pictures of the circuit board. It runs on a Nuvoton N76E003AT20 chip and the PWM signal is bumped up to 12V.



https://drive.google.com/file/d/1WrrtmuB0xuGuOOZ3hGxiFKxPYOYSFXFL/view?usp=sharing



https://drive.google.com/file/d/1FOr9XAujwiZ0xaACfYAVlk4Fm9zgo7bZ/view?usp=sharing


I have been working on some code with the help of some of the guys on here to control 2 servo motors. I have got the code to do all the things it needs to do to move the valves from 0 to 180 and so on, every time a button is pressed.

Code:
const int  buttonPin = 2;    // the pin that the pushbutton is attached to
const int servoPin1 = 9;
const int servoPin2 = 10;


// Variables will change:
int buttonState;         // current state of the button
int lastButtonState;     // previous state of the button
bool servoFacingLeft;




#include <Servo.h>
Servo myservo1;
Servo myservo2;

void setup()
{
  Serial.begin(9600);          //  setup serial
  // initialize the button pin as a input with pullup, active low
  pinMode(buttonPin, INPUT_PULLUP);
  //initialize button states
  buttonState = digitalRead(buttonPin);
  lastButtonState = buttonState;
  //servo
  myservo1.attach(9);
  myservo2.attach(10);
  Serial.println("Exhaust Valves ");

}

void loop()
{
  // read the pushbutton input pin:
  buttonState = digitalRead(buttonPin);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) //changed
  {
    if (buttonState == LOW) //new press, so change servo flag
    {
      servoFacingLeft = !servoFacingLeft;
    }
    delay(50);
  }

  lastButtonState = buttonState; // save the current state as the last state, for next time through the loop


  if (servoFacingLeft) //positions the servo
  {
    myservo1.write(-180); // 180 or -180 depending on type of valve
    myservo2.write(-180); // 180 or -180 depending on type of valve
    Serial.print("Valve Status: ");
    Serial.print(" Valve Open");
    Serial.println(" (Loud Mode)");

    {


    }
  }    else
  {
    myservo1.write(180); // 180 or -180 depending on type of valve
    myservo2.write(180); // 180 or -180 depending on type of valve
    Serial.print("Valve Status: ");
    Serial.print(" Valve Closed");
    Serial.println(" (Quiet Mode)");

  }
}
I connected the Arduino circuit up to an oscilloscope and you can see the results in the following pictures.

At 180,



https://drive.google.com/file/d/1LQfvC1vZmd0faboLnpJmYx0ok5YT6Udz/view?usp=sharing


https://drive.google.com/file/d/1hrqO0bovOCBghC8Da-FTtMaBhOaLf-U-/view?usp=sharing


And at -180 or 0



https://drive.google.com/file/d/1f1HVEnEfYJmuyypoSCN8RhwcdaXfHgYh/view?usp=sharing


https://drive.google.com/file/d/1e1ou9MIAFmtwxXt4q8nuZ7p5E8T78AGl/view?usp=sharing

This is fine for the micro servos on the Arduino but not for the exhaust valves.

I hooked up the oscilloscope to the valve controller and came up with the following results.

There is a constant 11-12v signal being produced and when the button on the remote is pushed it looks like the PWM signal drops to around 0V like a reversed PWM signal if that is the correct term. see the following photos.

when the controller is at idle, constant 11-12V.


https://drive.google.com/file/d/16Oi6elP4Dn8oqVMvZdappC09suJVNqC_/view?usp=sharing


When the OFF button is pressed (Valve Closed).



https://drive.google.com/file/d/1lq-EAeitjpsRkRLM4j3EwtbiKrSMtWis/view?usp=sharing


https://drive.google.com/file/d/1UCPo3eMPeBMM2_4ZrB9OSkiiZOCfFUW-/view?usp=sharing


When the ON button is Pressed (Valve open).




https://drive.google.com/file/d/1aZ2VZ-hzyTajETbnBM77nJ-aqyX6u-IL/view?usp=sharing


https://drive.google.com/file/d/1OMwDldNCrwTSCN0ak69UY46zLPuZ0o40/view?usp=sharing


Now to me, the signal looks the same when pressing ON or OFF but if you keep pressing the ON button when the controller is ON you can see the signal on the scope but nothing happens until you press the OFF button and the same goes for the OFF button. When each button is pressed it pulses for around a second and then returns to the constant 11-12v signal.


this is the first time using an oscilloscope so I may be doing it all wrong and hopefully, you guys can point me in the right direction if so.

Now the big question is..... Can I replicate the frequency and duty cycle of the valve controller and place it in the correct places in my code?

I basically want to control the valves with a momentary push button and in the future ad geofencing and time disable (Valve Closed) so not to wake the neighbours on early morning starts.

I have found a link to a BMW site with information of their valves which may be similar to my valves.

https://www.newtis.info/tisv2/a/en/...-electronics/exhaust-emission-system/Im2GgsKi

Kind Regards,
Mike.
 
Last edited:

Thread Starter

s200bym

Joined Aug 9, 2017
82
hi s200,
Why don't you post your images here, as attachments to your posts, rather than links.??
E

Hi @ericgibbs

I did insert an image link from a hosted site but they don't seem to show up. I'll try the links I used on the Arduino forum and see if they work.

Edited: Arduino forum links worked.

Mike.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi G,
I can access your images by clicking the links.
If you do manage to post the images here, I would suggest you use attachments rather than full images.
It makes it so much easier for anyone trying to help.;)
E
 

alecz2008

Joined Oct 17, 2019
3
Great project. Have the same problem....
I cannot get the valve control to move.
Don't even know how to connect to the valve controller. 12v, GND, and PWM

What frequency for the PWM ?
Is it in kHz range ?

Do I have to switch the PWM pin to ground from 12V ?

I really appreciate every hint ....
I would like to use Arduino with 5V PWM digital output and put a transistor to switch the 12V to ground....

Am I far from being successful ?

Thanks
Alex
 

danadak

Joined Mar 10, 2018
4,057
"Normally" in these interfaces the PWM is a logic level signal, 3.3 or 5V,
you need to consult the datasheet of the device you are trying to control.

If its 12V then this would be circuit you should consider -

1571824370965.png



Transistor just a general purpose one capable of handling load current (in this case of the relay).
The 10K on the base keeps transistor off when Arduino starts up and output pin is tristated.



Regards, Dana.
 

shortbus

Joined Sep 30, 2009
10,045
If its 12V then this would be circuit you should consider -
Are you sure about that? The device, an exhaust cut out, is like a RC servo motor. The PWM is needed going to the contacts in and out of the relay,not the coil of the relay. The PWM frequency tells the servo how far to open. It looks like the circuit shown would just make the contact of the rely wear out fast. Or maybe I'm missing some thing in the circuit shown?
 

danadak

Joined Mar 10, 2018
4,057
Are you sure about that? The device, an exhaust cut out, is like a RC servo motor. The PWM is needed going to the contacts in and out of the relay,not the coil of the relay. The PWM frequency tells the servo how far to open. It looks like the circuit shown would just make the contact of the rely wear out fast. Or maybe I'm missing some thing in the circuit shown?
The relay was just a load example, if PWM input is 12 V change relay to a load R,
and that will produce a PWM pulse 12V in amplitude.

Post link to valve.

Regards, Dana.
 

shortbus

Joined Sep 30, 2009
10,045
Post link to valve.
Would if I could, but neither the TS or the hijacker gave any ideas of what they have. The only type I have experience with just used a DPDT center off switch to open and close them. But do know that some use a remote type controller.
 
Top