Abstract. Four dimensional cone beam computed tomography (4DCBCT) uses a constant gantry speed and imaging frequency that are independent of the patient's breathing rate. Using a technique called Respiratory Motion Guided 4DCBCT (RMG-4DCBCT), we have previously demonstrated that by varying the gantry speed and imaging frequency, in response to changes in the patient's real-time respiratory signal, the imaging dose can be reduced by 50-70%. RMG-4DCBCT optimally computes a patient specific gantry trajectory to eliminate streaking artefacts and projection clustering that is inherent in 4DCBCT imaging. The gantry trajectory is continuously updated as projection data is acquired and the patient's breathing changes. The aim of this study was to realise RMG-4DCBCT for the first time on a linear accelerator.To change the gantry speed in real-time a potentiometer under microcontroller control was used to adjust the current supplied to an Elekta Synergy's gantry motor. A real-time feedback loop was developed on the microcontroller to modulate the gantry speed and projection acquisition in response to the real-time respiratory signal so that either 40, RMG-4DCBCT 40 , or 60, RMG-4DCBCT 60 , uniformly spaced projections were acquired in 10 phase bins. Images of the CIRS dynamic Thorax phantom were acquired with sinusoidal breathing periods ranging from 2s to 8s together with two breathing traces from lung cancer patients. Image quality was assessed using the contrast to noise ratio (CNR) and edge response width (ERW).For the average patient, with a 3.8s breathing period, the imaging time and image dose were reduced by 37% and 70% respectively. Across all respiratory rates, RMG-4DCBCT 40 had a CNR in the range of 6.5 to 7.5, and RMG-4DCBCT 60 had a CNR between 8.7 and 9.7, indicating that RMG-4DCBCT allows consistent and controllable CNR. In comparison, the CNR for conventional 4DCBCT drops from 20.4 to 6.2 as the breathing rate increases from 2s to 8s. With RMG-4DCBCT, the ERW in the direction of motion of the imaging insert decreases from 2.1mm to 1.1mm as the breathing rate increases from 2s to 8s while for conventional 4DCBCT the ERW increases from 1.9mm to 2.5mm.Image quality can be controlled during 4DCBCT acquisition by varying the gantry speed and the projection acquisition in response to the patient's real-time respiratory signal. However, although the image sharpness, i.e., ERW, is improved with RMG-4DCBCT, the ERW depends on the patient's breathing rate and breathing regularity.