Improvements and upgrades of the XRD to SAXS and residual stress measurement had been performed. The XRD machine has been in intensive use for research in crystallography and phase analysis since the 1990's. This instrument is controlled using the kanji version of the NEC computer. Improvements were made to the data acquisition system which includes a motor control and a counting system. The optical system adjustment was made to obtain a narrow and straight beam so that the width of the direct beam was not more than 0.2 degrees on the SAXS section. The Bragg-Brentano configuration with parallel beams optics is used for the measurement of residual stresses. A ψ-goniometer is installed so that the measurement of residual stress by the sin2 (ψ) method can be carried out. Slits of various sizes are used to define the irradiated surface area by the X-ray beam. The SAXS calibration was performed with the standard AgBE (silver behenate) sample. Using the Cu targets, the peaks of the planes (001), (002) and (003) were observed at angles of 1.4°, 3.0° and 4.5°, respectively. The residual stress diffractometer was calibrated using a stress-free and residual-stressed iron sample and the results were compared with the special purpose residual stress diffractometer. Measurements were made in the Fe-α plane (211) with a scattering angle of 156°. The measurement results of the iron samples free of residual stress and residual stress are -6 and -170 MPa, respectively.