I am trying to make a system that can launch a ball kind of like how a catapult would do. I'm going to be using an Arduino and an H-bridge with PWM but I'm not sure how I can control both speed and position. I want to be able to launch the ball so it is perfectly horizontal at a set speed.
I'm frankly not that great at understanding control systems beyond how to calculate transfer functions. Does anyone know how I can set up code in Simulink so that I can get my system to be going at the desired speed at a set position, and then reverse the direction of the motor so that the ball releases at that point? Would I just use PIDs or would I have to include blocks that have the rest of the motors transfer function?
I've included a picture of my current Simulink code which uses 2 PIDs, one for speed control and one for position control, but I think this is wrong because both would interfere with each other. My system reads encoder values from 2 channels on the motor to get the position and angular speed.