Peter Nachtwey
Member
Our motion controller doesn't need a bias or will take care of that so I didn't include it. The motion controller was directly connected to the motor that turn/tilted the rail. There was no mechanical adjustments for linkage required. There are really only two things that one could get nitt picky about. I didn't model the motor response. I said why. Also, the Kp and Kd are fixed and don't change as function of angle. I ignored this because the angles don't get that big for obvious reasons.Note that, in the simulation, you can get away with PD only because the CV is perfect i.e. CV is θ, so a PID output CV (θ) of 0 is indeed a level channel, so it is ideal, and the output of the PD will be 0 when the ball has stopped (dE/dt = 0) at the setpoint (E = 0). In an actual system, to get an angle of 0, the PID output CV may not be 0, so either an offset bias, or its fraternal twin Integral action (accumulation), will be required.
You have to remember that I was making this simulation for college students and only one knew anything about Runge-Kutta and no one had actually used it in real application where there is a system of non-linear equations. I said that the college students eventually got the system to work using a PD control with the table tennis ball and being very conservative with the gains to keep the rail relatively level and the motion/energy low.
I did need to look up how a ball rolls down a slope without sliding but after that it was pretty straight forward, for me at least.