问:
Is configuration space same as joint space?
For robotic manipulator like the one on the picture:

are the configuration space and joint space equivalent? I am trying to understand difference between the two...

答:
In robotics the configuration space is exactly the joint space of the manipulator.

Differently, to indicate the space where the forward kinematic law maps the joints configuration into, we use the terms task space and operational space, equivalently.


问:
PID tuning method based on Pole placement
Is it possible to determine PID parameter using pole placement.
I mean by solving the ch. eq. of close loop transfer functions  which consists of either P,PI,PD or PID controllers??

Because i've tried it, an eventhough i am getting my poles at the locations I want the systems does not act as I assumed.

an example. I want my system to be overdamped and to have settling time less than 1 sec. which means that i want my poles to lie on the real axis, and to be less than -4.

$$G(s) =\frac{10.95 s + 0.9574}{s^2 + 0.09149 s +  6.263*10^{-6}}$$

With P = 0.1, I= 0.617746, d =  0.0147173
I get a close loop system which is
$$G_cl(s) =  \frac{0.1612 s^4 + 1.109 s^3 + 6.86 s^2 + 0.5914 s}{  0.1612 s^4 + 2.109 s^3 + 6.952 s^2 + 0.5914s}$$

But looking at it's step response I see it creates overshoot, which i cannot justify due to an step input...

答:
I have to say that $G(s)$ seems to represent quite a strange physical system with a settling time of 15.8 hours, especially compared with the requirement. There might have been some mistakes in identifying the system, maybe? The known term of the denominator is out of scale. Perhaps the data you collected to identify the model are not correctly scaled.

Anyway, with those P-I-D parameters you mentioned I got the following close-loop system $sys_1$:

$$
sys_1(s)=\frac{0.1612 s^3 + 1.109 s^2 + 6.86 s + 0.5914}{1.161 s^3 + 1.201 s^2 + 6.86 s + 0.5914},
$$

which is a bit different from $G_cl(s)$.

To get a over-damped response with settling time lower than 1 second, it suffices to use a simple proportional controller with $P=0.3695$, obtaining:

$$
sys_2=\frac{ 4.046 s + 0.3538}{s^2 + 4.138 s + 0.3538}.
$$

See below the step responses of $sys_1$ and $sys_2$ close-loop systems.

ContentLicense: CC BY-SA 3.0


问:
Difference between Rao-Blackwellized particle filters and regular ones
From what I've read so far, it seems that a Rao-Blackwellized particle filter is just a normal particle filter used after marginalizing a variable from:

$$p(r_t,s_t | y^t)$$

I'm not really sure about that conclusion, so I would like to know the precise differences between these two types of filters. Thanks in advance.

答:
The Rao-Blackwellized Particle Filter (RBPF) as you say in your question performs a marginalization of the probability distribution of your state space.

The particle filter uses sampling to represent the multivariate probability distribution of your state space. Using samples to represent a distribution is firstly only an approximation, and secondly not very efficient in most cases. The higher the dimension of the state, the more particles you require. One trick introduced by Doucet et al. is to marginalize out a subset of the state space, which can be handled in a more efficient way by using a Gaussian representation.

These figures from my thesis might help to visualize the concept. Let's say you have a joint distribution over $X$ and $Y$

instead of sampling jointly over $X$ and $Y$, we can marginalize $Y$ and represent it as a Gaussian distribution. In this way we just need to sample over $X$,

which is much more efficient. Note that each sample now represent a distribution over $Y$.

This marginalization is very popular in SLAM. The reason is that jointly sampling over position and map is impractical. The RBPF idea has been made popular in FastSLAM, realizing that marginalizing the maps from the joint distribution makes the problem tractable. As in the example above, each particle there represents a pose, correspondences and a map. So there is one map per particle.

So the difference between an RBPF and a regular particle filter is that the RBPF samples over a subspace of the probability distribution of the state, and represents the rest using a different statistic. I have another related question on the math background of the Rao-Blackwellization part.


问:
How do I model a robot?
The answers I received to the question on training a line following robot using reinforcement learning techniques, got me to think on how to train a robot. I believe there are essentially two ways -

Train the physical robot.

Model the robot and simulate the training.

Did I miss something?

Approach 2 is definitely the better approach. However, a priori knowledge of the motion (response), a certain PWM signal (stimulus) would cause when the robot is in a given state is required. The motion caused by a PWM signal may depend on the (1) current battery voltage, (2) the mass of the robot and the (3) current velocity (did I miss something?).

How do I model such a robot? And how do I model it quick? If I change the battery or add a few boards and other peripherals and change the mass of the robot, I would have to remodel and retrain the robot. Can I do this by providing some random stimulus PWMs and measuring the response?

added: My related question in dsp.SE

Update: A suggested edit to the title by Ian worth mentioning - "How do I model train a robot so that if its dynamics change, it does not need complete re-training?" I think this is a good question too but different from the one I am asking here. I am okay with re-training for now.

答:
As I see it there are two main questions here. The first is, how do I model a robot? This is frequently done with a state-space formulation of the equations of motion. The exact equations depend on the physical construction of your robot. Yes, in order to model them with PWM input then you need to determine the transfer function from the PWM values you supply to the output of your actuators. Then you plug that function in for the control signal in your model. Again the derivation of this function is robot specific. The current battery voltage and the mass of the robot would likely be useful but I don't know about the velocity.

The second question is, given a mathematical model of my robot, what is the best way to train a reinforcement learning (RL) algorithm to control it? In short there is no one best way. Training directly on the robot tends to be time consuming because it takes the robot longer to execute trials. Simulations however can result in policies that are less accurate because the physics of the simulation are necesssarily simplified. Another approach is to train the learner in simulation to get a reasonable approximation and then transfer the resulting policy to the robot for further refinement. This of course fails if the model is not sufficiently accurate. It also requires extra development.

Finally you ask "Can I [remodel and retrain the robot] by providing some random stimulus PWMs and measuring the response?" In the case of RL there is no reason to think the new optimal policy is anything like the previous optimal policy and as such there isn't much reason to think a few random controls will supply sufficient information to change the policy appropriately. Of course retraining only needs to occur if the changes you make to your robot affect the formulation of the state-space model and/or the action model that you use. For instance, if your action model is in terms of high level actions ("go-left", "go-right", "go-forward") then changing the dynamics requires changing how you implement these motions but the policy should still hold.

Title: How do I model a robot?


问:
Free of charge Robot Magazine, Journal, Newsletter or similar
What free of charge Robot Magazine, Journal, Newsletter or similar publication are available?

Either geared toward technical professionals or the general public.

答:
Some of the open access robotics journals (free access)

1) International Journal of Advanced Robotic Systems

2) Robotics: Science and Systems


问:
What is the technical name when robot wheels are aligned to perform spot turn?
I have a robotic simulator that enables a 6 wheel rover to perform spot turn.
To prepare the rover to spot turn, I have to arrange/align the wheels in such a fashion:

```<code><front side>
//    \\
||    ||
\\    //
<rear side>
</code>```

What is the technical name of it? Circular wheel arrangement? Circular alignment?

答:
Differential drive

Left and right wheels drive clockwise and anticlockwise, at same speed, for robot to rotate with reference to central point between wheels

You may want to let front and back pairs of wheel free spinning (if gear ration small, open electric circuit will do) and only drive the central 2 wheels. Or, you need to model all six wheels, may be some skidding for spot turning.


答:
I'm not aware of any technical name for the alignment of the wheels except -- literally -- "steering".

Spot turns in theory are no different than any other turn.  You simply align the axis of each wheel with the radial lines coming from a single pivot point.  If that point is underneath the vehicle, you will be doing a spot turn (a.k.a. point turn, a.k.a. pivot turn).  If the point is not underneath the vehicle, you will be doing a regular arcing turn like you'd do in a car or bicycle or similar.

Even if not all the wheels have adjustable angles, you're still orienting all the wheels to the same point.

Title: What is the technical name when robot wheels are aligned to perform spot turn?

Body:
I have a robotic simulator that enables a 6 wheel rover to perform spot turn.
To prepare the rover to spot turn, I have to arrange/align the wheels in such a fashion:

```<code><front side>
//    \\
||    ||
\\    //
<rear side>
</code>```

What is the technical name of it? Circular wheel arrangement? Circular alignment?


问:
How to filter vibration programatically?
I'm working on a quadcopter. I'm reading the accelerometer and gyro data out from the MPU6050 and using complementary filter to calculate the roll and pitch values. When the quad is on the floor, and the motors are turned on the roll values are:

```<code>-4.88675227698
-5.07656137566
 7.57363774442
-3.53006785613
 4.44833961261
-2.64380479638
-3.70460025582
</code>```

It is very messy. After minus five there is plus seven. I would like to filter out this too high/low values programmatically but I have no idea how to do it.

EDIT:
At this moment I think the solution is the Low-pass filter. I'll let you know if it is successful or not.

答: Essentially you are talking about a low-pass filter on your output.  Kalman filtering is probably your best option for accuracy, but simply calculating a moving average should go a long way toward quieting the noise in your input.</p>


问:
How long can a VEX pneumatic arm be?
How long can a vex pneumatic piston be?</p>

答: I am assuming that you are referring to the high school competition Vex? As you probably know there is a 18x18 inch area limit for the robot. The starting position must remain within this limit but there is no limit to how far it can reach, whether or not it becomes unstable and breaks is a different matter. I haven't used pneumatics in 2 years so I forget the default length but Length shouldn't be a big factor to be concerned with.</p>

Title: How long can a VEX pneumatic arm be?


问:
Is there any advantage to velocity motion models over odometry motion models for SLAM?
I've seen several examples of SLAM algorithms (EKF SLAM, Graph SLAM, SEIF SLAM) written in terms of the velocity motion model.  I have yet to see an example of any SLAM algorithm utilizing the odometry motion model.  I wonder if there is an inherent advantage to using the velocity motion model over the odometry model for this problem.  Does it have something to do with the fact that odometry sensor information comes after the motion has already taken place, whereas velocity control commands are executed before motion?

答:
I can't think of a reason why a velocity model (based on control commands)
would be superior to an odometry model (which uses the actual wheel speeds).

The lecture notes from Freiburg on motion models imply the same:

Odometry-based models are used when systems are equipped with wheel
  encoders.

Velocity-based models have to be applied when no wheel
  encoders are given.

The timing does not have an influence here. If any, it would affect the latency, but even that I would think is not the case.

The better your model, the better your prediction. Having actual measurements in the model provide you with additional information to improve the model. One thing which is very commonly performed is to use an IMU to estimate the rotational part of your motion model.


问:
Assumptions about the nature of landmarks in SLAM algorithms
I'm trying to understand the role of landmarks in SLAM algorithms.  I've glanced over a few books concerning landmark based SLAM algorithms and I've come up with a rudimentary understanding which I believe is flawed.

How I think SLAM works:

As I understand it, landmarks are a set of points in a map whose locations are known a priori.   Furthermore, the number of landmarks in a map is fixed.  The number of landmarks detected at any one time may change, but the number of landmarks that exist in the map remains static at all times.

My understanding is that SLAM algorithms exploit the fact that these points are both uniquely identifiable and known a priori.   That is, when a robot senses a landmark, it knows exactly which landmark it detected and thus knows the exact location of that landmark.  Thus, a slam algorithm uses the (noisy) distance to the detected landmarks (with known location) to estimate its position and map.

Why I think I'm wrong

In my naive understanding, the usefulness of SLAM would be limited to controlled environments (i.e. with known landmarkds) and completely useless in unknown environments with no a priori known landmarks.  I would presume that some sort of feature detection algorithm would have to dynamically add landmarks as they were detected.  However, this fundamentally changes the assumption that the number of given landmarks must be static at all times.

I know I'm wrong in my understanding of feature based SLAM, but I'm not sure which of my assumptions is wrong:

Do feature based SLAM algorithms assume a static number of landmarks?

Do the landmarks need to be known a priori?  Can they be detected dynamically?  And if so, does this fundamentally change the algorithm itself?

Are there special kinds of SLAM algorithms to deal with unknown environments with an unknown total number of landmarks in it?

答:
You are right in your assumption that your understanding is wrong. SLAM stands for Simultaneous Localisation and Mapping. The map can be anything that associates locations with things that are at those locations. One example of a map is where you have landmarks for which the positions are known.

If you assume that you already have this map. This is not a SLAM problem anymore. Its just localisation. Wanting to know where you  (or your agent) is within this map.

The nature of a landmark or feature based SLAM is that the location, number and identification of features is usually not known. This is why you do mapping. The result of your algorithm is then the estimated position of those features that you have detected and the estimated position of yourself.


问:
how does poles and zeroes affect the step response of an transfer function?
I have this close loop transfer function:

It overshoots, but why? The poles are placed such that that the damping = 1, so why the overshoot?

答:
The zero in the transfer function has an anticipatory effect that you can easily see as an overshoot.

However, since the zero is in the left half of the s-plane, you can consider the pole-zero cancellation as a suitable technique to get rid of that zero.


答:
The technique you're looking for is called landmark extraction.

The magic of SLAM comes from being able to automatically decide what counts as a landmark among the "features" that the sensors pick up.

In the early days of SLAM, this was fairly simple: just count every geometric feature detected by the sensors as its own landmark.  This is not scalable, but it academically proved the functionality of SLAM.  As you'd expect, you need to have enough landmarks to get good navigation.  But from a practical standpoint, you need to keep the CPU/memory usage within reason.

Keeping that balance is an open problem -- there are many papers that focus solely on how to get landmarks from features quickly / space-efficiently / in a domain-specific way.  The SLAM for Dummies whitepaper from MIT has some good introductory text on that topic.

Title: Assumptions about the nature of landmarks in SLAM algorithms

Body:
I'm trying to understand the role of landmarks in SLAM algorithms.  I've glanced over a few books concerning landmark based SLAM algorithms and I've come up with a rudimentary understanding which I believe is flawed.

How I think SLAM works:

As I understand it, landmarks are a set of points in a map whose locations are known a priori.   Furthermore, the number of landmarks in a map is fixed.  The number of landmarks detected at any one time may change, but the number of landmarks that exist in the map remains static at all times.

My understanding is that SLAM algorithms exploit the fact that these points are both uniquely identifiable and known a priori.   That is, when a robot senses a landmark, it knows exactly which landmark it detected and thus knows the exact location of that landmark.  Thus, a slam algorithm uses the (noisy) distance to the detected landmarks (with known location) to estimate its position and map.

Why I think I'm wrong

In my naive understanding, the usefulness of SLAM would be limited to controlled environments (i.e. with known landmarkds) and completely useless in unknown environments with no a priori known landmarks.  I would presume that some sort of feature detection algorithm would have to dynamically add landmarks as they were detected.  However, this fundamentally changes the assumption that the number of given landmarks must be static at all times.

I know I'm wrong in my understanding of feature based SLAM, but I'm not sure which of my assumptions is wrong:

Do feature based SLAM algorithms assume a static number of landmarks?

Do the landmarks need to be known a priori?  Can they be detected dynamically?  And if so, does this fundamentally change the algorithm itself?

Are there special kinds of SLAM algorithms to deal with unknown environments with an unknown total number of landmarks in it?


答:
One obvious example of where velocity motion models work better is in robots that don't operate on land: UAVs and AUVs, for instance.

Thinking about whether the information comes before (as in the case of the velocity command) or after (as in the case of the odometry) the motion is a red herring -- it doesn't matter.  You are creating a position estimate partly based on what you see and partly based on how you think you moved.  Each of those involve uncertainty, so you just need to characterize that uncertainty properly.

In terms of accuracy, sometimes it's more appropriate to consider exact wheel motion, and sometimes it's more appropriate to consider vehicle momentum; it all depends on the vehicle.

Title: Is there any advantage to velocity motion models over odometry motion models for SLAM?

Body: I've seen several examples of SLAM algorithms (EKF SLAM, Graph SLAM, SEIF SLAM) written in terms of the velocity motion model.  I have yet to see an example of any SLAM algorithm utilizing the odometry motion model.  I wonder if there is an inherent advantage to using the velocity motion model over the odometry model for this problem.  Does it have something to do with the fact that odometry sensor information comes after the motion has already taken place, whereas velocity control commands are executed before motion?


答:
Looks like wikipedia calls it Active Four-Wheel Steering. Although, what you're talking about is the left and right side steering opposite of each, whereas Active Four-Wheel Steering in automobile usually refers to the front and rear steering opposite of each other, I still think your case can still be considered Active Four-Wheel Steering the way it is defined there:

In an active four-wheel steering system, all four wheels turn at the same time when the driver steers.

This is similar to crab steering, but with crab steering all the wheels turn in the SAME direction at the same angle so the vehicle can travel in a straight line at an angle.


答:
Through my reading of this book "Probabilistic Robotics" chapter 5 pp. 120,121. It seems what you thought is right. And this is the reason the authors mentioned.

Many commercial mobile robots (e.g. differential drive, synchro drive)
  are actuated by independent transnational and rotational velocities,
  or are best thought of being actuated in this way. The second model
  assumes that one has access to odometry information. Most commercial
  bases provide odometry using kinematic information (distance traveled,
  angle turned). The resulting probabilistic model for integrating such
  information is somewhat different from the velocity model. In
  practice, odometry models tend to be more accurate than velocity
  models, for the simple reason that most commercial robots do not
  execute velocity commands with the level of accuracy that can be
  obtained by measuring the revolution of the robot's wheels. However,
  odometry is only available after executing a motion command. Hence it
  cannot be used for motion planning.

Hope this helps.


答:
There is no "term" for this arrangement of wheels, just like there is no term for this arrangement:

```<code> //    //
</code>```

other than "turning right"

Body:
There is no "term" for this arrangement of wheels, just like there is no term for this arrangement:

 //    //

other than "turning right"


问:
Virtual Testing Environment for Drones
Does anyone know of a robotics developer environment ideal for testing AI programs for drones (e.g. quadrocopters, planes, helicopters, etc.)? I would like something like Microsoft Robotics Developer Studio that includes a virtual environment (such as an outdoor environment with gravity, wind, etc.) to test out flight dynamics. I would like the options to add sensors to the virtual drone, such as gps, altimeter, gyros, etc. that the AI program can then use to steer the drone.</p>

答:
For testing simple algorithms, you might be able to get by with a 2D simulator. There are a few out there that I am aware of:

Stage: http://playerstage.sourceforge.net/index.php?src=stage

STDR: http://stdr-simulator-ros-pkg.github.io/

Stage is an older, but useful, simulator which has integration with ROS (http: //wiki.ros.org/stage_ros) which will allow you to write code to interact with and manipulate robots in C++/Python.

STDR is a newer 2D simulator which also has ROS bindings.

If you want a full 3D simulator I can think of three, which again are not AI or quadrotors specific, that might meet your needs:

Gazebo: http://gazebosim.org/

MORSE: https://www.openrobots.org/wiki/morse/

V-REP: http://www.coppeliarobotics.com/

Gazebo is the 3D counter part to Stage and has ROS support, and it has been used with quadrotors (http://www.ros.org/news/2012/03/announcement-of-hector-quadrotor-stack.html), though it has no out-of-the-box support for them.

MORSE is based on blender and its game engine, it has ROS and YARP and Raw socket support.

V-REP is a free for education simulator with support for many languages and platforms, including Windows and C#, if that is your kind of thing.

Title: Virtual Testing Environment for Drones


问:
Pulse Position Modulation as used in RC controls
How are several channels multiplexed down to a single physical wire? If two channels are transmitting the same value in the same frame, wont there be an overlap of the pulses?</p>

答:
Multiple PWM channels generally aren't shoved into a single wire (Or I've never heard of it). If you need to send multiple data channels over the same wire then using a higher level protocol (such as UART or SPI) would be the way to go. While PWM is technically digital, it isn't like other digital protocols where data can be shoved in and expected to come out perfect on the other side. It's more like an analog signal where readings are subject to noise and infinite precision is not possible.

Also, it wouldn't matter if two channels are sending the same value or not. The way servo PWM works only the longer pulse would survive (Assuming the pulses are synchronized. If they weren't unusable garbage would most likely come out).

EDIT:
As for pulse positioning, it might be possible to multiplex 2 signals depending on how they were constructed. From what I have read ppm requires either a clock pulse or a external clock, but in theory it should be possible to multiplex. Keep in mind that there won't be any real way to differentiate between the pulses sent, and both sources will need to share the same clock.


答:
Many (perhaps most) radio control transmitters multiplex all the "RC PWM" channels into a single physical wire, using a system called "RC PPM" (radio-control pulse position modulation).
(a) (b) (c) (d) (e) (f) (g)

Often this "PPM" signal is transferred from the a student's RC transmitter through the buddy box wire to the teacher's RC transmitter.

The "combined signal" -- the "RC PPM signal" -- looks something like this
(based on diagram from Richard J. Prinz):
(h) (i) (j) (k) (l)

```<code>Sync    1       2     3     4        5    6    7   8   Sync...
---+ +----+ +------+ +-+ +-------+ +--+ +--+ +--+ +-+ +----...
   | |    | |      | | | |       | |  | |  | |  | | | |
   | |    | |      | | | |       | |  | |  | |  | | | |
   | |    | |      | | | |       | |  | |  | |  | | | |
   +-+    +-+      +-+ +-+       +-+  +-+  +-+  +-+ +-+
    *      *        *   *         *    *    *    *   *

 * - low separator pulse, always 0.5 ms
 1..8 - high "RC PWM pulse" for channels 1..8      0.5 – 1.5 ms
</code>```

The long "sync pulse" between frames is typically at least 5 ms long.
All the other pulses are no more than 2 ms long.
Most transmitters have a fixed frame rate somewhere in the range of 40 Hz to 200 Hz.

When the pilot moves the positions of the joysticks on the transmitter,
the width of the corresponding "RC PWM pulse" for that channel
will grow proportionally longer or shorter.

The corresponding radio control receiver decodes the radio signal to a RC PPM signal on a single physical wire.
Often the receiver includes either a 4017 decade counter or a 4015 shift register --
that chip decodes the RC PPM signal at its CLK input into to several independent "RC PWM" outputs. The various RC servos are connected to those outputs with standard 3-pin connectors with 0.1" spacing.
The RC PWM signal on the "signal" wire of the 3-wires coming out of the servo
has a pulse width that typically varies from 1.0 ms to 2.0 ms (proportional to the position of the joystick),
but only one pulse for each frame.

(The standardized "RC PWM" works differently enough from the PWM used to control DC motor speeds that some people say that RC PWM signals "are not really PWM signals"
(m) (n) (o) (p) (q). Alas,
none of those people give any suggestions as to what we should call these signals, so I call them "RC PWM signals" for lack of a better name.
Perhaps I should call them "RC control signals" ?).

If two transmitters are transmitting at the same time, then yes, there will be an overlap of pulses.
However, people at RC flying parks are very careful to assign each pilot (and the transmitter and receiver he uses) a different "frequency channel", so that the receiver in each airplane can easily pick out the signal from its own transmitter and ignore the radio signals from every other transmitter.

A 6-channel receiver uses only one "frequency channel", but it has 6 output channels (6 servo channels), i.e., it has 6 rows of output pins for up to 6 servos to plug into -- typically one channel each for pitch(elevator), roll(aileron), yaw(rudder), throttle, and some optional AUX channels.

During a single RC frame, the a 6-channel receiver cycles through every every servomotor, putting one "RC PWM" pulse at a time on each of its 6 outputs.
Only one of its outputs is ever active at any one time -- there is no overlap of its pulses.

With a typical 50 Hz 6-channel transmitter,
when all the control sticks are pushed to turn all the servos all the way counterclockwise, the receiver spits out

a 1 ms pulse on channel 1, then -- as soon as that finishes -- a 1 ms pulse on channel 2, for all 6 channels -- a total of 6 ms -- and the (relatively long) sync pulse is however long it needs to be to fill out the rest of the 20 ms frame.

When all the control sticks are pushed to turn all the servos all the way clockwise, the receiver spits out

a 2 ms pulse on channel 1, then -- as soon as that finishes -- a 2 ms pulse on channel 2, for all 6 channels -- a total of 12 ms -- and the (much shorter) sync pulse is however long it needs to be to fill out the rest of the 20 ms frame.

Title: Pulse Position Modulation as used in RC controls

Body: How are several channels multiplexed down to a single physical wire? If two channels are transmitting the same value in the same frame, wont there be an overlap of the pulses?</p>

Body:
Many (perhaps most) radio control transmitters multiplex all the "RC PWM" channels into a single physical wire, using a system called "RC PPM" (radio-control pulse position modulation).
(a) (b) (c) (d) (e) (f) (g)

Often this "PPM" signal is transferred from the a student's RC transmitter through the buddy box wire to the teacher's RC transmitter.

The "combined signal" -- the "RC PPM signal" -- looks something like this
(based on diagram from Richard J. Prinz):
(h) (i) (j) (k) (l)

Sync    1       2     3     4        5    6    7   8   Sync...
---+ +----+ +------+ +-+ +-------+ +--+ +--+ +--+ +-+ +----...
   | |    | |      | | | |       | |  | |  | |  | | | |
   | |    | |      | | | |       | |  | |  | |  | | | |
   | |    | |      | | | |       | |  | |  | |  | | | |
   +-+    +-+      +-+ +-+       +-+  +-+  +-+  +-+ +-+
    *      *        *   *         *    *    *    *   *

 * - low separator pulse, always 0.5 ms
 1..8 - high "RC PWM pulse" for channels 1..8      0.5 – 1.5 ms

The long "sync pulse" between frames is typically at least 5 ms long.
All the other pulses are no more than 2 ms long.
Most transmitters have a fixed frame rate somewhere in the range of 40 Hz to 200 Hz.

When the pilot moves the positions of the joysticks on the transmitter,
the width of the corresponding "RC PWM pulse" for that channel
will grow proportionally longer or shorter.

The corresponding radio control receiver decodes the radio signal to a RC PPM signal on a single physical wire.
Often the receiver includes either a 4017 decade counter or a 4015 shift register --
that chip decodes the RC PPM signal at its CLK input into to several independent "RC PWM" outputs. The various RC servos are connected to those outputs with standard 3-pin connectors with 0.1" spacing.
The RC PWM signal on the "signal" wire of the 3-wires coming out of the servo
has a pulse width that typically varies from 1.0 ms to 2.0 ms (proportional to the position of the joystick),
but only one pulse for each frame.

(The standardized "RC PWM" works differently enough from the PWM used to control DC motor speeds that some people say that RC PWM signals "are not really PWM signals"
(m) (n) (o) (p) (q). Alas,
none of those people give any suggestions as to what we should call these signals, so I call them "RC PWM signals" for lack of a better name.
Perhaps I should call them "RC control signals" ?).

If two transmitters are transmitting at the same time, then yes, there will be an overlap of pulses.
However, people at RC flying parks are very careful to assign each pilot (and the transmitter and receiver he uses) a different "frequency channel", so that the receiver in each airplane can easily pick out the signal from its own transmitter and ignore the radio signals from every other transmitter.

A 6-channel receiver uses only one "frequency channel", but it has 6 output channels (6 servo channels), i.e., it has 6 rows of output pins for up to 6 servos to plug into -- typically one channel each for pitch(elevator), roll(aileron), yaw(rudder), throttle, and some optional AUX channels.

During a single RC frame, the a 6-channel receiver cycles through every every servomotor, putting one "RC PWM" pulse at a time on each of its 6 outputs.
Only one of its outputs is ever active at any one time -- there is no overlap of its pulses.

With a typical 50 Hz 6-channel transmitter,
when all the control sticks are pushed to turn all the servos all the way counterclockwise, the receiver spits out

a 1 ms pulse on channel 1, then -- as soon as that finishes -- a 1 ms pulse on channel 2, for all 6 channels -- a total of 6 ms -- and the (relatively long) sync pulse is however long it needs to be to fill out the rest of the 20 ms frame.

When all the control sticks are pushed to turn all the servos all the way clockwise, the receiver spits out

a 2 ms pulse on channel 1, then -- as soon as that finishes -- a 2 ms pulse on channel 2, for all 6 channels -- a total of 12 ms -- and the (much shorter) sync pulse is however long it needs to be to fill out the rest of the 20 ms frame.


问:
Bluetooth module HC-05 giving ERROR :(0)
I am working right now with Arduino UNO and HC-05 bluetooth module.I followed the instruction given on this link for wiring. So there are 2 mode of working with this HC-05 module

Simple serial communication

Working in AT command mode so as to change the parameters of HC-05 module

As long as I work in simple serial communication mode, everything works fine but when I tried to change the parameters of module, it didn't work out. For working in At command mode, PIN NO 34 of HC-05 module needs to be high which I had taken care of. Lately I found that in mu module they had knowingly not connected the Berg strip to PIN 34, so I connected the PIN directly, even though I am not able to change the parameters of module and when I write any command on COM port of arduino IDE, I get this response

```<code>Enter AT commands:
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
ERROR:(0)
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÿýì¢^
</code>```

I think that garbage is due to my code

Here is my code:

```<code>#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);
  digitalWrite(9, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);
}

void loop()
{
  uint8_t x;
  char CommandFromSerial[50]=" ";
  char ResponseFromBluetooth[50]= " ";

  if ((Serial.available())){
    if(Serial.available()>0){
      for(x=0;x<50;x++)
        CommandFromSerial[x]=Serial.read();
      BTSerial.println(CommandFromSerial);
    }
  }

  if ((BTSerial.available())){
    if(BTSerial.available()>0)
      for(x=0;x<50;x++)
        ResponseFromBluetooth[x]=BTSerial.read();
    Serial.println(ResponseFromBluetooth);
  }
}
</code>```

I am not able to figure out what I am doing wrong. I used this command on COM port
AT\r\n and many other commands but every time I get the same response.

Did I mess up with my bluetooth module unknowingly?

答:
I had problems with this as well using a Pro Micro. Testing with a Mega instead and it worked no problem, using (57600) for Serial and (38400) for Serial1. I did try Serial1 as well as BTSerial with the Pro Micro, to no avail but didn't test with BTSerial on the Mega.

There's no pin 11 on the Pro Micro, so I used

SoftwareSerial BTSerial(10, 14);

For whatever reason, after trying with the Mega, it now works with the Pro Micro using John's code above, which is pretty much the same as the code I originally used (and which worked on the Mega).

I have found that Serial.println commands in the "void setup" section don't work on the Pro Micro but do on the Mega, so don't think it's not working just because you don't see those in Serial Monitor. In the "void loop" section they work fine though. It didn't make any difference using a command to wait for Serial to be ready, like so:

```<code>   Serial.begin(57600);
   while (!Serial) {
     ; // wait for serial port to connect. Needed for Leonardo only
   }

   Serial.println("Goodnight moon!");

   // set the data rate for the SoftwareSerial port
   Serial1.begin(38400);
   Serial.println("Ready");
}
</code>```

Body:
I had problems with this as well using a Pro Micro. Testing with a Mega instead and it worked no problem, using (57600) for Serial and (38400) for Serial1. I did try Serial1 as well as BTSerial with the Pro Micro, to no avail but didn't test with BTSerial on the Mega.

There's no pin 11 on the Pro Micro, so I used

SoftwareSerial BTSerial(10, 14);

For whatever reason, after trying with the Mega, it now works with the Pro Micro using John's code above, which is pretty much the same as the code I originally used (and which worked on the Mega).

I have found that Serial.println commands in the "void setup" section don't work on the Pro Micro but do on the Mega, so don't think it's not working just because you don't see those in Serial Monitor. In the "void loop" section they work fine though. It didn't make any difference using a command to wait for Serial to be ready, like so:

   Serial.begin(57600);
   while (!Serial) {
     ; // wait for serial port to connect. Needed for Leonardo only
   }

   Serial.println("Goodnight moon!");

   // set the data rate for the SoftwareSerial port
   Serial1.begin(38400);
   Serial.println("Ready");
}


问:
How to obtain dense point clouds from stereo cameras?
I am trying to use a stereo camera for scene reconstruction, but I can usually only obtain sparse point clouds (i.e. over half the image does not have any proper depth information).

I realize that stereo processing algorithms rely on the presence of texture in the images and have a few parameters that can be tweaked to obtain better results, such as the disparity range or correlation window size. As much as I tune these parameters, though, I am never able to get results that are even remotely close to what can be obtained using an active sensor such as the Kinect.

The reason why I want that is because very often point clouds corresponding to adjacent regions don't have enough overlap for me to obtain a match, so reconstruction is severely impaired.

My question to the Computer Vision experts out there is the following: what can I do to obtain denser point clouds in general (without arbitrarily modifying my office environment)?

答:
You can try to skip the salient point detection, and just densely sample over the image (as grid or so) and compute a feature descriptor at every sample point. You can probably even go as far as computing a descriptor for every pixel.

You might lose scale-invariance, but I think this won't hurt too much for stereo vision as objects will be at approximately the same scale in both images.

Another approach might be to combine multiple salient point detection algorithms: corners, edges, blobs and so on. Then you have to use the same feature descriptor algorithm for all detected points, however this latter part could be somewhat tricky to implement.


问:
What's the difference between Yaw and Attitude in Quad Rotor
I have a big miss conception between Yaw and attitude ?

Isn't both represent "how far is the quad from earth ?"

Also if you could post how to calculate them from IMU (gyro +accele + magent )

答:
I think you're confusing two words that are spelled almost identically:

Altitude:  (with an L) is the distance from the vehicle to the earth.  It is given in terms of meters.

Attitude:  (with a T) refers to the orientation of the vehicle with respect to a reference frame.  It is usually given in terms of roll, pitch, and yaw, which are all essentially angles of rotation along the x, y, or z axis.


问:
What does this "inverse" peak mean? (step function)
I identified my system and now I am trying to tune PI regulator since I think I do not need D.

I came across this graph while Matlabing and I do not know what does it mean.

I am using pidtune() to get my P and I values. (I think computation is all correct, I made model in simulink to confirm). Anyway see my picture and arrow is pointing at what I do not understand. Why is my system going below zero first?

It is supposed to be water flow regulator.

Transfer function:
$$ \frac{-0.311s + 0.05548}{s^2 + 0.06882s + 0.0007626}$$

Continuous-time PI controller in parallel form:
$$K_p + K_i * \frac{1}{s}$$

With $K_p = 0.256$, $K_i = 0.000342$

答:
What you seem to be concerned about is the well known nonminimum-phase effect of the zero $s_0=0.05548/0.311$ in the right half of the s-plane.

You should first ask yourself whether this lag has a physical interpretation in the context of your system. Many physical systems expose such a dynamics, but here it might also depend on how you carried out the identification.

Then, to properly account for such a lag, if it really exists and is not introduced by the identification process, you should make use of proper techniques. For example, look here.


问:
image size vs image resolution
I read somewhere that in the case of photoshop for example, the size refers to the number of pixels an image contains, but resolution involves the pixel's size, I don't know whether this definition goes for all the other fields. In computer vision, what's the difference between image size and image resolution?</p>

答:
Image size and image resolution generally have the same meaning in most cases. They usually refer to the dimensions of a 2D image, measured in pixels.

Image size can refer to the dimensions of a printed image.

In other contexts, image resolution can refer to an image's spatial resolution, which is a measure of the number of independent pixel values per unit length measured in a world coordinate frame. For example, in satellite imagery, we can measure the quality of a lens by determining its spatial resolution from its images of the earth.

Title: image size vs image resolution


问:
Need to clear some concepts: AHRS - Attitude - Yaw,Pitch and Roll - MARG sensors -INS
it's been while since I started reading about INS, orientation and so for quadrotors .

I faced the following terms : AHRS - Attitude - Yaw,Pitch and Roll - MARG sensors

I know for example how to calculate Yaw,Pitch and Roll , but does it related to Attitude ?

What's Attitude  any way and how it get calculated ?

AHRS "Attitude and heading reference system" does it formed from Yaw,Pitch and Roll ?

MARG(Magnetic, Angular Rate, and Gravity) ? how it's related to other terms ?

What about INS ( Inertial Navigation Systems ) ?

My questions here are about these concepts, and there meaning , how they cooperate with each other , how they got calculated and which sensors suits for what ?

答:
Summarized from wikipedia:

IMU:  (inertial measurement unit) is just a sensor that provides raw data to help determine velocity, acceleration, and orientation.  It is usually some combination of an accelerometer, gyroscope, and a magnetometer.  I emphasize that the IMU only provides raw data, and not necessarily the true information that you want.

MARG: is a general term for the kind of data obtained from an IMU:  magnetic (magnetometer), angular rate (gyroscope), and gravity (accelerometer).  A MARG sensor is an IMU that obtains all three of these pieces of data.  But generally speaking, IMU's may also provide other data such as temperature and pressure (both can be used to help determine altitude).

AHRS:  combines an IMU with some sort of processor that produces the useful information that you really need (i.e. roll, pitch, yaw, etc...).  This is usually done by means of a (extended) kalman filter.

INS:  is a complete system that enables you to determine and monitor the movement of an object over time, using the processed MARG data from that object.

To understand the relation between attitude and "roll, pitch and yaw", refer to my other answer:

What's the difference between Yaw and Attitude in Quad Rotor


问:
How to calculate Altitude from IMU?
How to calculate attitude from IMU ? </p>

<p>For example, mathematical equations </p>

答:
Altitude is usually determined from pressure and temperature sensors of an IMU.  You can see a formula here.  </p>

<p>However, you must realize that raw data from a sensor is NEVER RELIABLE.  Sensors do not always give a correct reading.  Instead, they give you a value somewhat close to the true value, but with some random "noise" added to it.  So, instead of just using the data that you obtain from the sensor, you should always filter out the noise using some form of kalman filter.  </p>

Title: How to calculate Altitude from IMU?

Body:
Altitude is usually determined from pressure and temperature sensors of an IMU.  You can see a formula here.

However, you must realize that raw data from a sensor is NEVER RELIABLE.  Sensors do not always give a correct reading.  Instead, they give you a value somewhat close to the true value, but with some random "noise" added to it.  So, instead of just using the data that you obtain from the sensor, you should always filter out the noise using some form of kalman filter.


问:
Inverse Kinematics in Java
I'm planning to write an Inverse Kinematics controlled 6 dof virtual robot for Android. I did some research on packages avaliable and couldn't choose the right one which will satisfy my needs on this project. I've seen a work with Eigen in C++, and used it, it was just fine. But since i'm not so experienced in Java, i wanted to ask before i start, if someone knows some appropiate packages for these operations.

Here is what i found so far:

JAMA,
Vecmath,
Jmathtools,
EJML,
JAMPACK
I ask this because i really dont want to get stuck in the middle of my project. Thanks in advance.

答: These are matrix-vector math libraries. They are related to inverse kinematics only because inverse kinematics involves matrices, vectors, and math. If you need an implementation of an inverse kinematics library, that is a different question. But any of those would be fine for doing the required math, once you solve the inverse kinematics in closed form or by some other method. Personally, I've used JAMA (it works).</p>

Title: Inverse Kinematics in Java


答:
An aircraft's attitude can be calculated from an IMU, but a full-fledged Attitude and Heading Reference System (AHRS) needs a bit more data -- magnetometers and GPS sensors can help.  Your question is a little vague as to what you're hoping to accomplish.

Here is an article describing some of the code you need in order to do this with quaternions, but in general there's not much I can suggest besides searching for "IMU attitude estimation".

Title: How to calculate Altitude from IMU?

Body:
How to calculate attitude from IMU ? </p>

<p>For example, mathematical equations </p>


答:
When talking about vehicles (such as aircraft), attitude is just a fancy word for "orientation": the combination of yaw, pitch, and roll.  These would be easy to calculate if the plane was just standing still; you'd use a compass to get the yaw, and a plumb bob to measure the pitch and roll.  However, the acceleration or deceleration of the aircraft would severely alter these measurements.

Gyroscopes measure angular velocity but can't measure position, velocity, or acceleration.  (Fortunately, they aren't affected by it either.)

Accelerometers can measure the force on an object (either real forces like gravity or perceived forces like centrifugal force).  This measurement is often integrated to estimate velocity, or double-integrated to estimate position (both of which become increasingly inaccurate with time).

Magnetometers measure the magnitude and direction of magnetic fields.

Regarding the other terms: IMUs produce some subset of MARG data (some have more sensors than others).  MARG data is used by an AHRS system to compute attitude (roll, pitch, yaw).  MARG data (optionally combined with other sensor data) is used by an INS system to compute both attitude and position.

Title: Need to clear some concepts: AHRS - Attitude - Yaw,Pitch and Roll - MARG sensors -INS

Body:
it's been while since I started reading about INS, orientation and so for quadrotors .

I faced the following terms : AHRS - Attitude - Yaw,Pitch and Roll - MARG sensors

I know for example how to calculate Yaw,Pitch and Roll , but does it related to Attitude ?

What's Attitude  any way and how it get calculated ?

AHRS "Attitude and heading reference system" does it formed from Yaw,Pitch and Roll ?

MARG(Magnetic, Angular Rate, and Gravity) ? how it's related to other terms ?

What about INS ( Inertial Navigation Systems ) ?

My questions here are about these concepts, and there meaning , how they cooperate with each other , how they got calculated and which sensors suits for what ?


答:
In the photoshop sense, image resolution refers to the quality of the printed image: how much physical space each image pixel will take up when it is printed.

In the computer vision sense, it's reversed: how many pixels that each unit of physical space takes up when it is captured by the camera.  (This measurement is entirely dependent on the distance between the camera and the subject.)

Title: image size vs image resolution

Body: I read somewhere that in the case of photoshop for example, the size refers to the number of pixels an image contains, but resolution involves the pixel's size, I don't know whether this definition goes for all the other fields. In computer vision, what's the difference between image size and image resolution?</p>


问:
How to use quaternions to feed a PID quadcopter stabilization loop?
I'm making a quadcopter. I have set up a PID loop to stabilize it to a given Euler angle (pitch and roll). The problem arises when the roll approaches 90 degrees (45 degrees and up). The values don't make sense anymore, as it approaches the gimbal lock. I intend to make it do complex maneuvers like looping etc., which exceeds the 45 degree roll limit.

How can I use quaternions to overcome this problem? (I get quaternions from the MPU-9150.) I have read many articles on the matter of quaternions, but they all talk about rotations in 3D software, and tweening between two rotation points. This makes little sense as I do not know imaginary numbers and matrices.

答:
A quadcopter contains (among other things) two separate and independent algorithms: an attitude estimation algorithm, and a control algorithm.

The attitude estimation algorithm computes information about the orientation of the quadcopter: the roll, pitch and yaw angles.

The control algorithm is responsible for driving the motors so that the orientation of the quadcopter matches what the pilot (or the autopilot software) expects. This algorithm is what would read the estimated quadcopter angles (from the attitude estimation algorithm) and change the motors speed to attempt to match the desired angles. PIDs are a well-suited and common control algorithm for quadcopters.

Gimbal lock is a phenomenon which may happen in the attitude estimation algorithm. It has nothing to do with the control algorithm. As such you don't need ESCs, motors or propellers to test for gimbal lock: you could modify your code to display your roll, pitch and yaw angles, and test that the correct values are calculated as you manually move your quadcopter around. You might be able to do this with the quadcopter tethered to your computer, via Bluetooth, or using other methods depending on your platform.

If the angles are calculated correctly you don't need to worry about quaternions. If they are not calculated correctly, quaternions might help you. The attitude estimation algorithm shall output 3 angles for the control algorithm to use, however it might use a different internal representation such as quaternions or 3x3 matrices. In that case it would still convert the attitude information to angles so as to provide usable data to the control algorithm. Generally speaking quaternions are unintuitive but computationally efficient. This makes them well suited for slow platforms such as Arduino. Matrices or angles may be an easier choice for faster hardware. If you need me to elaborate on one solution or the other please let me know, but it would be quite premature for me to give details at this stage as I am not convinced you need to implement quaternions.

Finally if the angles are calculated correctly the way to make your quadcopter loop is to control the angular rate rather than the angle. If your sticks represent the quadcopter angle there is no way to make it do a full loop: try to visualise the sticks position as the quadcopter loops and you should understand why. However if the sticks control the angular rate then you can control the speed at which it loops.

Good luck with your project!

Note: For the sake of simplicity I have not mentioned the theoretical option to manipulate the data as matrices or quaternions both in the attitude estimation algorithm and the control algorithm. I have never seen a quadcopter implementing such algorithms.


问:
What's the most adapted programming language for Robotic and principally AI?
I'm currency a Web programmer and I'm very passionate by robotics and specialty for Artificial Intelligence.

I have already make some C++ program for Microship and Arduino for little robots and other Lisp codes (example for labyrinth path search) but I think it's not really applicable for projects further.

I have read a lots for artificial neural network to create artificial mind, but it's very theoretical and I have no idea to reproduce that on code.

Someone have a idea to help me, a specific language, or just a C++ library ?
If you have some links, articles, or other tutorials I take it.

Thank a lots !

答:
Python has become increasingly popular in the computational sciences, but I'm not sure how widespread is its use in AI, machine learning, or robotics.

What I do know is that one popular choice is to use the open source Robot Operating System (ROS) to interface code with hardware.  While it is not a programming language per se, it interfaces with lots of codes written generally in C++ and Python.


问:
how to make Mac detect AVR board using USBasp and burn program to it?
I am new to Embedded, starting with AVR programming using C. I am working on Mac OS 10.9.4, so far I am using avrdude and xCode as IDE. It works very well, for now I am testing my code using Proteus.

But now I want to burn my .hex to AVR ATMega16 board. I have USBasp, which I am able to connect and it lights up the board. Now after searching on the internet, I think Mac is not detecting my board. I have checked /dev directory, but no usb device found.

So I am not sure what to next, how to make Mac detect my board and burn my .hex on it. I've found this: http://www.fischl.de/usbasp/ but no idea how to use this or its required or not.

So question stand is: how to make Mac detect AVR board using USBasp and burn program to it?

FYI: I've installed CrossPack on Mac.

答:
After reading AVR and CrossPack docs, I've found really easy to do this.

For AVR development environment setup, do the following thing:

Install xCode on your Mac, choose latest version.

Now install CrossPack.

This will do all the environment setup. CrossPack installs required libs to support USBasp as well.

To create project using xCode:

Create new project

Select xAVR project on next screen

Next set MCU you are using, Programmer to USBAsp, Frequency as needed.

There you go, try a first first time build it may fail, but try again it will work smooth.

You can use AVR DUDE directly from Terminal:

```<code>avrdude -c usbasp -p <partno> -P usb -v
</code>```

Body:
After reading AVR and CrossPack docs, I've found really easy to do this.

For AVR development environment setup, do the following thing:

Install xCode on your Mac, choose latest version.

Now install CrossPack.

This will do all the environment setup. CrossPack installs required libs to support USBasp as well.

To create project using xCode:

Create new project

Select xAVR project on next screen

Next set MCU you are using, Programmer to USBAsp, Frequency as needed.

There you go, try a first first time build it may fail, but try again it will work smooth.

You can use AVR DUDE directly from Terminal:

avrdude -c usbasp -p <partno> -P usb -v


问:
DC motor control - speed-torque curve
I am having some trouble understanding how to practically use the speed-torque curve of a DC motor.

I understand that the gradient of the speed-torque curve is defined by the design of the motor, the exact position of the curve depending on the voltage applied. So if the voltage is changed the speed-torque curve is also changed but remains parallel to the initial curve before the voltage was changed. See figure below.

So my intuitive guess is that when using the motor at a given desired operation point (desired speed and desired torque), the corresponding speed-torque curve Cd has a gradient specified in the data sheet of the motor and passes through the operation point. This curve Cd is obtained at a corresponding voltage Vd. See diagram below.

So my next guess is that in order to have the motor operate at this desired operation point, you have to set the voltage applied to the motor to Vd, and apply a current Id (computed using the torque and the torque constant).

Now from what I read this is not what is done in DC motor controllers. These seem to only drive the motor using current and some sort of PWM magic as is shown in the following diagram by maxon.

Anyone knows why voltage is not used in DC motor control and only current is? I do not understand how you can set the speed if you do not modify the voltage? And what is PWM useful for?

I have looked for hours over the internet and could not find anything relevant.

Thanks,

Antoine.

答:
The problem is that you cannot control both the voltage and the current. You apply a voltage, and the motor draws whatever current it wants (subject to your ability to supply that current). Alternatively, you make a current controller which automatically adjusts the voltage to maintain the desired current.

An analogy would be pushing an object through honey. Voltage is equivalent to the force you're applying, and current is equivalent to the speed of the object.

The object moves at a speed which depends on how hard you're pushing, and the dimensions of the object. You cannot choose to push gently and quickly, and you cannot choose to push really hard and slowly. If you want the object to move at a certain speed, you have no choice but to adjust the amount of force you apply until it moves at that speed. If it's moving too fast, you reduce the force. Too slow, and you increase the force.

This is how a motor is controlled. PWM 'magic' is just a way to control the voltage that doesn't cause the voltage controller to get really hot. (The alternative is a linear voltage source, which will get really hot).

Before we get into what's happening in the motor controller, it would be worth looking at a different graph:

Here we can see that the torque produced by the motor is purely a function of the current flowing through the windings, and it's pretty linear. If you want to produce a certain torque at the motor, all you need to do is look up on the graph for the current required, then tell your current controller to deliver this current. It does this by constantly measuring the actual current, and adjusting the voltage at the motor (using PWM magic).

Now we have a very nice situation for our robot's controller. Assuming a world with no friction, motor torque is proportional to acceleration. If you can control the acceleration, then you can easily control the velocity and position of the motor.

The motor position controller knows the trajectory it needs from the motor, and can calculate how much torque it needs at every point during this trajectory (because it knows the acceleration at every point in the trajectory). It's also looking at the actual position of the motor, which won't quite be correct because of friction, and uses that position error to adjust the amount of torque it wants. It then converts the torque demand into a current demand, and gives that to the current controller.

And there you have a servo.

Title: DC motor control - speed-torque curve


问:
How to calibrate an IMU unit?
Simply , how can I calibrate IMU unit ?

I read some papers about this topic and was wondering if there are any standard methods.

答:
Inertial sensor assemblies suffer from a number of error sources, including offsets, scale factor errors and limited frequency response. With multi-axis sensors, you also need to account for alignment errors among the axes and cross-axis coupling. In addition, most of these errors are temperature-dependent.

How you deal with these errors depends very much on your application. Designers of advanced systems evaluate each of them and determine which ones can be dealt with manual calibration (e.g., axis alignment), and which ones are dynamic enough that they need be be dealt with in the Kalman filter (e.g., offsets and scale factors), adding additional terms to the system model to account for them.

Title: How to calibrate an IMU unit?


问:
What are the advantages of optimal control as opposed to control theory?
For a robot, say path planning in particular, what are the pros and cons of choosing classical control theory or optimal control (LQR for example) ?</p>

答:
Robotic path planning is a field unto itself.  There are people doing research on integrating optimal nonlinear model based predictive control with path planning, but those tools aren't really ready for prime-time yet.  A good place to get acquainted with this field would be to skim through Steven Lavalle's free path planning book:

http://planning.cs.uiuc.edu/

After that you should have some idea what sort of algorithm you want to learn more about, hunt for existing code, implement your own code, etc...

ContentLicense: CC BY-SA 4.0


答: I am a programmer for my schools robotics team. We use Robot C. Very similar to Java but with slight syntax differences. Specifically i work with Vex Robotics. One part of the code controls Autonomous (non user controlled) programming. Check it out!</p>

Title: What's the most adapted programming language for Robotic and principally AI?

Body:
I'm currency a Web programmer and I'm very passionate by robotics and specialty for Artificial Intelligence.

I have already make some C++ program for Microship and Arduino for little robots and other Lisp codes (example for labyrinth path search) but I think it's not really applicable for projects further.

I have read a lots for artificial neural network to create artificial mind, but it's very theoretical and I have no idea to reproduce that on code.

Someone have a idea to help me, a specific language, or just a C++ library ?
If you have some links, articles, or other tutorials I take it.

Thank a lots !


问:
Relative Navigation Systems
Im trying to develop a system that autonomously navigates a large outside space, where accuracy is vital (GPS is too inaccurate). There are a number of options but have largely been used inside, has anyone tried these or used anything else?

WiFi triangulation,
Dead reckoning,
RFID landmarks

答:
I would look at the System "PIKSI" from Swift Navigation

It uses one fixed GPS modul and one which is carried on your Robot.
Your accuracy is about 5 centimeters, which is pretty good for a GPS based system

I haven't tried it yet, so I cannot share experience, but I think it is worth a try.

Here are some links:

http://swiftnav.com/piksi.html

https://www.kickstarter.com/projects/swiftnav/piksi-the-rtk-gps-receiver

Title: Relative Navigation Systems


问:
I'd like to use gesture based input for my robot. What are the pros and cons between the Xtion Live and the Kinect?
As in the title, I'd like to implement gesture recognition on my robot and I'm looking for the pros and cons between the Kinect and the Xtion - and also if there are any other sensible options available.

I'm thinking of the following, but open to other suggestions:

Accuracy

Price

Driver quality

Power draw

答: I know the Xtion is smaller and powered by USB where as the Kinect requires to use a wall power socket to operate. In terms of depth perception they are very similar in terms of accuracy. Depending on whether your robot needs to be portable (i.e not attatched to the mains) and small should probably be the deciding factor.</p>


问:
Servo controlled valve
I am trying to build a servo-controlled water valve.  Max pressure 150 psi , valve size 1/2".

Can anyone recommend a suitable 1/4-turn valve, either ceramic, ball valve, or anything else that is easy to turn, even under pressure? It must require very little torque to turn, so a standard servo can rotate it with a small lever attached.

答:
It is pretty common to take a simple and cheap solenoid valve and use a PWM at the input

TI  has a pretty nice driver (DRV102) which uses a analog input and provides enough power to switch the most valves. I don't even need a MCU, just a variable resistor is enought
Then just take a cheap valve and the job is done

Title: Servo controlled valve


问:
Choosing motor for a tricopter
I'm a newbie in RC field..I am planning to construct my first Tricopter ever.  Can anyone help me to find the power rating to select the motor for a tricopter?

I am at the beginning stage of construction.  Arm length of frame: 50cm each.  I need a thrust of about 2Kg -- nearly 666 gms for each motor.

答:
This depends on what you want to do with your copter.

Hovering:                              100-150 Watt/kg

ScaleFlight:                           200-300 Watt/kg

Some chilling acrobatic flight:        350-400 Watt/kg

3D acrobatics                          500+ Watt/kg

Hardcore 3D                            1000 Watt/kg

Just take the real weight of your copter, calculate the total power and divide it by 3 (in your case)

I also have a source for this but i know only a German one:
http://www.heli-planet.de/index.php?section=auslegung_von_e_motoren

Title: Choosing motor for a tricopter


问:
SLAM without landmarks?
First, is it possible to build map without landmarks for a robot in 2D? Let's say we have an aisle surrounded  by two walls. The robot moves in this environment. Now is it feasible to build such a SLAM problem? Or landmarks must be available to do so?</p>

答:
I think it is necessary to define what a landmark actually is. The other answer just defines them as markers and gives some examples. Something more formal and distinctive would be the following:

Landmarks are features which can easily be re-observed and distinguished from the environment. They are used by the robot to find out where it is (to localize itself).

Landmarks should be easily re-observable. Individual landmarks should be distinguishable from each other. Landmarks should be plentiful in the environment. Landmarks should be stationary.

This would for example exclude a simple pixel to act as a landmark, since in the real world it corresponds to an object which will become more or less pixels depending on distance. A blob would be more suitable since we just rely on finding a closed shape of a certain color (again with some threshold because colors change depending on lightening conditions and angle). In the real world the blob would be some orange sticker attached to the wall for example.

Title: SLAM without landmarks?


答:
I have tried using Decawave's DW1000 chips. You can now get these on little boards:

These can measure the distance between each other by measuring the time of flight of an Ultra-Wideband message. The precision is about 10cm, and the trueness depends on a lot of factors.

You have a few as base stations, and one or more on each robot. By triangulation, you can work out the location of the robot.

I can report that the chips are insanely complex to program, and the example code they provide is a huge hairball that looks like it was written by an intern. However, they do work, and the other benefit is that you can put a data payload in the messages, so they solve your communications problems too.

Title: Relative Navigation Systems

Body:
Im trying to develop a system that autonomously navigates a large outside space, where accuracy is vital (GPS is too inaccurate). There are a number of options but have largely been used inside, has anyone tried these or used anything else?

WiFi triangulation,
Dead reckoning,
RFID landmarks


答:
Please see Lavalle's book for more details, in the meantime some basic terminology....

A path is a sequence of robot poses. A trajectory is sequence of time-pose pairs. Path planning creates a path, and control methods (classical, optimal, adaptive, etc) produce trajectories.

For example, when you plan your route from home to work, you come up with roads that you would take. That's your path, and you just did path planning. When you embark on the journey, you are at the particular place and the particular time. That's your trajectory.

A difference is in the toolset you used to produce path and trajectories. You planned the path based on the goal and the physical size of your car. You created a trajectory by following the path (reducing the error) and by pushing gas and brake pedals, and turning the steering wheel.

Hope this helps.

Title: What are the advantages of optimal control as opposed to control theory?

Body: For a robot, say path planning in particular, what are the pros and cons of choosing classical control theory or optimal control (LQR for example) ?</p>


问:
Mechanical or electrical engineering for robotic and automation?
I have decided to pursue a career in automation and robotic. At the moment, I am being torn between Mechanical and Electrical Engineering. I know that both of them relate to my choices of career, and at the moment, I think that I like them equally. I hope you guys can help me solve my dilemma by using your insights/experiences to assist me with the following questions:

1/ From your experiences and opinions, which of the two engineering fields is generally more crucial and challenging, especially in an automation/robotics project?

2/ Which will see an increase in demand and importance in the near future? Which of them might become outdated/obsolete or at least develop at a slower rate compare to the other?(I have a feeling that EE has a slight edge over this matter; however, I am not so sure)
3/ Which of the fields is more versatile? Which is more physical demanding (I am actually quite frail)

4/ Which is generally easier to self-study? Robotics is obviously an incredibly broad and complex field and I have prepared to step outside of my comfort zone and do lots of studying by myself to achieve my goals and passion.

I could probably come up with a few more questions; however, I am sure that you guys got the gist of my puzzle. Thank you very much and I apologize if there is any grammatical error.

答:
As others mentioned, you should look into CS. In the broad strokes:

ME - build physical robots, + tangible, - might be physically demanding, - can be costly (need parts)

EE - build circuits, low level control, + less physically demanding, + tangible (now you have robot that does something), - can be costly (might need whole robots)

CS - build robot's "brain", + not physically demanding, + cheap for simulation, - less tangible (you need EE/ME folks if you want to see your algorithms on the physical robot), - experiments are expensive (for the same reason).

Of course, robotics is multi-disciplinary field and all three are closely related with blurred lines between them. Try all and see what clicks.


问:
Robot Loud Alarm
We are working on a project where we want to sound an alarm if somebody is messing around with our Robot (e.g., the Robot is being shaken abruptly or the cameras/LIDARs are blocked).
I am using "loud speakers" (4.1 x 3 inch 10 Watts 8 ohm speakers), but they are not loud enough.

Are there any small speakers or alarm systems small enough, but loud enough (closed to a car alarm) that you would recommend?
Ideally something that I can just plug into the robots computer, or interface with through a microcontroller. Either one would be fine.

答:
If you don't mind a hacky solution then opening one of these might be the best way to go. Just replace the button with a FET (or standard transistor) and be on your way.
If you wan't a more traditional/better looking solution, then the best thing I can recommend is getting a larger speaker/amplifier. It looks like one can buy car horns, but that would probably take more wiring than necessary.
If I were in your position, I would go with the electronic whistle. </p>

Title: Robot Loud Alarm


问:
computer vision using the FREAK local features descriptor - why overlapping fields?
I am currently studying the FREAK descriptor and I read the article published by its designers. It states that the aim was to mimic the retinal topology, and one of the advantages that could be gained is the fact that retinal receptive fields overlap, which increases the performance.

I thought about it a lot, and the only explanation I was able to come up with is the fact that, looking at this problem from an implementation point of view, a receptive field is the ensemble of an image patch centred around a pixel, plus the standard deviation of the Gaussian filter applied to this patch. The size of the receptive field represents the value of the standard variation. The bigger the size is, the more pixels will be taken into consideration when Gaussian filtering, and so we "mix" more information in a single value.

But  this guess of mine is very amateurish, I would appreciate it if someone could give an explanation from what goes on in the field of image processing-computer vision-neuroscience.

答:
Interesting question! Thanks for introducing me to FREAK!

The paper just says that overlapping fields "increases redundancy", my interpretation is that like most detectors, FREAK is essentially scrolling a detection window over the image. If you arbitrarily break the image into non-overlapping windows then there's a good chance you'll break a useful image patch into multiple pieces. Visual examples are better than wordy explanations. Let's assume I have a smiley-detector and I'm running it on the image below. The strongest response from my smiley-detector will come from the blue window, but if I had broken the image into non-overlapping windows (the red regions) then instead of one strong face descriptor, I'd have four crappy face descriptors.

As I said, I don't know the details of FREAK, but in general for scrolling-window-type detectors that's the reason to have overlapping windows.


答:
As a neuroscientist/engineer who teaches vision in a physiology course for engineers, but who hasn't read any of the FREAK docs, I'd point people to the works of David Marr, or maybe Kuffler.  I found a nice review at Introduction to visual computation and
the primate visual system - 11MB PDF.

Retinal receptive fields (or more properly, ganglion cell receptive fields, where ganglion cells are the output layer of the retina) have a center-surround topology, where the outer portions of the receptive fields behave opposite to the central part of the visual field.  Thus, a point of light shined on the center of the field might excite the ganglion cell, and if shined on the periphery of the field it might inhibit the same cell.   This image (mostly images from a physiology text by Purves) shows this idea in a couple of ways, and also shows an interesting illusion that results from this center-surround antagonism in the lower right (the center bar is a constant shade of grey).

This arrangement (approximately a difference of gaussians) has the benefit of increasing the dynamic range of the ganglion cell, and it also enhances the edges in images received by the retina.

The output from the ganglion cells projects fairly directly to the lateral geniculate nucleus, and from there to the visual cortex of the brain.  There, the roughly circular receptive fields of the ganglion cells can be joined up in interesting ways to respond to lines of contrast.  This is one of the reasons why overlapping fields can be so powerful.  From there, you can use overlapping "line" fields to detect x's, +'s, and so on, with increasing complexity.

Title: computer vision using the FREAK local features descriptor - why overlapping fields?

Body:
I am currently studying the FREAK descriptor and I read the article published by its designers. It states that the aim was to mimic the retinal topology, and one of the advantages that could be gained is the fact that retinal receptive fields overlap, which increases the performance.

I thought about it a lot, and the only explanation I was able to come up with is the fact that, looking at this problem from an implementation point of view, a receptive field is the ensemble of an image patch centred around a pixel, plus the standard deviation of the Gaussian filter applied to this patch. The size of the receptive field represents the value of the standard variation. The bigger the size is, the more pixels will be taken into consideration when Gaussian filtering, and so we "mix" more information in a single value.

But  this guess of mine is very amateurish, I would appreciate it if someone could give an explanation from what goes on in the field of image processing-computer vision-neuroscience.


问:
Pledge algorithm for maze solving robots
i saw this maze, and tried to apply pledge algorithm on it. But i am not able to solve this maze using this algorithm. what am i missing?
i want to ask, what i am doing wrong?

PLEDGE ALGORITHM:
in both cases we don't get to exit.

you can read about these algorithms at:

http://en.wikipedia.org/wiki/Maze_solving_algorithm

http://www.astrolog.org/labyrnth/algrithm.htm

答:
I can't quite see how you're doing the right-hand wall following. When I do it, this is what I get:

For the Pledge algorithm, it's working. It found an exit to the maze! It just so happens that the exit is the same as the start. If you want it to find the other exit, you'll have to block off the top exit after you enter the maze.


问:
Whats the logic to implement a particle filter for a robot with range sensor?
I am trying to implement a particle filter for a robot in Java. This robot is having a range sensor. The world has 6 obstacles - 3 in the top and 3 in bottom. I am calculating the distance of the robot from each obstacle's center and then performing the same activity for each particle. Then, i calculate the difference between the robot and particles. The particles for which the difference with robot measured distance are small, i give them higher probability in resampling.

But, the problem with this approach as told by my friend is that I am assuming that I already know the locations of the obstacles, which make this all process useless. How should I approach it rather in a sense that I don't know the obstacles. How can the particle filter be implemented then? How will the particle filter work in case i don't know the obstacles location? An example of process would be great help. Thanks

答:
Your question addresses three very different problems, all of which are hard with complicated research-type algorithms.

Localization: When you have a known map of the environment and an unknown robot position. The most common algorithm for this is Monte Carlo Localizataion. This is a particle filter exactly like what you're describing.

Mapping: When the robot wakes up in an unknown environment and has to build a map. Usually mapping algorithms assume that you know the location of the robot, ie from GPS or similar. I've never done pure mapping so I don't know any algorithms, but a quick google should find them.

SLAM: When you combine the two problems, an unknown environment and an unknown location the problem is called simultaneous localization and mapping (SLAM). This is very hard. There are good algorithms and good software packages to do it, but they are all still experimental and only work for certain types of environments / sensors. I highly highly recommend that you use an existing package rather than implementing SLAM yourself because it can take months of research work to tune all the parameters. I have no idea if there are SLAM packages for Java, but openslam.org has a great list of state-of-the-art SLAM algorithms. Personally I've used GMapping quite a bit and I trust it not to crash my $25k robot. Be aware that you are treading in research waters.

Sorry for giving you such a long answer to a short question. My suggestion would be to assume that you know the locations of the obstacles and do a simple Monte Carlo Particle Filter.


问:
How can one create a robot which respondes to input following a flowchart?
What are the most basic skills and components needed for creating a robot which gets two "yes" or "no" inputs with two push buttons, and goes down the defined flowchart and plays the relevant audio file each time it gets an input.

a flowchart like this:

```<code>____question 1_____________
|                         |
Yes                       No
|                         |
question 2___             question 3______
|           |             |              |
Yes         No            Yes            No
|           |             |              |
question 4  question 5    question 6     question 7
...
</code>```

答:
It would really be more of a programming problem than an actual robotics one. Either way, you would be programming this logic into it anyways. Basically, it would be a series of if/then statements that would get you to where you need to go.

Example:

```<code>//ask question here and get input (button press)
if( the button pressed was yes){

    //ask the next question, and get more input, repeat this process
}else{
    //do the other button's side of the flowchart
}
</code>```

Using this method, you would be able to setup your flowchart's logic flow perfectly.

Alternately, you could also use a switch/case, to get the same effect.

If you have no idea what I'm talking about, then be more specific as to how you are controlling this thing

Body:
It would really be more of a programming problem than an actual robotics one. Either way, you would be programming this logic into it anyways. Basically, it would be a series of if/then statements that would get you to where you need to go.

Example:

//ask question here and get input (button press)
if( the button pressed was yes){

    //ask the next question, and get more input, repeat this process
}else{
    //do the other button's side of the flowchart
}

Using this method, you would be able to setup your flowchart's logic flow perfectly.

Alternately, you could also use a switch/case, to get the same effect.

If you have no idea what I'm talking about, then be more specific as to how you are controlling this thing


问:
How to get pure end-effector translation through Jacobian?
I have a 7 DOF arm that I am controlling with joint velocities computed from the Jacobian in the standard way.  For example:
$$
{\Large J} = \begin{bmatrix} J_P \\J_O
\end{bmatrix}
$$
$$
J^{\dagger} = J^T(JJ^T)^{-1}
$$
$$
\dot{q}_{trans} = J^{\dagger}_P v_{e_{trans}}
$$
$$
\dot{q}_{rot} = J^{\dagger}_O v_{e_{rot}}
$$
$$
\dot{q} = \dot{q}_{trans} + \dot{q}_{rot}
$$

However, when specifying only translational velocities, the end-end effector also rotates.  I realized that I might be able to compute how much the end-effector would rotate from the instantaneous $\dot{q}$, then put this through the Jacobian and subtract out its joint velocities.

So I would do this instead of using the passed in $v_{e_{rot}}$:

$$
v_{e_{rot}} =  R(q) - R(q+\dot{q}_{trans})
$$

Where $R(q)$ computes the end-effector rotation for those joint angles.

Is this OK to do, or am I way off base?  Is there a simpler way?

I am aware that I could also just compute the IK for a point a small distance from the end-effector with no rotation, then pull the joint velocities from the delta joint angles.  And that this will be more exact.  However, I wanted to go the Jacobian route for now because I think it will fail more gracefully.

A side question, how do I compute $R(q) - R(q+\dot{q}_{trans})$ to get global end-effector angular velocity?  My attempts at converting a delta rotation matrix to Euler angles yield wrong results.  I did some quick tests and implemented the above procedure to achieve pure end-effector rotation while maintaining global position.  (This is easier because $T(q) - T(q+\dot{q}_{rot})$ is vector subtraction.)  And it did kind of work.

答:
You don't need the positional IK to solve this problem. All that is required is, that your Jacobian is invertible, i.e. keep away from sinuglar joint configurations. Consider, how the end effector's velocity is formed:

$$
\begin{bmatrix}
v_{trans} \\
v_{rot}
\end{bmatrix} = J(\boldsymbol{q})\cdot \boldsymbol{\dot{q}}
$$

So, if I understand correctly, you want to solve the above equation with $v_{rot} = 0$ for $\boldsymbol{\dot{q}}$:

$$
\boldsymbol{\dot{q}} = J(\boldsymbol{q})^{-1}\begin{bmatrix} v_{trans} \\ 0 \end{bmatrix}
$$

Keep in mind that -- in general -- you cannot nicely separate the joints in those joints which command translation and those which command rotation of the end effector. After all, how joints are mapped to the end effector's position and angle is determined by the mechanism's structure, which dictates the Jacobian's structure (and its singularites). For example, an arm with only rotational joints (like a typical industrial robot) needs to move all its motors in some kind of "compensating" way to produce pure end effector translation.


答:
If you don't know the location of the obstacles and want to apply your filter, I see two solutions:

Do a quick mapping using a simple algorithm easy to implement like the Occupancy Grid Algorithm (with this you localize the obstacles relatively to your robot)

Apply your particles filter

Move the robot

Relocalize your robot using odometry

Correct odometry errors by using another sensor measurements if possible

Using a SLAM algorithm to simultaneously Localize and Map obstacles. The SLAM algorithms are more robust to sensors and odometry errors than the Occupancy Grid Algorithm but are more difficult to implement and need generally more CPU consumption.

N.B: you must understand that there is no "optimal" solution since this problem still a very active research domain in robotics, the two solutions have advantages and drawbacks.
Consider also the speed of your processor or microcontroller.

Title: Whats the logic to implement a particle filter for a robot with range sensor?

Body:
I am trying to implement a particle filter for a robot in Java. This robot is having a range sensor. The world has 6 obstacles - 3 in the top and 3 in bottom. I am calculating the distance of the robot from each obstacle's center and then performing the same activity for each particle. Then, i calculate the difference between the robot and particles. The particles for which the difference with robot measured distance are small, i give them higher probability in resampling.

But, the problem with this approach as told by my friend is that I am assuming that I already know the locations of the obstacles, which make this all process useless. How should I approach it rather in a sense that I don't know the obstacles. How can the particle filter be implemented then? How will the particle filter work in case i don't know the obstacles location? An example of process would be great help. Thanks


答: You can fuse Laser mesurements (which are very precise) with GPS mesurements to navigate and localize the obstacles. I think this is the solution used by google car, but be careful: Laser finders can be very expensive.</p>

Title: Relative Navigation Systems


问:
Quadcopter cannot balance!
I am bulding a quadcopter using these compenents:

Microcontroller: Tiva C Lanchpad (ARM Cortex M4 - 80 MHz), but
running at 40MHz in my code

MPU 9150 - Sensorhub TI

ESC - Hobbywing Skywalker 40A

I use the sample project comp_dcm from Tivaware and use that angles for my PID which running at 100Hz

I test PID Control on 2 motors, but the motors oscillate as in the video i found on youtube from one guy!

Quadcopter  Unbalance

答:
A couple possibilities come to mind,

PIDs need tuning, this is relatively simple (entire books have been written on it)

Basically, set the I and D terms to 0 and slowly move up the P term till it oscillates and turn it down again to just below that point

Your code is running too slowly (this can cause all kinds of odd errors)

Title: Quadcopter cannot balance!


问:
Is there a rule of thumb for actuator torque overhead?
When installing a servo or other actuator, I measure the force needed to perform whatever action is needed and find an actuator that can generate more than the necessary force. However, I recently wondered if there's a rule of thumb or guideline for how much overhead is useful, before it becomes a waste.

For a (perhaps oversimplified) example, say I have a lever to lift something, and the force needed is 100 Newtons. An actuator that can manage 100 N maximum will have problems with this and stall, with any sort of friction or other imperfections. I would use an actuator that can produce 150 or 200 N - whatever is available and fits the design and budget. After testing, it may become apparent that 200 is overkill, 120 is sluggish, but 150 is good. Other than trial and error, is there a way to measure this, or a rule of approximation?

I realize that variables in the mechanics and construction can significantly alter what force might is needed to be considered ideal, but is there a commonly accepted value for simple applications? Something like "If you need x force, install an actuator with x + 20% force."

答: I always add 100-120% overhead (normally this just means the next bigger unit than exactly what I need) but also this comes with experience, a motor that can just barely lift your load will do so very slowly.


问:
Finding changes in environment using 2d laser
I have known map of the environment (2d occupancy grid map). I am trying to find if anything changed in environment using 2d laser while navigating by using maximum likelihood of laser with known map.

My question is how to know which measurements are corresponding to changes. My environment is not static and has some changes which is differs from known map. Now i am trying to find which objects newly came into the environment or moved out of the environment using laser.

答:
Let's asume that our 2D occupancy grid map is called G.

Programmatically, G is a 2D array of float numbers between -1 and 1 called evidences.

Now, to update the map, we need to :

read the new laser mesurements

calculate the distances of obstacles from the robot

re-calculate the evidence values of G, and then

replace the old values by the new evidence values.

If we want to find the changes in the environment, we can simply store the old values of G in a temporary array before re-calculating the new evidence values (step 3).

Therefore, the changes can be found by substracting the two arrays : C = G - old_G.

In this case: C is a 2D array representing the differences between the two grid maps, so 0 values of C represent no changes in the environement, while other values represent either new or moved objects.


问:
Design Calculations & Mathematical Modeling of Tricopters
I have been studying about building a tricopter.  But I couldn't find the design calculations or mathematical modeling of the tricopter any where over the internet.

What are the mathematical relationships or equations of motion and forces in tricopter?  How do I calculate the requirements of the structural design and the energy requirements of the motors?

答:
I too posted the same question here..:) To calculater the output power required check this link: http://www.wired.com/2014/05/modeling-the-thrust-from-a-quadcopter/

The same power can be applied to tricopter also..


问:
Purpose of programming an ESC
I am planning to buy an ESC for my tricopter setup. What is the purpose of programming an ESC? I am cost effective and is it really necessary that I should necessarily buy a programming card to program my ESC for my model?</p>

答:
An Electronic Speed Controller can be used in various situations, and rather than make 20 different speed controllers for every different situation, they make one which is programmable. The options you have vary depending on the ESC you buy, but typical ones include:

Battery types (NiMh, LiPo)

Different battery voltages

Cut-off voltages

Whether or not it should use active breaking

What to do when it's told to reverse

PWM frequency

It's annoying to have to buy a programming card, but this is one way they keep down the cost of the ESC. Rather than have all of these buttons and LEDs on every ESC, you just pay for them once.

Title: Purpose of programming an ESC


问:
PID Tuning Quadcopter Problem
I am tuning PID for quadcopter, the problem i have is that with different base Throttle, i seems that i have to adjust different PID gains in order for the quadcopter to balance! </p>

答:
Well, the optimal PID parameters are an estimation that should do best at all situations. It's possible that you just need to find better PID parameters.

But it could also be a hardware problem:
It helps to let the quad hover a bit and figure out if it's drifting in a specific direction - That should point you to the culprit, or at least to the culprit 'leg'.

The issues to check, in my opinion, will be:

ESC calibration isn't the same on all motors - The ESCs do not
react the same to the same throttle level. Recalibrating the ESCs
(preferably at the same time) should fix that.

The props could be unbalanced - Check that the props are in a good condition and         don't have any deformations.

Maybe one of the ESCs is acting up? Try
    measuring the current usage of each ESC changing the throttle from
    low to high. It should be about the same on every motor.

Check for loose stuff on the quad - Things tend to
    resonate in different throttle levels causing the quad to change its
    behaviour.

Try switching between parts. I'd go with switching ESC between sides and checking if it makes a difference in the drift direction.

Lastly, it could be (not likely however) a problem in the PID implementation. Which flight controller are you using?

ESC calibration

ESCs translate the signal coming from your receiver (PWM signal usually) to 3-phase voltage given to the motor. PWM signal is basically a square wave with changing duty cycle.

The duty cycle (D.C.) is really just the value the receiver receives from the RC Transmitter (the remote). Since each receiver & transmitter are different, the received value isn't always going from 0% to 100%. It can sometimes go from 20% to 90%, or in worse cases 40% to 60%, etc. Usually low D.C. means low channel value (low throttle in our case), but Futaba tend to reverse that (high D.C. = low channel value).

So what you need to do is to calibrate your ESCs to know the dynamic range of your throttle (how much D.C is low and how much is high). Check the ESC manual - it should explain how to do that. Usually it's something like:

Put throttle all the way up

Connect power to ESC

Wait for 3 beeps (or something)

Lower throttle until lowest value

Wait for 3 beeps

But it differs from ESC to ESC

Edit: Ran into a another explanation:
Purpose of programming an ESC

Title: PID Tuning Quadcopter Problem


答:
When selecting an actuator, you need to consider not just the force but also the power.

Power = force x speed

The faster you need to lift the lever, the more power you'll need. Companies like Maxon provide detailed graphs showing exactly how much torque you can expect at various speeds for their motors. Other companies may just state the motor's wattage.

You will also need to consider acceleration.

Force = mass x acceleration

When you're lifting your lever, you need to add its weight and the force required for acceleration. If you want to maintain maximum acceleration right up to the maximum speed, then the total power is:

power = (weight + mass x acceleration) x maxspeed

or:

power = mass x (9.8+acceleration) x maxspeed

Next check the efficiency of the gears. Again, companies like Maxon specify the gear efficiency, so divide your calculated power by the gear efficiency. If you're unsure of the efficiency, then assume it's about 60% efficient.

Lastly, you need to estimate how efficient the rest of your mechanism is. A tendon driven robot might be only 50% efficient in its power transmission, whereas attaching your lever directly to the motor shaft will be 100% efficient.

After all that, if you allow another 20% - 50% power on top of that, you should be OK.

Title: Is there a rule of thumb for actuator torque overhead?

Body:
When installing a servo or other actuator, I measure the force needed to perform whatever action is needed and find an actuator that can generate more than the necessary force. However, I recently wondered if there's a rule of thumb or guideline for how much overhead is useful, before it becomes a waste.

For a (perhaps oversimplified) example, say I have a lever to lift something, and the force needed is 100 Newtons. An actuator that can manage 100 N maximum will have problems with this and stall, with any sort of friction or other imperfections. I would use an actuator that can produce 150 or 200 N - whatever is available and fits the design and budget. After testing, it may become apparent that 200 is overkill, 120 is sluggish, but 150 is good. Other than trial and error, is there a way to measure this, or a rule of approximation?

I realize that variables in the mechanics and construction can significantly alter what force might is needed to be considered ideal, but is there a commonly accepted value for simple applications? Something like "If you need x force, install an actuator with x + 20% force."