How can I make an automated ball pitching machine?

Can anyone show or tell me how to make a ball pitching machine, similar to the ones they use for practicing baseball and tennis? I want to make one for my dog. Thanks for your help in advance.