问:
Salvaging a bunch of laptop battery packs
I'm working on my first robot project. I previously used a 12V 6Ah sealed lead acid battery, but recently I aquired some 15 ASUS Li-Ion battery packs, each of them 14.8V and either 2200 mAh or 4400 mAh. The laptops have been discarded, and some of the battery packs seem to be dead.

The battery packs have an 8 pin connector. Inside, I assume there's a bunch of 18650-cells and some electronics.

My robot can handle 14.8 V directly.

How can I use these batteries? How can I charge them without the laptops? I'm a little put off by the idea of taking the 18650-cells out of the packs and rebuilding my own battery pack and charging system, but if that's what's needed I have to do it.

The packs are marked ASUS A41-A3 for the 2200 mAh ones, and ASUS A42-A3 for the 4400 mAh ones.

答:
None of what I will say in this answer is safe, and you should not even attempt it without proper supervision, safety equipment and a class D fire extinguisher around.  Lithium ion batteries need to be handled carefully, in both the mechanical and electrical sense.  Physical stress can cause fires, as can improperly charging or discharging.

Given the danger of reverse engineering the cell management circuitry in your batteries, it would be better to disassemble them and treat them as individual cells.  Any of the cells that haven't gone flat need to be grouped to minimize any mismatches in their charge levels or lifetimes.  Then you can look at constructing a battery management system that can safely deal with the cells you have.


问:
How to determine quality of ICP matches?
In SLAM frontends which use the Iterative Closest Point (ICP) algorithm for identifying the association between two matching point clouds, how can you determine if the algorithm is stuck in a local minimum and returns a wrong result?

The problem is defined as matching two pointclouds which are both samples of some arbitrary surface structure, and the sampled areas have an overlap of 0-100% which is unknown. I know the Trimmed ICP variant works by iteratively trying to determine the overlap, but even this one can be stuck in a local minimum.

A naive approach would be to look a the mean square error of the identified point pairs. But without some estimate of the sampling this seems a risky thresholding. In the manual for the Leica Cyclone they suggest manual inspection of the pair error histogram. If it has a Gaussian shape the fit is good. If there is a linear fall-off the match is probably bad. This seems plausible for me, but I've never seen it used in an algorithm.

答: I think the best approach would be to use a data set which contains a ground truth. The data set which is most often cited in the literature is described in the paper "A benchmark for the evaluation of RGB-D SLAM systems." They also describe a few metrics to compare your pose estimation result with the ground truth. Hope this helps. Happy coding.  </p>

ContentLicense: CC BY-SA 3.0


问:
Controlling digital servos
Many websites say that analog servo motors work on 50Hz and digital servo motors work on 300Hz. My question is, does this difference apply only to the inner control loop of the servo or does the user of the digital servo actually provide 300Hz PWM signal? To rephrase, are all (most) servos including digital ones controlled with 50Hz PWM, or are digital ones specifically controlled with 300Hz PWM? Thanks</p>

答:
The difference between digital and analog servo is analog servo is controlled by custom logic chip and digital servo is controlled by micro controllers. Custom logic chips can control motor (inside servo) at 50Hz while micro controllers can control at up to 300Hz. Both of them take same user input which is generally pwm pulse ranging from 800ms-2200ms. The difference is inside servo. Higher motor update rate gives more precise and fast control. You can also refer here.

Update Rate for user input pwm can go upto 300Hz in case of digital servo and 50Hz in case of analog servo. One should be careful as over driving this pwm frequency may create jitters and sometimes fry your servo.

Title: Controlling digital servos


问:
Differential Drive Robot Control
Edited: I have a differential drive robot that needs to drive down a hall and stay in the center. I have 4 ultra sonic sensors, 2 on each side. Currently, I thought of implementing pure pursuit and having a lookahead distance etc. but I am not sure if this is the correct approach. I have all the lower level PIDs for motor control working, I just need some help in choosing a path planning algorithm? Will pure pursuit work to my needs? OR do people have any suggestions.</p>

答: error = distance to left - distance to right, goal (set point) is 0.</p>

Title: Differential Drive Robot Control


问:
How do I add an external library to the Rock Framework?
The Rock framework already includes a lot of software libraries. However, I would like to add an existing external library so that I can use it for my component development. What is the preferred way of doing that?</p>

答:
You should keep as a guideline that you should NOT modify the external package. If you have to, it should be in a way that can in the end be integrated upstream (i.e. be sent as a patch to the original developers and integrated there).

First thing: what name to give to the package ?
 - do NOT use the external/ category. This is deprecated and no new packages should be added to it
 - instead, find a proper category to put it in. The basename (the name of the package inside the category) is probably easy to derive from the library's own name or the name of the device it drives (if it is a device driver, Rock has special rules for device driver names, devicetype_devicename as e.g. imu_xsens).

Ideally, the external package follows standard practice: uses a standard build system such as CMake or autotools and provides an install target. It can be  added to the autoproj configuration like any other package. Ideally, a manifest file should be added in the package set in the manifests/

If the package does NOT follow these practices, then you will unfortunately have to get your hands dirty. You will have to create a special autobuild handler that handles your package manually. There are examples for these in the rock package set

```<code>import_package 'drivers/aria' do |pkg|
  def pkg.do_build
    # Perform install steps
    # Use run('build', Autobuild.tool(:command_name), 'argument', 'to', 'the', 'command') to run an external command
    # For instance
    #   run('build', Autobuild.tool(:make))
    # FileUtils.install to copy files
  end

  def pkg.do_install
    # Perform install steps
    # Use run('install', Autobuild.tool(:command_name), 'argument', 'to', 'the', 'command') to run an external command
    # FileUtils.install to copy files
    # Files should be installed in the prefix path returned by #prefix
  end

  def pkg.do_pkgconfig
    pkgconfig_dir     = File.join(prefix, 'lib', "pkgconfig")
    FileUtils.mkdir_p pkgconfig_dir
    # Generate a proper pkg-config file that you install in
    # pkgconfig_dir
    # A good way is to save a template file in the package
    # set directly and generate the file using ERB
  end

  pkg.post_install do
    pkg.progress_start "building %s" do
      pkg.do_build
    end
    pkg.progress_start "installing %s" do
      pkg.do_install
    end
    pkg.progress_start "generating pkgconfig file for %s" do
      pkg.do_pkgconfig
    end
  end
end
</code>```

Body:
You should keep as a guideline that you should NOT modify the external package. If you have to, it should be in a way that can in the end be integrated upstream (i.e. be sent as a patch to the original developers and integrated there).

First thing: what name to give to the package ?
 - do NOT use the external/ category. This is deprecated and no new packages should be added to it
 - instead, find a proper category to put it in. The basename (the name of the package inside the category) is probably easy to derive from the library's own name or the name of the device it drives (if it is a device driver, Rock has special rules for device driver names, devicetype_devicename as e.g. imu_xsens).

Ideally, the external package follows standard practice: uses a standard build system such as CMake or autotools and provides an install target. It can be  added to the autoproj configuration like any other package. Ideally, a manifest file should be added in the package set in the manifests/

If the package does NOT follow these practices, then you will unfortunately have to get your hands dirty. You will have to create a special autobuild handler that handles your package manually. There are examples for these in the rock package set

import_package 'drivers/aria' do |pkg|
  def pkg.do_build
    # Perform install steps
    # Use run('build', Autobuild.tool(:command_name), 'argument', 'to', 'the', 'command') to run an external command
    # For instance
    #   run('build', Autobuild.tool(:make))
    # FileUtils.install to copy files
  end

  def pkg.do_install
    # Perform install steps
    # Use run('install', Autobuild.tool(:command_name), 'argument', 'to', 'the', 'command') to run an external command
    # FileUtils.install to copy files
    # Files should be installed in the prefix path returned by #prefix
  end

  def pkg.do_pkgconfig
    pkgconfig_dir     = File.join(prefix, 'lib', "pkgconfig")
    FileUtils.mkdir_p pkgconfig_dir
    # Generate a proper pkg-config file that you install in
    # pkgconfig_dir
    # A good way is to save a template file in the package
    # set directly and generate the file using ERB
  end

  pkg.post_install do
    pkg.progress_start "building %s" do
      pkg.do_build
    end
    pkg.progress_start "installing %s" do
      pkg.do_install
    end
    pkg.progress_start "generating pkgconfig file for %s" do
      pkg.do_pkgconfig
    end
  end
end


问:
Why does a ID controller not exist?
Why doesn't a PID only consisting of ID exist?</p>

答:
I have very basic knowledge of control theory, but:

Wikipedia says (emphasis mine):

A high proportional gain results in a large change in the output for a given change in the error. If the proportional gain is too high, the system can become unstable (see the section on loop tuning). In contrast, a small gain results in a small output response to a large input error, and a less responsive or less sensitive controller. If the proportional gain is too low, the control action may be too small when responding to system disturbances. Tuning theory and industrial practice indicate that the proportional term should contribute the bulk of the output change.

In other words, when the proportional gain is too low, the control would be too slow to be usable, because its response to change would effectively be negligible. You can imagine making it 0 would only make things worse.

So while an ID controller can exist in theory, it would be pretty useless.

Title: Why does a ID controller not exist?


问:
What are some good cheap, silent, motors for mannequin robots and what kind of controller should I use?
What are some good cheap, silent, motors for mannequin robots and what kind of controller should I use?

I'm creating mannequin robots that require 24 motors: 2 neck, 4 shoulder, 2 elbow, 4 wrist, 2 waist, 4 hip, 2 knee and 4 ankle motors. The mannequins will be bolted via a horizontal post from the lower back to a wall. This means they can run, dance, and pose. I may also do something with the horizontal beam so the robots can do side flips, and moves like the twist, jumps and crouches. They will not stand up, but be bolted as I've described to a wall. They could even spin around completely to face the wall.

I've tried using 6v hobby servos for the joins. These are too weak for lifting fibreglass mannequin body parts. They are too loud. They also make noise when poses are held, and they drop and smash when power is shut off. I have been using a handheld remote control for testing with only 5 channels. The robot must be programmable though. Lets say the objective is to make a mannequin dance to 'Thriller' like Michael Jackson.

I am open to using kinnect technology as the controller (so that a dancer can simply dance in front of my robot, who can copy and remember) but I'm also open to controllers that allow me to force the mannequin into a pose at specific time codes in the song. If necessary, I am also willing to program the poses using some kind of lighting desk type controller (such as tech crews use in rock concerts to sync everything to go with the music).

I have noticed that a power drill or winch is very loud whereas my fan is very quiet. I live in an apartment in which neighbours can hear footsteps from other apartments. I would not dare turn on a drill at 4am because it would wake up everyone in the whole building, but I would have no guilt in turning on a fan. I need my robot to be as quiet as a fan. The voltage does not really matter for this project. I'm happy to use up to 240v from the wall socket.

Please let me know which motors and controllers are best for my mannequin robots, taking cost into account. Thanks so much for any help :)

答:
The majority of the noise you're hearing is not from the motor itself but from gearing, which both servo motors and drills have a lot of.  However, if you don't have a gearbox then when power is cut the torque exherted by the motor will become zero and your arm will fall.  I would reccomend a standard brushed DC motor with an encoder for precise control, however a special gearbox designed for less noise.  An example of this are the segway gearboxes, which are supposedly designed to be quiet and harmonic.  Here's a cheaper example, however it does not have the torque or speeed you are looking for.

http://www.robotshop.com/en/12v-silent-dc-motor-146rpm-encoder.html

Another option are stepper motors, which at certain sizes can offer huge amounts of torque with no gearing.  If your mannequin is mounted to a wall would it be possible to mount motors behind the wall, having them run winches through pulleys to manipulate the appendages?  This would eliminate the issue as it would allow some form of shield inbetween the noise and the application.

Finally, if you're simply articulating appendages pnuematics may be the better option

Hope this helps.


答:
You almost never see ID controllers because they generally don't do anything useful. Here is what they can do:

1) The D part will respond to changes in the system. It will try to correct and move the system back to 0, but once it reaches steady steady the D part is no longer active. Note that it does NOT matter where that steady state is; it could be 0 or 10 or 100.

2) Now imagine that the system is moving very slowly, so the D part is negligible. The I part will drive the integral of the error to 0. Again, this is NOT the same as driving the error to zero. Imagine the system is disturbed from 0 to -5. Now the integral will start to become negative and the controller will send positive commands. Once the system reaches 0 again, the integral is still negative so the controller is still applying positive commands and the system moves positive. Eventually the integral reaches zero but the system is now far into positive territory so the whole process repeats itself in the reverse.

Without P, the controller just doesn't reliably do what a control system is supposed to do: drive the error to 0.

Title: Why does a ID controller not exist?

Body: Why doesn't a PID only consisting of ID exist?</p>


问:
How mature is real-time programming in robotics?
Edit: I don't know why, but this question seems to be confusing many people. I am aware of when/where/why/how to use real-time. I am interested in knowing whether people who have a real-time task would actually care enough to implement it in real-time or not.

There's no need to mention why real-time operations are important for a robot. My question is however, how much is it actually used in robotics?

Take this question for example. Only one answer mentions any platform with real-time capabilities, and it is far from the top too. ROS apparently, being a very popular platform which is not real-time.

In the real-time world however, RTAI1 seems to be the only workable free real-time platform of use. It is however, limited to Linux (no problem), badly documented and slowly developed.

So, how much is real-time behavior sought after among robotics developers? The question is, how much are developers inclined to write real-time applications when real-time behavior is actually needed? If not much, why?

For example, reflexive behavior based on tactile data, cannot go through ROS because it would lose its real-time property. But do people really come up with a real-time solution or use ROS anyway, ignoring the real-time property?

1 or similarly Xenomai

答: Orocos is a mature real time robotics control software framework.  I have seen it used to successfully control high speed robotic manipulators with hard real time requirements.  It has many of the same framework level components as ROS, communications, configuration, serialization, and component based packaging.</p>


问:
Suggestions for stepper motor controllers
I am working on a project where a dslr camera will be rotated on a tripod on 2 axes. I'm definitely using nema 17 motors as those are what I have. The motors will rotate 30 degrees every 5 seconds in normal usage so speed is not a requirement. The weight of the camera is 1170g and I'm using 3d printed parts for the remainder of the mount. I tried running nema 17 stepper motors off a Adafruit Motor Shield V2 but the whole thing overheats (battery, driver, and motor). By the way, the motor will be controlled by an Arduino. I need to find another motor controller to use. I looked on ebay and things like this came up for 20 dollars which seems too good to be true.

My question is what motor driver should I use for this project as I have little experience with them outside of Arduino shields

答:
A "nema 17 stepper motor ... controlled by an Arduino"
is the same setup used by RepRap 3D printers.
Perhaps one of the stepper drivers on the "stepper motor driver" page at RepRep would be adequate for your project.
That page also has many relatively unbiased comments about each one.

One thing that many people regret: they save a bunch of money buying an extremely low-cost stepper motor controller, and then they are pulling their hair out for weeks because of inadequate documentation.
Stuff with good documentation often costs a little more, but in my opinion is well worth it.


答: I decided on the RAMPS shield from the reprap open hardware initiative. The stepper motors are cheap and the board is too when bought from certain places. The board is expandable and has many possible reuses. Also the pololu drivers are plenty powerful for this project with up to 2.2 amps with proper heat management. They accept ranges up to 45 volts in some cases. Also I have never seen one break on a reprap printer with over 500 prints.</p>

Title: Suggestions for stepper motor controllers

Body:
I am working on a project where a dslr camera will be rotated on a tripod on 2 axes. I'm definitely using nema 17 motors as those are what I have. The motors will rotate 30 degrees every 5 seconds in normal usage so speed is not a requirement. The weight of the camera is 1170g and I'm using 3d printed parts for the remainder of the mount. I tried running nema 17 stepper motors off a Adafruit Motor Shield V2 but the whole thing overheats (battery, driver, and motor). By the way, the motor will be controlled by an Arduino. I need to find another motor controller to use. I looked on ebay and things like this came up for 20 dollars which seems too good to be true.

My question is what motor driver should I use for this project as I have little experience with them outside of Arduino shields


答:
Digital servos accept the same pulse width and pulse repetition rate as regular analog servos.
a
b

With many RC servos -- both digital and analog -- as long as the "frame rate" (how many times per second the pulse is sent over the control wires to the servo, aka the pulse repetition rate) is in a range of 40 Hz to 200 Hz,
the exact value of the frame rate is irrelevant.
b
c
d
e
f
g
h
i

The RC radio receiver or Arduino or whatever is sending the pulses to the RC servo can send the pulses at any frequency in that range (and in many cases well outside that range), and the servo will Do the Right Thing.
The frequency listed by the servo manufacturer and the reseller for a servo (j) is not the frequency that must be used; it is the maximum of the range of frequencies that the servo is guaranteed to respond properly.

In particular, many people take a servo that is designed to respond to frame rates up to 200 Hz, and stick it in an airplane with a RC radio receiver that sends a frame to that servo 50 times per second, and the airplane flies just fine.

Many digital servos have a higher limit on the input pulse frame rate than many analog servos, but that's not what makes digital servos different from analog servos.

A few people -- such as people installing the tail servo of a small single-rotor helicopter (k), and people building quadcopters -- really need a servo or ESC that can support some frame rate much faster than 50 Hz.
They need to look at the specs and pick a servo with a supported frequency at least as high or higher than the update rate they need.
For example,
ArduCopter drives the stabilization loop at 100Hz (l) (m) (n),
so people using it must pick a servo or ESC that supports frequencies of at least 100 Hz.

Title: Controlling digital servos

Body: Many websites say that analog servo motors work on 50Hz and digital servo motors work on 300Hz. My question is, does this difference apply only to the inner control loop of the servo or does the user of the digital servo actually provide 300Hz PWM signal? To rephrase, are all (most) servos including digital ones controlled with 50Hz PWM, or are digital ones specifically controlled with 300Hz PWM? Thanks</p>


问:
Programming Robots with JavaScript
As somebody who is spending the majority of his time programming in JavaScript, what's the best route to get into small-robotics without needing to deviate too much from my current language focus?

Are there any project kits or tools that make use of the JavaScript language that might make the field more approachable for developers like myself? I would even be interested in virtual environments where all code is executed in a simulation.

答:
There are a couple of projects out there that mate the Arduino platform to the Node.js javascript execution engine.  Take a look at Johnny-Five, which is a library on top of the Arduino Firmata remote control protocol or node-reflecta, which is a Node.js interface for the Arduino Reflecta remote control protocol.

I've personally built a Node.js controlled robot called RocketBot, that combines node-reflecta with node-joystick on top of a Beaglebone and an Arduino so I can attest this approach works well.

Title: Programming Robots with JavaScript


问:
Quad copter attitude control
I have built a quad copter completely from scratch (electronics, mechanics and software).
I am now at the point where all my sensor data looks correct and when I tilt the quad copter the correct motors increase and decrease.

I have been trying to tune the PIDs for a couple of days now, in rate mode it stays level and rotates at roughly the correct degrees per second when I give it a command.

In stability mode a lot of the time it just spins around the axis and when I did get it stable it kept rotating from upright to upside down and then maintaining an upside down flat position. I have come to the conclusion that I am either doing something completely wrong or I have some + - signs mixed around somewhere.

Would anyone who is knowledgeable about quad copter control code be able to take a look at what I have done and how it works as I'm really struggling to work out what needs to change and what I should try next.

My flight control code is posted below, the other relevant classes are hardware.h and main.cpp

```<code>#include "mbed.h"
#include "rtos.h"
#include "hardware.h"

//Declarations
float Constrain(const float in, const float min, const float max);
float map(float x, float in_min, float in_max, float out_min, float out_max);
void GetAttitude();
void Task500Hz(void const *n);
void Task10Hz();

//Variables
float _gyroRate[3] ={}; // Yaw, Pitch, Roll
float _ypr[3] = {0,0,0}; // Yaw, pitch, roll
float _yawTarget = 0;
int _notFlying = 0;
float _altitude = 0;
int _10HzIterator = 0;
float _ratePIDControllerOutputs[3] = {0,0,0}; //Yaw, pitch, roll
float _stabPIDControllerOutputs[3] = {0,0,0}; //Yaw, pitch, roll
float _motorPower [4] = {0,0,0,0};

//Timers
RtosTimer *_updateTimer;

// A thread to monitor the serial ports
void FlightControllerThread(void const *args)
{
    //Update Timer
    _updateTimer = new RtosTimer(Task500Hz, osTimerPeriodic, (void *)0);
    int updateTime = (1.0 / UPDATE_FREQUENCY) * 1000;
    _updateTimer->start(updateTime);

    // Wait here forever
    Thread::wait(osWaitForever);
}

//Constrains value to between min and max
float Constrain(const float in, const float min, const float max)
{
    float out = in;
    out = out > max ? max : out;
    out = out < min ? min : out;
    return out;
}

//Maps input to output
float map(float x, float in_min, float in_max, float out_min, float out_max)
{
    return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

//Zeros values
void GetAttitude()
{
    //Take off zero values to account for any angle inbetween the PCB level and ground
    _ypr[1] = _ypr[1] - _zeroValues[1];
    _ypr[2] = _ypr[2] - _zeroValues[2];

    //Swap pitch and roll because IMU is mounted at a right angle to the board
            //Gyro data does need swapping - done within freeIMU class
    float pitch = _ypr[2];
    float roll = _ypr[1];
    _ypr[1] = pitch;
    _ypr[2] = roll;
}

void Task500Hz(void const *n)
{
    _10HzIterator++;
    if(_10HzIterator % 50 == 0)
    {
        Task10Hz();
    }

    //Get IMU data
    _freeIMU.getYawPitchRoll(_ypr);
    _freeIMU.getRate(_gyroRate);
    GetAttitude();

    //Rate mode
    if(_rate == true && _stab == false)
    {
        //Update rate PID process value with gyro rate
        _yawRatePIDController->setProcessValue(_gyroRate[0]);
        _pitchRatePIDController->setProcessValue(_gyroRate[1]);
        _rollRatePIDController->setProcessValue(_gyroRate[2]);

        //Update rate PID set point with desired rate from RC
        _yawRatePIDController->setSetPoint(_rcMappedCommands[0]);
        _pitchRatePIDController->setSetPoint(_rcMappedCommands[1]);
        _rollRatePIDController->setSetPoint(_rcMappedCommands[2]);

        //Compute rate PID outputs
        _ratePIDControllerOutputs[0] = _yawRatePIDController->compute();
        _ratePIDControllerOutputs[1] = _pitchRatePIDController->compute();
        _ratePIDControllerOutputs[2] = _rollRatePIDController->compute();
    }
    //Stability mode
    else
    {
        //Update stab PID process value with ypr
        _yawStabPIDController->setProcessValue(_ypr[0]);
        _pitchStabPIDController->setProcessValue(_ypr[1]);
        _rollStabPIDController->setProcessValue(_ypr[2]);

        //Update stab PID set point with desired angle from RC
        _yawStabPIDController->setSetPoint(_yawTarget);
        _pitchStabPIDController->setSetPoint(_rcMappedCommands[1]);
        _rollStabPIDController->setSetPoint(_rcMappedCommands[2]);

        //Compute stab PID outputs
        _stabPIDControllerOutputs[0] = _yawStabPIDController->compute();
        _stabPIDControllerOutputs[1] = _pitchStabPIDController->compute();
        _stabPIDControllerOutputs[2] = _rollStabPIDController->compute();

        //If pilot commanding yaw
        if(abs(_rcMappedCommands[0]) > 0)
        {
            _stabPIDControllerOutputs[0] = _rcMappedCommands[0];  //Feed to rate PID (overwriting stab PID output)
            _yawTarget = _ypr[0];
        }

        //Update rate PID process value with gyro rate
        _yawRatePIDController->setProcessValue(_gyroRate[0]);
        _pitchRatePIDController->setProcessValue(_gyroRate[1]);
        _rollRatePIDController->setProcessValue(_gyroRate[2]);

        //Update rate PID set point with desired rate from stab PID
        _yawRatePIDController->setSetPoint(_stabPIDControllerOutputs[0]);
        _pitchRatePIDController->setSetPoint(_stabPIDControllerOutputs[1]);
        _rollRatePIDController->setSetPoint(_stabPIDControllerOutputs[2]);

        //Compute rate PID outputs
        _ratePIDControllerOutputs[0] = _yawRatePIDController->compute();
        _ratePIDControllerOutputs[1] = _pitchRatePIDController->compute();
        _ratePIDControllerOutputs[2] = _rollRatePIDController->compute();
    }

    //Testing
    _ratePIDControllerOutputs[0] = 0; // yaw
    //_ratePIDControllerOutputs[1] = 0; // pitch
    _ratePIDControllerOutputs[2] = 0; // roll

    //Calculate motor power if flying
    if(_rcMappedCommands[3] > 0.1 && _armed == true)
    {
        //Constrain motor power to 1, this means at max throttle there is no overhead for stabilising
        _motorPower[0] = Constrain((_rcMappedCommands[3] + _ratePIDControllerOutputs[1] - _ratePIDControllerOutputs[2] + _ratePIDControllerOutputs[0]), 0.0, 1.0);
        _motorPower[1] = Constrain((_rcMappedCommands[3] + _ratePIDControllerOutputs[1] + _ratePIDControllerOutputs[2] - _ratePIDControllerOutputs[0]), 0.0, 1.0);
        _motorPower[2] = Constrain((_rcMappedCommands[3] - _ratePIDControllerOutputs[1] + _ratePIDControllerOutputs[2] + _ratePIDControllerOutputs[0]), 0.0, 1.0);
        _motorPower[3] = Constrain((_rcMappedCommands[3] - _ratePIDControllerOutputs[1] - _ratePIDControllerOutputs[2] - _ratePIDControllerOutputs[0]), 0.0, 1.0);

        //Map 0-1 value to actual pwm pulsewidth 1060 - 1860
        _motorPower[0] = map(_motorPower[0], 0.0, 1.0, MOTORS_MIN, 1500); //Reduced to 1500 to limit power for testing
        _motorPower[1] = map(_motorPower[1], 0.0, 1.0, MOTORS_MIN, 1500);
        _motorPower[2] = map(_motorPower[2], 0.0, 1.0, MOTORS_MIN, 1500);
        _motorPower[3] = map(_motorPower[3], 0.0, 1.0, MOTORS_MIN, 1500);
    }

    //Not flying
    else if(_armed == true)
    {
        _yawTarget = _ypr[0];

        //Set motors to armed state
        _motorPower[0] = MOTORS_ARMED;
        _motorPower[1] = MOTORS_ARMED;
        _motorPower[2] = MOTORS_ARMED;
        _motorPower[3] = MOTORS_ARMED;

        _notFlying ++;
        if(_notFlying > 500) //Not flying for 1 second
        {
            //Reset iteratior
            _notFlying = 0;

            //Reset I
            _yawRatePIDController->reset();
            _pitchRatePIDController->reset();
            _rollRatePIDController->reset();
            _yawStabPIDController->reset();
            _pitchStabPIDController->reset();
            _rollStabPIDController->reset();
        }
    }
    else
    {
        //Disable Motors
        _motorPower[0] = MOTORS_OFF;
        _motorPower[1] = MOTORS_OFF;
        _motorPower[2] = MOTORS_OFF;
        _motorPower[3] = MOTORS_OFF;
    }

    //Set motor power
    _motor1.pulsewidth_us(_motorPower[0]);
    _motor2.pulsewidth_us(_motorPower[1]);
    _motor3.pulsewidth_us(_motorPower[2]);
    _motor4.pulsewidth_us(_motorPower[3]);
}

//Print data
void Task10Hz()
{
    int batt = 0;
    _wirelessSerial.printf("<%1.6f:%1.6f:%1.6f:%1.6f:%1.6f:%1.6f:%1.6f:%d:%1.6f:%1.6f:%1.6f:%1.6f:%1.6f:%1.6f:%d:%d:%d:%d:%1.6f:%1.6f:%1.6f:%1.2f:%1.2f:%1.2f:%1.2f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f:%1.8f>",
    _motorPower[0], _motorPower[1], _motorPower[2], _motorPower[3], _ypr[0], _ypr[1], _ypr[2], batt, _ratePIDControllerOutputs[0], _ratePIDControllerOutputs[1], _ratePIDControllerOutputs[2], _stabPIDControllerOutputs[0], _stabPIDControllerOutputs[1], _stabPIDControllerOutputs[2], _armed, _initialised, _rate, _stab, _gyroRate[0], _gyroRate[1], _gyroRate[2], _rcMappedCommands[0], _rcMappedCommands[1], _rcMappedCommands[2], _rcMappedCommands[3], _yawRatePIDControllerP, _yawRatePIDControllerI, _yawRatePIDControllerD, _pitchRatePIDControllerP, _pitchRatePIDControllerI, _pitchRatePIDControllerD, _rollRatePIDControllerP, _rollRatePIDControllerI, _rollRatePIDControllerD, _yawStabPIDControllerP, _yawStabPIDControllerI, _yawStabPIDControllerD, _pitchStabPIDControllerP, _pitchStabPIDControllerI, _pitchStabPIDControllerD, _rollStabPIDControllerP, _rollStabPIDControllerI, _rollStabPIDControllerD);
}
</code>```

The whole program can be seen on my mBed page at http://mbed.org/users/joe4465/code/QuadMK6/

If you need any more info or something explaining let me know.

If anyone can point me in the right direction or has any idea of what I should try next it would be very much appreciated.

Thanks
Joe

答:
If you've built this from scratch, the best person to troubleshoot your code is yourself.

Look at the basic pieces of the code: the sensor, the PIDs, and the motor control.  Write some functions to help you test each of those pieces individually, so that you can determine whether the error you're seeing is in just one component, or a system-level error based on some incorrect code in all 3 components.

Once you know the extent of the error, you'll be able to either recognize the problem and fix it, or to ask a more focused question here.

Title: Quad copter attitude control


问:
LQR design with low effort
I am trying to implement a controller for an inverted pendulum using LQR (with MATLAB command lqr(A,B,Q,R)). The problem is that the motors are relatively weak, so I tried to increase R, but simulations show that the effort is still very high. How can I reduce the effort?</p>

答:
With LQR you can either decrease $Q$ or increase $R$. If that's not working you have to consider the possibility that your motor just will not work.

It also might be worth looking at different controller design techniques. If I remember correctly, LQR minimizes the total energy, which usually means a large initial correction followed by a slop back to zero for the control signal (as opposed to lots of oscillation). There are other techniques that can focus on the maximum peak instead of total energy (e.g. generic optimal control or $\mathcal{H}_2$ robust-control techniques, which Matlab has commands for) but they tend to be difficult to understand and use without a lot of study.

Aside from changing the motors, you're left with studying the other optimal controllers or just playing around with PID, feedforward, and/or pole-zero shaping to see if you can get a better response.

Title: LQR design with low effort


问:
understanding the PID controller
I am trying to understand the effects of P, I and D constants in a PID controller on a system.

As far I've understood, P and I make the system 'faster', and D makes it 'slower'(which I read in books), but I don't actually understand what makes it go 'fast' or 'slow'.

How an integrator causes overshoot and all things like that. It makes sense that the P part causes overshoot, since it adds a gain. But what is the integrator doing? I want some kind of mathematical understanding on how all these parameters affect the system.

I know how they work individually, but I'm having a hard time understanding, how it affects the system as a whole. For example, how does a Zero added to the system lead to decrease in overshoot, but when normally adding a zero to a system would create more overshoot.

答:
It sounds like you've missed the core concept of a PID, so let's start from scratch.

In mathematical terms, a PID controller decides how much force to apply in order to move a system in 1-dimensional space -- from an actual position to a desired position.  Based on the error $(\text{error} = \text{position}_{desired} - \text{position}_{actual})$, it provides a value for some corrective force to be applied; this value is the sum of 3 forces (P, I, and D).

Proportional force is so named because it is directly proportional to the error.  Double the error, and you double the force.  When error is zero, proportional force is zero.  You've observed that this makes the system "faster", which is more or less correct; it controls how aggressively the system will attempt to return to zero.

Derivative force is proportional to the rate of change of the error -- the differential calculus type of derivative.  Double the rate of change of the error, and you double the force.  So, when the system is standing still then the derivative force is zero.  You've observed that this makes the system "slower", which is somewhat correct, but probably not for the reason you think; it accounts for momentum in the system.

Integral force is proportional to the error multiplied by time -- the differential calculus type of integral.  Double the amount of time that the error stays at a certain value, and you double the force.  So, when the system spends an equal amount of time moving between negative and positive errors, the integral term drops to zero.  The integral term accounts for constant forces, like gravity, that act on the system.

Title: understanding the PID controller


答:
The short answer to this is that the P (Proportional) part of the PID controller is the base function of the controller and that the I (Integral) and D (Derivative) parts merely attempt to fix the very commonly encountered downsides of the P-only controller.

If we have a look at the general actuating force in the system - the motor or "actuator" the PID controls - the explanation becomes quite obvious. For the PID, the actuation is:

```<code>u = Kp*(e) + Kd*derivative(e) + Ki*integral(e)
</code>```

where e is the error from the desired system position, and Ki, Kd and Kp are user-defined numbers. Now, imagine that the system indeed is in its desired position, meaning the error e=0; then u would also be zero! So, the question then becomes how to get u = 0 when the system is in the state we would like it to be in. This can explain why you typically only see P, PD, PI, or PID controllers used, because these combinations usually coincide with an actuation u=0 that gives the desired system state. There is, however, nothing wrong about the I, D, ID, or even ABC-controller - you can literally add any additional party to u that you find useful for the system you are working with. You could for instance say that

```<code>u  = 0,  if |e| < 5 and
u  = 1,  otherwise
</code>```

which effectively would be a simple on-off switch like your typical thermostat.

Hope this help!

Title: Why does a ID controller not exist?

Body:
The short answer to this is that the P (Proportional) part of the PID controller is the base function of the controller and that the I (Integral) and D (Derivative) parts merely attempt to fix the very commonly encountered downsides of the P-only controller.

If we have a look at the general actuating force in the system - the motor or "actuator" the PID controls - the explanation becomes quite obvious. For the PID, the actuation is:

u = Kp*(e) + Kd*derivative(e) + Ki*integral(e)

where e is the error from the desired system position, and Ki, Kd and Kp are user-defined numbers. Now, imagine that the system indeed is in its desired position, meaning the error e=0; then u would also be zero! So, the question then becomes how to get u = 0 when the system is in the state we would like it to be in. This can explain why you typically only see P, PD, PI, or PID controllers used, because these combinations usually coincide with an actuation u=0 that gives the desired system state. There is, however, nothing wrong about the I, D, ID, or even ABC-controller - you can literally add any additional party to u that you find useful for the system you are working with. You could for instance say that

u  = 0,  if |e| < 5 and
u  = 1,  otherwise

which effectively would be a simple on-off switch like your typical thermostat.

Hope this help!

ContentLicense: CC BY-SA 4.0


问:
How PID affect the Root locus of a close loop transfer function
I am trying to understand how a PID controller moves the poles and zeros of an transfer function.
I've been playing a bit with it, but aren't able to see some kind of connection.

I mean that P and I rises the Overshoot which would mean that the damping ratio gets smaller, thereby should  away from the real axis.

and D should should do the opposite, but it doesn't seem to be true with the examples i've used.. am i doing something wrong??

Well i kind of just want a general knowlegde of how it affect second order systems.

答:
So imagine this scenario:

You are driving you car towards a red stop light. As a human, you would naturally adjust your speed so that you smoothly stop in front of the stop line.

Here is how a PID controller would do it:

P: The proportional part of the controller would measure the exact distance from the car to the stop light, and drive slower and slower as it approaches the light. The P-controller  will drive super slow when getting close to the light, eventually stop without actually reaching it.

I: The integral part of the controller would go fast towards the light, pass it, realise it had gone too far, drive back, drive back too far, then go forwards again, drive pass the light again, and so on. The I-controller might, in fact, never stop on the line.

D: The derivative part of the controller would know exactly when to start breaking, so that it does not break to early - like the P-controller - nor does it drive to far - like the I-controller. Instead, it would start breaking exactly when it needs to, giving a firm but smooth stop in front of the stop light.

A properly tuned PID would combine these characteristics: The P would measure the exact distance to the light, and adjust the initial speed according to this distance. The I would be more aggressive, and enforce that no breaking is done until the the stop light is close, while the D would take over breaking when it realises the car is going way too fast towards the stop light, and break firmly.

Depending on the weighting of Kp, Ki and Kd, these characteristics will be more or less visible in the final system. Of course, the example contains some simplifications. For a general tuning guide, have a look at the Ziegler-Nichols method; the first paragraph in this wiki pretty much explains it all. Note that this tuning method is merely a guide, and that you will most likely have to manually fine tune the system afterwards.

Hope that helps!


问:
Which type of actuator will be suitable for a very strong robot arm?
I wish to build a robotic arm that can lift a useful amount of weight (such as 3-6 kg on an arm that can extend to approx 1.25 meters). What actuators are available to accomplish this? The main factors and design points are:

Not Expensive

5 to 6 DOF

to be mounted on a yet to be designed mobile platform

battery powered

stronger than hobby servos (at least for the 'shoulder' and 'elbow' joints)

not slow to actuate

答:
Mobile platform: An electro-mechanical linear actuator can be a good choice for light weight actuator which can be mounted on mobile platform.

Battery powered: An electro-mechanical linear actuator is good choice over servo motors, as linear actuators draw power only when it is moving, and it does not need power to hold its position.

5-6 DoF: It might be difficult to achieve this using electro-mechanical linear actuator, as they are mechanical complicated and have limited range of motion

You can try linear actuators from www.firgelli.com. They have miniature linear actuators as well, which are good for small scale application.

Mechanical design concept for arm using linear actuator: Most of earth moving equipment have hydraulic linear actuator. Some of the joints for linear actuator can be implemented in this line.


问:
How does a robot efficiently store a map it makes?
From what I understand, you can create a map using sensors and storing values in an array.  For example, the array can have 0's for places not visited, and 1's for places visited, or 0's for open spaces and 1's for occupied spaces, etc.

The map I'm thinking of making will have about 1000 x 2000 members.  This means I need an array of 2 million members.  That seems like a lot.  If I have eight attributes about each member (like temperature, light level, sound level, etc.), then I have 16 million pieces of information to capture.

Is this correct, or is there a better way to create a map for a robot using software?

答:
It really really depends on the kind of map. If you want a map that is a 2-D grid of boolean values, then it depends on how sparse the map is expected to be.

If you want to keep all boolean values, you would need at least N * M * S bits (assuming the map is N by M and each location has S sensor readings), which for your numbers translate to ~2MB of data. If your microcontroller doesn't have this much space, then that's a bad approach.

However, all is not lost! Usually the environment has some feature you can take advantage of. For example, if the environment is not full of obstacles, you don't need to memorize all the empty spaces, right? Or if there is an area closed by obstacles, you don't to keep track of what's inside it, since you can't get there anyway.

That said, perhaps the approach with the least amount of memory would be to model your environment by a set of closed polygons. As you explore the world, you refine the polygons, but not with extreme details, to reduce the memory footprint. All algorithms would then work with polygons (e.g. collision detection) rather than bitmaps which is possibly also less costly, so it could be a win for everyone!

This Wikipedia article may help, where topological frameworks are hinted at, and the thereby linked Map Database Management which could also provide some insight.


答:
Look at papers and projects at universities on how others have done this.
Unfortunately most of this is not as transferable from robot to robot as one would initially imagine.
There is a lot that will be custom to your robot.

That being said, here's what I did...

What I was doing for mine was a graph of 1" squares representing the room.

To "fill in" a square I incremented the value of it by 1.  To "clear" it I decremented it by 2, to min of 0.
I then filled in squares as IR and Ultrasonic detectors detected them.  I cleared them as the squares would be seen to be clear.
This handled transient obstacles OK, but it walked about as the sensors and their precision did not match the grid well.

This also depends as Shahbaz stated on resources for storage/processing power, etc.

Title: How does a robot efficiently store a map it makes?

Body:
From what I understand, you can create a map using sensors and storing values in an array.  For example, the array can have 0's for places not visited, and 1's for places visited, or 0's for open spaces and 1's for occupied spaces, etc.

The map I'm thinking of making will have about 1000 x 2000 members.  This means I need an array of 2 million members.  That seems like a lot.  If I have eight attributes about each member (like temperature, light level, sound level, etc.), then I have 16 million pieces of information to capture.

Is this correct, or is there a better way to create a map for a robot using software?


问:
Is it important to have good PI settings when we running in self-level with kk2?
I have a kk2.1.5 and I fly with the self-level on. In the kk2, there are two menus. One to set PI-settings and another with selflevel-settings. Both enable to set P-Gain and I-Gain.

Is it important to have good PI-settings when the self-level is on, or is setting good values in selflevel-settings sufficient?

答:
Without having tested the kk2.1.5 specifically, I tell you my experience based on a mini-quad with a PID of some sort, and PIDs in general:

A good PI settings will make the quad faster and more "determined" at leveling out while avoiding drift (the quad not fully reaching the correct level, just almost). Auto-leveling is particularly useful when you are letting the sticks go during flight. How they influence the quad during handling, I don't know.

That being said, having a badly tuned controller is much better than having none at all. And having a too aggressive controller might make everything go crazy.

Try to adjust the P-part first. The P alone will not be able to compensate for constant disturbances - such as wind - but will determine the overall quickness of the system. The I-part will make sure there is no drift, and that the quad will actually reach the desired level - but also make the stabilizing much more aggressive. Be careful with not setting the I too high initially, as it might overshoot too much, and become unstable. So: P first until you are happy with it, then I. Start low on both and increase.

Good luck!


问:
Simon K firmware when the IMU outputs at 50HZ
I am building a Quadcopter using the Sparkfun Razor IMU which outputs the Roll, Pitch and Yaw axes values at 50 Hz, which limits the operations of the controller(implemented on Arduino IMU), to 50 Hz mx itslef. Please tell me if flashing the ESCs(EMax 40A) with the Simon K firmware can do me any good.

I'll be grateful. :)

答:
There are benefits from SimonK beyond update frequency. For example SimonK handles hysteresis (The time it takes to change the rpm of the motor is drastically reduced with simonk) differently.

Also it eliminates some of the unwanted parameters that WILL cause you grief, eg lipo cutoff and brakes.

Using a 50mhz update rate will not produce a very good performance multirotor. The Razor does processing on board, which will be repeated by the flight controller. Something like a $25 Naze would be magnitudes better.


答:
When you're choosing actuators, it's instructive to start by calculating how much power you need at the end effector. When you say 'not too slow' you should have some idea what this means, especially under different load conditions.

For example, you might say: 6kg at 0.2m/s and  0kg at 0.5m/s

Now add in the estimated weight of the arm: 10kg at 0.2m/s and  4kg at 0.5m/s

Now calculate the power: 100N * 0.2m/s = 20W  and 40N * 0.5m/s = 20W

So the peak power output at the end effector is 20W. You're going to need an actuator which can comfortably produce more than 20W.

I'm going to make assume that you end up deciding to use an electric motor as your actuator. These are still the actuator of choice for powerful electric robots systems. (If you successfully get this robot working with muscle wire without burning down your workshop, I'll eat my mouse).

Since you're using an electric motor, you'll almost certainly be using some kind of gears. Assume the gear train on the motor is about 50% efficient. This means you'll need an electric motor rated for at least 40W. If you want this to be a reliable arm, I'd spec a motor rated for at least 60W.

Next you need to spec the gear train. What's the torque needed? 100N*1.25m = 125Nm. But as usual, you need to spec more torque than this for the gear train, not least because you'll need some spare torque to be able to accelerate the load upwards. Select a gear train which can take more than the rated load.

Lastly, make sure that the motor's torque multiplied by the gear ratio multiplied by the efficiency exceeds your torque requirement, but not the maximum gear load.

Title: Which type of actuator will be suitable for a very strong robot arm?

Body:
I wish to build a robotic arm that can lift a useful amount of weight (such as 3-6 kg on an arm that can extend to approx 1.25 meters). What actuators are available to accomplish this? The main factors and design points are:

Not Expensive

5 to 6 DOF

to be mounted on a yet to be designed mobile platform

battery powered

stronger than hobby servos (at least for the 'shoulder' and 'elbow' joints)

not slow to actuate


答:
The world is always bigger than the robot's memory can hold (it's bigger than your memory can hold, too).

There are 2 ways to reduce the space that you need.  The first is to consider whether you need to pre-allocate the storage space, and the second is to consider what kind of compression you can use.

Pre-allocating space makes sense if you already have values for those 8 attributes at every square, or if the robot's job is to visit all 2 million squares and measure them.  However, if the robot is just going to visit a small portion of the total squares then you might be able to store the data in something like a quadtree instead.  (There are many other structures that take advantage of sparse data sets, and I won't list them here.)

Compression can help if you can't avoid pre-allocating the space.  For example, you could store the state of visited squares as bits instead of bytes to get 8:1 compression with minimal effort.  For the attributes of the spaces, do you need exact values?  Can you exploit patterns in the data to save on storage space (think of GIF, JPEG, and other 2D compression schemes).


问:
What is the difference between a Robot and a Machine?
What is the difference between a Robot and a Machine? At what point does a machine begin to be called a robot?

Is it at a certain level of complexity? Is it when it has software etc?.

For instance: A desktop printer has mechanics, electronics and firmware but it is not considered a robot (or is it). A Roomba has the same stuff but we call it a robot. So what is the difference.

I have always believed that a robot is a robot when it takes input from it's environment and uses it to make decisions on how to affect it's environment; i.e. a robot has a feedback loop.

答:
Back to the original question, a robot is something that turns it self on and off and does its thing without human interference, touching, sending a signal, ect. Like the Roomba. Sure sometimes you tell it to do certain things, but that is different, that is just for an occasion.When you are done, it goes back to vacuuming again. A machine is a thing that has mechanics, electronics and firmware, but needs human interference to work, like the printer. You send a signal telling it to print, not it telling itself to print.
Does that answer your question?</p>


问:
Quadcopter PID output
I'm trying to develop a control system to a quadcopter and one of my options is to use a PID controller (which I think is the most used method).

From what I've read, the commom strategy is to run a PID algorithm to each axis. My question is: how the PID output is converted to PWM signals?

I'm asking that because the three axes and the four rotors depend on each other. I mean, if I slow down a couple of rotors which are opposite to each other then the quadcopter will move down in a vertical axis. But if I speed one of them and slow down the other, the quadcopter will rotate in a different axis.

So we cannot isolate each axis and associate them with a single rotor or a pair of those. And because of that, how can a PID output (which is associated to an axis) can be converted to PWM signals to the rotors?

Is that a MIMO system?

答:
If you slow down one couple of oppositely placed rotors in a quadcopter, it will not only reduce the vertical thrust, it will result in change of yaw.

Since what you're asking is essentially a general description of PID tuning techniques for a quadcopter, I suggest you stick to Google for the moment, including http://blog.oscarliang.net/quadcopter-pid-explained-tuning/   and   http://www.thomasteisberg.com/quadcopter/

Things to note:

You can have more than 1 PIDs per axis

The usual output of PIDs are +/- values for rate of change of roll, pitch and yaw.

The desired change in roll, pitch or yaw is brought about by a low level controller. It converts the rate of change to a restoring torque (basically... a small increment in one motor and a corresponding small decrement in the opposite motor.)

Usually, roll and pitch PIDs act on two motors at a time. Yaw PID act on all fours.

You may try going through :
understanding the PID controller
and
Quadcopter PID tuning

Title: Quadcopter PID output


问:
proper tuning method of an cascade controller?
Would a control system consisting of 2 PID controller one plant  would be considered as an cascade controller??

And how come would a proper tuning method be?

As far i've googled it seems to me that only best method is to manually do it, one by one.

this is how my system looks like
http://snag.gy/rJH2J.jpg

答:
A cascaded controller simply has the output of one controller acting as the input to another.

A good example of this would be in a motor control application where you typically have a current loop controlling the current to the motor, over that you'd have a velocity loop where the output of that loop is the input to the current loop, and over that you'd have a position loop where the output is the input to the velocity loop.

Each loop can be tuned independently of the other by whatever method you fancy.  Tune the inner-most controller first and then start going outwards.


问:
Spatial tracking between two UAVs
I have two Unmanned Aerial Vehicles (planes) which work well. They can fly to various waypoints automatically using GPS.

Now I would like them to fly together in formation. I would like them to fly side-by-side fairly close. This is too close to reliably use GPS to guarantee that they keep the correct relative positions safely, and so I am looking for another way.

Somehow the UAVs need to be able to measure their position and orientation in space relative to the other one. How can I do this? Is there some kind of sensor which can do this? It would need to have the following properties:

6 axes (position and orientation)

Range 0m - 5m, (from between plane centres, but planes won't actually ever touch wingtips)

Works in day or night and all weather conditions

Light weight (This is for 1.5m wingspan RC planes, so max extra weight of about 100g)

Probably need about 50Hz - 100Hz refresh rate, but might get away with less, using the IMU to fill in the gaps

答:
How close together is important. I saw the range of 0-5m, but if you're suggesting that they might touch, or just barely not touch, then you're going to have difficulties. Lightweight is also a vague term which will need to be defined better in order to adequately answer your question. Still, there are some things to keep in mind:

Augmented GPS can get you sub-inch accuracy. This will likely involve an extra antenna, so space and weight might be a concern. You also have to make sure you don't lose GPS accuracy at the wrong time, which I've seen with some systems.

As geez suggests, IMU is very useful for the 6-DOF tracking.

You almost certainly know this, but 3D movement makes this a tricky problem. Avoiding collisions is relatively easy, but ensuring the proper formation between the two means sensing the other vehicle will require a wide range of detection.

A sensor such as MS's Kinect will get you some around .6m to 3m 3D sensing, but in a relatively narrow cone, so you'd need several to cover the all around the planes. Also, they're not all that fast and will have trouble in difficult weather. Most weather, really. I don't know of any variants that are outdoor rated, especially in cold/damp (condensation on a lens would kill that sensor).

Which also brings me to another question: speed. Planes are all reasonably fast, but there's glider fast and there's supersonic jet fast and all ranges in between. Refresh rate vs. distance between UAVs will be a very important consideration. Is 30-60hz enough time for your UAVs to correct when they're a few meters apart, or do they need something close to 100hz?

If 30-60Hz is enough, you could potentially mark your UAVs with a distinctive pattern and use optics to detect that pattern and, combined with GPS etc, use that for close-range stuff. The problem with straight image detection is that it's computationally intensive and sometimes tricky to do, especially depending on your math skills. You'd have to have a way to keep the lens clear of condensation, like the Kinect, but I don't believe that's an intractable problem in this case, because you have a lot of options on cameras. Not saying it'd be easy, but easier than with a Kinect-style sensor.

XBee is cool, but it's all packet based, so there's a maximum refresh rate on transmitting between units. You'd probably need some tolerance on lost packets, as well.

So, no sure answers yet, but possibly with some domain narrowing we could help you more. Size, weight, minimum distance, and maximum speed limits will all wildly affect what solution you might go with.

UPDATE based on additional information:

Hmmm. I don't think there's an ideal solution. An array of ultrasonics could get you collision avoidance, but there's no high-refresh rate 3D sensor that I know of that could make a bubble around your plane in the 0-5m range. If you were scaling up, you could use something like a Velodyne laser to do something like the equivalent, but environmental conditions would make that less than ideal without work on the software end.

Think hard about tolerances. Is it vital they be able to fly within X cm of wingtip to wingtip? Do they need to be coplanar, or would it be okay if one were, for example, +/- a meter above the other as long as they don't collide? You might also see if you have options on the navigational smarts of the planes, so that, as long as they're following their flight plans within tolerance, they are quiet, but if they are blown off course (or whatever), then they send out an alert to the other UAVs with what they know to be wrong. A differential system might be enough, though I imagine the test cycle for that will be exciting.

Also, do a check on Augmented GPS systems to see if someone makes a lightweight version. Most of the ones I've seen are for agricultural use, so they're more keen to make it ideal for putting on a tractor, but it's worth checking.

Title: Spatial tracking between two UAVs


问:
How can I dynamically control the amount of torque necessary to rotate something for a test rig?
I'm looking to build a test rig for a robot that rotates a 1" diameter pipe 180º (roll not yaw or pitch). I am currently testing a motor's performance when subjected to various kinds of PWM (high duty cycle, low duty cycle, etc). I would like to characterize how this performs under various loads.

Is there a simple mechanical mechanism I can attach to a fixture and insert into or around the pipe that lets me control how easy or difficult it is to rotate?

I am thinking of something like a drill bit chuck that fits inside the pipe and expands or a circular clutch that clamps down around pipe to add resistance when one tightens a thumbscrew. I would like to go from no resistance to full stop for a 4N•m motor. I would like to be able to test how 'sticky' the pipe is using a torque wrench.

I imagine this would be very simple but I can't think of something that would do this!

答:
Only rotate 180º, right? Not continuous rotation?

How about wrap a string around the pipe and then hang a weight off the string? As you rotate the pipe it will lift the weight and the torque calculation is straightforward. If you need more torque you can artificial increase the diameter where the weight is attached.

Hmm, looking at your title again you say "dynamically control" ... does that mean you need to change the torque in the middle of one test? One of your examples includes a clutch with a tightening thumb screw, though, so maybe not?


问:
Transfer function of DC motor being unstable due to a controller?
I am having a hard time grasping the concept of a DC motor  with load being unstable, and stable due to a controller

My confusions appears as I am trying to design a controller for one using Z-N method, and the transfer function i've identified using matlab tells me that my DC-motor always will be stable.

Which makes sense, since feeding it constant voltages, will lead to a constant veloicty.

But to use the z-n approach the system has be able to become unstable, and since this isn't possible i am getting confused if a motor are able to become motor for which i am to design a controller for.

The question in simplicity,
how come can a controller make a motor, (if the motor itself cannot (due to pole zero plot)) unstable.

答:
2 comments ...

First, as many people said in answer to your other question, you need to understand that your transfer function is not the real transfer function of the motor. Real motors have nonlinear, and other, unmodelled effects that can cause problems in certain cases.

Second, you need to consider the entire system, not just a single subsystem. Stability is a property of the combination of motor+controller, so a poorly designed/tuned controller connected to a stable motor can easily make the whole system unstable.


答:
Let's try to give a comprehensive answer and stay on topic!

As you said in your question there is one PID per axis. This means 3 PIDs in total: roll, pitch, and yaw.

Also the motors input is a PWM high-level time, typically in the 1000-2000us range. There are 4 motors input: front, back, left, and right. One subtlety of the motors is that there is a value under which the motors stop completely, for instance 1100ms.

There is another variable not mentioned in the question: the throttle.

The first step in my quadcopter project was to tune the throttle. My throttle values were between -100 and 100, so I applied the following formula to each motor: motor = 300 * throttle / 100 + 1550. The constant values are arbitrary and give us a motor value in the 1250-1850 range, other values of the same magnitude would work.

Only then do we apply the PIDs using the motor mix formula. For instance for my +4 quadcopter the formula is:

Front = Throttle + PitchPID - YawPID

Back = Throttle - PitchPID - YawPID

Left = Throttle + RollPID + YawPID

Right = Throttle - RollPID + YawPID

The PID output has no unit. Choosing the right P, I, and D constants shall give us values which can stabilise the quadcopter. One caveat is that depending on the PID values the motor input can exceed the bounds: it could go over 2000us or under 1100us (which is our example motor cut value). In order to avoid such a situation we can analyse the higher and the lower of our motors inputs and add a constant to get all the motors within bounds.

For instance if the motor mix formula gave us:

Front = 1900

Back = 1800

Left = 2100

Right = 1700

We would remove 100 from each motor and get:

Front = 1800

Back = 1700

Left = 2000

Right = 1600

This would give us motors input values within bounds and maintain the difference between motors.

As a side note you said in a comment that the thrust vs PWM input is not linear. This is true but PIDs can drive non-linear systems with more or less success. For quadcopters the consensus is that it works reasonably well :)

If anything was unclear please let me know!

Cheers,
Marc.

Title: Quadcopter PID output

Body:
I'm trying to develop a control system to a quadcopter and one of my options is to use a PID controller (which I think is the most used method).

From what I've read, the commom strategy is to run a PID algorithm to each axis. My question is: how the PID output is converted to PWM signals?

I'm asking that because the three axes and the four rotors depend on each other. I mean, if I slow down a couple of rotors which are opposite to each other then the quadcopter will move down in a vertical axis. But if I speed one of them and slow down the other, the quadcopter will rotate in a different axis.

So we cannot isolate each axis and associate them with a single rotor or a pair of those. And because of that, how can a PID output (which is associated to an axis) can be converted to PWM signals to the rotors?

Is that a MIMO system?


问:
Robot start-up movement problems
I have created robot using a robot chassis kit from hobbyking. At first when testing the robot connected to USB power source and the wheels lifted above the ground everything seemed to be OK. Then, when I tried to power the robot with batteries I encountered a problem with starting the movement.

The robot hardly starts to move even when I power it with 100% of power - sometimes I have to push it a little bit in order to start driving.

As a newbie I don't know whether it is a power source (battery) or motors problem.

There are 4 motors with torque of 800gf.cm min in the chassis.

The gear ratio is 48:1 and to power the motors

I used two serially connected Li-ion batteries and dc-dc regulator which limits the voltage output to 5V.

The power is regulated with dual H-bridge motor driver.

According to specifications, the maximum free running current for a single motor is 250mA and I have read that the stall current is 3-8x running current.

Anyway, the problem is that the robot has problems with starting-up driving and I don't know how whether the motors are even powerful enough to move the robot or it is a power source problem or perhaps the obstacle could be solved with appropriate power regulation (ramp).

How can I solve this problem?

答:
Try running the motors in free-load condition (holding in air). If motor runs then, most likely they are not able to carry the load or the battery is dying. Try replacing the battery & see if that works well. Here in all, I am assuming that you boards are working well & enough power is reaching the output pins of the board (or input of motor).

Anyways, its difficult to run metal geared motors at 5V. What are the motor specifications?

Just to test, see if you can disconnect any 2 motors (either front or back) & see if the bot moves. This may give you some hints.

Title: Robot start-up movement problems


问:
How do I learn about Arduino/raspberry-pi based robotics on my own?
I am interested in learning how to build a dynamic quadcopter, and hope to be fairly proficient with Arduino/raspberry-pi. What resources and/or practices might you recommend? </p>

答:
In your shoes, I would start "simpler".

First, I would make a system that cycles between LED states (on/off/blinking) based on interaction with a sensor. That's to get the basics.

Then, I would build a little "truck" bot, one that can drive around my room without getting stuck. This is (especially in MY room, where navigation between all sorts of stuff is risky...) already an interesting challenge.

Next, I would add navigation (get some points/GPS-positions/emitters/NFC-tags/anything-that-suits-you in my room and go around them with the bot, which seems to be something you want your quadcopter to be able to do so that it knows how to come home, once you have GPS integrated)

Next I would add a few circuits for balancing (you really want the quad to know up from down, and handle their stability well). Side note, if you are on the equator, factor that in your system. It seems American F-16s had to be upgraded (a long while ago...) when the US Air Force had the nasty surprise of having them roll 180° when passing the equator :D

At that point, you're much more savvy than I'll ever be ;)


问:
How mature is real-time programming in robotics?
Edit: I don't know why, but this question seems to be confusing many people. I am aware of when/where/why/how to use real-time. I am interested in knowing whether people who have a real-time task would actually care enough to implement it in real-time or not.

There's no need to mention why real-time operations are important for a robot. My question is however, how much is it actually used in robotics?

Take this question for example. Only one answer mentions any platform with real-time capabilities, and it is far from the top too. ROS apparently, being a very popular platform which is not real-time.

In the real-time world however, RTAI1 seems to be the only workable free real-time platform of use. It is however, limited to Linux (no problem), badly documented and slowly developed.

So, how much is real-time behavior sought after among robotics developers? The question is, how much are developers inclined to write real-time applications when real-time behavior is actually needed? If not much, why?

For example, reflexive behavior based on tactile data, cannot go through ROS because it would lose its real-time property. But do people really come up with a real-time solution or use ROS anyway, ignoring the real-time property?

1 or similarly Xenomai

答:
In response to "when/in which case" real-time systems are used:

In my experience, motion control is the main application for real-time systems. For controlling motors a high frequency (100hz, 1000hz and more) and low jitter (time variations) are important. Safety is a big point here. Consider a robot among humans: For example, you want/need to ensure that the robot (arm) stops in a specific time frame/distance.

For other tasks such as path planning, vision processing and reasoning real-time system are not that important and often avoided due to the overhead in development time and hardware costs.

Nowadays, big robots such as the PR2 combine both worlds. In the real-time context of the RT enabled operating system (e.g. Linux + Xenomai) motion control is happening and in the non-real-time part (user land), vision processing and planning are embedded in systems like ROS. Both can run on the same computer.

I'm happy to edit this answer, once the question has been clarified. :-)


问:
Acrylic/plastic cutting services
I want to cut acrylic pieces that will be assembled into the body of a robot. What are some recommendations for acrylic/plastic cutting services? Does laser cutting produce the best results?</p>

答:
Just signed up to answer the question!

I have always found I get the best results laser cutting when using acrylic, would highly recommend it. Have made robots from some solid 6mm accrylic before. It looks nice, it's strong, pretty light, quick to cut, and it's easy to make more robots later!

I would also recommend using acrylic glue to hold the body together:
http://www.cutlasercut.com/resources/tips-and-advice/bonding-and-glueing-acrylic-and-plastics

I managed to get hold of some which was UV cured, and only took about 20 minutes to dry in the sun. This stuff is pretty toxic, would recommend using it outside anyway.

Title: Acrylic/plastic cutting services


答:
Are you just using a microcontroller? Do you have the option of strapping a laptop to it?

I use Octomap to store my robot's maps (with the robotic operating system):
http://octomap.github.io/

It is the best method I have found to store rich robot sensory data in an efficient way. There is a good PDF explaining how it works:

www.first-mm.eu/files/hornung13auro.pdf

I'm pretty sure you could apply the same principles to a raw embedded robot.


问:
What parts do I need for a strong robotic arm?
https://www.youtube.com/watch?v=MPhhYlIq294

I have found this robotic arm on the internet, and I was wondering if someone can tell me what parts I need to build it or similar. The video says it can lift a small cat.

I need to be able to program it, so I'll need a controller.

Please recommend specific motor, controller links that you recommend. Thanks :)

答:
The video link is to a universal robots robot (R10), it is a very high quality arm. I would rate it as one of the best in the world in it's class.

I recommend ROS industrial to drive the robotic arm:
http://rosindustrial.org/

If you are doing the mechanics yourself, and you want to get it to this quality, you will need some serious skill, a small team of engineers, and a lot of cash.

If you are just doing it by yourself as a hobby, you will probably want to start small:
https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-on-your

You can get it running with just a laptop and an Arduino. The project will be pretty cheap.

I get most of my serious gear from China (big motors, sensors + electronics), and design/create most of the mechanics myself. It takes a lot of effort and cash.


问:
Performance/memory considerations for pathfinding lookup tables on RobotC for a small set of paths
I'm writing a C code generator geared toward RobotC and complex tasks for an FTC team, and was wondering about some performance and storage concerns:

How much memory is available for my program's data? It'll be mostly pre-defined lookup tables, generally in the form of multidimensional arrays.

How much NXT memory is available for my program itself? As in, roughly how much code can I expect to fit into a single RobotC compiled program?

How quickly do programs execute, generally? Looking at disassembly most of my generated lines correspond to 2-4 opcodes.

Based on these, I'm trying to make a decision of precomputation vs runtime pathfinding.

I'm using NXT/Tetrix. My major interest at this point with these questions is for pathfinding. I plan to have a 64x64 grid and be running Djisktra's A* algorithm with a heuristic function that assigns a penalty to turns and is as close to consistent as possible (not sure if consistency/monotonicity is doable with the turn penalty).

Roughly 8 paths would be cached if I decide to use the pre-cached lookup tables.

Instead of a set, I'll probably use a boolean array for the set of nodes visited. The fact that I'm working with a square layout will allow me to use a 2D array for the map needed to reconstruct the path.

I'd love some feedback and answers to my question if anyone has any. Thanks!

答:
Just to be clear, my answers assume you are asking about NXT, not the more recent EV3. Also I couldn't find information on how RobotC works on NXT – if it loads native code straight to memory or generates RXE files to run on the NXT VM – so I'll cover both scenarios.

According to the NXT Hardware Developer Kit, the NXT brick's main processor is connected to 64KB RAM. That is the amount of memory available for bare metal programming, that is if you load a native program into the brick, bypassing the original firmware. Of course in this case your program will also have to include drivers to control robot sensors, motors and so on.

If however your program runs on top of the NXT VM, the Executable File Specification says that "[w]hen the VM runs a program, it reads the encoded
.RXE file format from flash memory and initializes a 32KB pool of RAM reserved for use by user programs. The .RXE file specifies the layout and default content of this pool. (...) Non-volatile sub-components remain in the file, which the VM can refer to at any time during program execution. The code space is an example of a non-volatile sub-component. The bytecodes never change at run-time, so these bytecodes remain entirely in flash memory."

In other words, RXE programs have a 32KB limit for data structures, but bytecode instructions are not included in this total – they are executed directly from Flash memory, which has a size of 256KB (minus the size of the NXT VM – unfortunately I couldn't find a number for this).

As for processing speed, the NXT HDK says the main processor runs at 48MHz. How this translates to actual speed again depends on whether RobotC programs run natively or on top of the VM. The nxtOSEK project reports their test program achieves a maximum speed of 1,864,000 loop iterations per minute.

But at any rate, I'd bet peripheral pooling, not processing speed, will be you main speed limiting factor. According to Sivan Toledo, "[t]he Interval Timer of the AT91SAM7S256 is used to generate an interrupt every 1 ms. This interrupt is used for time keeping and for running all the periodic tasks of the system." So every 1ms your program stops while the NXT drivers talk to sensors and motors.

So to summarize:

RXE programs running on top of the VM are limited to 32KB RAM for data structures, whereas native programs will have 64KB to share between data and code;

RXE programs run straight from Flash, so their code size is limited to how much storage is taken by the firmware. For native programs see the previous answer;

The brick's main processor runs at 48MHz, but peripheral interruptions occur once every 1ms, so even native code will probably run somewhat slower than that.

I hope this helps.


问:
Definition of (or determine whether something is) a robust controller?
I am bit uncertain how I should interpret the definition of an robust controller. </p>

<p>As far I've understood, the closed loop system including the controller has to have a high gain for frequencies where disturbance appears, and decay at frequencies higher than the work area, or noise.  Both of these can be determined using a bode plot, thereby determining the robustness of my closed-loop system. </p>

答: In its broadest sense, a controller is "robust" when it allows for bounded variations to its parameters – in other words, the controller continues to work as long as its parameters remain within a given bounded range. In the context of Bode work, this translates to high-gain feedback, but it's not necessarily true elsewhere – see for example the H-infinity methods.</p>


问:
Voice control solution for Linux robot?
I wanted to present a voice-controlled robot in my lab's upcoming demo contest. My robot is essentially a x86 Ubuntu notebook resting on top of a two-wheeled platform, so in principle any solution available on Linux would do.

I looked into Julius, but it seems the only comprehensive acoustic model available for it is aimed at the Japanese language – which coincidentally I can speak a little, but apparently not clearly enough to produce anything beyond garbled text. I also tried the Google Speech API, which has a decent selection of languages and worked very well, but requires Internet access. Finally there is CMU Sphinx, which I haven't yet tested, but I'm afraid might have a problem with my accent (I'm a nativa Brazilian Portuguese speaker, and apparently there is no such acoustic model available for it).

Is that all there is to it? Have I missed any additional options? As you may have guessed, my main requirement is support for my native language (Brazilian Portuguese), or failing that, good performance for English spoken with foreign accents. A C++ API is highly desirable, but I can do with a shell interface.

答:
Well, if no connection with internet is a requirement, I would say that the best option could be using Julius with a self trained corpus model. In this case you can use your own language and intonation. As an advantage, the success percentage of the ASR unit will be higher than using a public trained corpus. As a disadvantage, this corpus will be useful just for you, for other users the percentage of recognized commands will be lower.

With your own corpus, using a limited number of voice commands would be something relatively easy to do, but of course if we are speaking about natural language recognition, the only solution is looking in internet for an already trained corpus of your own language.

I used Simon http://www.simon-listens.org to prepare my own corpus, and once was correctly working, I integrate it in the Julius Engine.

If using a remote service, as you said the Google API, could be possible, then a combination of Julius + Google API would be the best solution.
Julius continuously running the ASR process looking for a keyword (already integrated in your corpus), and once this keyword is found, trigger a request to the Google service that is not limited for the number of commands to be recognized.

One year ago I created a similar project using Julius, Google API and the Raspberry Pi board. Here can you find further infos: http://www.robotergarten.de (dead link)

Title: Voice control solution for Linux robot?


问:
Can I reuse the hall sensors in a brushless motor as an encoder?
I have upgraded the motors in my robotic arm to sensored, brushless RC car motors. The hope was to reuse the Hall sensors to double as a rotary encoder, by tapping 2 Hall sensors and treating the 2 bits as a quadrature signal (a crude quadrature since 2 of the 4 states will be longer than the other 2).

This works when none of the motor phases are powered and I just rotate the motor manually. But once the stator coils are energized, the encoder no longer counts correctly: When running at low power, the counting is correct, but when running under high power, the count is monotonic (only increases or decreases) no matter if I run in reverse or forward.

I'm almost certain this is because of the stator coils overpowering the permanent magnets on the rotors. So is there still a way to use the Hall sensors as an encoder?

Sorry if this is an obvious question. I'd love to research this problem more if I had more time.

Update:
I've measured the wave forms with my DSO quad and see the expected 120 degree separated signals (the measurement for phase C gets more inaccurate over time because I only had 2 probes, so I measured phases A & B first, then A & C, and then merged them.

When ESC speed is 0.1:

When ESC speed is 0.3:

Previously, I was using a hardware quadrature counter (EQEP module on a BeagleBone). At speed=0.3, this was counting backwards no matter if I do forward or reverse!

I then implemented quadrature counting on an LPC1114FN28 uController. The result was still bad at high speeds (count didn't change at all). The logic was:

```<code>void HandleGPIOInterrupt()
{
  const uint8_t allowableTransitions[4][2] = {1, 2, 3, 0, 0, 3, 2, 1};
  static int prevState = -1;
  int state = phaseA | (phaseB * 2)
  if (prevState != -1)
  {
    if (allowableTransitions[prevState][0] == state)
    {
       ++rotations;
    }
    else if (allowableTransitions[prevState][1] == state)
    {
      --rotations;
    }
  }
  prevState = state;
}
</code>```

Then I got the idea to change the code to not update prevState until an expected state happens (to deal with glitches):

```<code>  int state = phaseA | (phaseB * 2)
  if (prevState != -1)
  {
    if (allowableTransitions[prevState][0] == state)
    {
       ++rotations;
       prevState = state;
    }
    else if (allowableTransitions[prevState][1] == state)
    {
      --rotations;
      prevState = state;
    }
    else
    {
        // assume transition was a glitch
    }
  }
  else
    prevState = state;
</code>```

Now the counting finally is correct in both directions, even at speeds higher than 0.3!
But are there really glitches causing this? I don't see any in the waveforms?

答: I would think you should be able to. I've used magnets and reed switches in a similar application for a speed sensor which uses the turns to calculate speed much like an encoder and it worked perfectly. The hall sensor should behave in a similar way.</p>


答: We use a laser in our robotics program and they work well, but may sometimes aesthetically scar the edges a bit on transparent pieces. Also, for the most durable robot, I would reccomend lexan polycarbonate instead of acryllic or plexiglass. You can hit lexan with a hammer and it won't shatter and you can cut it using tin snips if need be. A band saw is also a good way to cut plastics.</p>

Title: Acrylic/plastic cutting services

Body: I want to cut acrylic pieces that will be assembled into the body of a robot. What are some recommendations for acrylic/plastic cutting services? Does laser cutting produce the best results?</p>


答: Find a project you really think is cool with a tutorial and then work towards that. For programming, a good way to learn is to beg, borrow and steal from others by combining their programs to make a hybrid of your own. This gives you something good to start with and you can see what the programmer did to make it work in the first place.</p>

Title: How do I learn about Arduino/raspberry-pi based robotics on my own?

Body: I am interested in learning how to build a dynamic quadcopter, and hope to be fairly proficient with Arduino/raspberry-pi. What resources and/or practices might you recommend? </p>


答: robotergarten gave some really interesting tips, but in the end I decided to roll my own Google Speech client, using sox to record the user's voice. The ability to work without an Internet connection would be nice but is not really required for my demo, and response time is short enough.</p>

Title: Voice control solution for Linux robot?

Body:
I wanted to present a voice-controlled robot in my lab's upcoming demo contest. My robot is essentially a x86 Ubuntu notebook resting on top of a two-wheeled platform, so in principle any solution available on Linux would do.

I looked into Julius, but it seems the only comprehensive acoustic model available for it is aimed at the Japanese language – which coincidentally I can speak a little, but apparently not clearly enough to produce anything beyond garbled text. I also tried the Google Speech API, which has a decent selection of languages and worked very well, but requires Internet access. Finally there is CMU Sphinx, which I haven't yet tested, but I'm afraid might have a problem with my accent (I'm a nativa Brazilian Portuguese speaker, and apparently there is no such acoustic model available for it).

Is that all there is to it? Have I missed any additional options? As you may have guessed, my main requirement is support for my native language (Brazilian Portuguese), or failing that, good performance for English spoken with foreign accents. A C++ API is highly desirable, but I can do with a shell interface.


答: Also for completeness, I did find a Julius model for Brazilian Portuguese, but was rather underwhelmed with its performance – Julius would take several seconds to process any utterance, and usually get what I said hilariously wrong. A second model that promised improved performance for dictation would require me to recompile Julius in order to work, but at that point I had already resigned myself to relying on the Google cloud.</p>

Title: Voice control solution for Linux robot?


问:
F/OSS Optical Object Avoidance
I am beginning work on a larger scale, 250-350 lbs wheeled robot and looking to use both optical and other means of object avoidance. I am concerned with a robot this large causing issues with running into things, including people as it has a top speed of 15mph and that would cause issues with safety. I am starting out with a remote control but am looking to have the robot become self contained. I have been loosely following the DARPA driver-less car project but will not have anywhere near the fiscal or power budget that they do for sensors and computers. Am I thinking to far afield with my idea of having a self-contained robot in the 250-300 lbs range that does not break the bank on optical object avoidance? Any comments or experiences will be greatly appreciated.</p>

答:
Optical avoidance of people in an every-day (like) environment would be difficult, your best bet would be with sensing the range of things from the robot, rather than if it is a person or not. An Xbox Kinect could do the job if mounted in the right place. Alternatively you could use range finders, either the light or acoustic variety. I have used Ultrasonic sensors from these people before, and they are good at ranges from about 5cm to around 3 meters, although they have an unfortunately small field of view, but they work.

Alternatively, if you are able to have a controlled environment, such as an arena or room, you can use libkoki markers (or an alteration thereof) to define the edges or your arena and anything the robot must not go near. The libkoki libraries can be found here

Title: F/OSS Optical Object Avoidance


答: You could use the gps system for long-range co-ordination, an altimeter for height, and ultra-sonic sensors for close-range co-ordination. When the planes get in to close proximity the ultrasonic sensors would work for collision prevention. The only extra weight would be ultrasonic sensors, and an altimeter.</p>

Title: Spatial tracking between two UAVs

Body:
I have two Unmanned Aerial Vehicles (planes) which work well. They can fly to various waypoints automatically using GPS.

Now I would like them to fly together in formation. I would like them to fly side-by-side fairly close. This is too close to reliably use GPS to guarantee that they keep the correct relative positions safely, and so I am looking for another way.

Somehow the UAVs need to be able to measure their position and orientation in space relative to the other one. How can I do this? Is there some kind of sensor which can do this? It would need to have the following properties:

6 axes (position and orientation)

Range 0m - 5m, (from between plane centres, but planes won't actually ever touch wingtips)

Works in day or night and all weather conditions

Light weight (This is for 1.5m wingspan RC planes, so max extra weight of about 100g)

Probably need about 50Hz - 100Hz refresh rate, but might get away with less, using the IMU to fill in the gaps


问:
Differential Drive Robot on uneven surfaces
So I am building a differential drive robot and I want it to autonomously drive in a straight line on an uneven surface. I know I need a position and velocity PID. As of now, I am deciding on which sensors to buy. Should I use optical encoders, accelerometers, or something else?

I wanted to go with accelerometers due to the error encoders would face due to slippage, but I am not sure.

Some enlightenment would help!

答:
nanogru is right, you will need definatley need an IMU, not just an accelerometer. The one he recommended looks pretty good.

Would also recommend going down the Ardiuno track, it will make life much easier and cheaper.

I normally use encoders too. There is a good Arduino library for encoders:
http://www.pjrc.com/teensy/td_libs_Encoder.html

Have had good success with optical quadrature encoders. Can be read using digital or interrupt inputs. If you want the best performance, you will want to use at least a Mega to have enough interrupts.

You could also upgrade your robot with a laptop, Kinect, Linux, and ROS (if your robot can handle the payload).

This stuff is pretty easy to set up these days for 6DOF SLAM and autonomous navigation, especially with new tools like MoveIt:
http://moveit.ros.org/robots/

What do you plan on doing with the position data? Is it for autonomous navigation?


问:
Visualizing kinect data on rviz
I am a beginner of ROS, Kinect and Ubuntu. What I want is to visualize Kinect's data on rviz environment then run object recognition on it.

I've tried a few tutorials but had no luck. All I got was an empty rviz world.

Since I am a beginner I would appreciate any step-by-step instructions (preferably for hydro or groovy).

I would also like to note that I've managed to get visual from Kinect so the device is working fine.

答:
ROS Indigo Igloo will be coming out in a week or 2. Will be the first release in a year (they used to have 6 month release cycle, it has been a long wait). It moves at such a fast pace, so it may be worth waiting until it comes out so you don't have to set up your environment/re-learn new stuff again.

I would recommend you start with MoveIt, even if you already have Hydro or Groovy set up:
http://moveit.ros.org/documentation/tutorials/

With this tutorial first:
http://docs.ros.org/hydro/api/moveit_setup_assistant/html/doc/tutorial.html

Then move onto the integrating the Kinect:
http://docs.ros.org/api/pr2_moveit_tutorials/html/planning/src/doc/perception_configuration.html

Title: Visualizing kinect data on rviz


答:
a couple of years ago I tried Julius and it worked quite well. It is documented here, hope it helps:
http://achuwilson.wordpress.com/2012/01/11/speech-recogition-using-julius-in-linux/

and

http://achuwilson.wordpress.com/2012/01/11/chippu-speech-recognition/

Title: Voice control solution for Linux robot?


问:
How can I achieve long distance, high quality 3D Scans on a mobile robot?
Am going to be competing in Robocup Rescue in Thailand next year - I was too busy to pull off a campaign for Brazil this year :(

Will be using CUDA powered GPUs, Kinect/Xtions, and ROS as the primary navigation system, but I need a sensor for long range scanning - at least 25 meters. It is probably overkill for the competition, but I want it to be used in other real world applications. It will need to be very robust, fairly light, high resolution, and proven. The cheaper the better, but high quality is a must.

Have read this question, but I need something that is available and proven now:
What different sensing approaches are used in the current batch of indoor 3D cameras?

A similar question was asked before, but closed:
LIDAR solutions. The suggestion was good , but I need something with a lot more range:

At the moment am probably going to go with a the RobotEye RE05 or RE08 3D-LiDAR:

Here is a paper that descibes how this sensor can be used on a mobile robot: www.araa.asn.au/acra/acra2012/papers/pap125.pdf

Does anyone have any alternative techniques, or suggestions of a sensor that can achieve similar results?

答:
If cost is a factor, you can also do 3D reconstruction using stereo vision with a pair of commercial digital cameras. Many algorithms are available online to reconstruct 3D scenes from a pair of stereo images since this is a popular research topic.

The quality and range of the reconstructed scene will be a function of the image resolution, the image distortion, and the spacing between cameras.


答:
I think what you're really asking is what kind of actuator can I get that's powerful,  inexpensive, and simple, which rules out hydraulics.

I'm also building a robot arm... first to catch balls and hopefully fencing!
So I'm interested in speed and power, but not precision which is what most robots aim for.

To the best of my knowledge, if you want high power and use commodity parts, the answer is RC car motors and planetary gearboxes.

Motor: you need to get a sensored motor for precise running (especially during startup), braking, and counting revolutions. Here's an excellent recommendation:

Revolver stubby
    Very high amount of torque in a compact size due to being an outrunner (likely the only sensored outrunner out there thanks to John Holmes)

Planetary gearbox:
Look at BaneBots' P60 and P80 gearboxes.

I have used both of these to soup up a Scorbot 3 that I bought at a surplus depot and am impressed.

Title: What parts do I need for a strong robotic arm?

Body:
https://www.youtube.com/watch?v=MPhhYlIq294

I have found this robotic arm on the internet, and I was wondering if someone can tell me what parts I need to build it or similar. The video says it can lift a small cat.

I need to be able to program it, so I'll need a controller.

Please recommend specific motor, controller links that you recommend. Thanks :)