Building off of HW 0x02, we are furthering our preparation for our term project by developing a simulation and test a controller for the simplified model of the pivoting platform. Our group decided to attempt both python and matlab to complete this assignment, with the resulting and properly functioning submission to be in matlab, which you will find below. However, you will find our python script linked below as well.
In our simuation, we used the following parameters:
We did not need to design our own controller for this assignment, rather we were given the following gains to test our system performance in closed loop: K = [-0.3, -0.2, -0.05, -0.02] with the units K = [N, N*m, N*s, N*m*s]
Matlab Script:
Simulink:
[Simulation A]
Discussion: The ball is initially placed at the center of the platform, the one stable point in our inherently unstable system. Given that there are no appreciable forces acting on the ball in this simulation, no initial displacements/velocities of the platform or ball, and no torque input from the motor, this system will not deviate from its initial stable point. Therefore, this is a static system, and such behavior is shown by the zero slope lines in all displacement and velocity plots.
[Simulation B]
Discussion: The position of the ball as shown in plot [1,1] shows an interesting tendency to climb the incline, moving a direction opposite the tilt. Given that no force is being put into the ball, this tendency is hard to explain. Using newton’s 2nd law it is conceivable that the ball has an small nonzero acceleration as the platform tilts that acts in a direction opposite the motion of the platform. This is confirmed when we look at the velocity graph, whose change with respect to time is distinctly nonlinear and negative, meaning there is a nonzero, negative acceleration in the direction opposite the rotation of the ball. Frictional effects not being appropriately modeled might also have something to do with this physically inconceivable upward motion.
With the oddity explained, the rest of the ball’s position and velocity graph’s show motion we would expect of an open loop controller. The platform will continue to tilt to greater and greater angles [plot[1,2]] at a higher and higher rate [plot [2,2]], increasing towards instability, the point at which the ball falls off the platform.
[Simulation C]
Discussion: As plot[1,1] shows, the ball starts at a position of x = 0.05m, which drives the plate to tilt clockwise about the y-axis, as shown in plot[1, 2]. The system’s regulator detects this initial displacement and attempts to correct the displacement by driving the motor to oppose the ball’s displacement. As a result, even though the platform’s angular velocity starts negative [clockwise] owing to the ball’s initial displacement [plot [2,2]], the clockwise angular velocity slowly decreases as the torque from the motor opposes the ball’s translation and, by association, the clockwise angular displacement of the platform as well. The effect on the ball’s velocity is shown in plot[2,1], where the counteracting torque applied by the motor to the platform drives the ball’s position to change in the direction opposite its initial displacement.
The above description is for one cycle of the closed loop controller. Owing to mechanical losses and the corrective actions of the regulator, the peaks associated with each oscillation will gradually decrease until the ball is more or less returned to a stable state at the center of the platform, which occurs roughly 20 seconds after the initial linear displacement.