Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Inverting pwm signal

Status
Not open for further replies.

Dakta

New Member
Just wondering what the best approach is to take regarding detecting and inverting a pulse width modulation signal.

The complication is that it operates on a switched earth with a constant voltage, rather than switching the voltage.

I thought of perhaps using a microcontroller with a pin pulled up connected between the load's earth and the mosfet used for connecting it to ground, but wouldn't this drop the voltage across the device?

Got to be a simpler way, the pwm is a typical high frequency motor driving setup running at 12v.
 
Last edited:
Sorry chaps, think I might have confused you.

When I say invert, I mean invert the polarity, not the duty. Just so we're clear!


Anyway, I thought about it...and I thought about it, and I came up with this:

**broken link removed**

The switch is a manual 'duty cycle simulator' to simulate the original duty cycle, the resistor is a false load, where the original load used to be, the mosfet is there to invert the signal, and the lamp is now the 'load' .

Basically how it works is when the switch is 'off', there is no earth connection so the gate is pulled high, meaning the lamp is one, and vice versa.

Reckon it'l work? seems to simulate ok.
 
Since the Mosfet needs to have its gate at least 4.5V higher than its source then the 12V light bulb in your circuit will barely glow with a voltage of only 7.5V.

The circuit does not invert because it is a source-follower.

You should use the Mosfet as a switch with a very low voltage loss. But then it will be an inverter.
 
Bugger, back to the drawing board.

Could I cheat and run the source through a voltage divider made of resistors to make the 4.5v gap between source and gate?

I don't know if that makes sense actually...i'll give it some thought tomorrow.
 
Last edited:
Please learn something about electronics and about Mosfets.

You have the light bulb connected to the Source pin when it should be connected to the Drain pin. Then it will be a low loss switch. But it will invert the signal.
 
Last edited:
Please learn something about electronics and about Mosfets.

Now now, there's no need to be rude, i'd rather have no help than a cocky response.

(Yep, it means a lot of jobs get left undone, but standards are standards). The value of the project is such that I won't bear the cost of being spoken down to. This forum is useful which is why I come here, but I will find better, more informative sources of information if my question is a chore to you.

I do appreciate what you're saying though and I'll give it a try. I hope I misinterpreted your post.
 
Last edited:
Now now, there's no need to be rude, i'd rather have no help than a cocky response.
Most of us are experts because we learned about this stuff. You aren't because you didn't.
I am tired of teaching nOObies (most from India) because I am not a teacher.

We usually talk about very complicated electronic circuits here, not about a simple Mosfet wired so its output voltage is too low.
 
You can always go away.

I don't mean off the forum, I just don't have the time of day for people with attitude.

I don't want to argue with the likes of you, I just want assistance. If you are loathed to give it then we're simply not a match, and you're wasting my time as much as you think I'm wasting yours.

I want to learn electronics, but only within the scope of my projects. This is not actually a project, just a problem I've got to solve with the design element of someone elses equipment and I just thought I might learn something with solving it.

Many on here will be electronic engineers, I assume. I'm not, my work is with computer maintenance, and I also work with engines. The engine element is what brought me to electronics as I do a lot of software disassembly for the ecu's I tune, and I recallibrate the fuelling tables etc for performance.

I hope it doesn't dissapoint anyone to say that I don't want to be a fully fledged electronics engineer, I have a lot of respect for you all, and it might be where my interest is, but unfortunately it isn't where my expertise is. Im sorry that's causing difficulties.

I turned to electronics because it had the potential to solve a few control options I was going to face. I could have done it with pneumatics and valves, but I thought getting to grips with this would give me more scope for the future. problems I might face tomorrow. I'm not a quick learner. This forum has been a good aid.

Anyway, heated discussion is not what I came for. So like I said last post, keep your thoughts to yourself. You can think of me what you will, but I'd prefer them private.

You arn't a teacher, and yo arn't paid to teach. You are only obligated to write, or contribute what you want.

You don't have to help with the simple stuff, so I don't see why it bothers you so. Going away is a perfectly good option, it'd help us both (and avoid the row).

If this forum is ill designed to get assistance, then so be it. I'll get over it. But rudeness will just get it ignored because it's just daft and childish.

Like I said before, I'd rather not have an answer because people don't want to answer such a simple concept, than have to deal with a group of grouchy electronics enthusiasts who can't contain their manners.

Ideally, someone would help, and this discussion wouldn't be here. But it's okay if it's not to be, i'll get my information somehow. It's not the end of the world kid.

The real shame is I've just lost faith in what I thought was a good forum. I have integrity I don't blame the forum for you, but it does put a damper on the atmosphere. Well done.

Anyway sorry for the long and heavily edited post, I try not to let unpleasantries get to me, I try to be balanced but being honest this attitude has knocked me off my horse a bit, I thought we were okay here so I'm more taken aback than 'pissed orrf'.

Oh well. I suppose I could've met you in the street.
 
Last edited:
Maybe you can tell us more about what you want to do. Why are you trying to invert a PWM signal, it's such an unusual request. What are you actually driving? What are the voltages and currents involved. Your simple FET circuit won't do much, but if you provide more details, we might think of something that will work.
 
I'll explain, but I left it out in case it caused more confusion on here, I don't know if we have any petrolheads on here.

Basically I've disassembled the software on a vehicle ecu (intel 8051), and I've got the control routine for the physically blanked off EGR valve, which controls an actuator using a pwm signal to a vacuum solenoid which pneumatically positions it based on the duty cycle.

The duty cycle is decided by PID loop, and the setpoint is decided by a 3d lookup table with fuel injected quantity on one axis, engine speed on the other. The setpoint is basically the air mass that is seen by a sensor on the engine's air intake.

So, this lookup table basically sets an ideal airmass, and the actuator is positioned to acheive this airmass by opening a valve.

Now I want this actuator to control a valve for another purpose. The axis on the lookup table are perfect, and the control loop is tuned well for this purpose, as the other device being controlled is also vacuum actuated, (a turbocharger).

Basically I want the turbocharger to respond to airflow into the engine, instead of the egr valve.

are we clear?

The problem is this - the egr valve reduces airflow when it is on. The turbo increases airflow when it is on.

So whilst the lookup table is perfectly designed for my purpose, the calculated duty is always exactly opposite what I need.

The voltage is 12v, and the current is <1A

I'm comfortable with basic microcontrollers, so had the pwm signal being a switched positive I think I would have been fine on my own and I might even have stuck an lcd on so I could measure and monitor the duty.

However it's a switched earth and was outside my known abilities, so I thought i'd ask here.

As for my mosfet circuit, that was just an afterthought. I tried to do research as well as asking questions and that came to me. I don't know why, clearly it's just caused a lot of aggro.

It's a shame really, I know there's a lot of professionals on here, but I don't think it makes it right to put people down.

I get asked a lot of daft questions in my time too, just mostly on diesel injection characteristics not bloody mosfets. It's never an excuse to be rude though.

I could always just buy a controller, (and I could). but it's no good to me. What do you learn from that.

I'm a good all rounder, I don't have many hobbies but a lot of my pasttimes are built from problems I have to solve. I've enjoyed my pic work so far. I try and learn whatever I need to do to do whatever I'm wanting to do. I'm rarely an expert on any one subject, but I'm not poorly educated.

A lot of my triumphs are therefore attributed to people who have given me a helping hand. That is true. But I've always benefited from this as I gain permanent knowledge.



And I don't and won't suffer fools.
 
Last edited:
I just don't have the time of day for people with attitude.
Only poor Black American people talk about "attitude".

I don't want to argue with the likes of you, I just want assistance.
I want to learn electronics.
There should be a special forum for new kids like you (most are from India) who know nothing about electronics. Most of us learned it in University.
Some people here are actually real teachers and they might teach you. But watch out for the new kids who give wrong advice.

Good luck.
 
Dakta:

I'd take critical comments from folks like Audioguru, Mike K8lH, Pommie, Blueroomelectronics etc. as constructive. Don't feel insulted if you're told to go read up a bit first and then ask.


You see u are asking about the very basics of a MOSFET switch. Seeing that u have a simulator, why didn't u try another configuration or two 1st? If u don't understand how to configure a MOSFET, u can say so and we'll point u to where u can learn it.

having said that:

Here's where u can get useful details without too much reading.

Electronics Demonstrations
 
MOsaic, I disagree. There is no reason to be abusive, not to mention racist.

Let's try to be gentlemen.
 
Last edited:
Well perhaps Audioguru is being a bit gruff but I don't know abt the racist bit.
I am of 100% Indian heritage and I don't feel insulted by the India comment.

I have seen for myself the number of new members from that part of the world who don't ask but demand wholesale solutions since they don't want to spend the time to understand.
 
Just to recap, I'm very british, I've done university and, well for what it's worth, unless I've been stood in the stack of a class 28 cobo when it's been test-fired, I certainly ain't black.

This is me:

**broken link removed**

You are right though, I'm a youngun. And you are also right that I didn't study electronics at university, though in all fairness I found it so interesting it might have been better and more useful than management.

Right, onto the simulator, beleive it or not, my circuit works. The voltage when on is reduced to 10, but other than that it inverts perfectly. Try it.

Now I assumed audioguru was telling me to 'swap the mosfet around, dummy' (I might be wrong) but I tried that too, and the mosfet stuck on.

I'm not stupid, it was probably my misunderstanding of what audioguru was trying to say rather than his mistake, but you can appreciate I'm not going to press him further. As tempting as it is in human nature, arguing out our difference isn't going to solve my problem, and I'd rather have the solution, than prove a point against whoevers attacking my knowledge next.
 
Last edited:
are we clear?

Not even close :p I'm just gonna punt and assume what you said makes sense. Do you know there is a circuit element that does nothing more than invert the signal from the input to the output? The are called logic inverters, like the 4069 or 74HC04. They run at a maximum 5 - 5.5V, and are suceptible to power spikes that are often encountered in automotive electrical systems. Otherwise, you can use a small FET or BJT, but you have to connect the output to the drain or collector to get the inverted output. These transistors will run at hight voltages and are a little more rubust in hostile environments.


You still haven't told us what your voltages and currents are.
 
Well perhaps Audioguru is being a bit gruff but I don't know abt the racist bit.
I am of 100% Indian heritage and I don't feel insulted by the India comment.

Whether you were insulted or not, there is no reason for racist comments. What do they have to do with electronics? Or helping people?

We can be gentlemen and sill be helpful.
 
Last edited:
It's 'almost' what I want. And I appreciate the suggestion.

The solenoid I'm trying to control has a permanent live feed. Always on.

The negative, however, is modulated by pwm. Basically it connects to ground when the duty is high, and is 'floating' (not sure if thats the right term) or 'disconnected' when the duty says it should be low.

Therefore I'm not sure if whats on the page can do it, as you arn't converting a voltage perse, you're converting an 'intermittant connection to ground' into your regular pulsed duty cycle.

Think of it like connecting a lamp to 12v then tapping out morse code by tapping the negative lead against ground.

I've used mosfets in this configuration before without a problem, with a permanent live feed through the load, with a mosfet connecting it to ground when the gate is high. Not had a problem.

What I haven't done before is try to interpret this 'intermittent earth connection' and invert it, so a 30% duty becomes 70% etc.

I don't really mind whether the output is a pulsed earth or a pulsed positive. But a pulsed earth is the input, with a fixed 12v feed as the reference so to speak.
 
Last edited:
Anyway to recap, running my original circuit on the first page in proteus, when the earth switch is connected (as it would be when the duty is high) I get 0v between the 12v feed and the output earth of the load (the lamp). The lamp stays off.

When this is inverted, and the earth is disconnected (the switch is open, representing the mosfet controlling the earth connection in the ecu is at logic 0) then my mosfet pulls high and the lamp comes on.

true, at 10v not 12v, but it does do the opposite of the input. Which might be why I took the critisism so badly. I don't mind being called an idiot, but it goes down much better when my solution isn't the closest one to a working outcome.

I was expecting to be told something wasn't right with it however, I am NOT a mosfet expert, and the whole point of posting the circuit was for feedbacks sake.

I do appreciate the feedback received, there are good people on here.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top