Supposing I want to measure 1-5A over a range of 1-40V on an ammeter, should I change the shunt resistor every time the voltage changes so that the voltage drop across the shunt resistor stays the same?
No. The meter connected to the shunt is measuring the voltage across the shunt and not the voltage from the PSU. The voltage across the shunt will be proportional to the current through the shunt. If this stays within the shunt specification then all is well.
![schematic](https://i.sstatic.net/9wopt.png)
simulate this circuit – Schematic created using CircuitLab
Figure 1. PSU with shunt and ammeter.
If yes, how do ammeters on lab bench power supplies work over a wide range of voltages?
Again, the meter is reading the voltage drop across the shunt and not across the load.
From the comments:
If the voltage changes, wouldn't the voltage drop across the shunt also change?
Yes, of course, as defined by Ohm's law. So you or the power-supply designer should choose a shunt that is capable of measuring the range of currents of interest. For example, a 5 A bench power supply will give out 5 A max so a 5 A shunt is all that is required.
If the voltage drop across it changes, how would it measure current correctly?
Because if the current through the shunt drops the voltage across the shunt will drop in proportion. V=IR means that for a fixed resistance (the shunt in this case) voltage across the shunt is proportional to current through the shunt.