Power Supply

class Nets.Power

Control voltage and current on net.

set_voltage(voltage)

Set the voltage level on the trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.set_voltage(4.95)
v_in.enable()
Parameters:

voltage (float) -- Voltage in Volts

set_current(current)

Set the current level on the trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.set_current(.4)
v_in.enable()
Parameters:

current (float) -- Current in Amps

set_ovp(voltage)

Set the over voltage limit for net.

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.set_ovp(5.05)
v_in.enable()
Parameters:

voltage (float) -- Voltage in Volts

set_ocp(current)

Set the current level on the trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.set_ocp(.5)
v_in.enable()
Parameters:

current (float) -- Current in Amps

get_ovp_limit()

Query over voltage protection limit

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
ovp = v_in.get_ovp_limit()
print(ovp)
Returns:

over voltage protection limit

Return type:

float

is_ovp()

Query if over voltage protection has been triggered

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
ovp = v_in.is_ovp()
print(ovp)
Returns:

whether over voltage protection has been tripped

Return type:

bool

clear_ovp()

Clear an over voltage condition

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.clear_ovp()
get_ocp_limit()

Query over current protection limit

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
ocp = v_in.get_ocp_limit()
print(ocp)
Returns:

over current protection limit

Return type:

float

is_ocp()

Query if over current protection has been triggered

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
ocp = v_in.is_ocp()
print(ocp)
Returns:

whether over current protection has been tripped

Return type:

bool

clear_ocp()

Clear over current condition

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
v_in.clear_ocp()
voltage()

Query real-time voltage on trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
voltage = v_in.voltage()
print(voltage)
Returns:

real time voltage value

Return type:

float

current()

Query real-time current on trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
current = v_in.current()
print(current)
Returns:

real time current value

Return type:

float

power()

Query real-time power on trace

from lager.pcb.net import Net, NetType

v_in = Net.get('VIN',
            type=NetType.PowerSupply,
            setup_function=setup_net,
            teardown_function=teardown_net)
power = v_in.power()
print(power)
Returns:

real time power value

Return type:

float