An apparatus for controlling a voltage of a direct current terminal of construction machinery equipped with a motor (110, 120), the apparatus comprising: one or more inverters (111, 121) connected to one or more motors (110, 120) which convert electric energy into mechanical energy or regenerate mechanical energy to electric energy, respectively, and configured to control the one or more motors (110, 120); a converter connected to an energy storage apparatus storing regenerative power generated by the one or more motors (110, 120) to control the energy storage apparatus; a direct current terminal capacitor connected between the one or more inverters (111, 121) and the converter, and configured to receive power through the one or more inverters (111, 121) and collect the regenerated power through the converter; and a control unit configured to generate one or more inverter demanded voltages demanded by the one or more inverters (111, 121) and a converter demanded voltage demanded by the converter, and configured to variably control a direct current terminal voltage of the direct current terminal capacitor based on the generated one or more inverter demanded voltages and the generated converter demanded voltage, wherein the control unit calculates a maximum demanded voltage among the one or more generated inverter demanded voltages and the converter demanded voltage, and variably controls the direct current terminal voltage of the direct current terminal capacitor according to the calculated maximum demanded voltage, the apparatus charaterised in that the control unit adds a predetermined voltage margin to the calculated maximum demanded voltage, and variably controls the direct current terminal voltage of the direct current terminal capacitor according to the maximum demanded voltage to which the predetermined voltage margin is added. one or more inverters (111, 121) connected to one or more motors (110, 120) which convert electric energy into mechanical energy or regenerate mechanical energy to electric energy, respectively, and configured to control the one or more motors (110, 120); a converter connected to an energy storage apparatus storing regenerative power generated by the one or more motors (110, 120) to control the energy storage apparatus; a direct current terminal capacitor connected between the one or more inverters (111, 121) and the converter, and configured to receive power through the one or more inverters (111, 121) and collect the regenerated power through the converter; and a control unit configured to generate one or more inverter demanded voltages demanded by the one or more inverters (111, 121) and a converter demanded voltage demanded by the converter, and configured to variably control a direct current terminal voltage of the direct current terminal capacitor based on the generated one or more inverter demanded voltages and the generated converter demanded voltage, wherein the control unit calculates a maximum demanded voltage among the one or more generated inverter demanded voltages and the converter demanded voltage, and variably controls the direct current terminal voltage of the direct current terminal capacitor according to the calculated maximum demanded voltage,