A machine for producing and dispensing liquid or semiliquid products for use as food (or foodstuffs), comprising: - a holding vat for a liquid base product; - a treatment circuit for said liquid base product, in order to obtain a liquid or semiliquid foodstuff, said treatment circuit comprising at least one heat-adjustment system for adjusting one or more values associated with the temperature of said base product, intermediate products and/or finished product; - dispensing means for distributing said foodstuff; wherein said heat-adjustment system comprises a thermal circuit within which a thermal fluid circulates, and equipped with: a compressor, a condenser, an electronic expansion valve, and an evaporator, said electronic expansion valve being interposed between said condenser and evaporator, wherein said heat-adjustment system further comprises a control unit acting on said electronic expansion valve for adjusting a passage section of the valve through an electronic command signal, said control unit being configured for: - determining a main parameter representative of the instantaneous overheating of the thermal fluid coming out of the evaporator, wherein said main parameter is determined as a function of a difference between the temperature (Tout) of the fluid coming out of the evaporator and the saturation temperature (Tsat) of the fluid coming out of the evaporator; - determining a reference parameter (SHset) for said overheating, the value thereof being the value that the instantaneous overheating should take to enable the foodstuff to reach or keep the desired temperature; - generating said electric command signal as a function of a comparison between said main parameter and reference parameter (SHset); said machine being characterized in that, in said control unit, said reference parameter (SHset) - is determined as a function of a predetermined value (SHmin), and of an auxiliary value depending on the variation in time of the temperature (Tout) of the fluid coming out of the evaporator and of the saturation temperature (Tsat) of the fluid coming out of the evaporator. - a holding vat for a liquid base product; - a treatment circuit for said liquid base product, in order to obtain a liquid or semiliquid foodstuff, said treatment circuit comprising at least one heat-adjustment system for adjusting one or more values associated with the temperature of said base product, intermediate products and/or finished product; - dispensing means for distributing said foodstuff; - determining a main parameter representative of the instantaneous overheating of the thermal fluid coming out of the evaporator, wherein said main parameter is determined as a function of a difference between the temperature (Tout) of the fluid coming out of the evaporator and the saturation temperature (Tsat) of the fluid coming out of the evaporator; - determining a reference parameter (SHset) for said overheating, the value thereof being the value that the instantaneous overheating should take to enable the foodstuff to reach or keep the desired temperature; - generating said electric command signal as a function of a comparison between said main parameter and reference parameter (SHset);