Being a founding member of the Astronomical Society, Charles needed a device that could calculate long and tedious astronomical calculations, and thus he came up with the idea of having a mechanical machine to tackle the problem.
Charles began work on his first engine in 1821 and it was called the Difference Engine, it was essentially a calculator and was capable of calculating polynomial functions and outputting the results automatically in table form. Charles planned on having the machine produce up to 20 digits or more, while calculations at the time were rarely carried out to more than 6 digits. This would solve the problem of needing to manually solve long astronomical calculations.
He took the project very seriously, he set up a workshop which was fireproof and went as far as having a dustproof environment just for testing the device, and hiring master machinists to build and assemble his machine.
However, the machine was never completed, problems with financial support from the government, and disagreements between Charles and the engineer that Charles had hired to help build the engine meant that construction had to stop. Based on the designs, the Difference Engine would have had weighed around four tons and stood at eight feet high, and would have had contained at least 25,000 parts.