- Ahmet Samet KOŞUM S5635830
- Mustafa Melih TOSLAK S5431021
- To design an interactive simulator of a hoist with two degrees of freedom (2 d.o.f)
- To develop two different consoles for user interaction with the hoist
- To simulate the motion of the hoist along the X and Z axes with user commands
- To simulate the real-time position of the hoist and report it on the inspection console
- To simulate environmental effects on the motion of the hoist
- To provide emergency stop (S) and reset (R) functionality
- To simulate the motion of the hoist along the X and Z axes with two separate processes (motor X and motor Z)
- To develop a watchdog process to monitor the overall system and reset it in case of inactivity for a certain period of time (60 seconds)
The project aims to control a hoist with two degrees of freedom, allowing the user to input commands to control its movement. The hoist has two motors: one for movement on the x-axis and the other for movement on the z-axis.
The first window is the command console, where the user can input commands by clicking on buttons. There are six buttons in total: three buttons each for controlling the velocity on the x-axis and z-axis. The velocity steps can range from -2 to 2 with two velocity steps. The command console also includes two pipes to send inputs to the motor x and motor z processes.
The second and third processes are the motor x and motor z windows, respectively. The pipes from the command console are read and the inputs received. The velocity and position of the hoist are then calculated every second. Pipes are also created to send the position values to the world console.
The fourth process, the world , receives data about the position from the motor x and motor z processes. It simulates the real-life behavior of the hoist, taking into account environmental factors such as friction and wind by adding random values to the received data. The updated "real position" is then sent to the inspection console via a pipe.
The inspection console is used to show the movement of the hoist to the user. It includes two important buttons: "R" (Reset), which moves the hoist to its initial position on the x and z axes, and "S" (Stop), which stops all processes immediately.
The sixth and final process is the watchdog, which kills all processes and itself if no buttons are pressed for 60 seconds.
1- Install the ncursers Library:
sudo apt-get install libncurses-dev
2- Change the permissions of .c files inside the src/ folder to be executable by running:
chmod +x *.c
3- Change the permissions of .sh files inside the ARP_Assignment_1/ folder to be executable by running:
chmod +x compile.sh
chmod +x run.sh
4- Compile the code by running:
./compile.sh
6- Run the code by typing:
./run.sh
In the event that any unusual issues arise after starting the application, such as buttons not appearing in the GUI or graphical elements appearing misaligned, simply try resizing the terminal window as a solution.
The project has successfully achieved its goal of allowing the user to control the movement of a hoist with two degrees of freedom. By using the command console, motor x and motor z processes, world console, inspection console, and watchdog process, the movement of the hoist can be accurately simulated and monitored.