0

I'm trying to drive symmetrical voltmeter with not-so-symmetrical voltage divider. PWM is working as a charm, but I have problem with rest of the circuit. I can't really control voltage in a voltmeter, its always around -5V or 5V. How can I improve this circuit to make it work?

Here's the link:

schematic

Jump3r
  • 103
  • 4
  • Well, square gen should be 2.5V amplitude, 2.5V DC offset. – Jump3r Jan 11 '18 at 09:20
  • You can embed an image rather than have a link that doesn't work. Use the little mountain/sun symbol above the text entry box to drop an image in. – Andy aka Jan 11 '18 at 09:28
  • 1
    BTW I took a look at the image and it's really not clear from the image or the text or both what your question is. – Andy aka Jan 11 '18 at 09:30
  • Fixed link using html link. Should be fine now. – Jump3r Jan 11 '18 at 09:35
  • That voltmeter in simulator is basically open circuit, if you are talking about zero-center ammeter used as voltmeter then you can roughly represent it with resistor, which has resistance close to the resistance of your device. – Vadimchik Jan 11 '18 at 10:19
  • Besides your H-bridge circuit is completely wrong. You should use both NPN and PNP transistiors. – Vadimchik Jan 11 '18 at 10:23
  • @Vadimchik, I'll try using resistor then. Why I can't use only npn transistors? I'm controlling them by Atmega, so I have quite good knowledge what's going on with voltage on them. – Jump3r Jan 11 '18 at 16:18
  • @Vadimchik Using both NPNs and PNPs is not strictly a requirement, all-NPN bridges work just as well, provided you manage to drive the upper BJTs into saturation (which is not the OP's case). – Dmitry Grigoryev Jan 12 '18 at 12:04

1 Answers1

1

Having quite good knowledge on what's going on with voltage on transistors won't help you if you do not know how transistor really works. You expect all transistors to work as a switch, but they won't if you leave circuit like that.

schematic

simulate this circuit – Schematic created using CircuitLab

You have following errors: Transistor Q5 will work as emitter follower (it will not go into saturation as in switch mode). When PWM source on it's base goes to the high state(5v) it may be represented as voltage source with (5 - 0.7) V and internal resistance equal to R5. So voltage on the collectors of the Q1 and Q3 transistors will be something around 4.3 volts. Q1 and Q3 are emitter followers again. But the voltage on it's collector is already 4.3v (and mind the voltage drop on the R5) and emitter-to-ground circuit contains your load resistance (I've met electomechanical ammeters with internal resistance 750 to 4k Ohms) so Q1 and Q3 will not go into saturation when you expect. It may be not so critical if you use it with measuring instrument which have relatively low current consumption, maybe it even will work SOMEHOW (I am not sure) with BJTs in linear modes. But if you want to drive heavy load this circuit is only good for burning transistors. Instead you better try this:

schematic

simulate this circuit

Connecting one GPIO pin instead SW1 you can control polarity of the voltage and put the PWM output to other half-bridge. In this configuration all transistors work as a switches. However be aware of shot-through which may happen if there is no voltage source attached instead PWM or SW1. In that case current can flow through Q3 collector-> Q3 base->R1->R2->Q1 base->Q1 collector same applies to other half-bridge(Q3 R3 R4 Q4). This can open lower and upper transistors simultaneously which will result in a short between ground and positive supply. You can avoid this by setting corresponding bits in DDR and PORT registers just after initialization. Other way is to use 4 ATMega pins instead of 2, thus avoiding this situation. You can use 2 regular GPIO pins to control direction (Q3 and Q1) and 2 PWM pins, that resides on the same timer (they are called in following manner: OC1A and OC1B for Timer1), which will generate inverted PWM signals.

Vadimchik
  • 199
  • 6