tac

package module
v0.0.0-...-fca637f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 3 Imported by: 0

README

TAC

This tool computes valves amplifer electronic stuff. It also exposes formulas as a package.

Usage

$ tac tac.yml --verbose

Heaters:
- 6L6GC:   2 * 900mA = 1.8A
- ECC81:   1 * 300mA = 300mA
- 6SL7:    3 * 300mA = 900.0mA
Choke: 5.39H
Power consumed:
- Wa: 60W      - for 2 valve(s) in PP
- Ia: 130.2mA  - at plate for 2 valve(s) in PP
- Is: 10.7mA   - at screen for 2 valve(s) in PP
Preamp consumed:
- ECC81:   typical: 2 * 10mA = 20mA
           maximum: 2 * 8.3mA = 16.7mA (5W)
- 6SL7:    typical: 6 * 2.3mA = 13.8mA
           maximum: 6 * 3.3mA = 20mA (6W)

====

Selected transformer voltage: 350-0-350
Diode Reverse Repetative Maximum (Vrrm) rating: 1.2kV
  -> We knock off 10% to allow for variation in mains voltage, and knock off another 10% to allow for the transformer voltage being high if loaded only lightly.
  -> The popular 1N4007 is rated for 1000V. Two 1N4007 in series can handle 2000v.
  -> http://www.valvewizard.co.uk/bridge.html
Calculated voltage at first capacitor (B+): 479.5V
Calculated DC current at first capacitor: 201mA
Calculated DC wattage at first capacitor: 96.4W
Calculated choke: 5.93H @ 52.09mA (10% plus factored in)
  -> Resonant frequency is kept below 10Hz.
Calculated current: 195.25mA (10% plus factored in) at 6.6kΩ load
  -> Maximum preamp current consumption is used.
Calculated maximal valve(s) wattage: 71W
Calculated filament current (typically the 6.3v secondary): 3A
Calculated cathode bypass capacitor: Ck=35.01µF for Rk=1kΩ @ F=5Hz
Calculated cathode bypass capacitor: Ck=15.92µF for Rk=2.2kΩ @ F=5Hz
Calculated cathode bypass capacitor: Ck=6.25µF for Rk=5.6kΩ @ F=5Hz
Calculated LED resistor: 201.89Ω for 0.089W @ VAC=5.33V

Disclaimer:
  Please, consult your chosen tube model manufacturer data sheet, especially, when you entered the Rload.
  Then the calculation provided is an estimation based on the assumption that Rload is not relatively small!
  Tubes are non-linear devices and current draw may change under a number of conditions!
  This calculation is provided in the hope of being useful as a reference only.
  Proceed with caution! This tool disclaims any responsibility from any intended or actual use and consequences of this calculation.

Thanks:
  This tool is fully inspired by https://thesubjectmatter.com/calcptcurrent.html
  It use formula from Merlin Blencowe's books and its website http://www.valvewizard.co.uk

Specifications

  • Only computes for FULL WAVE rectification
    • Center tap transformer
    • Non center tap transformer
  • The rectifier must have a capacitor input load
  • Preamp tube current consumption may be way greater than the real value because it's based on the maximum power dissipation.

License

MIT

Contributing

All PRs are welcome.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Documentation

Index

Constants

View Source
const PreampValveTypicalVoltage float64 = 250

Variables

View Source
var (
	UnitPico  = math.Pow(10, -12)
	UnitNano  = math.Pow(10, -9)
	UnitMicro = math.Pow(10, -6)
	UnitMilli = math.Pow(10, -3)
	UnitNone  = math.Pow(10, 0)
	UnitKillo = math.Pow(10, 3)
	UnitMega  = math.Pow(10, 6)
)

Unit multiplier.

View Source
var PowerValves = map[string]PowerValve{
	"EL34": {
		Power: 25,
		SingleEnded: Currents{
			Ia: 100 * UnitMilli,
			Is: 14.9 * UnitMilli,
		},
		PushPull: Currents{
			Ia: 100 * UnitMilli,
			Is: 14.9 * UnitMilli,
		},
		If: 1.5,
	},
	"6L6GC": {
		Power: 30,
		SingleEnded: Currents{
			Ia: 72 * UnitMilli,
			Is: 5 * UnitMilli,
		},
		PushPull: Currents{
			Ia: 134 * UnitMilli,
			Is: 11 * UnitMilli,
		},
		If: 0.9,
	},
	"6V6S": {
		Power: 14,
		SingleEnded: Currents{
			Ia: 45 * UnitMilli,
			Is: 5 * UnitMilli,
		},
		PushPull: Currents{
			Ia: 70 * UnitMilli,
			Is: 13 * UnitMilli,
		},
		If: 0.5,
	},
}

PowerValves characteristics. Based on https://www.jj-electronic.com/en/power-tubes

View Source
var PreampValves = map[string]PreampValve{
	"ECC81": {
		Ua:  300,
		Wa:  2.5,
		Wat: PreampValveTypicalVoltage * 10 * UnitMilli,
		If:  0.3,
	},
	"ECC83S": {
		Ua:  300,
		Wa:  1,
		Wat: PreampValveTypicalVoltage * 1.2 * UnitMilli,
		If:  0.3,
	},
	"ECC803S": {
		Ua:  300,
		Wa:  1.2,
		Wat: PreampValveTypicalVoltage * 1.2 * UnitMilli,
		If:  0.3,
	},
	"6SL7": {
		Ua:  300,
		Wa:  1,
		Wat: PreampValveTypicalVoltage * 2.3 * UnitMilli,
		If:  0.3,
	},
}

PreampValves characteristics. Based on https://www.jj-electronic.com/en/preamplifying-tubes

View Source
var Rectifiers = map[string]float64{
	"DIODE": 1.37,
	"GZ34":  1.36,
	"EZ81":  1.30,
	"5U4B":  1.28,
	"5Y3":   1.25,
}

Rectifiers' coef. SQRT(2) = ~1.4 is the ideal coef. Based on https://thesubjectmatter.com/calcptcurrent.html

Functions

func CathodeBypassCapacitor

func CathodeBypassCapacitor(Rk, F float64) float64

CathodeBypassCapacitor computes an approximation of the cathode bypass capacitor value according the given cathode resistor Rk in Ohm and the wanted frequency F in Hertz.

For full baypass, use F = 5Hz

func Choke

func Choke(C, F float64) float64

Choke computes the choke value you should use in your power supply unit.

C is the capacitor value after the rectifier and before the Choke, usually ~47µF.

F is the resonant frequency that we want to keep below 10Hz.

http://www.valvewizard.co.uk/smoothing.html -> Don't forget that the choke must handle the poweramp screen current and preamp current.

func FormatUnit

func FormatUnit(v float64, precision int, unit string) string

FormatUnit returns a pretty print version of the given value.

func LEDResistor

func LEDResistor(VAC, DCForwardVoltage, I float64) float64

LEDResistor computes the resistor value to put in series with the LED.

func Load

func Load(DC, power float64) float64

Load computes output transformer load.

func PowerCurrent

func PowerCurrent(v PowerValve, topology string, n int, DC, Rload float64) (Ia, Is float64)

PowerCurrent computes the maximum current consumption for the given n triode.

http://www.valvewizard.co.uk/pp.html http://www.valvewizard.co.uk/smoothing.html (Design Example)

func PowerRI

func PowerRI(R, I float64) float64

PowerRI computes the power for the given R and I.

func PreampCurrent

func PreampCurrent(v PreampValve, U float64, n int) float64

PreampCurrent computes the maximum current consumption for the given n triode.

func RectifierDiodeRating

func RectifierDiodeRating(U1, U2 float64) float64

RectifierDiodeRating computes the Reverse Repetative Maximum (Vrrm) rating that excess the peak AC voltage. For a tap-center transformer like 350-0-350, U1=350 and U2=350. For a normal transformer like 0-350, U1=0, U2=350.

http://www.valvewizard.co.uk/bridge.html

The popular 1N4007 is rated for 1000V. This corresponds to an AC voltage of 1000V/1.4 = 714Vrms. However, we should knock off 10% to allow for variation in mains voltage, and knock off another 10% to allow for the transformer voltage being high if loaded only lightly. Therefore, we can't use the 1N4007 if the (advertised) transformer voltage is greater than 580Vrms.

func SmoothingCapacitor

func SmoothingCapacitor(R float64) float64

SmoothingCapacitor computes the capicitor value to put after a voltage dropping resistor.

func Tolerance

func Tolerance(v float64) float64

Toloreance adds a 10% of error factor.

func TransformerCurrentFWC

func TransformerCurrentFWC(Uac1, Uac2, Iac float64) float64

TransformerCurrentFWC computes an approximation of the transformer's DC current after Full Wave rectifier with a Capacitor input load. https://www.hammfg.com/electronics/transformers/rectifier

func Vpp

func Vpp(U float64) float64

Vpp computes the peak-to-peak voltage of an AC voltage.

e.g. 230VAC is about 325Vpp.

Types

type Currents

type Currents struct {
	// Anode/Plate current in Ampère.
	Ia float64
	// Screen current in Ampère. Ig2 in JJ datasheets.
	Is float64
}

type PowerValve

type PowerValve struct {
	Power       float64
	SingleEnded Currents
	PushPull    Currents
	// Heater current.
	If float64
}

type PreampValve

type PreampValve struct {
	// Maximum anode/plate voltage.
	Ua float64
	// Maximum power dissipation.
	Wa float64
	// Typical power dissipation (Ua*Ia from typical characteristics)
	Wat float64
	// Heater current.
	If float64
}

Directories

Path Synopsis
cmd
tac

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL