Here is a constant current generator circuit. It is a bit more fancy than necessary for this application, but it is still reasonably simple to build and the components are low cost.
ERRATA
(1) Change R4 from 0R022 to 0R025
(2) Change R1 from 84K09 to 74K
CIRCUIT DESCRIPTION
(1) N1, a precision RRIO opamp, is part of a feedback loop which adjusts the voltage on the gate of the PMOSFET, Q1 to keep the voltage drop across R4 the same as the reference voltage across R1, which is 100mV. RRIO= Rail to Rail Input Output, which means that the opamps inputs work normally from the negative supply line to the positive supply line and the output voltage can swing from the negative supply line to the positive supply line.
(2) By Ohms law, 100mV across 25mOhm gives 4A which will flow out of Q1 drain. As the source and drain currents of a MOSFET are the same, the circuit produces a constant current of 4A from the drain of Q1.
(3) The string of three TL431s probably looks a bit odd but it gives a better accuracy and lower current consumption than using one TL431 and two precision resistors (TL431s have a rather high control current of 4uA worst case). Each TL431 is wired as a 2.5V Zener to give a total reference voltage of 7.5V, which is also the supply line voltage for the opamp. The TL431 are jelly bean price so the seeming extravagance is justified.
(4) Q2 and Q3 also form a constant current generator, in this case of 3mA. This current biases the three TL431 voltage references at around 1.5mA and provides the supply current for the opamp. Having a constant current supply means that the circuit consumes a constant current of 3mA regardless of input supply voltage.
(5) R1 and R2 simply divide the 7.5V reference voltage to feed 100mV to the non inverting input of the opamp, N1.
(6) The circuit may look a bit odd because the reference voltage is referred to the positive supply line rather than the 0V line, but this arrangement is quite normal and is used extensively in electronic circuits especially inside integrated circuits. The opamp does not care where it gets its input voltages from. All it cares about is making sure both of its inputs are exactly the same, in the case of the OPA192 within +-5uV nominal, by adjusting its output voltage, The OPA192 effectively takes no input current so there are no errors caused by input current (unlike the TL431s).
NOTES
(1) At 4A the dropout voltage (overhead) will be around 200mV
(2) The current accuracy is +-0.2% plus the errors due to R1, R2, and R4
(3) The input voltage range is 8.5V to 55V which is limited by the VDS of the PMOSFET, Q1
(4) The output voltage range is 0V to 54.8V
(5) The circuit current consumption is 3mA irrespective of input and output voltage.
(6) The limiting factor is the dissipation in PMOSFET Q1. With a suitably large heatsink, 50W would be possible. This means that at 4A constant current the maximum Q1 VSD is 50/4 =12.5V
(7) R4 is a 'four terminal' resistor to ensure accuracy. As standard four terminal resistors are expensive, you can wire an ordinary two terminal resistor as a four terminal resistor to get a close approximation.
(8) R16 is a gate stopper to prevent the PMOSFET from oscillating at high frequency. R16 should be connected directly to the gate terminal.
(9) The layout and connections should be as shown in the schematic to ensure accuracy and frequency stability.
(10) The capacitors play no part in the fundamental operation of the circuit. Instead they provide decoupling, except for C3 which tailors the open loop frequency response to ensure frequency stability. All capacitors should be physically connected as shown on the schematic.
(11) All capacitors are +-10% ceramic X7R dielectric types. The 22uF types should have a voltage rating at least 10% above the maximum input voltage, remembering to take into account any ripple voltage. But C3 need only be 10V or more. The 100nF capacitors should have a voltage rating of 10V or more.
(12) R1 is the theoretical value to give a 4A constant current and can be made up from 62K and 12K resistors in parallel.
(13) The PMOSFET, Q1 was originally made by International Rectifier but they were formally taken over by Infinion in January 2016, so you may see the manufacturer variously described as International Rectifier or Infinion. Infinion are progressively changing the IR data sheets to Infinion, but the technical data is unchanged.