He first talked about the principles of a calculating engine in a letter to Sir Humphrey Davy in 1822 . He first discussed the principles of a calculating engine in a letter to Sir Humphry Davy in 1822 .