Welcome to the Space Station project, Robotics Club at IIT Kanpur. This project aims to develop a robotic system capable of precise motion control and efficient data collection using a imu sensor and encoder and pid control.
The project involves multiple aspects of robotics, including:
- Position and Velocity Control of DC Motors: Utilizing PID controllers to achieve accurate motor control.
- Sensor Data Processing: Collecting raw data from an Inertial Measurement Unit (IMU) and applying a Kalman filter for noise reduction and improved measurement accuracy.
- System Setup: Dual booting systems with Windows and Ubuntu 20.04 to facilitate development and installing ROS Noetic for robot control and simulation.
- Hardware Development: Designing and building a 4 Omni Wheel Testbot to test various control algorithms and integration techniques.
- Software Integration: Integrating Arduino IDE with ROS for seamless hardware control and communication.
This README provides a comprehensive guide to the various components of the project, including detailed instructions, code examples, and troubleshooting tips. We welcome contributions from the community and encourage you to get involved in the development of this exciting project.
In this section, we focus on the position and velocity control of DC motors, essential for achieving precise movements in our robotic system.
The control of DC motors involves regulating their position and velocity to meet desired setpoints accurately. We use PID (Proportional-Integral-Derivative) controllers for this purpose, which help minimize the error between the desired and actual motor states.
- DC Motors: The primary actuators for movement.
- Encoders: Used for feedback to measure the motor's position and velocity.
- PID Controllers: Implemented in software to control the motors.
-
Set Up Hardware:
- Connect the DC motor to the motor driver and the encoder to the microcontroller.
- Ensure proper power supply and connections.
-
Configure PID Controllers:
- Implement PID control algorithms in your microcontroller or a connected computer.
- Tune the PID parameters (Kp, Ki, Kd) to achieve the desired response.
-
Write Control Code:
- Read encoder values to get current position and velocity.
- Compute the error between desired setpoints and current values.
- Apply PID control to adjust motor inputs accordingly.
We have provided a comprehensive example of PID control for DC motors in our repository. To use this code, follow these steps:
-
Clone the Repository:
git clone https://github.com/Shivansh-gupta2005/Space_Station_snt-.git
-
Navigate to the Control Code Directory:
cd Space_Station_snt/velocity_control_of_dc_motor.cpp -
Upload the Code to Your Microcontroller: Open the provided Arduino code in the
position_velocity_controldirectory using the Arduino IDE and upload it to your microcontroller.
Tuning the PID parameters (Kp, Ki, Kd) is crucial for optimal performance. Here are some tips:
- Kp (Proportional Gain): Adjusts the response to the current error. Higher values increase the response speed but can cause overshoot.
- Ki (Integral Gain): Addresses accumulated errors over time. Higher values eliminate steady-state errors but can cause instability.
- Kd (Derivative Gain): Responds to the rate of change of the error. Higher values reduce overshoot and improve stability.
Accurate position and velocity control of DC motors are vital for the precision and reliability of our robotic system. By carefully tuning PID controllers and ensuring proper feedback mechanisms, we can achieve the desired performance in our Space Station project. For the complete code and detailed instructions, please refer to the repository.
In this section, we focus on collecting raw data from an Inertial Measurement Unit (IMU) and applying a Kalman filter to improve the accuracy of our measurements by reducing noise.
An IMU provides critical data about the orientation and movement of our robotic system. However, the raw data from an IMU can be noisy. To address this, we use a Kalman filter, which is an algorithm that estimates the true state of a system from noisy measurements.
- IMU Sensor: Used to measure acceleration, angular velocity, and sometimes magnetic field.
- Microcontroller: For reading the IMU data and implementing the Kalman filter.
- Kalman Filter: An algorithm to filter out noise and provide more accurate measurements.
-
Set Up Hardware:
- Connect the IMU sensor to the microcontroller.
- Ensure proper power supply and connections.
-
Collect Raw IMU Data:
- Write code to read raw data from the IMU sensor. This typically includes acceleration and gyroscope readings.
-
Implement the Kalman Filter:
- Apply the Kalman filter to the raw data to reduce noise and improve accuracy.
We have provided a comprehensive example of collecting IMU data and applying a Kalman filter in our repository. To use this code, follow these steps:
-
Navigate to the IMU Data Collection Directory:
cd Space_Station_snt/imu_data.cpp -
Upload the Code to Your Microcontroller: Open the provided Arduino code in the
imu_data_collectiondirectory using the Arduino IDE and upload it to your microcontroller.
-
Reading IMU Data:
- Initialize the IMU sensor.
- Read acceleration and gyroscope data from the sensor.
-
Applying the Kalman Filter:
- Initialize the Kalman filter parameters.
- Continuously read IMU data and apply the Kalman filter to get filtered data.
Collecting raw data from the IMU and applying a Kalman filter is crucial for accurate and reliable sensor measurements in our robotic system. By implementing this process, we can significantly reduce noise and obtain precise data for our Space Station project. For the complete code and detailed instructions, please refer to the repository.
In this section, we provide a step-by-step guide to set up a dual-boot system with Windows and Ubuntu 20.04. This setup allows you to leverage the benefits of both operating systems, facilitating development and testing for the Space Station project.
Dual booting enables you to have both Windows and Ubuntu installed on the same computer, allowing you to choose which operating system to boot into. This setup is particularly useful for robotics projects where you might need the development tools available on both platforms.
- A computer with Windows installed.
- A USB drive with at least 8GB capacity.
- Ubuntu 20.04 ISO file (download from ubuntu.com).
- Backup of important data.
-
Backup Your Data:
- Ensure you have backups of all important data before proceeding.
-
Create a Bootable USB Drive:
- Download and install Rufus on Windows.
- Use Rufus to create a bootable USB drive with the Ubuntu 20.04 ISO file.
-
Create a Partition for Ubuntu:
- Open Disk Management in Windows.
- Shrink the volume of your main partition to create free space for Ubuntu (at least 20GB recommended).
- Leave the space unallocated.
-
Disable Fast Startup in Windows:
- Go to Control Panel > Power Options > Choose what the power buttons do.
- Click on "Change settings that are currently unavailable."
- Uncheck "Turn on fast startup" and save changes.
-
Boot from the USB Drive:
- Restart your computer and boot from the USB drive (you may need to change the boot order in BIOS/UEFI settings).
-
Install Ubuntu 20.04:
- Select "Install Ubuntu" when prompted.
- Follow the installation steps. When asked about installation type, select "Something else."
- Choose the unallocated space you created and set up the following partitions:
- Root (
/): At least 15GB, ext4 filesystem. - Swap: Optional, typically 1-2 times your RAM size.
- Home (
/home): Remaining space, ext4 filesystem (optional).
- Root (
- Proceed with the installation.
-
Configure Bootloader:
- The installer will automatically detect Windows and configure the GRUB bootloader to allow selection between Windows and Ubuntu at startup.
-
Complete Installation:
- Finish the installation and restart your computer.
- You should see the GRUB menu, allowing you to choose between Windows and Ubuntu.
-
Update Ubuntu:
- After logging into Ubuntu, open a terminal and run:
sudo apt update sudo apt upgrade
- After logging into Ubuntu, open a terminal and run:
-
Install Essential Software:
- Install any necessary development tools and libraries required for your project.
- Bootloader Issues: If you don't see the GRUB menu, you may need to repair the bootloader using a live USB session.
- Partitioning Errors: Double-check the partition sizes and filesystems during the installation process.
Dual booting Windows and Ubuntu 20.04 provides a flexible development environment, allowing you to leverage the strengths of both operating systems. By following this guide, you can set up a dual-boot system to facilitate your work on the Space Station project. For additional details and troubleshooting, please refer to the official Ubuntu documentation.
In this section, we provide a step-by-step guide to install ROS Noetic on Ubuntu 20.04. ROS (Robot Operating System) is a flexible framework for writing robot software, and ROS Noetic is the latest LTS (Long Term Support) release.
ROS Noetic provides tools and libraries for building and simulating robots. This installation guide ensures that you have a working ROS Noetic environment on your Ubuntu 20.04 system, which is essential for developing and testing robotic applications in the Space Station project.
- A computer running Ubuntu 20.04.
- Basic knowledge of using the terminal.
-
Setup Your Sources.list:
- Open a terminal and configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse."
sudo add-apt-repository restricted sudo add-apt-repository universe sudo add-apt-repository multiverse
-
Setup Your Keys:
- Add the ROS package repository to your sources list.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-noetic.list'- Set up your keys.
sudo apt update sudo apt install curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - -
Installation:
- Update your package list.
sudo apt update
- Install ROS Noetic Desktop-Full.
sudo apt install ros-noetic-desktop-full
-
Environment Setup:
- Add the ROS environment variables to your bash session.
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc
-
Dependencies for Building Packages:
- Install dependencies for building ROS packages.
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
-
Initialize rosdep:
- Initialize
rosdepto easily install system dependencies for source you want to compile and is required by most ROS packages.
sudo apt install python3-rosdep sudo rosdep init rosdep update
- Initialize
-
Check the ROS Installation:
- Ensure that the installation was successful by running the following command:
roscore
- This should start the ROS master. If you see messages about the ROS master running, then the installation was successful.
-
Create and Build a Catkin Workspace:
- Create a catkin workspace and build a sample package to verify the setup.
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catkin_make source devel/setup.bash
-
Run a Sample Node:
- Test your installation by running a simple ROS node.
rosrun turtlesim turtlesim_node
By following these steps, you will have a fully functional ROS Noetic installation on your Ubuntu 20.04 system. This setup is essential for developing and testing the robotic applications in the Space Station project. For additional details and troubleshooting, refer to the [official ROS Noetic installation guide](http://wiki.ros.org/noetic/Installation/Ubuntu
In this section, we introduce the 4 Omni Wheel Testbot designed and built for the Space Station project. The Testbot is a versatile robotic platform capable of omnidirectional movement, which is crucial for testing and validating control algorithms and integration techniques.
The 4 Omni Wheel Testbot is equipped with four omni wheels, each independently powered and controlled. This design allows the Testbot to move in any direction and rotate freely, making it ideal for applications requiring precise maneuverability and agility.
- Omni Wheels: Four omni-directional wheels allow movement in any direction without changing orientation.
- Independent Control: Each wheel is independently controlled, enabling complex movement patterns.
- Payload Capacity: Designed to carry various payloads for testing sensors, actuators, and other components.
- Modular Design: Facilitates easy customization and integration of additional sensors and hardware components.
- Omni Wheels: Specialized wheels with rollers set at 45-degree angles to the wheel's axis.
- Motors: Each wheel is driven by a dedicated motor for independent control.
- Microcontroller: Controls motor drivers and interfaces with external systems.
- Frame: Provides structural support and mounting points for components.
The Testbot serves as a platform for testing and developing robotics applications, including:
- Control Algorithms: Implementing and fine-tuning algorithms for navigation and obstacle avoidance.
- Sensor Integration: Testing and calibrating sensors such as IMUs, cameras, and distance sensors.
- Software Development: Writing and debugging software for autonomous navigation and task execution.
The repository for the 4 Omni Wheel Testbot contains:
- CAD Designs: CAD files for the mechanical design of the Testbot.
- Control Software: Example code and libraries for controlling the Testbot's movement.
- Documentation: Detailed documentation on assembly, operation, and maintenance.
To get started with the 4 Omni Wheel Testbot, follow these steps:
-
Clone the Repository:
git clone https://github.com/Shivansh-gupta2005/Space_Station_snt-.git cd space-station/ ls wheel1.cpp wheel2.cpp wheel3.cpp wheel4.cpp -
Setup and Assembly:
- Follow the assembly instructions provided in the
Documentationdirectory. - Ensure all components are securely mounted and connected according to the design specifications.
- Follow the assembly instructions provided in the
-
Upload Control Software:
- Upload the provided control software to the microcontroller onboard the Testbot.
- Adjust configurations as needed for your specific setup.
-
Testing and Validation:
- Conduct initial tests to ensure all wheels respond correctly to commands.
- Test different movement patterns and verify the Testbot's omnidirectional capabilities.
We welcome contributions to the 4 Omni Wheel Testbot project. Feel free to submit issues, feature requests, or pull requests to help improve and expand the functionality of the Testbot platform.
This project is licensed under the MIT License. See the LICENSE file for more details.
The 4 Omni Wheel Testbot is a powerful tool for developing and testing robotics applications within the Space Station project. Its omnidirectional movement capabilities and modular design make it suitable for a wide range of experimental and educational purposes in robotics. For further details and updates, please refer to the repository
In this section, we outline the process of integrating Arduino IDE with ROS (Robot Operating System) for controlling hardware components and exchanging data between the two environments. This integration is crucial for developing robotic systems that require real-time control and sensor data processing.
ROS provides a flexible framework for robotics software development, while Arduino IDE is commonly used for programming microcontrollers that interface with sensors, actuators, and other hardware components. Integrating these two environments allows for seamless communication and control, leveraging the strengths of both platforms.
- Arduino Microcontroller: Used to interface with sensors and actuators.
- ROS (Robot Operating System): Provides middleware and tools for robot software development.
- ROS Serial: ROS package for serial communication between ROS and Arduino.
-
Install Arduino IDE:
- Download and install Arduino IDE from arduino.cc.
- Install necessary drivers for your Arduino board.
-
Install ROS (if not already installed):
- Follow the steps outlined in the Installing ROS Noetic README.md to install ROS Noetic on your Ubuntu 20.04 system.
-
Install ROS Serial:
- ROS Serial enables communication between ROS and Arduino over serial port.
- Install ROS Serial using the following command:
sudo apt install ros-noetic-rosserial-arduino sudo apt install ros-noetic-rosserial
-
Set Up Arduino Libraries:
- Open Arduino IDE and install the ROS libraries for Arduino:
- Go to Sketch > Include Library > Manage Libraries.
- Search for and install
ros_liblibrary.
- Open Arduino IDE and install the ROS libraries for Arduino:
-
Upload ROS Arduino Sketch:
- Create or open an Arduino sketch (.ino file) that communicates with ROS.
- Include necessary headers and define ROS communication objects.
- Upload the sketch to your Arduino board.
-
Configure ROS Workspace:
- Create a ROS workspace if you haven't already:
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_init_workspace cd ~/catkin_ws catkin_make source devel/setup.bash
- Create a ROS workspace if you haven't already:
-
Run ROS Serial Node:
- Launch the
rosserial_pythonnode to establish communication between ROS and Arduino:roscore # Start ROS master if not already running rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0 _baud:=57600 - Replace
/dev/ttyUSB0with the correct serial port of your Arduino board.
- Launch the
-
Verify Communication:
- Test communication by publishing and subscribing to topics between ROS and Arduino.
- Use ROS tools (
rostopic,rqt, etc.) to monitor and interact with data exchanged between the systems.
-
Arduino Sketch:
- Implement code to read sensor data (e.g., from an IMU or distance sensor) and publish it as ROS messages.
- Subscribe to ROS topics to receive commands for controlling actuators (e.g., motors or LEDs).
-
ROS Nodes:
- Write ROS nodes to process sensor data, implement control algorithms, and interact with other components of your robotic system.
Integrating Arduino IDE with ROS enables robust control and communication capabilities in robotic applications. By following these steps, you can effectively integrate Arduino-based hardware with ROS for developing advanced robotics projects, such as those within the Space Station initiative. For further details and updates, please refer to the official ROS documentation.
In this section, we describe the implementation of the velocity_distributor_node responsible for controlling the velocity of the 4-wheel TESTBOT based on IMU data. This node plays a crucial role in interpreting sensor information and distributing velocity commands to achieve desired movement and stability.
The velocity_distributor_node utilizes data from the IMU (Inertial Measurement Unit) to calculate and distribute velocity commands to each wheel of the TESTBOT. This approach ensures coordinated movement and responsiveness, essential for navigating and maintaining stability in various environments.
- IMU Sensor: Provides data on acceleration and angular velocity.
- ROS (Robot Operating System): Middleware for robotics software development.
- ROS Messages: Custom messages for transmitting velocity commands.
- Control Algorithms: Implemented to interpret IMU data and calculate wheel velocities.
-
IMU Data Processing:
- Subscribe to IMU data messages (
sensor_msgs/Imu) published on a ROS topic. - Extract relevant data such as linear acceleration and angular velocity.
- Subscribe to IMU data messages (
-
Velocity Calculation:
- Use control algorithms (e.g., PID controllers) to interpret IMU data and calculate desired velocities for each wheel.
- Adjust velocity distribution based on robot orientation and movement goals.
-
Publish Velocity Commands:
- Publish velocity commands (
geometry_msgs/Twist) to individual wheel controllers or motor drivers. - Ensure synchronization and coordination between all four wheels for smooth movement.
- Publish velocity commands (
-
Launch
velocity_distributor_node.py:rosrun Space_station_snt velocity_distributor_node
-
Subscribe to IMU Data:
- Implement a subscriber to receive IMU data from the sensor topic.
- Process and interpret IMU data to extract orientation and velocity information.
-
Calculate Wheel Velocities:
- Implement algorithms to convert IMU data into velocity commands.
- Consider factors like robot orientation, environmental conditions, and desired movement behavior.
-
Publish Velocity Commands:
- Publish calculated velocity commands to respective wheel controllers using ROS topics.
- Ensure real-time communication and responsiveness to maintain stability and accuracy.
- Simulation and Real-World Testing:
- Conduct simulations to validate velocity control algorithms and behavior under different scenarios.
- Perform real-world testing to verify performance and fine-tune parameters if necessary.
The velocity_distributor_node is essential for controlling the velocity of the 4-wheel TESTBOT based on IMU data, ensuring precise and stable movement in the Space Station project. By implementing this node and integrating it with ROS, you can effectively harness sensor data to achieve desired robotic behaviors and navigation capabilities. For further details and updates, please refer to your project's documentation and the official ROS documentation.
In this section, we provide details about the licensing terms and conditions for the software components used in the Space Station project. Understanding and adhering to these terms is essential for using, modifying, or distributing any part of the project.
The software components, including code, scripts, and configuration files, in the Space Station project are licensed under the MIT License unless otherwise specified. The MIT License is a permissive open-source license that allows you to freely use, modify, and distribute the software, provided that the original copyright notice and license terms are included in all copies or substantial portions of the software.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
When attributing the Space Station project, please include the following information:
- Mention the project name and authors.
- Provide a copy of the MIT License included in the software.
By adhering to the MIT License terms, you ensure proper use, modification, and distribution of the software components in the Space Station project. If you have any questions or need further clarification regarding licensing, please refer to the MIT License or contact the project maintainers.
Thank you for exploring the Space Station project README. This document has provided an overview of the project's components and how to set them up, integrate them, and control them effectively. By leveraging ROS (Robot Operating System), Arduino IDE, and various sensors, we aim to create a versatile platform for robotics development.
Your contributions are valuable to enhancing the Space Station project:
- Fork the Repository: Start your own version of the project to experiment or improve existing features.
- Pull Requests: Submit improvements, bug fixes, or new features to be reviewed and integrated into the main project.
- Feedback: Share your thoughts, suggestions, or report issues to help us improve and refine the project.
-
Clone the Repository:
git clone https://github.com/your-repo/space-station.git cd space-station/ -
Explore and Experiment:
- Set up your development environment.
- Follow the README instructions to integrate components and test functionalities.
- Experiment with new ideas or enhancements.
- Join our community to discuss ideas, ask questions, and collaborate with other developers and enthusiasts.
- Follow project updates and contribute to ongoing discussions to shape the future of the Space Station project.
The software components in this project are licensed under the MIT License. See the LICENSE file for details.
By forking the repository, submitting pull requests, and engaging in discussions, you contribute to making the Space Station project better. Your involvement drives innovation and improvements, ensuring that our robotic platform continues to evolve and meet the challenges of modern robotics applications. We look forward to your contributions and thank you for your interest in our project.