A print timing signal generation method for generating a print timing signal that defines a timing at which ink is ejected from a print head in a printing apparatus including a print head configured to eject ink onto a printing medium, a moving mechanism configured to relatively move a positional relationship between the print head and the printing medium, an encoder configured to output a pulse at a cycle corresponding to a moving speed that is a speed at which the moving mechanism relatively moves the positional relationship, and an internal clock generating circuit configured to generate an internal clock at a constant cycle, the print timing signal generation method comprising:
- measuring a length of each of unit periods by counting a number of internal clocks, the unit periods each being a period from a rising edge of a pulse outputted from the encoder to a next rising edge, or a period from a falling edge of a pulse outputted from the encoder to a next falling edge;
- generating, based on a length of a first unit period that is a unit period one preceding, a reference signal corresponding to a signal obtained by multiplying a frequency of the print timing signal;
- generating the print timing signal based on the reference signal and a multiplication setting value that is a setting value of a multiplication factor representing a relationship between the frequency of the print timing signal and a frequency of the reference signal;
- calculating, based on the length of the first unit period and a length of a second unit period that is a unit period two preceding, a position deviation amount caused by a difference between the moving speed in the second unit period and the moving speed in the first unit period;
- calculating a cumulative position deviation amount by accumulating the position deviation amount;
- and
- adjusting the multiplication setting value based on a result of comparing the cumulative position deviation amount with a predetermined threshold,
- wherein in the generating the print timing signal, after the print timing signal one preceding is generated, the print timing signal is generated when a number of times the reference signal is generated becomes equal to the multiplication setting value.