GithubHelp home page GithubHelp logo

chuski92 / copter_arm_robot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masterrobotica-uvic/copter_arm_robot

0.0 0.0 0.0 37 KB

Project designed to learn PID control, relying on ros_control + gazebo for sim/real scenarios

License: GNU General Public License v3.0

CMake 11.17% C++ 88.83%

copter_arm_robot's Introduction

Copter Arm Project

Project designed to learn PID control, relying on ros_control + gazebo for sim/real scenarios, heavily inspired by the example given in the Introduction to Control System Design - A First Look online course from MIT.

Here is a short video showing this package working

Hardware

The list of components required to mount the real platform is:

  • Linear potentiomer
  • Arduino
  • H bridge motor driver
  • Motor DC + Helix (They must agree, shaft, speed, power, etc.)
  • 2x 2A / 7VDC supply
  • Wires
  • Protoboard (optional)
  • Chienesse stick, wooden clothespin, ramplug and a wood strip (or whatever you find that suit a similar purpose)

If you don't have the money or the skills to build it, don't worry, you can use the simulation, see the Usage section below.

Software

  1. The package is built using the Gazebo/ROS ecosystem, in particular, the ROS/Kinetic distro. Installation instruction can be found here.
  2. After the installation, you need to create a ROS workspace, following these instructions
  3. In addition, this package requires the forked version of the teleop_tools/mouse_teleop package. Thus, you need to clone the package using the following command in a terminal (after steps 1 and 2): roscd && cd ../src/ && git clone https://github.com/MasterRobotica-UVic/teleop_tools.git
  4. Finally, get this package usingt he following command in a terminal: roscd && cd ../src/ && git clone https://github.com/MasterRobotica-UVic/copter_arm_robot.git
  5. You are good to build: roscd && cd .. && catkin_make

Usage

For the real scenario, connect everything, power up and type:

roslaunch copter_arm_robot copter_arm_real.launch

Or use the simulated scenario:

roslaunch copter_arm_robot copter_arm_sim.launch

Description of the real scenario

The arduino board doesn't do any computation, it is just a hardware interface between PC and motor driver. If you take a peek in the code running as firmware is pretty simple, it only subscribes to the motor command and publishes the measured angle. The former is forwarded directly to the pin where the motor driver is connected to, and the latter comes directly from the pin where the potentiometer is connected to.

This part of the code is mainly composed of three functions. The init() function that takes care of initilize subscribers, publishers, and populate all (typical) memebers of a hardware_interface::RobotHW object. The read() that updates the measured values from the Arduino to the shared memory for the controller, and the write() that updates the commanded values from the controller shared memory for the Aruino.

The calibrated values of the potentiometer are in fact computed here as well here. The gain and bias values are parameters that can be set in this file, where there is a brief explanation of how to calibrate a linear potentiometer. Note that, changing these values does not require to re-build the project.

It is worth to note that, in our scenario, there is a free joint (the one with the potentiometer) and an actuated joint (the one with the motor/helix couple), from the URDF point of view. Thus, if one takes a look of the controller configuration there are two controllers that basically forward commands, and this is because in the ROS controls project there is no way to set such scenario for a PID control.

To overcome this issue, the generic pid is used. This is reflected in the launch file. For this to work, the /control_effor topic is remapped, the /setpoint transformed from the mouse readings, and the /state from the /joint_states topic.

copter_arm_robot's People

Contributors

carlosjoserg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.