Good tip for the Lexmark All-in-one inkjet printer owners (mine is the X6170):

Lexmark Hardware Error 0502After some months of use, your printer might get the habit of stopping in the middle of a page and showing “Hardware Error 0502” on the LCD display. If you leave the printer alone for a while, it might start printing again. Then again, it might not. Pretty annoying.

The Lexmark support site will let you power off, remove the power cord for 30 seconds (!!), take out the cartridges and fiddle with some encoder strip. This whole procedure might take you up to 30 minutes and it will not help (been there, done that).

The real answer is given by a person called ‘clem’:

Lexmark metal barHardware Error: 0502.

On the multi function machine seems to be a coating on the metal rod that the cartridges travel on. Just wipe this rod with a kleenex and the problem seems to go away. Somehow it presents a drag on the cartridges and causes an error.

Clem
(from fixyourownprinter.com)

This works! Clean the sucker with a paper towel (another page talks about re-lubricating the thing, but that was not necessary in my case). The towel will be black (ink residu, presumably), but there you go printing to your heart’s desire again.
Lexmark problem solved
A big thank-you to Clem, Google and the wisdom of crowds!

UPDATE: also seems to work for some Dell printers (some of them are manufactured by Lexmark)