答:
Based on the calculations, it seems that any amount of torque can get
  the robot moving

That is true only for a theoretical robot moving in vacuum without any friction in its mechanisms. Normally if you limit a current too much, you won't even get the motor moving without any load, not to mention a whole robot.

the more torque, the faster the robot's acceleration

Yes, the acceleration is directly proportional to the force you apply $$
a=\frac{F}{m}
$$,
which in turn is directly proportianl to the torque
$$F=\frac{T}{R}$$
Both mass and wheel radius are constant, so when you increase torque, the acceleration increses also.

if the power source cannot supply the full stall current of the motors, will the robot not be able to start moving

The torque is proportional to the current you supply, so in the worst case scenario (depleated, undersized battery ant too weak motor) this may happen. However, for your robot and motors you should be fine. Your robot will just accelerate more slowly.

Once the robot reaches full speed and is no longer accelerating, theoretically the motors will not be providing any torque, but I do not think this is the case. Is it, and if so, how will I know how much torque they will be providing?

Again, you forget about the friction. Your robot will stop accelerating when friction will be equal to the torque. For Pololu motors this happens usually at 70-90% of motors no load speed, depending on robot's weight and mechanics.

Generally, in my calculations I usually choose 50% safety margin, and I have never had any trouble. You have some 30%, but that should be fine too.

Title: Relationship between motor torque and acceleration

Body:
I am working on designing and building a small (1 1/2 lbs), 2-wheeled, differential drive Arduino-controlled autonomous robot. I have most of the electronics figured out, but I am having trouble understanding how much torque the motors will actually need to move the robot. I am trying to use the calculations shown here and the related calculator tool to determine what speed and torque I will need. I will be using wheels 32mm in diameter and one of Pololu's High-Power Micro Metal Gearmotors. I performed the calculations for a robot weight of 2 lbs to be safe and found that the 50:1 HP Micro Metal Gearmotors (625 RPM, 15 oz-in) should theoretically work fine, moving the robot at 3.43 ft/s with an acceleration of around 29 ft/s^2 up a 5-degree incline.

However, I have not found an explanation for several things that I think would be very important to know when choosing drive motors. When the robot is not moving and the motors are turned on at full power, they should need to deliver their full stall torque. Based on the calculations, it seems that any amount of torque can get the robot moving, but the more torque, the faster the robot's acceleration. Is this true? Also, if the power source cannot supply the full stall current of the motors, will the robot not be able to start moving? In my case, I am powering the robot through a 7.2V (6S) 2200mAh NiMH battery pack that can provide around 2.6A continuously, and when it does that the voltage drops to less than 1V. Will this be able to power my motors? Once the robot reaches full speed and is no longer accelerating, theoretically the motors will not be providing any torque, but I do not think this is the case. Is it, and if so, how will I know how much torque they will be providing? Will the motors I chose have enough torque to move my robot?


问:
Slam Odometer Requirement
How accurate must my odometer reading be for SLAM ?

I am writing this extra section because it says my question body does not meet the quality standard.

答:
That's what's great about SLAM: it doesn't matter. As long as your sensor noise is modeled appropriately and the odometer readings can be translated to position changes, the general algorithm holds.

In a practical sense, with very high uncertainty from odometery, it will update the position just fine, but will seem to ignore the odometer when any other information is available (e.g., laser and static landmarks). Without other information, your maps may look like junk, but it will faithfully produce an estimate with correspondingly high uncertainty.

ContentLicense: CC BY-SA 3.0

Title: Slam Odometer Requirement


问:
How to get data from ArduPilot through Serial Port
I'm doing a project related to telemetry, and I want to make ArduPilot (programmed with ArduPlane 2.73) send through a serial port the sensors informations such as height, GPS position, etc.. I have tried to use ArduStation, but I could not change its firmware to do what I want.

The idea would be to read the Ardupilot's serial port using an Arduino Uno, and then saving it in a SD card in real-time. So ArduPilot needs to send data without any user input or something like that. I've already tried to manipulate ArduPlane source code to do that, but I couldn't either.

Has someone here did something like that before? I need some advice!

答:
To get the sensor data you need:

First to write a MAV_DATA_STREAM_EXTRA1 message to the arduCopter. This message tells it to send out the sensor data (and at what rate it should do that). (BTW - this message relates to yaw/pitch/roll data only).

Then you read the relevant data message (in this case MAVLINK_MSG_ID_ATTITUDE) and decode the relevant sensor data.


问:
Reliably establishing communication and OI mode with Create 2
I've started tinkering with a Create 2, but I'm having issues reliably getting it to accept my commands.  I can occasionally get it right, but sometimes, it just seems to ignore me.  I'm guessing my cleanup code isn't getting the state fully reset or something.  Is there a good pattern to follow for fail-safe initialization code?

Here's what I'm doing right now:

Pulse BRC low for 1 second

Wait 1 second

Send 16x 0 bytes (to make sure if it's waiting for the rest of a command, this completes it - seemed to help a bit when I added this)

Send 7 (reset)

Wait 10 seconds

Send 128 (start)

Wait 2 seconds

Send 149 35 (ask for the current OI state)

Wait 1 second

Send 131 (safe mode)

Sometimes I'm then able to issue 137 (drive) commands and have it work.  Most times it doesn't.  The times when it doesn't, I'm seeing a lot of data coming from the Create 2 that I'm not expecting, that looks something like this (hex bytes):

```<code>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3f 2a ff 73 21 09 cc 0a 88 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3f 2a ff 73 21 09 cc 0a
</code>```

There's more, but my logging cut it off.  I get the same pattern a couple of times, and it seems to be at least partially repeating.  I thought maybe it's the 16 0-bytes I sent followed by 003f 2aff 7321 09cc 0a88, but I still don't know how to interpret that.

Sometimes it will make some noise for the reset command, but usually ignores the start/safe mode commands completely (I can tell because the green light stays on).

答:
I figured out my problem - the '149 35' I was sending to ask for the current OI state (so I could confirm communication) was wrong. I should be sending '149 1 35'. From then on, it was all confused about what I was sending it, because it was expecting 35 sensor-id bytes.

Short version: make sure you follow the protocol right :(


问:
KUKA robot - update coordinates
I need to develop something in order to update some coordinates in a KUKA KR C4 robot predefined program.

After some research I've found some ways to do it, but all of them non free.

I had several options, like developing a HMI in the console with 3 buttons, to touch up the 3 coordinates that I have to update for example.

Sending a XML file would work too but I need a RSI connection, and I can't do it without proper software (I guess).

Do you know about something like this? Or a C++ library that allows me to have access the .src/.dat files or to create a new one with the same "body" but with different coordinates?

Summing up, imagine that I have a conveyor that carries boxes and I need to develop a pick and place program. So far so good. But every 100 boxes, the size changes (and I can't predict it). So the operator goes and updates the coordinates, but I want to make sure that he won't change anything else in the program. Any ideas?

答:
This is as far as it can be from an elegant solution:

You can access the src and dat files via ftp. You can manipulate them as you like afterwards. However you cannot load them into memory without pressing some buttons on the panel. To circumvent this you might be able to install a program on the windows os running on the kuka controller that can move the mouse by getting external command via ethernet. You cam change the src file by editing over ftp and instruct the virtual mouse program to make some clicks to load the src into memory.

A somewhat more elegant solution is:
Make the operator switch the robot from auto-ext mode to T1 (as I recall this unloads the program from memory) with a hardware switch. Access teh program vie ftp edit on a PC with custom hmi copy back via ftp and instruct the operator to switch the robot back to aut-external (as I recall it loads back the program to memory) with a hardware switch)

Title: KUKA robot - update coordinates


问:
Choosing motor type for high reliability for many cycles
I am designing a multi modal stent testing machine which will bend, twist, and compress stents (very thin, light, and fragile cylindrical meshes for in arteries) in a tube. The machine will operate at maximum 3.6 Hz for months at a time (> 40 million cycles). As the machine will be in a lab with people, the noise should be minimal. I am choosing actuators for my design but was overwhelmed by the range of products available.

For rotating the stents around their axis, I will need a rotary actuator with the following specs:

torque: negligible max angle: 20 deg

angular velocity needed: max 70 deg/s

hollow shafts are a plus

For compressing the stents, I will need a linear actuator with the following specs:

force: low (<1N)

max stroke: 20mm but if possible 70mm for allowing different stent lengths

stroke velocity needed: max 120mm/s

Price of these motors is not the driving factor.

I looked into stepper motors, servo motors, and piezoelectric motors. There seems to be s huge selection that fits my requirements. If all motor types have a reliability that suits my needs, which characteristics/advantages/disadvantages should I consider that determine the selection of suitable actuators? I do know what the difference is between the motor types, but there is a lot of overlap. Concrete suggestions are welcome.

答:
Brushless (AC) permanent magnet motors are a reliable technology that has good controllability.

Look for companies whose controllers suite you. Many will have a basic motion environment that is enough to set up your tests without any custom programming.

Maxon and Faulhaber are good sources for small motors and controllers. Faulhaber has direct drive linear motors.

If your hollow shaft is for wiring, and you end up using a hollow shaft motor, make sure you do some stress calculations for the wires. You may find that bending stress (coming in from the side) is better than torsional. Make sure you have wire break detection or use something capable of the fatigue like beryllium copper for the flexing wiring.


答:
Certainly, as @Hauptmech says, a brushless motor is preferred for long-term reliability testing.  I would select between BLAC and BLDC based on the required smoothness of the acceleration profile.   From your description it sounds like that isn't a key performance indicator, so a BLDC motor might be just fine (the difference being whether a trapezoidal or a sinusoidal profile is used to drive the motor).  You could implement a stepper motor, also, which is really just a high pole count brushless motor.   That would be simple to control and would provide the same reliability as any other brushless motor.

Another mechanical aspect to consider is that of bearing spacing and the ability to withstand off-axis loads (for rotary motors), and off-axis moments (for your linear drives).   The bearings are by far the most likely mechanical item to go bad during your reliability test, so I would compare the specs for those items, assuming all else is equal.

Since you stated in your question that many technologies would seem to meet your requirements, I would also focus on how easy it would be to maintain the test system, and on how easy it will be to set up.   The main issues I would look at for maintainability are fairly trivial items - going with a company that has a support person in your area, ensuring you can source any required replacement items locally (even though specs say something will last for 5M cycles, not every one will), and being able to get the ancillary components (drives, power supplies, etc) if any of them go bad.   For ease of setup, I would look for a company that has quality applications engineers, and for technologies that your company has used in the past.   If both a stepper and a BLDC motor meet your reliability requirements, and your company has used BLDC motors but not steppers in the past, it would make sense to go with the technology you have experience with.

There are so many good options for you.  I also suggest that you rationalize a strategy for making this decision, and then make it.   Your testing won't be any better if it takes you three months to decide than it would if you came up with a solution this week :-)

Title: Choosing motor type for high reliability for many cycles

Body:
I am designing a multi modal stent testing machine which will bend, twist, and compress stents (very thin, light, and fragile cylindrical meshes for in arteries) in a tube. The machine will operate at maximum 3.6 Hz for months at a time (> 40 million cycles). As the machine will be in a lab with people, the noise should be minimal. I am choosing actuators for my design but was overwhelmed by the range of products available.

For rotating the stents around their axis, I will need a rotary actuator with the following specs:

torque: negligible max angle: 20 deg

angular velocity needed: max 70 deg/s

hollow shafts are a plus

For compressing the stents, I will need a linear actuator with the following specs:

force: low (<1N)

max stroke: 20mm but if possible 70mm for allowing different stent lengths

stroke velocity needed: max 120mm/s

Price of these motors is not the driving factor.

I looked into stepper motors, servo motors, and piezoelectric motors. There seems to be s huge selection that fits my requirements. If all motor types have a reliability that suits my needs, which characteristics/advantages/disadvantages should I consider that determine the selection of suitable actuators? I do know what the difference is between the motor types, but there is a lot of overlap. Concrete suggestions are welcome.


问:
If I must fly my drone in bad weather, how can I maintain control of it in strong winds?
If I need to fly a drone in strong winds, how can I stabilize it? Should I use accelerometers and gyroscopes to keep it steady? Or should I just use some flight technique under such circumstances?</p>

答:
In controls this is known as disturbance rejection.  In order to sustain your motion in the presence of high winds you need the controller to be as responsive as possible, and an accelerometer would help.    A fast loop rate will also help.

You also have to deal with the nonlinearities of thrust, drag, weight, and lift.  Depending on the design of your drone, you might be able to "point it into the wind" to get some additional lift.   But the dynamics of this are very difficult.


问:
Will connecting two servo motors double the torque?
For my robot, I am using two continuous rotation servos to spin a threaded rod. I am trying to make this project as cheap as possible. Here are the servos that I can find:

Servo #1: This is a very cheap option and it has half of the torque I need.

Servo #2: This has all of the torque my project requires, but it is much more expensive that two of servo #1.

Can I hook up two of servo #1 to each end of the rod and have them move synchronized? I can spare a few extra pins on my microprocessor that I am using; that isn't a issue. I know hooking two together will increase torque, but I don't want 75% of the torque I want in this situation. Also, I don't care if I only have 98% of my torque "goal" with the extra weight (which probably won't happen) but I don't want to, like I said earlier, have 70, 80, 90% of my "target goal" of torque if possible.

Any help appreciated. Thanks in advance.

答:
In theory, you're correct.  But in practice, slight differences between the two motors will make them fight each other instead of working in perfect harmony:

Even the smallest mismatch in wire tolerances, lengths etc. will create
  different back emf characteristics due to different impedances.

So both will work separately, but the actual characteristics of the 2
  motor within the very small timeframes of a "minimum" move at relatively
  high speed will not be in synch .. and thus the 2 motors fight each other.

For this reason, your plan to save money by connecting a second servo to your microcontroller will probably cost you money.  Not only are you shortening the life of the servos, you're doubling your chance of a servo failure.  Worse, the failure of one servo may cascade to the other unless you are using a mechanical linkage (as ApockofFork's answer recommends), e.g. the one in this video.

With that said, connecting multiple servos with a fixed linkage is done all the time, e.g. RC plane rudders, RC plane ailerons.  But to avoid the problems cited earlier, it requires an additional control component that can compensate for the differences in the electrical characteristics of the servos.  These are commonly called "servo equalizers", "matchboxes", or "servo synchronizers".


问:
Why would a drone need a magnetometer? Are an accelerometer and a gyroscope not sufficient?
Why would a drone need a magnetometer? What would the drone do with this information? I think it would be to tell direction, but why would it need this if it has an accelerometer and a gyroscope?</p>

答:
The main difference between accelerometer and gyroscope vs magnetometer is that first two give only relative information - you may calculate heading relative to your starting position, but you won't have any idea how this heading relates to world directions.

What's more, as both gyroscope and accelerometer give you only accelerations values, calculation of pose and heading basing on their readings is incremental. That means that pose estimation error increases over time. Magenetometer can be used to correct these data.

Edit:
As Jakob stated in the comment, accelerometer can also be used to estimate pose (roll and pitch angles), but only when your drone doesn't accelerate and you measure gravity only. When drone accelerates, you won't know for sure how much of the acceleration comes from its movement and how much from gravity force.

Generally, more sensors let you account for errors more easily and make pose estimation more accurate. If you want more information, "sensor fusion' is a good keyword to start. Also this question on Kalman filter is worth reading.


问:
VEX Cortex Motor Speeds up under load
I am trying to get my robot to drive straight and am having trouble.  I find that when running the motors with no load they run fine.  If I put a load on one motor it accelerates.  The other performs as expected, it tries to maintain speed.  I am running 393 motors with encoders and PID selected.  I am running robot C.

See the following video: https://youtu.be/u3P0Wectwco

program is as follows;

```<code>#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, dgtl12, killB,          sensorTouch)
#pragma config(Sensor, I2C_1,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign )
#pragma config(Sensor, I2C_2,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign )
#pragma config(Sensor, I2C_3,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign )
#pragma config(Motor,  port2,           rmotor,        tmotorVex393_MC29, PIDControl, reversed, driveRight, encoderPort, I2C_1)
#pragma config(Motor,  port3,           lmotor,        tmotorVex393_MC29, PIDControl, driveLeft, encoderPort, I2C_2)
#pragma config(Motor,  port4,           topmotor,      tmotorVex393_MC29, openLoop, encoderPort, I2C_3)
#pragma config(Motor,  port5,           pmotor,        tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

void StopAll(){
    motor[rmotor] = 0;
    motor[lmotor] = 0;
    motor[topmotor] = 0;
    motor[pmotor] = 0;
}

//Stops the program at the push of a button
task eStop(){
    while (SensorValue(killB) == 0){
        wait1Msec(10);
    }
    StopAll();
    stopAllTasks();
}

task main()
{
    startTask(eStop);

    nMotorEncoder[rmotor] = 0;
    nMotorEncoder[lmotor] = 0;

    motor[rmotor] = 15;
    motor[lmotor] = 15;
    wait1Msec(20000);
    motor[rmotor] = 0;
    motor[lmotor] = 0;
    StopAll();

}
</code>```

Thank you,

Mark

答: The problem was with the motor encoder.  Upon disassembly, I discovered that the encoder was installed improperly.  For whatever reason, the encoder gear was installed without an axle.  Under no load, it worked.  When under load apparently it would shift enough to cause it to miss counts causing the encoder to under sense speed, thus speeding up to motor.</p>

Title: VEX Cortex Motor Speeds up under load


问:
Why does the Pixhawk have 2 IMUs
I was looking at the Pixhawk specs and noticed that it has 2 different IMUs- Invensense and STM. Is it for redundancy or does it have any other higher purpose?</p>

答:
Why someone would choose to use 2 different brands, I am not sure.

It is VERY common and indeed common sense to use different brands of a critical component for security.

This is because the chances are the the same brand component is likely to have the same point of failure. Therefor two different brands are used as they are unlikely to have the same point of failure. In aerospace systems this is the MINIMUM requirement i.e. several IMUs all of different brands.

Title: Why does the Pixhawk have 2 IMUs


问:
RRT algorithm in C++
I want to implement RRT for motion planning of a robotic arm. I searched a lot on the internet to get some sample code of RRT for motion planning, but I didn't get any. Can someone please suggest a good source where I can find RRT implemented in C++ for any type of motion planning.</p>

答:
The first hit on GitHub gives me the following implementation, which is what you seem to be looking for.

https://github.com/RoboJackets/rrt

Title: RRT algorithm in C++


答:
A magnometer lets the drone control its geographical heading. It's really the accelerometer that tells direction (not the gyroscope) and, in this case, the direction is down-wards. This provides feedback to manipulate the drone's pitch-and-roll positions. A magnometer tells another direction - feedback used to manipulate the angular yaw position.

At its most basic, any autopilot system needs to control the aircraft's flight dynamics: pitch, roll and yaw (or azimuth).

A gyroscope senses angular velocity across the pitch-, roll- and yaw-axis. A system could use this feedback to manipulate the speeds of the motors such that desired angular velocities are maintained across all axes.

An accelerometer senses force along the pitch-, roll- and yaw-axis. A system could use this data, combined with data from the gyroscope (see "sensor-fusion"), to estimate the aircraft's orientation relative to the ground and use this feedback to manipulate angular velocities such that desired angular positions are maintained in the pitch-and-roll axes.

A magnometer senses magnetic flux density across the pitch-, roll- and yaw-axis. A system could use this data, combined with data from the accelerometer and gyroscope, to estimate the aircraft's orientation relative to the Magnetic North Pole and use this feedback to manipulate angular velocity such that a desired angular position is maintained in the yaw-axis.

Without a magnometer, only the angular velocity can be maintained in the yaw-axis (not the angular position, which exists only relative to some known direction). In theory, provided that such direction is given upfront as an initial vector, it is possible to use the gyroscope data as feedback to track the aircraft's relative orientation as it rotates over time. In practice, however, this integration accumulates error (see "gyroscope drift") and the method soon becomes impractical without also incorporating feedback from other sensors (that provide a means of some direction relative to the aircraft).

Title: Why would a drone need a magnetometer? Are an accelerometer and a gyroscope not sufficient?

Body: Why would a drone need a magnetometer? What would the drone do with this information? I think it would be to tell direction, but why would it need this if it has an accelerometer and a gyroscope?</p>


问:
Why do I need I-gain in my outer-loop?
I'm implementing a set of loops to control pitch-and-roll angular positions.

In an inner-loop, motor speeds are adjusted to achieve desired angular rates of rotation (the "inner-loop setpoints").

An outer-loop decides these desired angular rates (the "inner-loop setpoints") based on the aircraft's angular positions.

Outer-loop

Frequency = ~400Hz

Outer PV = input angular position (in degrees)

Outer SP = desired angular position - input angular position (in degrees)

Inner-loop

Frequency = ~760Hz

Inner PV = input angular rotation (in degrees-per-second)

Inner SP = constant1 * Outer MV (in degrees-per-second)

PWM = Inner MV / constant2 (as percentile)

I understand what I-gain does and why this is important, but I'm not able to see any practical reason for also having I-gain specified in the outer-loop. Surely the inner-loop would compensate for any accumulated error, leaving no error to compensate for in the outer-loop, or is my thinking flawed?

Any example gain values to elaborate would be greatly appreciated.

答:
In my own experience, it is not necessary Integral term in any of these loops. I got a fine PD tuning of both inner and outer loop. See for instance this paper, where I firstly tuned PD only with PSO.

Wikipedia shows a simple animation of each of the effects of P-I-D in any tuning https://en.wikipedia.org/wiki/PID_controller#Manual_tuning.

Title: Why do I need I-gain in my outer-loop?


答:
Integral gain is how you eliminate steady state error. An integral gain in the inner loop means you'll (eventually) have no steady state error on the angular velocity.

What ensures no steady state error on angular position, which is arguably the more important of the two? Outer loop integral error.

Title: Why do I need I-gain in my outer-loop?

Body:
I'm implementing a set of loops to control pitch-and-roll angular positions.

In an inner-loop, motor speeds are adjusted to achieve desired angular rates of rotation (the "inner-loop setpoints").

An outer-loop decides these desired angular rates (the "inner-loop setpoints") based on the aircraft's angular positions.

Outer-loop

Frequency = ~400Hz

Outer PV = input angular position (in degrees)

Outer SP = desired angular position - input angular position (in degrees)

Inner-loop

Frequency = ~760Hz

Inner PV = input angular rotation (in degrees-per-second)

Inner SP = constant1 * Outer MV (in degrees-per-second)

PWM = Inner MV / constant2 (as percentile)

I understand what I-gain does and why this is important, but I'm not able to see any practical reason for also having I-gain specified in the outer-loop. Surely the inner-loop would compensate for any accumulated error, leaving no error to compensate for in the outer-loop, or is my thinking flawed?

Any example gain values to elaborate would be greatly appreciated.


问:
How to decide the battery power for my robot
I need my motor to be powered with 12V, 5A for 1 hour continuously. How can i decide the Ah rate of the battery. Please suggest some lithium ion battery for the specification</p>

答:
The Ah rating is a measure of charge - how many amps the battery can supply, for how long.

In your case you need 5A for 1 hour, and that is simply 5 Ah. You multiply the current by the time required, to get the charge needed.

Next, The voltage rating is basically how many cells are used to make up that battery. You can't control that - you just have to get a battery that has the correct number of cells.

So the full specification you need is: something rated for approximately 5Ah at approximately 12V.  (I can't advise on which one you should buy, as there are so many other factors that have to be taken into account.)


答:
How accurate must my odometer reading be for SLAM ?

There is no specific level for the accuracy. This is why the modern approaches for building SLAM are probabilistic approaches. This is due to the fact that noise in any sensor is inherited even with very accurate ones. The heavy load with very noisy sensors will be on your filters. You need very good filters to at least run SLAM in very simple maps (e.g. a bunch of points).

Title: Slam Odometer Requirement

Body:
How accurate must my odometer reading be for SLAM ?

I am writing this extra section because it says my question body does not meet the quality standard.


答:
As other people have said, in a steady-state condition, a gyroscope+accelerometer sensor suite can successfully estimate the roll and pitch values of the UAV, but not its yaw angle.

However, there have been early successful fixed-wing UAV autopilots which managed to solve the yaw value through differentiation of the GPS signal. One such example is the MatrixPilot system.

This was possible since an airplane is aligned with the GPS track, more or less, with the roll and pitch values being independent of that solution. Naturally, this is not possible with a multirotor which can move at any direction regardless of heading.

But in the case of sustained turns, the additive Corriolis force dubs the accelerometer into thinking that the aircraft is inclined in a different pose than the actual one. Gradually, the solution from an AHRS filter diverges and gets tricked into thinking that the plane is banked less than the actual angle.

When coming out of the turn, the AHRS solution is badly corrupted and takes a long time to get re-adjusted by the GPS track.

The magnetometer can solve this problem, by providing a stable reference vector, throughout the turn.


问:
Type of servo and torque calculation required for a 2axis robot arm
I am trying to build a 2-axis robot arm with pan and tilt mechanism. The gripper/holder will hold an object weighing 300 grams. The total weight of the arm including the motors will be around 2 kg. I have decided to use 180 degree servo motors. The maximum arm reach will be 340 mm.
what I want to ask is:

What kind of servos (analog/digital) will be suitable to support the
total weight (2 kg) and the object weight (300 g)?

How do I calculate the required torque?

How many servos should I use to make sure that my arm doesn't flip
over?

Please suggest me if there is a better approach to designing the robot. I am fairly new to electronics and this is the first time I am building a robot.
Thanks in advance.

答:
Torque is pretty easy to calculate.  A 300 gram (2.94 Newton) mass at the end of a 340 mm (0.34 meter) arm is 1 Nm.  (2.94 * 0.34).  If the arm weighs 2 kg (19.61 N), and its center of mass is half it's length, (0.17 m), that adds another 3.33 Nm.  So a total of 4.33 Nm.  But this doesn't take into account the joint's rotational acceleration which you didn't specify.

You should check out this arm torque calculator.  The robot arm tutorial on that same site also has lots of helpful info.

I'm not sure what you mean about the arm flipping over.  But to ensure that a rigid body does not tip, simply sum the torques about the edge of the supporting convex hull.


问:
Any books or web resources for robotics mechanical design?
I plan to build a mechanism with multiple axis, which is similar to a robot. To start, I need to define some specifications such as repeatable precision, speed, acceleration, and payload. Then the motor and structure is selected and designed based on these parameters. After that, I need to choose methods to manufacture these components. I would like to consult experienced experts in this forum that is there any suggested books, textbooks, or website resources I can learn these knowledge? </p>

答:
You could look at three books.

A Mathematical Introduction to Robotic Manipulation - S.Sastry, X.Li and R.Murray provides a theoretical foundation to the kinematics, dynamics and control aspects of robotic manipulators. The only downside to this book is that it lacks in algorithmic content like that available in Probabilistic Robotics - Sebastian Thrun

Robotic Engineering An Integrated Approach deals with the A to Z of designing a robotic manipulator. It gives you a theoretical overview of the fundamental concepts. In terms of design it takes you from requirements through implementation and practical considerations while choosing actuators, computing systems etc. The downside for this book is the same as the previous book.

Mechanical Design of Robots covers mechanical engineering topics such as stresses, strains, structures, linkages etc. It is a book to help you design a robotic system from a functionality standpoint. The author maintains that design of robots should not necessarily compromise on aesthetic values by always going by the worst case scenario.


答:
What Ians answer says about the two motors fighting is true however, I wouldn't go as far to say that you can never put two motors together for more power. In general  if the two motors are identical and you are hooking them up and controlling them identically then you can probably get away with it but I would expect some wasted energy and thus extra heat from the two motors fighting a little bit. You will also not get exactly two times the output.

Worst of all it will probably hurt the lifespan of the motors. In other words it will probably do in a pinch but is definitely not ideal. If you really do, do a good job syncing them up then you can theoretically keep the losses to a manageable level.

If you are going to use two motors on the same output you will probably want to gear them together or use some other linkage that isn't fixed (I.E. don't attach them both to the same shaft). That way there is some looseness between them so they will fight each other a little less.

Title: Will connecting two servo motors double the torque?

Body:
For my robot, I am using two continuous rotation servos to spin a threaded rod. I am trying to make this project as cheap as possible. Here are the servos that I can find:

Servo #1: This is a very cheap option and it has half of the torque I need.

Servo #2: This has all of the torque my project requires, but it is much more expensive that two of servo #1.

Can I hook up two of servo #1 to each end of the rod and have them move synchronized? I can spare a few extra pins on my microprocessor that I am using; that isn't a issue. I know hooking two together will increase torque, but I don't want 75% of the torque I want in this situation. Also, I don't care if I only have 98% of my torque "goal" with the extra weight (which probably won't happen) but I don't want to, like I said earlier, have 70, 80, 90% of my "target goal" of torque if possible.

Any help appreciated. Thanks in advance.


问:
Pose-Graph-SLAM: How to create edges if only IMU-odometry is given?
I want to estimate the poses of a vehicle at certain key frames. The only sensor information I can use is from an IMU which yields translational acceleration and orientation measurments. I obtain a 7D pose, i.e. 3D position vector + unit quaternion orientation, if I integrate the translational acceleration twice and propagate the orientation measurements.

If I want to add a new edge to the graph I need a constraint for that edge. In general, for pose graphs this constraint represents a relational transformation $z_{ij}$ between the vertex positions $x_i$ and $x_j$ that are connected by the edge.

Comparing my case to the literature the following questions arised:

How do I calculate a prediction $\hat{z}_{ij}$ which I can compare to a measurement $z_{ij}$ when computing the edge error? Initially, I understood that graph slam models the vertex poses as gaussian distributed variables and thus a prediction is simply calculated by $\hat{z}_{ij}=x_i^{-1} x_j$.

How do I calculate the information (preferred) or covariance matrix?

How and when do I update the information matrices? During optimization? Or only at edge creation? At loop closure?

I read about the chi-square distribution and how it relates to the Mahalanobis distance. But how is it involved in the above steps?

Studying current implementations (e.g. mrpt-graph-slam or g2o) I didn't really discover how predictions (or any probability density function) is involved. In contrast, I was even more confused when reading the mrpt-graph-slam example where one can choose between raw poses and poses which are treated as means of a probability distribution.

答:
First off, it doesn't sound like you're actually doing SLAM. You didn't mention an exteroceptive sensor (e.g., laser, camera) that actually maps the environment. With just an IMU, you are doing localization, or more specifically, dead-reckoning. With just an IMU, there is no way to actually implement pose-graph SLAM in its usual formulation.

That being said, I'll try to answer your questions pretending you have some exteroceptive sensor that is measuring the environment, with which you can generate pose-transformation measurements.

Let's say the nodes in the graph are $x=(x_1,...x_n)$, where $x_i = (p_i, q_i)$ is the position $p_i$ and orientation $q_i$ of the node (6 DOF). Then the predicted observation between them is simply their relative position and relative orientation. For example, if the orientation is parameterized as a unit quaternion, $\hat{z}_{ij} = (p_j - p_i, \log(q^{-1}_i q_j)).$ For an explanation as to why the $\log$ is there, see one of my other answers.

In pose-graph SLAM, the information matrix is the "Hessian" $J^\top \Sigma J$ (not actually the Hessian, just an approximation), where $J$ is the Jacobian of your errors with respect to your state, and $\Sigma$ is the information matrix of your measurements.

The information matrix changes every time you add a node, every time you add an edge, and every time you optimize the pose-graph. You can calculate it at any time by calculating $J^\top \Sigma J$.

Your cost function that you are trying to minimize represents the Mahalanobis distance between your predicted and actual measurements, which has a chi-square distribution.

Not really sure exactly what you mean here. Note that you are trying to maximize the likelihood of your observations, which means you are trying to find the state the maximizes the PDFs of your measurements. How do we do this? We take the negative log of the Gaussian PDF, which forms our cost function. For example, for a 1-D linear system, the cost of a measurement is the negative log of the PDF of the measurement:

$$
f(z|x,\sigma) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{\left(z-Hx\right)^2}{2\sigma^2}\right)
$$

$$
-\ln(f(z|x,\sigma)) = \eta\frac{\left(z-Hx\right)^2}{2\sigma^2}
$$

Note that $\eta$ is a normalization constant that does not depend on $x$, therefore it has no effect on the optimization. The goal of pose-graph SLAM is to find $x$ that minimizes $-\ln(f(z|x,\sigma))$ for measurements simultaneously. If you consider the measurements independent, then the cost is just the sum of the negative log-likelihoods.


问:
Quadcopter Props? Wood vs Plastic vs Carbon Fiber
All the pro FPV builds and the more expensive quads don't seem to be using plastic props. Any reason for this?</p>

答:
Maybe this would help. The flex is just a twist. The twist causes a lower angle of attack, progressively worsening the further out the blade you travel and as the revolutions are increased (where and when you're getting your most lift). It's the point hitting the air hardest.

Less angle of attack means less bite, resulting in less lift and less response (this is also the reason variable pitch works). The denser the air, the less angle of attack needed and vice versa. Also the twisted blade takes less power to rotate. Flatter blades give less lift and less response but will increase the flight times due to less drag on the twisted prop. A prop is just a wing that rotates - drag and lift.

The tests were done long before quads through. Sikorsky might have been the first to do wind tunnel and lift capabilities tests I think if you would like another place to search. I hope this helps.


问:
Calibrate a 2d scanner mounted on a rotary axis
A 2d laser scanner is mounted on a rotary axis. I wish to determine the transformation matrix from the center of the axis to the center of the scanner, using only the input from the scanner and the angle of rotation.

The 2d scanner itself is assumed to be calibrated, it will accurately measure the position of any object inside the plane of the laser, in regards to the scanner origin.

The rotary axis is calibrated as well, it will accurately measure the angle of its own movement.

The scanner is aligned and mounted close to the center of rotation, but the exact offset is unknown, and may drift over time.

Assume it is impractical to measure the position and orientation of the scanner directly.
I am looking for a way to determine the exact values for the 6 degrees of offset the scanner may have in relation to the axis, determined solely on the 2d information from the scanner and the rotation angle from the axis.

I am mainly interested in the 4 offsets depicted here, since the other two do not matter in regard to generating a consistent 3d point cloud from the input data.

By scanning a known calibration object, it should be possible to determine these offsets. What are the mathematical formulas for this?

What sort of calibration information is required at a minimum?
Is it for example possible to determine all parameters simply by scanning a flat surface, knowing nothing about the surface except that it is flat?

(The transformation matrix from rotation axis to world is unknown as well, but that one is trivial to determine once the transformation from axis to camera is known.)

Example

On the left the camera is placed exactly on the rotational axis.  The camera scans a planar object with reference points A B and C. Based on the laser distance measurements and the angle of the axis, this planar object can be reconstructed.

On the right, the camera has an unknown offset to the axis. It scans the same object. If the point cloud is constructed without knowing this offset, the planar surface maps to a curved surface.

Can I calculate the offset based on the surface curvature?

If I know the real-world distances and angles between A, B and C, how can I calculate the camera offsets from that? What would be the minimum number of reference points I need for all 4 offsets?

答:
The simplest method in this case is to essentially brute force the problem but to brute force it in an intelligent manner.

What you will need is a set of data from the scanner while it is scanning an object, preferably a mathematically simple object like a cube or a sphere and the exact offset position or offset of that object relative to the mount of this scanner.

If you have these two pieces of information the next trick is essentially testing various combinations scanner offsets (what I would typically call calibration values) until you find offsets that cause the scanner data to accurately represent your object. For this you can either randomly guess values which can take forever and not get anywhere (but in theory would eventually get you the right answer) or you can use an optimization method

To use an optimization method you will need to develop some sort of metric to say whether a particular set of offsets works better than another set. Then whatever optimization method you are using will use that score to say whether to adjust the values in a particular direction. Eventually it will settle on a particular set of values that seem to work best.

This is a pretty brief and poor description of a very in depth topic but hopefully it will get you pointed in a direction. If you would like a more detailed description of anything leave a comment.


问:
What is the common process to place a robotic arm gripper
I implemented a simulation for a robotic arm that has to grab things. This arm has a 6DOF structure and a simple gripper on the top. I made a simple CCD IK algorithm to control the arm. I can use it in two ways:

Compute the position of the last joint of the arm before the hand
part (which means 1 end-effector). Then use an analytical method to
place the hand in a good orientation.

Compute directly the arm, and the hand position by giving the CCD IK algorithm 2 end-effectors that are the 2 finger of the hand.

What is the most used method for a grabbing arm robot ? I'm not willing to find a solution, just to know what people usually do.

答: If your robot has a spherical wrist, meaning all three axes intersect at a point, you can use wrist partitioning to solve your problem.  With wrist partitioning, you use the first three joints of the robot to place the center of the wrist at a desired position, then use the three wrist axes to orient the end effector.   It becomes two simpler problems vs one difficult problem.


问:
Can we simulate a actuator with a very strong torque with a PID controller
I use gazebo to simulate a robot arm. To control its joints, I use PID controllers. As you might know, PID are sometimes pretty hard to tune and this is the case for a robotic arm. To avoid any tuning, and because I don't need the PID values to be realistic, I set to zero the derivative and integral parameters, increase a lot the proportional gain and add a lot of damping in my joints. By doing this, I can get a well working arm but only if I disable the gravity.

My question is the following. Do you have an idea how I could simulate a very strong actuator with not necessarily realistic parameters?

EDIT 1: Setting the integral and derivative gain is stupid. The integral gain helps in correcting the effect of the gravity. The derivative gain counters the loss of stability and speed due to the integral gain.

This question somehow leads to another. Do you know what tuning do the robotic arm manufacturer (big arms for car industry for example). I guess that this arm use actuators with a very strong torque and a low maximum speed which reduces the need of tuning.

EDIT 2: More info on my setup. I use gazebo 6, with ODE. The robot description is in SDF. I control the robot with a model plugin. As a PID controler I use the PID class from the common library of gazebo and get directly the JointControler associated to the model.

Let say that I would like actuators very robust without any tuning needed. This way I could have a simulation WITH dynamics (by opposition to the SetPosition method). Do you think it is possible ?

答:
I can get a well working arm but only if I disable the gravity.

It seems to me you are not using feedback linearizing approach with your PID controller. Remember PD and PID work only with linear models. If you have no uncertainties in your model which is what you are looking for by saying "an ideal motor", then PD works very well. Once you add uncertainties in your model then you need to utilize PID to overcome the steady state error.


答:
Each control system has its own characteristics (overshoot, damping, settling time, response time, etc).

The outer loop is just another control system, so it may have a steady state (residual) error. And the I term is necessary to get rid of it.

If you had a third level controller (e.g lateral acceleration) you would still need another I term. And if you had a higher level outer loop (e.g. Speed), you would still need yet another I term in that loop. If you had yet another higher level (outer) loop (e.g. Position), you would again need an I term. Otherwise you run the risk of not reaching your target location.

Of course if the intermediate control variables are not important (e.g acceleration), you might just cancel that I term of that loop. However, any time you want to get rid of the steady state error of any of your variables (in any of the loops), you use an integral term.

Title: Why do I need I-gain in my outer-loop?


问:
Finding rotation quaternion
I am trying to use a quaternions for robotics and there is one thing I don't understand about it. Most likely because I don't understand how to define position with quaternions and how to define rotation with quaternions if there is any difference..

Please watch my "understanding steps" and correct if I am wrong somewhere.

Lets assume I we have 2 vehicle positions described by 2 rotation quaternions:
$$
q_1 = w_1 + x_1i + y_1j +z_1k = \cos(\pi/4) + \sin(\pi/4)i
$$
This quaternion is normalized and represents rotation over the $x$ axis for $\pi/2$ angle as I understand it.
$$
q_2 = w_2 + x_2i + y_2j + z_2k = \cos(\pi/4) + \sin(\pi/4)k
$$
And this one represents rotation for the same angle $\pi/2$ over the $y$ axis.

$q_1*q_2 = q_3$ which would be the same rotation as if we made $q_1$ first and $q_2$ second.
$$q_3 = \frac{1}{2} + \frac{i}{2} +\frac{j}{2} +\frac{k}{2}$$

QUESTION 1: Given $q_2$ and $q_3$ how can I find $q_1$?

QUESTION 2: How to find a rotation angle over some other vector, given rotation quaternion? For example I want to find on what angle does $q_3$ turned over $2i+j-k$ quaternion.

答:
Unit quaternions are used to define rotations, and has nothing to do with position. It defines all points in $SO(3)$, the 3D rotation group, and does not suffer from singularity, as in the case of Euler angles.

The quaternion ${\bf q}_1=\cos(\pi/4)+\sin(\pi/4)\bf i$ represents rotation about (not over) the $\bf i$ vector, which in general represents the $x$-axis,  by an angle of $\pi/2$. This can be easily understood by the equivalent axis-angle representation. Any quaternion can be written as ${\bf q}=\cos(\phi/2) + \sin(\phi/2){\bf k}$, where ${\bf k}$ is a unit vector representing the axis of rotation and $\phi$ is the angle in radians. Following the logic, the quaternion ${\bf q}_2=\cos(\pi/4)+\sin(\pi/4)\bf k$ represents rotation about the $z$-axis and not $y$-axis.

The equivalent rotation of first performing ${\bf q}_1$ and then ${\bf q}_2$ is given by ${\bf q}_3={\bf q}_2{\bf q}_1$. Note the order of the multiplication. Also, the quaternion multiplication is not commutative. The quaternion multiplication is performed using the following rules:

${\bf ij}={\bf k}$, ${\bf jk}={\bf i}$, ${\bf ki}={\bf j}$

${\bf ji}={\bf -k}$, ${\bf jk}={\bf -i}$, ${\bf ki}={\bf -j}$

${\bf i}^2={-1}$, ${\bf j}^2={-1}$, ${\bf k}^2={-1}$.

Following these rules, one can calculate ${\bf q}_3={\bf q}_2{\bf q}_1=\frac{1}{2}+\frac{1}{2}{\bf i}+\frac{1}{2}{\bf j}+\frac{1}{2}{\bf k}$.

In order to find ${\bf q}_1$ if ${\bf q}_2$ and ${\bf q}_3$ are given, one can write the equation as

${\bf q}_1={\bf q}^{-1}_2{\bf q}_3$.
The inverse of a quaternion ${\bf q}^{-1}_2$ is given by its conjugate.

Hence, ${\bf q}^{'}_1=(\cos(\pi/4)-\sin(\pi/4){\bf k})*(\frac{1}{2}+\frac{1}{2}{\bf i}+\frac{1}{2}{\bf j}+\frac{1}{2}{\bf k})$, $*$ represents quaternion multiplication. This gives ${\bf q}^{'}_1={\bf q}_1$.

Finding the equivalent axis-angle representation:

The norm of the vector component gives $\sin(\phi/2)$ and the scalar component gives $\cos(\phi/2)$. Hence, the angle $\phi=2\operatorname{ArcTan}(\sin(\phi/2),\cos(\phi/2))$. Note the use of ArcTan and the double argument. This gives a unique answer, as opposed to taking ArcCos or ArcSin. The axis vector can then be found by dividing the vector component of quaternion by $\sin(\phi/2)$.
 For example, the quaternion ${\bf q}_3$ can be stated as rotation about the unit vector ${\bf v}=\frac{1}{\sqrt{3}}{\bf i}+\frac{1}{\sqrt{3}}{\bf j}+\frac{1}{\sqrt{3}}{\bf k}$ by an angle of $\frac{2\pi}{3}$.

Further references:

Quatenions and spatial rotations (Wikipedia)

Quaternions and Rotations in 3-Space: How it Works

Representing Attitude: Euler Angles, Unit Quaternions, and Rotation
Vectors

Title: Finding rotation quaternion


问:
Programming A Rover
I am part of my College team which is planning to enter a Mars Rover Challenge. In the point of view of a programmer, where should I start? I know C is the main language NASA used for their Rover and I have a basic understanding of it. Plus, how much should I look into the RTOS part for making a rover?

Any books/links to this topic would be greatly appreciated.

答:
Ravi - This is a great question.  So many great ideas stop simply because we don't know how to kick things off.  I'll try to list a few options below for each of your questions so I don't sound like I'm selling one method or product.

Your question is at a very high level, so I'll try to point you to some great resources; if I went too deep, I'd have a novel for you - and there is no reason to recreate the wheel.  Your (compound) question also allows for a lot of subjective opinion - I'll try to keep my answer as objective as possible.  As a reference for when I inject my opinion, my 3-person university senior design team built an autonomous firefighting robot for RoboGames (A worldwide competition held annually near San Francisco, CA) and took 2nd place - not bragging, as we didn't win the gold, but we were in the same boat as you when we started: "where the heck do we even start?!?"

Where to Start

Planning is integral - the more time you spend here, the less money and frustration you waste later on, so again I reiterate that you have a great question here.

There are a LOT of getting started books/resources out there - it is so helpful it can be overwhelming and may actually seem like it adds to the confusion.

EDX.org - this is an amazing site that offers FREE full college courses on almost every course of knowledge from schools like MIT, Harvard, UC Berkley, etc - and its constantly adding new classes.  Search 'Robot' or 'Embedded' for a dozen classes.  Here are a couple EDX classes (Class 1 / Class 2) that are using a $50 dev board and showing you how to program the microcontroller and interface with sensors.  (If you buy the board, you are already on your way just watching the videos and following along with the exercises).

RobotPark - A great site - just follow the links for 'learn' and 'design.'

FreeBookSpot - This site has a WEALTH of free ebook links on all topics.  Search 'microcontrollers' or 'robot' to be greeted with over a hundred good resources.  Look for beginner/getting started titles.  (The main options will be PIC or Arduino - more on that to come).  Almost all of these books offer step-by-step getting started demos and code samples.  (This site sometimes updates their domain, so if this link is broken, search for 'freebookspot' on your favorite search engine).

Since this is a college project - I'd hit up a professor that teaches micro-controllers/robotics.

Language

Some feel this is one of the more important decisions, others feel it is one of the least.  If you pick up a class or book from the above section, it will most likely already define what dev board, language and programming IDE you should use for it's code samples.

As far as languages to use, here are some available options:

C - C is a great language that enables one of the widest range of micro-controllers to interface with (assembly language is the probably the widest, but has a larger learning curve and can add to development times).  It is also more respected in the engineering community than the other options I will list below.  Since you are a student, MicroChip offers you a free MPLab dev environment with C compiler for PIC programming.

Arduino - Seen as a quicker/easier option to use when getting started with a trade off that you are more limited in hardware (there are many that would argue this point - or that it doesn't matter).  Arduino boards (and shields) are relatively cheap and easy to pick up from Amazon/SparkFun/etc.  Here is a great intro on SparkFun's site for Arduino.

C#.NET - Many find C# extremely easy to pick up and use, and is a great fully-functional alternate option; it is also another free option, as it uses Microsoft's free libraries/IDE. Check out [Netduino's] site for more information.

Raspberry PI - a dev board with many online resources that easily allows linux to be loaded on it (Not a language, but I list it here as an easy option for using an OS on a dev board).

RTOS

RTOS (Real Time OS) enables you to have a lot of power over processing data as it comes in without buffering.  I found in academia, real time OS got a lot of interest from professors, but there are very few applications where I needed it for a rover.  A good system of interrupts is usually more than adequate for prioritizing processor time for your different systems.  I hope I'm not upsetting your professor/adviser if this is on their agenda - it is definitely a fun intellectual exercise (and has its uses); however, it can add unnecessary time and limit your hardware choices by forcing the use of an OS (real time or not).

Buying Parts

When you get started, sites like SparkFun and RobotShop offer great options and kits to make life easier.  Amazon may even sell some of the same dev boards cheaper.  If you need to get down to fine granularity and want the more advanced options, mouser and digikey are a great option.

Wrapping it up with a subjective opinion

Take it or leave it - but I'll offer you the advice I'd give myself if I was starting over again.  See if you can get in a micro-controller / embedded system class at your university if offered as early as possible - this gives you access to a professor or TA that is yours for all your questions (use the heck out of them!).  Visit the EDX site and start watching the free lecture / lab videos to see if you like the hardware/software in their demos/examples - if not, look at the free book site and find platform that interests you and run with it).  Expect to run into overwhelming frustration when things that look correct don't go right.  And keep up on this robotics stack exchange forum (among others) to keep getting fresh ideas and finding better ways of doing things.

Title: Programming A Rover


问:
How do I convert link parameters and angles (in kinematics) into transformation matrices in programming logic?
I'm doing robotics research as an undergraduate, and I understand the conceptual math for the most part; however, when it comes to actually implementing code to calculate the forward kinematics for my robot, I am stuck. I'm just not getting the way the book or websites I've found explain it.

I would like to calculate the X-Y-Z angles given the link parameters (Denavit-Hartenberg parameters), such as the following:

$$\begin{array}{ccc}
\bf{i} & \bf{\alpha_i-1} & \bf{a_i-1} & \bf{d_i} & \bf{\theta_i}\\
\\
1 & 0 & 0 & 0 & \theta_1\\
2 & -90^{\circ} & 0 & 0 & \theta_2\\
3 & 0 & a_2 & d_3 & \theta_3\\
4 & -90^{\circ} & a_3 & d_4 & \theta_4\\
5 & 90^{\circ} & 0 & 0 & \theta_5\\
6 & -90^{\circ} & 0 & 0 & \theta_6\\
\end{array}$$

I don't understand how to turn this table of values into the proper transformation matrices needed to get $^0T_N$, the Cartesian position and rotation of the last link. From there, I'm hoping I can figure out the X-Y-Z angle(s) from reading my book, but any help would be appreciated.

答:
The DH Matrix section of the DH page on wikipedia has the details.

Basically you want to use the information in your table to create a set of homogeneous transformation matrices. We do so because homogeneous transformations can be multiplied to find the relation between frames seperated by one or more others. For example, $^0T_1$ represents the transformation from frame 1 to frame 0 while $^1T_2$ represents the transformation from frame 2 to frame 1. By multiplying them we get the transformation from frame 2 to frame 0, i.e. $^0T_2 = ^0T_1^1T_2$.

An easy way to create each of the transformations is to make a homogeneous transformation or homogeneous rotation matrix for each column in the table and multiply them together. For example, the transformation from 1 to 0 (e.g. $^{i-1}T_i, i = 1$) is

$^0T_1 = Trans(d_1)*Rot(\theta_1)*Trans(a_2)*Rot(\alpha_2)$

where

$Trans(d_1) = \begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & \bf{d_1 = 0} \\ 0 & 0 & 0 & 1 \end{bmatrix},$

$Rot(\theta_1) = \begin{bmatrix} \text{cos}(\bf{\theta_1}) & - \text{sin}(\bf{\theta_1}) & 0 & 0 \\ \text{sin}(\bf{\theta_1}) & \text{cos}(\bf{\theta_1}) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix},$

$Trans(a_2) = \begin{bmatrix} 1 & 0 & 0 & \bf{a_2 = 0} \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix},$

$Rot(\alpha_2) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \text{cos}(\bf{\alpha_2 = 0}) & -\text{sin}(\bf{\alpha_2 = 0}) & 0 \\ 0 & \text{sin}(\bf{\alpha_2 = 0}) & \text{cos}(\bf{\alpha_2 = 0}) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$.

In this case

$^0T1 = Rot(\theta_1)$.

Once you have all your transformations you multiply them togther, e.g.

$^0T_N = ^0T_1*^1T_2...^{N-1}T_N$.

Finally you can read the displacement vector out of the homogenous transform $^0T_N$ (i.e. $d = [^0T_{N,14}, ^0T_{N,24}, ^0T_{N,34}]^T$). Similarly you can read out the rotation matrix from $^0T_N$ to find the X-Y-Z angles.


答:
Let's assume that the inner loop, whose input is desired angular rate and output is motor input, can track the desired angular rate. Some internet fellow has taken care of that for us. I'm going to be considering a step change in desired position:

Let $e = x_{des} - x$ and $ \dot e = -\dot x$ this will be our outer loop controller

$$\dot x = k_p e + k_d \dot e$$

substituting in $\dot e$ gives

$$ -\dot e = k_p e + k_d \dot e$$

which can be rearranged as

$$\dot e = - \frac{k_p}{k_d + 1} e$$

which is a first order system. I've ignored inner loop dynamics but that should be fine, inner loop dynamics should be at least an order of magnitude faster than the outer loop dynamics.

I am not saying that integral control is not useful, just that it is not strictly necessary in the outer loop. It is easy to imagine a situation where the inner loop is not behaving correctly that results in a steady state error.

The px4 flight stack for multicopters approaches attitude control with pd control for angular position and pid control for body rate control.

https://pixhawk.org/users/multirotor_pid_tuning (link broken)

Title: Why do I need I-gain in my outer-loop?

ContentLicense: CC BY-SA 4.0


问:
Name of large robotic arms (two finger) with wrist, arm, hands and spinning shoulder axis
I've been looking for large robotic arms (with two fingers) and the arm so they are able to pick up and drop things in a space around the arm (and even spin around the 'wrist').

I'm not sure what the terminology is for such an arm. I've seen this, OWI-535 Robotic Arm Edge, and it looks close. Is there something larger that can be hooked up to a Raspberry Pi instead of the remote controller?

Is there a particular term for this in a generic context? Or is there a way to build such an arm using off the shelf parts?

答:
You might want to consider building, and designing (or following a standard design for) a robot arm, using "servo backets"1, which are designed to be used with standard servos (i.e., the MG995 or MG996R). Here is a common example of one such robot arm:

These brackets are cheap and widely available, as a quick search for servo brackets, or robot brackets will show you.

There are many types/forms/shapes available, and they are all compatible with each other:

Short U bracket;

Long U bracket;

Oblique U bracket;

I bracket;

L bracket

Multi Function bracket;

Body Plates;

Elongated, or Large, U bracket;

and others.

Note that these names are not standard, merely descriptive, and may vary from supplier to supplier. Here is a Short U and a Multi Function bracket

These brackets are reusable, so, once you have completed your robot arm, should you become tired of it, you could dismantle it, purchase some additional brackets and make a humanoid (upright) robot,

or a hexapod,

or whatever.

As the first photo (of the robot arm showed), a simple robot grabber/gripper is also available for the end of the arm:

These grippers, and the brackets themselves, are widely available on eBay. Note that it is invariably cheaper to buy the brackets independently, than the whole arm kits that you see, by about 50% usually. Although having said that, the 21 DOF humanoid robot kits are actually the cheapest option, if you can get one for £45, and you think that you will need all of the extra brackets at some point in the future. You will also require bearings (and cups), so make sure that any kit that you buy has those included.

The parts that you will require for the robot arm are as follows:

Multifunctional bracket x 5

Long U shape bracket x 3

L shape bracket x 1 (to attach the claw)

Acrylic board x 1

Cup bearing x 4

Screw nut x September 1

Alloy mechanical claw x 1

U beam bracket x 2 (for the base)

MG996R x 6

Servo Extension cord x 3

Servo horns x 6

Here is a better view:

1 There is a correct name for them, other than servo brackets, but the real name escapes me.


答:
The OMPL library has some good quality implementations of several sampling-based motion planners, as listed here :
http://ompl.kavrakilab.org/planners.html

In particular, you can find several variants of RRT under the BSD license.

Title: RRT algorithm in C++

Body: I want to implement RRT for motion planning of a robotic arm. I searched a lot on the internet to get some sample code of RRT for motion planning, but I didn't get any. Can someone please suggest a good source where I can find RRT implemented in C++ for any type of motion planning.</p>


问:
OpenRAVE ChechCollison command in C++
What is the equivalent code of "env.CheckCollision(robot)" in C++? Even though it is said that conversion of commands from python to c++ is easy and intuitive, where can I find a proper documentation for this conversion?</p>

答:
Have you checked out this example ?

It illustrates checking for self-collisions. If you also have a look at the CollisionCheckerBase class you can find OpenRAVE::CollisionCheckerBase::CheckCollision to check for collisions between two bodies, among other methods. Maybe that is enough to put the pieces together.

Title: OpenRAVE ChechCollison command in C++


答:
Industrial robot controllers (and most "real" robot arm controllers) will have a feedforward term to remove the effect of gravity. Often called gravity compensation. You noticed how necessary this is when you disabled gravity...

Check your chain of libraries for an artificial limit being set on the joint effort (torque).

You might take a look at moveit! to see if it helps you. Otherwise you are going to have to take the time to learn a bit of robotics (and controls) math.

Title: Can we simulate a actuator with a very strong torque with a PID controller

Body:
I use gazebo to simulate a robot arm. To control its joints, I use PID controllers. As you might know, PID are sometimes pretty hard to tune and this is the case for a robotic arm. To avoid any tuning, and because I don't need the PID values to be realistic, I set to zero the derivative and integral parameters, increase a lot the proportional gain and add a lot of damping in my joints. By doing this, I can get a well working arm but only if I disable the gravity.

My question is the following. Do you have an idea how I could simulate a very strong actuator with not necessarily realistic parameters?

EDIT 1: Setting the integral and derivative gain is stupid. The integral gain helps in correcting the effect of the gravity. The derivative gain counters the loss of stability and speed due to the integral gain.

This question somehow leads to another. Do you know what tuning do the robotic arm manufacturer (big arms for car industry for example). I guess that this arm use actuators with a very strong torque and a low maximum speed which reduces the need of tuning.

EDIT 2: More info on my setup. I use gazebo 6, with ODE. The robot description is in SDF. I control the robot with a model plugin. As a PID controler I use the PID class from the common library of gazebo and get directly the JointControler associated to the model.

Let say that I would like actuators very robust without any tuning needed. This way I could have a simulation WITH dynamics (by opposition to the SetPosition method). Do you think it is possible ?


答:
The general name for the arm in your picture is an Articulated Arm or Articulated Robot but there are many variations on the theme.

I have mostly worked with SCARA arms as fewer motors need to hold the weight of the load:

See my answer to Which type of actuator will be suitable for a very strong robot arm

Title: Name of large robotic arms (two finger) with wrist, arm, hands and spinning shoulder axis

Body:
I've been looking for large robotic arms (with two fingers) and the arm so they are able to pick up and drop things in a space around the arm (and even spin around the 'wrist').

I'm not sure what the terminology is for such an arm. I've seen this, OWI-535 Robotic Arm Edge, and it looks close. Is there something larger that can be hooked up to a Raspberry Pi instead of the remote controller?

Is there a particular term for this in a generic context? Or is there a way to build such an arm using off the shelf parts?


问:
How can we use the accelerometer for altitude estimation?
I am currently implementing an autonomous quadcopter which I recently got flying and which was stable, but is unable to correct itself in the presence of significant external disturbances. I assume this is because of insufficiently tuned PID gains which have to be further tweaked inflight.

Current progress:

I ruled out a barometer since the scope of my research is only indoor flight and the barometer has a deviation of +-5 meters according to my colleague.

I am currently using an ultrasonic sensor (HC-SR04) for the altitude estimation which has a resolution of 0.3cm.  However I found that the ultrasonic sensor's refresh rate of 20Hz is too slow to get a fast enough response for altitude correction.

I tried to use the accelerations on the Z axis from the accelerometer to get height data by integrating the acceleration to get velocity to be used for the rate PID in a cascaded pid controller scheme. The current implementation for the altitude PID controller is a single loop pid controller using a P controller with the position input from the ultrasonic sensor.

I had taken into account the negative acceleration measurements due to gravity but no matter how much I compute the offset, there is still the existence of a negative acceleration (eg. -0.0034). I computed the gravitational offset by setting the quadcopter to be still on a flat surface then collecting 20,000 samples from the accelerometer z axis to be averaged to get the "offset" which is stored as a constant variable. This variable is then subtracted from the accelerometer z-axis output to remove the offset and get it to "zero" if it is not accelerating. As said in the question, there is still the existence of a negative acceleration (eg. -0.0034). My quad then proceeds to just constantly climb in altitude. With only the ultrasonic sensor P controller, my quad oscillates by 50 cm.

How can this consistent negative acceleration reading be effectively dealt with?

Possible Solution:
I am planning to do a cascading PID contoller for the altitude hold with the innerloop (PID controller) using the accelerometer and the outer loop (P controller) using the sonar sensor. My adviser said that even a single loop P controller is enough to make the quadcopter hold its altitude even with a slow sensor. Is this enough? I noticed that with only the P gain, the quadcopter would overshoot its altitude.

Leaky Integrator: I found this article explaining how he dealt with the negative accelerations using a leaky integrator however I have a bit of trouble understanding why would it work since I think the negative error would just turn to a positive error not solving the problem. I'm not quite sure. http://diydrones.com/forum/topics/multi-rotors-the-altitude-yoyo-effect-and-how-to-deal-with-it

Single loop PD controller with the ultrasonic sensor only:
Is this feasible using feedback from a slow sensor?

Sources:

LSM303DLHC Datasheet: http://www.st.com/web/en/resource/technical/document/datasheet/DM00027543.pdf

Leaky integrator: http://diydrones.com/forum/topics/multi-rotors-the-altitude-yoyo-effect-and-how-to-deal-with-it

ArduPilot PID Loop: http://copter.ardupilot.com/wp-content/uploads/sites/2/2012/12/Alt-Hold-PID-version-3.0.1.jpg

答:
The barometer carried on the pixhawk has an altitude resolution of 10 cm. If that isn't enough, you could write a kalman filter that uses the accelerometer data in the prediction step and the ultrasonic sensor and/or the barometer in the correction step.

But I don't see this solving your problem. An accurate measurement of altitude at 20hz should be plenty if all you're trying to do is hold altitude.

What is the time constant / natural frequency and damping on your controller?

I guess I hadn't finished reading your question this morning ( it was before my coffee). The acceleration from the imu is the measurement of acceleration plus gravity. To get the inertial acceleration of the imu, subtract the gravity vector from the measurement. You'll never be able to control on integrated acceleration measurements. The measurements are corrupted by noise and you have no way to correct for this.

--- answer to control portion of the question

Lets assume that all you are trying to do is hold an altitude and are not concerned about holding a position for now ( though this approach will work for that as well). And assuming that you can command whatever thrust you want ( within reason), then this becomes an easy problem.

A first pass at the system dynamics looks like

$\ddot z = \frac{u}{m} - g$

where positive $z$ is up. Lets add a hover component to our throttle that deals with gravity. So

$ u = u_{fb} + u_{hover}$

Our new dynamics look like

$\ddot z = \frac{u_{fb} + u_{hover}}{m} - g = \frac{u_{fb}}{m}$

Cool! Now we design a control law so we can tack a desired altitude.

Our control system is going to be a virtual spring and damper between our quad and desired altitude ( this is a pd controller).

$ \ddot z = k_p(z_{des} - z) + k_d(\dot z_{des} - \dot z)$

The system should now behave like a second order system. $k_p$ and $k_d$ can be chosen to achieve the damping ratio and natural frequency you're looking for.

At this point I would like to reiterate that integrating accelerometer data is not an okay way to generate state estimates. If you really want to hack something together fast, feed the sonar measurements through a lowpass filter with an appropriate dropoff frequency. Your vehicle isn't going to be oscillating at 20hz so controlling off just the sonar data will be fine.


问:
In order to integrate MCL and Occupancy Grid to implement Grid-based FastSLAM, do you have to record all data?
It's unclear as to how one goes about integrating Occupancy Grid mapping and Monte Carlo localization to implement SLAM.

Assuming Mapping is one process, Localization is another process, and some motion generating process called Exploration exist. Is it necessary to record all data as sequenced or with time stamps for coherence?

There's Motion: $U_t$, Map: $M_t$, Estimated State: $X_t$, Measurement: $Z_t$

so..

each Estimated state, $X_t$, is a function of the current motion, $U_t$, current measurement, $Z_t$, and previous map, $M_{t-1}$;

each confidence weight, $w_t$, of estimated state is a function of current measurement, $Z_t$,  current estimate state, $X_t$, and previous map, $M_{t-1}$;

then each current map, $M_t$ is a function of current measurement, $Z_t$, current estimated state, $X_t$,  and previous map, $M_{t-1}$.

So the question is, is there a proper way of integrating mapping and localization processes? Is it something you record with timestamp or sequences? Are you suppose to record all data, like FullSLAM, and maintain full history.
How can we verify they are sequenced at the same time to be referred to as current (i.e. measurement) and previous (measurement).

答:
The question is a bit old but an answer might help. I think you are getting confused by thinking of mapping, localization and exploration as separate processes in the context of grid-based FastSLAM. In the most basic form of the algorithm you have the three steps you described:

At every timestep :

Update the poses of your particles using your motion model

Assign weights using your measurement model

Use the calculated weights to resample the particle set

For a given particle, once you have estimated $x_{t}$ based on $x_{t-1}$ through sampling (step 1), you simply update the previous map by integrating the new measurements you have made at time $t$ "trusting" that they were made from pose $x_{t}$.

It's because the algorithm gives importance to assigning precise weights (step 2) and regularly resampling your particle set (step 3) that it can confidently use the $x_{t}$ estimates made through the sampling step to update the map.

Because with every timestep you are marginalizing over the previous state - like all Bayesian filtering approaches to online SLAM - you do not need to keep track of the full history of your data.

If you are still fuzzy on how these steps work together, you can take a look at the pseudocode for gmapping from this presentation:


问:
create2 commands with an app called SERIAL
there is an app called SERIAL, available in the app store.
I've downloaded it on my mac and am experimenting with it, any ideas on how to send create2 OI commands using "Serial"?

so far it seems a handy app, I've bypassed all the need for other drivers. anyone else use SERIAL/something of the like?

*when the SERIAL terminal is open and the number 9 is pressed on my mac it seems to activate cleaning mode. thats all the communication I'm getting after hours of playing around in python and mac terminal.

答: I suspect that what you are trying won't work.  See this other question for the difference between trying to command the Create with a terminal vs. code: Sending commands from Ubuntu.</p>


问:
Quadrocopter PID
I am building a quadcopter for my school project. I am trying to program my own flight controller using PID algorithm.

I'll try to make my question simple using as an example below only two motors

```<code>                       1-----------2
</code>```

Let's say I am trying to stabilize my two motor system using gyro from the diagram below to one above

```<code>                       1--
                          -----
                               ----2
</code>```

Using the formula Output = (gyro - 0) * Pgain

Do I need to increase the output only on the motor 2 or would I have to do both:
increase the output on the 2nd motor while decreasing the output on the first motor? Thank you

答: There's no need of different P gains in each rotor. Just calculate the needed gyro in each of them. Good luck.</p>

Title: Quadrocopter PID


答:
Technically, you can do it either way, but consider the following scenario: You are flying with a heavy load, and there is a wind gust. Each rotor is operating at almost 100% capacity due to the heavy load. Now the wind gust has gotten you un-level. Say you need 20% of full speed to make the correction. What happens?

Well, if you are trying to control level only by increasing motor 2, then it's already essentially at full speed, so it cannot go any faster. The craft never levels because there is no "overhead" available - the actuator (fan) is operating at 100% so there is nothing left over for it to do when you ask for more.

If you try to control by splitting the 20% between motor 1 and motor 2, then motor 2 still can't do anything, but motor 1 can lower its speed by 10%. The vehicle will now level. Not as fast as if you weren't operating at near-capacity, again because the lack of overhead hinders performance, but it still responds.

This is typically how the quadrotor would be programmed. Each motor contributes to 1/4 of the thrust requested for altitude control, and then the attitude controller adds or removes from each motor in pairs.

So say you had motors:

AB

CD

If you wanted roll, you could speed up AC and slow down BD - this would cause roll with little change in altitude because A+B+C+D is still the same. Similarly, you could speed up AB and slow down CD to pitch. Again, A+B+C+D is the same. Finally, you can yaw by speeding up AD and slowing down BC.

When you split the power request from all positive on one motor (side) to half positive on one and half negative on another, you gain a lot of advantages when it comes to stability and control. I would point out that it is possible to roll, pitch, and yaw, simultaneously, and maintain altitude by doing this.

Title: Quadrocopter PID

Body:
I am building a quadcopter for my school project. I am trying to program my own flight controller using PID algorithm.

I'll try to make my question simple using as an example below only two motors

```<code>                       1-----------2
</code>```

Let's say I am trying to stabilize my two motor system using gyro from the diagram below to one above

```<code>                       1--
                          -----
                               ----2
</code>```

Using the formula Output = (gyro - 0) * Pgain

Do I need to increase the output only on the motor 2 or would I have to do both:
increase the output on the 2nd motor while decreasing the output on the first motor? Thank you


问:
Are Artificial Intelligence and Robotics Different?
I need help in differentiating between AI and Robotics. Are AI and Robotics two different fields or is robotics a subject in AI?

I want to pursue a career in AI and Robotics. So I need your valuable suggestion. I searched the web and also some universities that I want to apply and I cannot find any such thing that I am searching for.

答:
Background:

Robotics is 4 things essentially - Design (Dn), Mechanical Engineering (ME), Electrical/Electronic Engineering (EEE) and Computer Science (CS). Now depending on which university you choose the composition of these four subjects will vary drastically. I am Robotics graduate from the University of the West of England where the focus is entirely on EEE + CS. Now because there is only so much that can be covered in 3 years, the Computer Science component is made up of AI, Software Design Principles and Programming (starts with C, then MATLAB and for AI any PL of interest).

Artificial Intelligence (AI):

When it comes to AI, the subjects covered include (not exhaustive),

Knowledge Representation, Problems, Search Spaces and Techniques.

AI Paradigms in Robotics (Behavioral, Reactive, Deliberative etc.)

Advanced AI - Machine Learning, Genetic Algorithms, Optimization Techniques (Swarms, Particles etc.), Fuzzy Logic, Neural Networks, Adaptive Neuro Fuzzy Inference Systems etc.

Computer Vision.

You cannot have Robotics separate from AI. To truly say that a course is Robotics it needs to have the four elements in some composition I mentioned at the start else it is everything but Robotics.


问:
Real-time object classification for an indoor autonomous quad-rotor
I am designing an indoor autonomous drone. I am currently writing an object classification program in OpenCV for this purpose. My objects of interests for classification are: ceiling fans; AC units; wall and ceiling lamps, and; wall corners. I am using BoW clustering algorithm along with SVM classifier to achieve this (I'm still in the process of developing the code, and I might try other algorithms when testing).

The primary task of the drone is to successfully scan (what I mean by scanning is moving or hovering over the entire ceiling space) a ceiling space of a given closed region while successfully avoiding any obstacles (like ceiling fans, AC units, ceiling and wall lamps). The drone's navigation, or the scanning process over the ceiling space, should be in an organised pattern, preferably moving in tight zig-zag paths over the entire ceiling space.

Having said that, in order to achieve this goal, I'm trying to implement the following to achieve this:

On take off, fly around the given closed ceiling space and use SLAM to localise and map its environment.

While running SLAM, run the object classier algorithm to classify the objects of interests and track them in real time.

Once obtained a detail map of the environment and classified all objects of interest in the local environment, integrate both data together to form an unified map. Meaning on the SLAM output, label the classified objects obtained from the classifier algorithm. Now we a have fun comprehensive map of the environment with labeled objects of interest and real-time tracking of them (localization).

Now pick random corner on the map and plan a navigation pattern in order to scan the entire ceiling space.

So the question now here is, is using object classification in real-time will yield successful results in multiple environments (the quad should be able to achieve the above mentioned tasks in any given environment)?. I'm using a lot of train image sets to train my classifier and BoW dictionary but I still feel this won't be a robust method since in real-time it will be harder to isolate an object of interest. Or, in order to overcome this, should I use real-situation like train images (currently my train images only contain isolated objects of interests)?

Or in my is using computer vision is redundant? Is my goal completely achievable only using SLAM? If, yes, how can I classify the objects of interest (I don't want my drone to fly into a running ceiling fan mistaking it for a wall corner or edge). Furthermore, is there any kind of other methods or sensors, of any type, to detect objects in motion? (using optical flow computer vision method here is useless because it's not robust enough in real-time).

Any help and advice is much appreciated.

答:
tl;dr - SLAM is good enough for your task.

The ceiling is the area where your robot will be traveling in. Few things to notice -

Ceiling is fixed and not changing.

Things on the ceiling are fixed as well at any given time unless the environment is changed.

The number of things on the ceiling are also fixed.

If you are going to be using a feature based map then the features are the walls and the objects on the ceiling all of them being obstacles.

In view of these three observations your SLAM should be enough, these obstacles are your features and thus there comes no question as to identifying them or classifying. Commonsense tells that any obstacle is a potential danger to the robot and thus is to avoided or maneuvered around. Depending on the size of the map and the number of obstacles the algorithms used for SLAM will have to be chosen obviously. If the task is to just navigate the ceiling around these features from point A to B then SLAM should be enough. As for detecting the fan, since you know the position of it on the ceiling, usually it is in the center, then u can feed that information into your map and let your robot maintain a certain radius away from that particular feature. This way you will avoid doing unnecessary computation in trying to keep track of frames or extra sensors to do this.

Object classification and tracking can be done since the scene your robot are static, but is not necessary for your task. In addition the training will have to be done for different environments which IMO doesn't seem to be very feasible and complicates things for your task.


问:
How can I detect the edge of a table?
I'm new to robot making and just got my first arduino to play around.

I want to make a robot that will wander on a table, and it will last longer I think if I could make it avoid falling from the table.

What will be the best way to make it detect the edge of a table so I can make it stop and turn around ? It have to be something reliable and preferably cheap.

It will also be better if I don't need to add extra stuff to the table so I can use it on any surface (my first idea was to draw path lines on the table and make a line follower robot, but I don't like this idea very much).

答:
An easy and cheap approach is to use a a touch sensor like a whisker. The controller just monitors whether the whisker is in contact with the ground, if one is not then it stops and moves away from that wisker.

Another fairly cheap method is to use a set of IR range finders pointed toward the ground. The controller then monitors the values returned from the rangers and if any of them go above some predefined threshold then the robot stops and moves away from that sensor.

Title: How can I detect the edge of a table?


问:
Building a stationary robot which can talk
I am a Computer Science major and I only have basic ideas on Robotics. I am planning to build a stationary cubical AI.

The main purpose of this bot will be that, it will have a sensor to check if the door has been opened and immediately asks a question "who has opened the door?" I also want it to recognize the correct words to interact the word, I am not talking about voice recognition but word recognition so that who ever speaks the correct words(words in bot's memory) can interact with it. Depending on who opens the door(prolly my family) I want it to speak out different things. I want it to respond to simple questions like, "what is the date and time?" , " a random qoute or a fact or a joke".

Is this too hard to achieve? Could anyone give me a basic idea on how to approach this project?

答:
Is this too hard to achieve?

No

Could anyone give me a basic idea on how to approach this project?

Get familiar with the basics and start writing code. Here are few links for you to study:

Robot operating system

CMUSphinx in ROS

Try to follow the examples as is first, that will give you a basic understaning, then you can extend the example to fit your needs.


问:
Does a controlling system need to be more complex than the system being controlled?
Is there any theoretical principle, or postulate, that states that the controlling system has to be more complex than the system being controlled, in any formal sense of the notion "complex"?</p>

答:
Consider these two items:

With pole placement controller design, you can alter a controllable, $n^{th}$ order, system's characteristic equation to get the desired behavior.  You still have $n$ eigenvectors for your system with this method.

Using state space control, for a system with $n$ states, your system matrix $A$ is of rank $n \ $x$\  n$.  Your input matrix $B$ is $n \ $x$\ p$ ($p$ inputs).  Your output matrix $C$ is $q \ $x$\ n$ ($q$ outputs).

I'm not certain which of the formal meanings of "complex" you're considering, but does the above refute it?


问:
Is there an alternative to manifolds when using quaternions for orientation representation in Pose Graph SLAM?
I want to implement my own pose graph SLAM following [1]. Since my vehicle is moving in 3D-space i represent my pose using a 3D-translation vector and a quaternion for orientation. [1] tells me that it's necessary to adapt their algorithm 1 by using manifolds to project the poses into euclidean space.
I also studied the approach of [2]. In section "IV.B. Nonlinear Systems" they write that their approach remains valid for nonlinear systems. I conclude that for their case it's not obligatory to make use of a manifold. But I don't understand how they avoid it. So my questions are:

Is it correct that there is an alternative to manifolds?

If yes, how does this alternative look like?

[1] Grisetti, G., Kummerle, R., Stachniss, C., & Burgard, W. (2010). A tutorial on graph-based SLAM. Intelligent Transportation Systems Magazine, IEEE, 2(4), 31-43.

[2] Kaess, M., Ranganathan, A., & Dellaert, F. (2008). iSAM: Incremental smoothing and mapping. Robotics, IEEE Transactions on, 24(6), 1365-1378.

答:
You might want to have a look at [1] where the author uses iSAM for estimating - among other quantities - the position and attitude of a rigid body spinning in microgravity.

In section 4.5 p111 he mentions using a combination of {attitude error vector + reference quaternion} within the nodes of the pose graph :

*It is clear that any representations of attitude include nonlinear transformations and kinematics. This causes a problem for modelling and propagating probability distribution functions with Gaussian random variables, such as those typically used in Extended Kalman Filters or the iSAM system. It is well understood that the covariance matrix of a quaternion is rank deficient due to its normalization constraint. While there is active research in a number of estimation systems that do not use Gaussian random variables [83, 109, 127, 118, 119], a typical approach for dealing with this is to use three vector error parameterization and reset the quaternion (see [26, 70, 82, 134]), which is what will be used here since it fits well with the iSAM system for Gaussian random variables and has a history of good performance.

This error vector and reference quaternion approach can be applied to pose graph optimization methods such as iSAM. For each of the nodes that specify the vehicle’s 6DOF trajectory, the reference quaternion approach is mirrored. This means that at the vehicle’s state nodes for each timestep, both a four parameter reference quaternion and a three parameter attitude error is stored. Each time the optimization problem is re-linearized, a reset step is performed. This reset step transfers all of the attitude error into the reference quaternion."

In his particular case he uses Modified Rodriguez Parameters (MRP) but you could probably choose an alternative representation if you keep the idea of combining an error vector with a quaternion within the nodes.

[1] Tweddle, B. E., Computer Vision-Based Localization and Mapping of an Unknown, Uncooperative and Spinning Target for Spacecraft Proximity Operations, Ph.D. thesis, Massachusetts Institute of Technology, Department of Aeronautics and Astronautics, Cambridge, MA, 2013.


问:
Robot autonomous variable terrain with yaw sensor
I am programming a robot to drive over variable terrain obstacles autonomously. The variable terrain could potentially knock the robot off of its initial heading, but I would like to design an autonomous sequence to correct for any change in direction. I am using a very accurate sensor with compass and yaw. What is the best way to have it correct for any changes and maintain its heading? Side to side motion does not have to stay perfect, but the heading needs to stay the same.We are currently correcting it by overpowering one side of the wheels (depending on direction of correction needed) until the heading is correct again, but this seems to be a slightly antiquated method, so I'm looking for a cleaner and more smooth method.</p>

答:
There's not a singular, best approach to solve your problem.  It's a qualitative problem (what's a good/viable solution?), not so much a quantitative one (how do I minimize drive time under all conditions? minimize path drift, again, under all conditions? minimize battery drain? etc).  You could turn it into a quantative problem, but that's a huge undertaking.

@Chuck's writeup looks great for PID usage.  PIDs are a great solution when you can characterize your environment, ie: properly tune your PID's variables.  A PID wouldn't be my choice because I like learning algorithms more.

So here are some other approaches and a few pros/cons.

Kalman filtering

Pros: not only addresses your drift, but it accounts for the error in your sensors.  You should keep in mind that regardless of how good a sensor is, it's not perfect, so not all of the drift occurs because of the terrain. Plug and play code exists.

Cons: very steep learning curve; matrix math.

Particle filering

Pros: very simple to code and tailor to your exact surroundings. path correction is very similar to the integral portion of a PID controller.

Cons: this addresses the error in your sensors as the main problem and the drift from the environment as a secondary problem.

SLAM with way points

Pros: one of the most heavily documented navigation methods

Cons: many, many variants to choose from; requires your robot to be stateful and remember its learned states from earlier runs, otherwise this approach is overkill; you'll need to hybridize your implementation by adding known way points to your map

I think that neural nets would be an interesting way to adjust the robot's immediate actions.  That is, change the driving techniques to correct for slippage in mud or rain.  But, again, overkill.

To throw in a few more options:

motion planning with potential functions (also called "gradient descent" and "vector field" calculation)

feed-forward / feedback reinforcement learning.

Here's a chapter on path planning.

I'd be interested to know what you choose to go with.

Good luck,
Ryan