问:
Controlling a system with delayed measurements
Assume I have a rather simple system I want to control, but all sensor measurements exhibit considerable time delay, i.e.:

$z_t = h(x_{(t-d)}) \neq h(x_t)$

With my limited knowledge about control, I could imagine the following setup:

One observer estimates the delayed state $x_{(t-d)}$ using control input and (delayed) measurements.

A second observer uses the delayed observer's estimate and predicts the current state $x_t$ using the last control inputs between delayed measurement and current time.

The second observer's estimate is used to control the system.

Can I do any better than that? What is the standard approch to this problem? And is there any literature or research about this topic?

答: The most straightforward approach is to use a Kalman filter with a memory of recent state history. While waiting for measurements you do the standard time update. When a new measurement arrives, you restore the state and error covariance to the appropriate point in time, apply the measurement update, and then apply time updates to get to the current point in time.</p>


问:
6 DOF Robotic Arm
We are building a 6 DOF robotic arm as a college project and we've almost finished the designs. The problem is with the controls. We still havent thought on how to control the arm, as in , software gui interfaces , etc. Any suggestions on this ? Also, is there any simulation software for Simulating and testing robotic arms ? </p>

答:
I think Matlab suits your needs. About the control input, once you got the dynamic equation of your manipulator,
\begin{equation}
M(q) \ddot{q} + C(q, \dot{q})q + G(q) = u \qquad (1)
\end{equation}

then you need to specify the input $u$ of the dynamic equation (1). There are many control input algorithms. The simplest one is PID control which specifies the input as the error.
\begin{equation}
u = K_{p} \tilde{q} + K_{i} \int_0^t{\tilde{q}dt} + K_{d} \frac{d}{dt} \tilde{q}
\end{equation}

where $u(t) = [u_{1},..., u_{n}]^{T}$ the input, $\tilde{q}(t) = q(t) - q_{d}(t)$ which represents the error $e(t)$. $q_{d}(t)$ is the desired trajectory and $K_{p}, K_{d}$ and $K_{i}$ are the gain matrices, the proportional, derivative, and integral respectively.

Also, the inverse dynamics and Lyapunov-based design algorithms are good ones. The problem with the last two algorithms is that they require the parameters of the system to be given accurately, so you should start with PID controller. In GUI, you might want the user to specify the desired trajectory whether tracking or regulation trajectories. Also, you might want the user to adjust the Gain of PID.

As a start point, you should implement two arms in Matlab. The kinematic and dynamic equations of two arms are given in the majority of manipulator books. Pick one and try to test the aforementioned algorithms. Start with regulation problem in which the desired trajectory is a constant value and see how well your manipulator approaches the desired trajectory as time approaches infinity. Also, try to plot the errors which are the difference between the current trajectory and the desired one. They must approach zero when time approaches infinity.

ContentLicense: CC BY-SA 3.0

Title: 6 DOF Robotic Arm


问:
Will a 20amp ESC run a Turnigy 2213-980?
I'm a noobie just starting out and trying to come up what I need to build my first quadrocopter, I just wanted to run something by people with some experience before I commit to buying anything.

Would this esc be fine for running this motor? As I understand it the ESC should be rated for slightly above what the max amps are for the motor?

On top of that, should this battery be able to run all of the motors without any issue?

答:
In process of selection of components for multirotor, one should start from motor as it is the driving component. Maximum current drawn by your motor is given by manufacture which is 15A. Now your ESC should have maximum current rating more than maximum current rating of motor. This is satisfied in your motor-ESC combination so your selection looks good.

Maximum current that can be obtained from a battery depend on capacity (mAh rating) and constant discharge rating (C rating) and is given by multiplication of both. In your case, battery should be able to give constant 55A (2200x25 = 55000mA). However maximum current that can be drawn by motor is 15A, so you should be able to use this battery with given single motor-ESC combo. However for a quadrotor, total maximum current drawn will be 15x4 = 60A. So you should consider using battery with more mAh rating or more C capacity like this or this.

Also make sure that you do not put any bigger propeller on motor than a recommended one. This action might cause motor to draw more current that maximum rating which might result in burning of motor.


问:
EKF localization known correspondences
I'm facing problems with this book and it is the only book that discusses localization in depth. The results that I'm getting makes no sense. I've read a lot of papers, majority of them copy the localization algorithm from this book. My question here is why $\bar{\mu}$ and $\bar{\Sigma}$ are being changed every iteration?? I'm using them to get the predicted measurements in lines 11- 13, so they should be fixed.

9. for all observed features $z^{i}  = [r^{i} \ \phi^{i} \ s^{i}]^{T} $ do

10.   $j = c^{i}$

11.         $q = (m_{x} - \bar{\mu}_{x})^{2} + (m_{y} - \bar{\mu}_{y})^{2}$

12.         $\hat{z}^{i} = \begin{bmatrix}
\sqrt{q} \\
atan2(m_{y} - \bar{\mu}_{y}, m_{x} - \bar{\mu}_{x} ) - \bar{\mu}_{\theta} \\
m_{s} \\ \end{bmatrix}$

13.         $ \hat{H}^{i} = \begin{bmatrix}
h_{11} & h_{12} & h_{13} \\
h_{21} & h_{22} & h_{23} \\
h_{31} & h_{32} & h_{33} \\ \end{bmatrix}  $

14.     $\hat{S}^{i} = H^{i} \bar{\Sigma} [H^{i}]^{T} + Q $

15.     $K^{i} = \bar{\Sigma} [H^{i}]^{T} [S^{i}]^{-1}$

16.     $\bar{\mu} = \bar{\mu} + K^{i}(z^{i}-\hat{z}^{i}) $

17.     $\bar{\Sigma} = (I - K^{i} H^{i}) \bar{\Sigma} $

18. endfor

19. $\mu = \bar{\mu}$

20. $\Sigma = \bar{\Sigma}$

Please suggest me other books that discuss EKF localization in depth.

答:
The underlying assumption seems to be that if all observed features you measure at the same time are independent, you can apply the EKF correction step several times: Once for each observed feature. (I am currently not completely sure whether this is valid.)

This is what the above algorithm does. It is an optimization of the naive solution, which would work like this:

You can also combine the measurement vectors of all observed features to a full measurement vector $z$ by stacking them on top of each other:

$z = (z_0^T, z_1^T, z_2^T, ...)^T$

You will get the full Jacobian by stacking all Jacobians accordingly. The full measurement covariance matrix $Q$ is the block-diagonal matrix which contains all individual measurement covariances $Q$ as blocks on its diagonal.

This way, you can use the original EKF algorithm which modifies $\bar\mu$ and $\bar\Sigma$ only once.

But: This naive solution is computationally more expensive, which is why you should use the method described in Probabilistic Robotics. Using the naive method, you have to invert one much bigger matrix $H \bar\Sigma H^T + Q$ instead of several much smaller versions.

Title: EKF localization known correspondences


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

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

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

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

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

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

1 or similarly Xenomai

答:
Start thinking about your robot in terms of multiple CPUs and the real time question shifts.  If you have an algorithm that needs high speed reliable feedback such as a two wheel balancer or a quad-copter stabilizer or a servo pulse out, real time is extremely important, but the task is also very constrained.

You can offload a control loop like this to a dedicated real time CPU such as the cheap 8 bit AVR or low end 32 bit ARMs found in the Arduino class of devices.  There's nothing preventing you from adding many dozens of these small MCUs running dedicated control loops, USB device enumeration even makes this easy.

Now that you have the timing sensitive control loops handled by a dedicated CPU, you can relax the real time needs of the 'brain' of the robot which can run higher end logic using components such as ROS on Linux or Kinect for Windows.


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

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

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

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

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

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

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

答:
For the stereo vision, it could be very hard to achieve a resolution over 1% I think, which means 10cm resolution can be achieved for 10m range..

Roboteye RE05 seems to be a good option.. However where to buy one?


问:
ROS: Best practices?
I'm going to build a small robot system, and it seems like that ROS serves a nice framework to control and program the system.

However, I am wondering which is the best practice to manage the components of my robot.

Does it make sense to put all the sensors in one node?

Should I only put the sensors of the same type in one node or is it better to have one node for one sensor?

Is it a good practice to have some kind of handler node, which takes input from sensors and steers the corresponding actuators or should the actuator nodes and sensor nodes communicate directly?

Fused sensor nodes and actuator nodes with handler

Single sensor and actuator nodes with handler

Direct communication

For me, I guess the best is to have some kind of handler, which handles the communication between sensors and actuators and have one node for each element of the robot (like in figure 2), because the system is in this way loosely coupled and can be extended easily, but I want to know what your opinion is.

答:
Very short answer: 2

Sensors

Regarding whether reading from sensors all in one node or each separately, you should ask yourself this question:

Are the sensors meaningless without the other?

This question asks if the sensors are tightly coupled or not. For example, say you have a sensor that is sensitive to temperature (and you need to compensate for it). You add a temperature sensor primarily to fix the value of the other sensor. In this scenario, it makes sense to read both values at the same time, since they are tightly coupled. In fact, without the readings from the temperature sensor, the readings from the original sensor is useless.

On the other hand, if the sensors are individually useful, by all means keep them in separate nodes. This has many benefits:

The nodes can be run on separate processors

The nodes can be reused in future robots

Failure in communication with one node doesn't bring the whole system down

Restart of acquisition from a faulty sensor board can be done separately from the others

In fact, if you need any of the above benefits, you would have to go with separate nodes, even if the sensors are tightly coupled, but that usually doesn't happen.

Actuators

This is analogous.

Are the actuators meaningless without the other?

For example, if you are designing a wrist with robotic tendons where for each tendon (for whatever reason) two motors are responsible to simultaneously work to move a joint in one or the other direction, then having them served in the same node makes much more sense than separate.

On the other hand, where actuators are independent (common case), it makes sense to have one node for each actuator. In that case, each could be put in a different node.  Besides the exact same benefits as with sensors, there is this added benefit:

If an actuators is stalled (for whatever reason), the other actuators still function.  If there is redundant degrees of freedom, they could even completely compensate for it.

This has one implication. If you need the actuators to work in harmony, then put them in the same node. This is not just because of failure in communication, but because different nodes means different delays; on a distributed system each node is on a different part of the network and hence the difference in delays, on a centralized system different delays happen on high CPU loads due to each process's luck in scheduling.

Should There Be a Handler?

Even though the answer is "it depends", there is a common approach with many advantages. Let's change the name and call it "controller". The approach is "yes, there should be a controller".

The advantages of having a controller are (among many):

Decoupled processing: each node is responsible for one thing which means:

Simplicity: which implies

Easier development

Easier debugging

Fewer errors

Less chance of failure

Reusability: because the same controller can be used with different sensor nodes if they have the same functionality (i.e. message and service formats).

Execution on separate hardware: each node can be moved in the network. For example, sensor and actuator nodes may be moved to a dedicated microcontroller (Arduino for example (not that I recommend)) and the controller on a PC.

Avoid extreme ugliness: if the sensors wanted to directly influence the actuators, the result is simply a mess. Assuming no controller, let's look at each case:

One sensor node: basically this means the sensor node and the controller are put together in the same node. Not too bad, but very unnecessary.

Many sensor nodes: this is the mess. This means the controller is distributed among the sensor nodes. Therefore all the sensor nodes have to talk with each other for each to know how to control its associated actuator(s). Imagine a failure in communication or various kinds of delays and you'll see how difficult it becomes. Given that this is utterly unnecessary, there is no reason for doing it!

These said, there are disadvantages too. Having more nodes (any nodes, not just the controller) means:

More wasted communication: the data have to move around in standard formats (so serialized and deserialized) through network or shared memory, ROS core has to look at them and decide who to deliver them to, etc. In short, some system resources are wasted in communication. If all nodes where in one, that cost could have been zero.

Higher chance of failure: if for whatever reason a network link goes down, or a node dies, there is a failure in the system. If you are not prepared for it, it can take down the whole system. Now this is actually a good thing in general to be able to lose part of the system but not all of it (graceful degradation), but there also exist applications where this should be avoided as much as possible. Cutting the communication and putting all code in one node actually helps with system stability. The down side is of course, the system either works fine or suddenly dies completely.

Chaotic timings: each node runs on its own. The time it takes for its messages to arrive at others is non-deterministic and varies run by run. Unless your nodes timestamp each message (as a side note: you need to have synchronized clocks to a good degree, which ROS doesn't) and unless each receiving node can take the delay into account and control accordingly (which is a very difficult task on its own) then having multiple nodes means high uncertainty about the age of the data. This is actually one of the reasons (among many) that most robots move so slow; their control loop has to be slow enough to make sure all data correspond to the current period. The larger the delays, the slower the control loop.

In all above disadvantages, the solution is to reduce the number of nodes, preferably to a single node. Wait a minute, that's not using ROS anymore! Exactly.

To summarize:

Use ROS for non-realtime systems where delays could sporadically get high. In that case, feel free to have as many ROS nodes as you wish. In fact, it's very good practice to have each ROS node do one and only one thing. That way, they become very simple, and they become highly reusable.

On the other hand, for realtime systems, by all means avoid ROS. For that there is orocos and technologies like EtherCAT and more often than not, ad-hoc solutions.

As a final word, in practice ROS does fine. Not great, but fine. Very often the system is not critical and the chance of failure is so small that every now and then a restart is not a big deal. This is the Ostrich algorithm!

Title: ROS: Best practices?


问:
How to control a function with two different inputs
How might I be able to control one function (like brightness control of an LED) with two different triggers (like a tactile switch and an IR remote)?

I am trying to be able to control the brightness with switches as well as IR remote when desired.

答:
I'm assuming you are doing this with a microcontroller.

The solution is very simple. Let's say you know how to do them individually. In the most general case, this would be:

For the tactile sensor:

```<code>/* get the value from tactile sensor */
unsigned int value_from_tactile = read_tactile();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness = 100 - value_from_tactile * 100 / 256;

write_brightness(brightness);
</code>```

For IR remote:

```<code>/* get the value from IR sensor */
unsigned int value_from_ir = read_ir();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness = value_from_ir * 100 / 65536;

write_brightness(brightness);
</code>```

which are generally the same code, even though each is implemented with a different peripheral, e.g. one may use ADC, another I2C etc.

The problem is now how to merge them. Before getting to code, we should first define the exact behavior of the system. This is really really dependent on the goal of the system.

Let's put this in mathematical terms.  The examples above translate to:

For the tactile sensor:

$b_1(x) = 100 - x * 100 / 256$

For the IR remote:

$b_2(y) = y * 100 / 65536$

where $b_N$ is the brightness of the LED, $x$ is the value of the tactile sensor and $y$ is the value of the IR sensor. Obviously, these two functions conflict. They drive the same output with different formulas.

The question is, what would the function $b(x, y)$ look like, where it takes into account both $x$ and $y$? The answer is that you should decide it based on your systems. Some examples would be:

$b(x, y) = max(b_1(x), b_2(y))$: This means whoever wants the LED to have a higher value wins.

$b(x, y) = (b_1(x) + b_2(y)) / 2$: The brightness of the LED is determined equally by both sensors.

$b(x, y) = (N * b_1(x) + M * b_2(y)) / (N + M)$: One of the sensors has more control over the brightness of the LED.

$b(x, y) = min(100, b_1(x) + b_2(y))$: Both sensors can drive the brightness of the LED to its maximum individually, but they can also work together.

$b(x, y) = \left\{
  \begin{array}{l l}
    b_1(x) & \quad \text{if $b_2(y) == 0$}\\
    b_2(y) & \quad \text{o.w.}
  \end{array} \right.$: Give priority to IR sensor and only control through touch if not being controlled by IR.

There are many other ways you can think of combining the two. Whichever you choose, the code would be straightforward. We just put the two pieces of code from before together, and then add the chosen merge function:

```<code>/* get the value from tactile and IR sensors */
unsigned int value_from_tactile = read_tactile();
unsigned int value_from_ir = read_ir();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness_1 = 100 - value_from_tactile * 100 / 256;
unsigned int brightness_2 = value_from_ir * 100 / 65536;

/* merge */
unsigned int brightness;
switch (strategy)
{
    case 1:
    default:
        brightness = brightness_1 < brightness_2?brightness_2:brightness_1;
        break;
    case 2:
        brightness = (brightness_1 + brightness_2) / 2;
        break;
    case 3:
        brightness = (N * brightness_1 + M * brightness_2) / (N + M);
        break;
    case 4:
        brightness = brightness_1 + brightness_2;
        if (brightness > 100) brightness = 100;
        break;
    case 5:
        brightness = brightness_2 == 0?brightness_1:brightness_2;
        break;
}

write_brightness(brightness);
</code>```

Body:
I'm assuming you are doing this with a microcontroller.

The solution is very simple. Let's say you know how to do them individually. In the most general case, this would be:

For the tactile sensor:

/* get the value from tactile sensor */
unsigned int value_from_tactile = read_tactile();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness = 100 - value_from_tactile * 100 / 256;

write_brightness(brightness);

For IR remote:

/* get the value from IR sensor */
unsigned int value_from_ir = read_ir();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness = value_from_ir * 100 / 65536;

write_brightness(brightness);

which are generally the same code, even though each is implemented with a different peripheral, e.g. one may use ADC, another I2C etc.

The problem is now how to merge them. Before getting to code, we should first define the exact behavior of the system. This is really really dependent on the goal of the system.

Let's put this in mathematical terms.  The examples above translate to:

For the tactile sensor:

$b_1(x) = 100 - x * 100 / 256$

For the IR remote:

$b_2(y) = y * 100 / 65536$

where $b_N$ is the brightness of the LED, $x$ is the value of the tactile sensor and $y$ is the value of the IR sensor. Obviously, these two functions conflict. They drive the same output with different formulas.

The question is, what would the function $b(x, y)$ look like, where it takes into account both $x$ and $y$? The answer is that you should decide it based on your systems. Some examples would be:

$b(x, y) = max(b_1(x), b_2(y))$: This means whoever wants the LED to have a higher value wins.

$b(x, y) = (b_1(x) + b_2(y)) / 2$: The brightness of the LED is determined equally by both sensors.

$b(x, y) = (N * b_1(x) + M * b_2(y)) / (N + M)$: One of the sensors has more control over the brightness of the LED.

$b(x, y) = min(100, b_1(x) + b_2(y))$: Both sensors can drive the brightness of the LED to its maximum individually, but they can also work together.

$b(x, y) = \left\{
  \begin{array}{l l}
    b_1(x) & \quad \text{if $b_2(y) == 0$}\\
    b_2(y) & \quad \text{o.w.}
  \end{array} \right.$: Give priority to IR sensor and only control through touch if not being controlled by IR.

There are many other ways you can think of combining the two. Whichever you choose, the code would be straightforward. We just put the two pieces of code from before together, and then add the chosen merge function:

/* get the value from tactile and IR sensors */
unsigned int value_from_tactile = read_tactile();
unsigned int value_from_ir = read_ir();

/* convert to range of LED brightness (formula is just random example) */
unsigned int brightness_1 = 100 - value_from_tactile * 100 / 256;
unsigned int brightness_2 = value_from_ir * 100 / 65536;

/* merge */
unsigned int brightness;
switch (strategy)
{
    case 1:
    default:
        brightness = brightness_1 < brightness_2?brightness_2:brightness_1;
        break;
    case 2:
        brightness = (brightness_1 + brightness_2) / 2;
        break;
    case 3:
        brightness = (N * brightness_1 + M * brightness_2) / (N + M);
        break;
    case 4:
        brightness = brightness_1 + brightness_2;
        if (brightness > 100) brightness = 100;
        break;
    case 5:
        brightness = brightness_2 == 0?brightness_1:brightness_2;
        break;
}

write_brightness(brightness);


问:
Device that can push out independent pin points?
I'm looking for a device that can push out independent pinpoints from something similar to a Pin Point Impression Toy. I'm looking to create a 3D image from for example my computer. Does anybody know the name of such a device or can point me in the right direction of making one?

I've been looking now for a while, but I'm having some slight problems finding a good way to describe it as a search term.

I'm sorry if this is the wrong forum.

答:
I don't know of any devices that exist for this purpose (besides devices that are not for sale, such as the MIT Media Lab's "Transform" table), but I'd imagine that the 2 most promising approaches for a homemade solution would be:

Use a robot arm or X/Y table to move to each pin location and push it the desired distance -- one pin at a time.  Reset the pins by just tilting the pins' frame back.

Attach a bowden cable to each pin and use a servo (or linear actuator) at the other end to control the position.  This has the advantage of setting all the pins in parallel.


问:
How to calculate serial speed and buffer requirements for PC to microcontroller communications?
A common scenario is to have a PC that sends commands to a microcontroller via RS232.  My PC program is sending commands (each of which are composed of multiple bytes) as fast as it can to a small robot.  The microcontroller on the robot is a Parallax Propellor.

I have noticed that if I don't process bytes quickly enough on the microcontroller side of things, it can very quickly overflow the default buffers in the popular serial port drivers that are available for the Propellor. (The buffers are generally anywhere from 16 to 256 bytes).  I can arbitrarily increase these buffers or create my own larger circular buffer, but I would like to have a more methodical approach to determining appropriate size requirements and/or the minimal amount of time I can wait before pulling bytes out of the serial port driver buffer.

At 1st glance:

115200 == 115.2 bits per millisecond == ~12.8 bytes per millisecond (assuming 1 stop bit)

1) Is that a valid way to calculate timing for serial transmissions?

Also, given my specific setup:

PC Program <--> Bluetooth Serial Profile Driver <--> Bluetooth Transceiver <-*-> BlueSMIRF Wireless Modem <--> Parallax Propellor Program

2) What is the maximum amount of data I can send for a given period of time consistently without eventually running in to problems?

Maybe I'm over complicating things, but it seems like there are potentially multiple buffers involved in the transmission chain above.  How do others commonly deal with this? Do they throttle the PC sending to a known safe rate? Implement flow control?  If implementing flow control, how does that affect bandwidth and response times?

(If it matters, my experiment is to use a joystick on the PC to control multiple servos with instant reaction to the joystick movements. So every small movement of the joystick results in multiple commands being sent to the microcontroller. The commands are not just simple positional commands though, they also involve acceleration/deacceleration of servos over time and this is the reason that the microcontroller spends a significant amount of clock cycles before processing new bytes.)

答:
I'd suggest two possible approaches.

Use a 'heartbeat' to transfer a well known state packet at a fixed frequency that fits within your 'speed budget'.  In this case, you never send ad hoc messages directly from the PC or MCU, all you can do is update the state packet which will be sent at the scheduled time.

Put a hard limit on your 'transmission budget' and enforce it.  E.g. you can only send one packet every 100 ms and if a 2nd packet is submitted before 100 ms has expired, its transmission is delayed until the 100 ms timeout (e.g. quantum) has expired.  This requires you to add messages to a queue and then send from the queue at a fixed rate.  Similar in approach to the heartbeat in #1 but a bit more efficient since data isn't sent when it hasn't changed.  The downside of this design is if you are oversending, you build higher and higher latencies into your communications and if you have variable bursty communication the communications latency can vary widely.

I tend to work with #1 to send data from the MCU since the algorithm is simple and small.


答:
Delayed measurements are a very common occurrence in LBL sonar positioning, commonly used by AUVs.  Modified Kalman filters are a common solution.  I searched for "LBL", "delay", and "EKF".  Here are a few reasonable papers:

Delayed-state sigma point Kalman filters for underwater navigation

Contributions to Automated Realtime Underwater Navigation

Self Consistent Bathymetric Mapping from Robotic Vehicles
in the Deep Ocean

The discussion of Navigation Filters (section 17) in the MOOS manual

Title: Controlling a system with delayed measurements

Body:
Assume I have a rather simple system I want to control, but all sensor measurements exhibit considerable time delay, i.e.:

$z_t = h(x_{(t-d)}) \neq h(x_t)$

With my limited knowledge about control, I could imagine the following setup:

One observer estimates the delayed state $x_{(t-d)}$ using control input and (delayed) measurements.

A second observer uses the delayed observer's estimate and predicts the current state $x_t$ using the last control inputs between delayed measurement and current time.

The second observer's estimate is used to control the system.

Can I do any better than that? What is the standard approch to this problem? And is there any literature or research about this topic?

ContentLicense: CC BY-SA 4.0


问:
SCARA Arm Lead Screw Choices
I'm thinking about building a SCARA Arm to lift moderate loads(5lbs) with a high degree of accuracy. I want a relatively quick and inexpensive Z axis gantry, and I was thinking about using a lead screw with dual linear rail. Trouble is I'm not certain the linear velocity will be fast enough.

What's the best method of choosing the lead screws and the associated nut, given a desired linear velocity of 10inches/second and a NEMA stepper motor driving it?

答:
There are a bunch of mechanical considerations but as far as the screw/motor combination is concerned you want to look at the top speed and torque requirements.

Your torque requirements are a function of the reflected load seen at the motor during acceleration (including things like nut friction).

I've worked on screw driven systems that went up to ~x3 your speed requirements and I've seen others that are even faster.  So there's no feasibility issue from a load/speed perspective.  There are practical questions in terms of what type of screw to use, cost, accuracy, whether the motor is directly coupled to the screw or not, etc.  When very high loads are involved screws are often a very good linear motion solution.

Is there some specific NEMA motor size you have in mind?  There's a huge range of torque available from "NEMA" stepper motors.  How accurate do you need your linear motion to be?  What sort of acceleration did you have in mind?  What's your budget?  What's the range of motion?

Title: SCARA Arm Lead Screw Choices


问:
Where can I buy heavy-duty Omni Wheels?

Where can I buy multi-directional omni wheels?

I'm specifically looking at something which can support in excess of 100kg/wheel, so around 400kg in total. Also, a possible mission profile would include a 300 meter excursion outdoors on asphalt path, so they should be a little durable. The only ones I can find online are small ones for experimenting.

答:
Have seen in-action omni wheel industrial fork lift trucks like these image search.

https://www.google.com/search?q=omni+wheels+folk+truck&safe=off&tbm=isch&tbo=u&source=univ&sa=X&ei=aiqhU8DwDdWhugTy_oCIBA&ved=0CCoQsAQ&biw=1654&bih=813  Apparently, they are production items, although may not as widely used as the 'normal' wheel version

Title: Where can I buy heavy-duty Omni Wheels?


问:
Motors response different with high-frequency PWM
We are making a junior soccer robot and we just got our brilliant motors from Maxon.
Setting the PWM timer to low-frequencies (around 39kHz or 156 kHz ) the robot acts as expected. But this produces some problems.

It puts a heavy current on batteries (around 1.5A for 3 motors which is far too high).

The high current causes our motor drivers (L6203) to heat up very quickly and even heat-sinks won't help them.

The motors make such a bad sound as they are screaming and this is not normal.

In contrast when I configure the timer on high-frequencies (such as 1250 kHz or 10000 kHz) the current drops off to 0.2A which is ideal and the sounds quit down.
But this causes a problem that our 3 motors when set to run on their highest speed (PWM set to 255) don't run by the same rpm. like one of them runs slower than others making robot turn to a specific side and so our handling functions fail to work correctly.

Asking someone he told me that the drivers don't respond the same to frequencies thus resulting in different speeds and because on low frequencies the difference is very small I won't notice it but on higher frequencies the difference becomes bigger and noticeable.

So is there any workaround for this problem? or I should continue using low frequencies?

PS: I'm using ATMEGA16 as the main controller with a 10 mHz external crystal.

答:
Two issues on hardware,

a)  Chip takes time to turn on and off. Heating up more while in-between on and off. So, no point to use too high frequency. Generally, 10, 15 or 20KHz max, out of human ear range is enough.

See details (explain frequency effects with examples of 20 chips from many companies) (especially those items state ultrasonic frequency 20KHz) in

http://www.pololu.com/category/11/brushed-dc-motor-drivers

b)  Motor coil has inductance. Too high frequency reduce current flow, low torque, low RPM.

Apparently, 0.5A per motor seems in normal range. Likely, at 6, 7.2 or 12 volts, a few watts to 10 watts per motor for fast robot motion.


问:
What are the reasons for not having autonomous robots in our daily activities?
The fact is that the more I search the less I find autonomous (real) robots in use. The companion robots are all toys with limited useless functionality. Whenever there is a natural disaster you don’t see operational search and rescue robots in the news. Even military robots in service are all remotely controlled machines. They are not intelligent machines. Industrial robotic arms are deterministic machines. The only robots with some levels of autonomous functionality are cleaning bots, warehouse operations bots and farming robots.

On the other hand, today:

the artificial intelligence algorithms are very good in making decisions

the sensing technologies are very sophisticated

the communication technologies are very fast

we can manufacture cheap parts

people are extremely gadget savvy

So, why there is no real robot in our day to day life? No investment in the domain? No market yet? Not enough knowledge in the domain? A missing technology? Any idea?

答:
This situation may change now that Aldebaran has announced the Pepper robot for approx US$2000 (plus an as yet undisclosed subscription).

Also this year the NAO robot was reduced in price and is now available for approx US$7000


问:
Observation Model Jacobian for Fixed Transforms
Let's say I have a hypothetical sensor that provides, for example, velocity estimates, and I affix that sensor at some non-zero rotational offset from the robot's base. I also have an EKF that is estimating the robot's velocity.

Normally, the innovation calculation for an EKF looks like this:

$$ y_k = z_k - h(x_k) $$

In this case, $h$ would just be the rotation matrix of the rotational offset. What are the ramifications if instead, I pre-process the sensor measurement by rotating $z_k$ by the inverse rotation, which will put its coordinates in the frame of the robot? Can I then safely just make $h$ the identity matrix $I$?

答:
The KF (EKF), even though it is closed form, does not require you to input directly what your sensors sense. Preprocessing is OK if you are doing it perfectly and not losing information.

Consider GPS measurements, which may occur in a coordinate frame which is "rotated" with respect to the robot's base or the robot's map coordinate frame. The "rotation" (pre-processing) and scaling (to find x-y from long-lat), are typically not included in the Jacobian.

In your example, if "rotating" the velocity sensor meant that it detected: $v+b$ for velcoity vector $v$ and some fixed bias $b$, then yes, simply removing the bias before incorporating the data is fine. Your innovation has the same value, since $h(x)$ is already the operation you described (applying the rotation).

But if the velocity sensor now measured $v+f(x)$, as in it measured greater velocity if the robot was turning right than left (as is the case of optical flow calculations from a camera facing a little to the right instead of directly forward), then you'd have to be much more careful. (Update jacobians or have near-perfect pre-processing).


问:
Preventing leaks in motor shafts for underwater bots
Whenever building an aquatic bot, we always have to take care to prevent leakages, for obvious reasons. Now, holes for wires can be made watertight easily--but what about motors? We can easily seal the casing in place (and fill in any holes in the casing), but the part where the axle meets the casing is still left unprotected.

Water leaking into the motor is still quite bad. I doubt there's any way to seal up this area properly, since any solid seal will not let the axle move, and any liquid seal (or something like grease) will rub off eventually.

I was thinking of putting a second casing around the motor, maybe with a custom rubber orifice for the shaft. Something like (forgive the bad drawing, not used to GIMP):

This would probably stop leakage, but would reduce the torque/rpm significantly via friction.

So, how does one prevent water from leaking into a motor without significantly affecting the motor's performance?

(To clarify, I don't want to buy a special underwater motor, I'd prefer a way to make my own motors watertight)

答:
If you're looking for a very cheap way to do it (as in, educational budget cheap), check out the Sea Perch ROV build manual.

Full disclosure, I used to work at the MIT lab that heads up this educational program.

On page 9 of that PDF it starts talking about how to waterproof a hobby motor with a film canister and toilet bowl wax.  The entire housing remains submerged and we've taken it to 20 or 30 foot depths in some cases.

The build is actually pretty straightforward; we help a lot of junior high and high school kids make these and I can't remember an incident where the seal turned out to be unreliable.


问:
What is the cheapest / easiest way of detecting a person?
I'd like to know if anyone has had success detecting a warm-bodied mammal (ie. Human) using standard off the shelf, inexpensive sensors?

Ideally, I'd like to use an inexpensive sensor or combination of sensors to detect a person within a room and localize that person. I would like the robot to enter a room, detect if a human(s) is/are present and then move to the detected human. The accuracy does not need to be 100%, as cost is more of a factor. I'd like the computational requirements of such a sensor to be such that it can run on an Arduino, although if it's impossible, I'd be willing to utilize something with more horespower, such as a Raspberry Pi or a BeagleBone Black. I have a few thoughts; however, none of them are ideal:

PIR Sensor - Can detect movement within a large field of vision (ie. usually 120 degrees or more).  Might be the closest thing to a "human" detector that I'm aware of; however, it requires movement and localizing/triangulating where a person is would be very difficult (impossible?) with such a large field of vision.

Ultrasound - Can detect objects with good precision.  Has a much narrower field of view; however, is unable to differentiate between a static non-living object and a human.

IR detectors - (ie. Sharp range sensors) Can again detect objects with great precision, very narrow field of view; however, it is again unable to differentiate objects.

Webcam + OpenCV - Possibly use face detection to detect human(s) in a room.  This may be the best option; however, OpenCV is computationally expensive and would require much more than an arduino to run.  Even on a Raspberry Pi, it can be slow.

Kinect - Using the feature detection capabilities of Kinect, it would be relatively easy to identify humans in an area; however, the Kinect is too expensive and I would not consider it a "cheap" solution.

Perhaps someone is aware of a inexpensive "heat-detector" tuned to body heat and/or has had success with some combination of (#1-4) above and would like to share their results?

答: A more recent sensor type that can be used are MEMS based temperature arrays by Omron (D6T range) or Excelitas (DigiPile). These, as opposed to PIR elements, measure absolute temperatures and thereby allow to distinguish between background and foreground temperatures and detect movement and static presences of temperature sources.</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.

答:
First, I think you need to go back and look at your code. Gimbal lock is only a problem when you get very near (within a couple degrees) of 90. If you are seeing strange behavior at 45 degrees something else is the cause.

As for your question, quaternions are usually not used directly in basic PID control since they have complicated behavior resulting in non-intuitive results. Usually they are either converted to Euler angles and then used in the normal PID controller, or special nonlinear controllers are designed to use them.

Note that for your looping maneuvers, PID is generally not a very good controller: the gains that work well near hover no longer work well at large angles. Usually, when someone wants to do a loop they go "open loop", i.e. they start the maneuver under control and then once they get past a certain angle just just apply a fixed series of commands until they have completed the loop. Figuring out what fixed series of commands to use is the tricky part and often uses reinforcement learning (kind of like a formal way of doing trial and error).


问:
Can ROS run on a Raspberry Pi?
Can ROS run on a Raspberry Pi?

ROS is resigned to run on a network of machines, with different machines, even different cores on the same machine doing different jobs. Can one of those machines be a Raspberry Pi?

I am considering using an R-Pi as the EtherCAT master on a mobile robot, communicating with the main PC over WiFi, using a dongle.

Can an R-Pi even run ROS at all?

Would an R-Pi have enough processing power to do some 1kHz servoing?

Would it be possible to run some servoing on the host through the WiFi connecion?

答:
Robotics is hard enough as it is when all your dependencies are working.  The last thing you need are additional problems coming from incompatible components or unsupported combinations.

I looked into this a little and here was my progression:

Raspberry Pi doesn't support Ubuntu because it's ARM CPU uses an older instruction set (ARM v6 I believe?) and the Ubuntu team dropped support for this back in like 2009.

Beaglebone is similar to a Raspberry Pi in many ways and has a newer instruction set so it will run Ubuntu.  However the 'best' Ubuntu ARM distribution is coming out of the Linaro project and they dropped support for the Beaglebone a few revisions back (last was Linaro 12.03) because it's using an older TI OMAP 3 processor (welcome to the wonderful world of rapid smartphone progress).

My next step was to look at the TI Pandaboard which uses the newer OMAP 4 processor that is currently supported, but it costs closer to the $200 range.

But now Ubuntu officially released for the Nexus 7.  At 200 dollars, the Nexus 7 gets you everything a Raspberry Pi offers plus a lot more.  Keep in mind that even with a Raspberry Pi, once you add in the charger, wifi adapter, storage card, and cables you're creeping up closer to 100 dollars than 35 dollars so imho the Nexus 7 is a much better deal.

Lastly, don't try and output a 1 khz signal out of a non real time OS.  Attach yourself a cheap microcontroller like the PJRC Teensy (Arduino clone) and let it handle the simple real time tasks for you.  This way you dedicate the inexpensive CPU to these simple time sensitive tasks.  At 16 MHz with support for multiple timers, a little AVR MCU can handle a half dozen tasks like this without issue.

Title: Can ROS run on a Raspberry Pi?


答:
This MOOC free-of-charge course, Welcome to TUMx's AUTONAVx!
Autonomous Navigation for Flying Robots, may help. It covers:

Learning theory

Exercise Quadcoptor programming that run on both stimulator and actual hardware

Title: How to use quaternions to feed a PID quadcopter stabilization loop?

Body:
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.


答: Try andymark, their 10 inch mecanums (or smaller) may suit you well.</p>

Title: Where can I buy heavy-duty Omni Wheels?

Body:
Where can I buy multi-directional omni wheels?

I'm specifically looking at something which can support in excess of 100kg/wheel, so around 400kg in total. Also, a possible mission profile would include a 300 meter excursion outdoors on asphalt path, so they should be a little durable. The only ones I can find online are small ones for experimenting.


问:
Problems using syskit monitors -> failed emission of the foo event of
I had just tested my first monitor, which results in the following error
regarding the suggestion in How to define conditions for state-machines in roby?

unfortunately i ran into a runtime error, i don't know whether this is a bug or if i misuse the monitor...

```<code>16:28:27.564 (Roby) = failed emission of the weak_signal event of Pipeline::Detector:0x71f5cf0
16:28:27.564 (Roby) = Backtrace
16:28:27.564 (Roby) |
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/task.rb:663:in `emitting_event'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/task_event_generator.rb:46:in `emitting'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/event_generator.rb:628:in `emit_without_propagation'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1017:in `block (2 levels) in event_propagation_step'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:648:in `propagation_context'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1015:in `block in event_propagation_step'
16:28:27.564 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:559:in `block in gather_propagation'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:648:in `propagation_context'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:559:in `gather_propagation'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1014:in `event_propagation_step'
16:28:27.565 (Roby) |/home/auv/dev/tools/roby/lib/roby/execution_engine.rb:783:in `block in event_propagation_phase'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:761:in `gather_errors'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:779:in `event_propagation_phase'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1426:in `process_events'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1940:in `block (2 levels) in event_loop'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/support.rb:176:in `synchronize'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1939:in `block in event_loop'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1917:in `loop'
16:28:27.565 (Roby) /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1917:in `event_loop'
16:28:27.565 (Roby) | /home/auv/dev/tools/roby/lib/roby/execution_engine.rb:1797:in `block (3  levels) in run'
16:28:27.565 (Roby) =
</code>```

Don't know whether this is a bug, or if i had miss-used the monitor...
here is the action_state_machine i'm using:

```<code>183     describe("Find_pipe_with_localization").
184         optional_arg("check_pipe_angle",false)
185     action_state_machine "find_pipe_with_localization" do
186         find_pipe_back = state target_move_def(... some long stuff here ... )
187         pipe_detector = state pipeline_detector_def
188         pipe_detector.depends_on find_pipe_back, :role => "detector"
189         start(pipe_detector)
190
191         pipe_detector.monitor(
192             'angle_checker', #the Name
193             pipe_detector.find_port('pipeline'), #the port for the reader
194             :check_pipe_angle => check_pipe_angle). #arguments
195             trigger_on do |pipeline|
196                 angle_in_range = true
197                 if check_pipe_angle
198                     angle_in_range = pipeline.angle < 0.1 && pipeline.angle > -0.1
199                 end
200                 state_valid = pipeline.inspection_state ==  :ALIGN_AUV || pipeline.inspection_state == :FOLLOW_PIPE
201                 state_valid && angle_in_range #last condition
202             end. emit pipe_detector.success_event
# for non-monitor use, this works if the above is commented out
203 #        forward pipe_detector.align_auv_event, success_event
204 #        forward pipe_detector.follow_pipe_event, success_event
205
206         forward pipe_detector.success_event, success_event
207         forward pipe_detector,find_pipe_back.success_event,failed_event #timeout here on moving
208     end
</code>```

答: Apart from the error message that is very unspecific (look at my comment to the question), the event that is causing the fault (weak_signal) is not part of the state machine. I guess that there is something else going on here that has no relationship with the monitor at all.


问:
Velocity Model Motion in Matlab (Probabilistic Robotics)
I want to implement the velocity motion model in Matlab. According to Probabilistic Robotics page 124, the model is as following

\begin{align*}
\hat{v}      &= v + sample(\alpha_{1} v^{2} + \alpha_{2} w^{2}) \\
\hat{w}      &= w + sample(\alpha_{3} v^{2} + \alpha_{4} w^{2}) \\
\hat{\gamma} &= sample(\alpha_{5} v^{2} + \alpha_{6} w^{2}) \\
x' &= x - \frac{\hat{v}}{\hat{w}} sin \theta + \frac{\hat{v}}{\hat{w}} sin(\theta + \hat{w} \Delta{t}) \\
y' &= y + \frac{\hat{v}}{\hat{w}} cos \theta - \frac{\hat{v}}{\hat{w}} cos(\theta + \hat{w} \Delta{t}) \\
\theta' &= \theta + \hat{w} \Delta{t} + \hat{\gamma} \Delta{t}
\end{align*}

where $sample(b^{2}) \Leftrightarrow \mathcal{N}(0, b^{2})$. With this kind of variance $\alpha_{1} v^{2} + \alpha_{2} w^{2}$, the Kalman Gain is approaching singularity. Why?

答:
There are several traps you might have stepped into, but it is difficult to tell without more information. The first issues that came to my mind:

The equations you wrote down are for sampling from the velocity motion model. But then you write about the Kalman Gain approaching singularity, which only makes sense of you apply a Gaussian filter (EKF or UKF). There is no sampling in EKF or UKF.

The model above is not defined for $\omega = 0$. You need to handle this special case by computing the limit for $\omega \to 0$. Hint: L'Hôpital's rule

The model assumes perfect accuracy (no noise) if $\omega = v = 0$. This is a rather strong assumption and may or may not lead to problems.


问:
How to brake a brushed dc motor, belt-driven linear actuator to within 0.5mm of an end stop
I will have a belt-driven linear actuator, consisting a gantry-plate riding on two rails. I'm thinking of using a brushed dc motor.

The gantry will move from home position to the right (outbound) at 1m/s. The mass of the gantry will vary from 3Kg to 6Kg. On the return home (inbound) one must avoid spillage of contents which may require soft start/stop or simply a slow return to home.

In the outbound case, what I'd like to know is how,in a practical sense, do you brake the mass and bring the gantry to a stop, ensuring that the gantry plate always comes to rest to within 0.5mm of an end plate?

I'm clearer how I can ensure the gantry stops to within 0.5mm of the home position, because I can use a PWM ramp to slowly decelerate.

I'm wanting to avoid using an MCU. Just want to use an IC with switches and potentiometers.

You can also use math if you want to explain.

Of course, one seeks to begin to arrest the mass as close to the end stop in the outbound case as one can without problems.

Thanks.

答:
Since you are trying to affect the acceleration as well as the endpoints, you should consider using a PID controller.  That will provide the effect of braking, but it will do so as part of the larger goal of coming to a complete stop at a desired setpoint.

Depending on how you tune it, you can have it start and stop very gently (vs very responsively) according to your own needs.

There are several analog PID circuits, (e.g. this one) if you don't want a microcontroller-based solution.


问:
PWM PID control for small 2 watts brushed DC motor
It is "good enough" for PID output directly controls, without further modelling, the PWM duty cycle?

Logic behind the question is,

In case of pure resistance heater, PWM duty cycle percentage directly relates to power (on off time ratio). So, direct control is appropriate.

However, motor has two additional effects,

a) with considerable inductance, initial current is smaller and ramping up over time

b) as RPM gradually ramping up, after time constant of mechanical inertia etc, increasing back EMF will reduce current

Will it be wise to ignore the above two effects and still expect a reasonably good outcome?

Application is 6 volts, 2 watt DC brushed motor, gear 1:50, 10000 RPM no load, PWM frequency 490Hz, driving DIY 1kg robot.

答:
The factors that you mention will definitely have an effect on the accuracy of your PID.  Whether that inaccuracy is enough to negatively affect your outcome is something that only you can determine -- preferably after doing some tests.  In most cases, these inaccuracies are safe to ignore.

In general, if you have some nonlinear effect in your actuator, you would handle that separately from your PID.  For your case, you would need to write some algorithm that converts the desired value (PID output) to the appropriate PWM signal, based on the current state of the motor.  Even if you can't measure the properties of the motor directly to do this, a simple mathematical model of the motor might be enough.

Before you start in this direction, make sure that you've actually found a problem behavior that is being caused by naive conversion of PID level to PWM level (i.e., you know that your PID is tuned properly but you still see a problem).  Otherwise, you will have no way to judge whether your algorithm is helping or hurting your results.


问:
Absolute positioning without GPS
Using an IMU a robot can estimate its current position relative to its starting position, but this incurs error over time. GPS is especially useful for providing position information not biased by local error accumulation. But GPS cannot be used indoors, and even outdoors it can be spotty.

So what are some methods or sensors that a robot can use to localize (relative to some frame of reference) without using GPS?

答:
You're asking how to use an acceleration sensor to make better position measurements.  As you've correctly pointed out, these accumulate error over time.

One way to improve this is to have periodic absolute-position updates, like from GPS, or from the techniques in many of the answers here.

However, don't overlook any abilities you may have to get absolute-velocity updates.  Any speed-over-ground sensor, or just the raw position/velocity data from the wheels (if you have wheels) can improve your dead reckoning accuracy.

Title: Absolute positioning without GPS


问:
Rock envire - vizkit3d : Change environment visualization (envire lib) from ruby script
I am using a ruby script to connent the Multi Layer Surface Map of the velodyne_slam component to the vizkit3D visualization.

The visualizazion plugin is loaded like this:
envireViz = Vizkit.default_loader.EnvireVisualization

It is possible to get the MLSVisualisation object from the EnvireVisualization in order to set visualization properties (like colors etc.) from the ruby script?

Rubys introspection abilities didn't help a lot here...

答:
That is currently not implemented. The Envire visualization plugins are all handled and updated by one Envire Vizkit plugin.

But since the Envire visualization plugins became QObjects too it would be possible to add a qt slot method to get an instance of the envire plugins, where the properties can be accessed.


问:
autoproj snapshot with git detached HEAD
I need to search in the git history of a couple of packages to
get back to a working state for a demo. I am searching by checking out
commits manually until I found the commits of all effected packages that
work together.

By checking out commits manually, I will get into the detached HEAD state:

$ git checkout 995e018
-> You are in 'detached HEAD' state. [...]

To save the current state of all packages, a snapshot is created:

$ autoproj snapshot demo_working

Now the demo_working/overrides.yml will pin the commit where the HEAD is
pointing to (e.g. 5e2e3a259) instead of the commit that I chose manually
for the package (995e018).

Is this the desired behaviour? In my opinion a snapshot should store the
current state of all my git repositories meaning that I can also select
commits manually.

答:
Working with git HEADs is just a bad idea, so yes, this behaviour is expected.

What you want to do is reset your current branch to the desired commit, i.e.

```<code>git reset --hard 995e018
</code>```

which will be picked up by autoproj

Body:
Working with git HEADs is just a bad idea, so yes, this behaviour is expected.

What you want to do is reset your current branch to the desired commit, i.e.

git reset --hard 995e018

which will be picked up by autoproj


问:
One of the best ways to numerically integrate the velocity?
I need to get position $x$ from integrating velocity $v$. One could use 1st order Euler integration as

$x_{t+1} = x_t + \delta * v_t.$

However, doing so leads to errors proportional to sampling time $\delta$. Do you know any more accurate solution please?

答:
One of the most common techniques for integrating ODEs is to using Runge-Kutta methods (of which Euler integration is just a special case). However, these only improve errors due to discretization of time. If you are concerned about errors caused by noise in $\delta$ then I'm not aware of any better methods.

Add Example

For RK4 and using the dynamics $\dot{x}(t) = v(t)$, where the velocity is not dependent on the  state, you have
$$
\begin{align}
k_1 &= v(t)
\\
k_2 &= v \left ( t+\frac{\delta}{2} \right )
\\
k_3 &= v \left ( t+\frac{\delta}{2} \right )
\\
k_4 &= v \left ( t+\delta \right )
\\
x(t+\delta) &= x(t) + \frac{h}{6} (k_1 + 2 k_2 + 2 k_3 + k_4)
\end{align}
$$

If you have access to $v(t+\frac{\delta}{2})$ this will provide an improvement over Euler integration. If not, you can probably still get some improvement by assuming $v(t+\frac{\delta}{2}) = \frac{v(t) + v(t+\delta)}{2}$.

Other Option - Kalman Filter

For such a simple system, another option would be to use a Kalman filter. In the case where you only have access to $v(t)$ and $v(t+\delta)$ (no intermediate information) this might work better.


答:
We have used PID for a similar application involving hydraulic cylinder control. We used an SSI linear position sensor and we could get WAAAAAAYYY more accurate than .5mm

We were moving at 24"/sec over 6 ft of travel

And the braking effect was great.

Title: How to brake a brushed dc motor, belt-driven linear actuator to within 0.5mm of an end stop

Body:
I will have a belt-driven linear actuator, consisting a gantry-plate riding on two rails. I'm thinking of using a brushed dc motor.

The gantry will move from home position to the right (outbound) at 1m/s. The mass of the gantry will vary from 3Kg to 6Kg. On the return home (inbound) one must avoid spillage of contents which may require soft start/stop or simply a slow return to home.

In the outbound case, what I'd like to know is how,in a practical sense, do you brake the mass and bring the gantry to a stop, ensuring that the gantry plate always comes to rest to within 0.5mm of an end plate?

I'm clearer how I can ensure the gantry stops to within 0.5mm of the home position, because I can use a PWM ramp to slowly decelerate.

I'm wanting to avoid using an MCU. Just want to use an IC with switches and potentiometers.

You can also use math if you want to explain.

Of course, one seeks to begin to arrest the mass as close to the end stop in the outbound case as one can without problems.

Thanks.


问:
Starting out advice on making robots and tinkering with microcontrollers
I'd like to start making robots and tinkering with microcontrollers. Where do I start, and what do I need?

I'd like to make my own robots. I'm comfortable with programming (assembly and C) so I've got that part covered, but my electronics/circuits knowledge is a little weak. I have no idea what material to start with and which tools I need, nor how to put stuff together.

For the microcontroller, I'm thinking about going with the Pololu Orangutan LV-168 or the Arduino Duemilanove, although I'm leaning more towards the Orangutan because of the built-in LCD and pushbuttons (which I would expect to use, especially for debugging and user interaction). Am I on the right track? It seems to me like the number of I/O ports is small, but is that the case in practice?

答:
I'd suggest using kits to get you started.  There are excellent resources today that will quickly get you enough confidence and knowledge to built great robots.  I'd stick with as 'mainstream' technologies as you can in order to maximize what you can learn from others.  The most mainstream microcontroller you could choose is the Arduino Uno, perhaps its newer replacement the Arduino Leonardo.

Make's Getting Started with Arduino plus Maker Shield

This gets you the documentation, microcontroller, electronics, and your first few projects to get started with.  The documentation is excellent and takes you from very beginning to enough knowledge to do your own projects.

Add some electronics background by getting the Make Electronics book with the matching Components Pack 1 so you can do the projects in the book.  This will get you familiar enough to add blinky lights and simple sensors.

Then get your tooklit basics, such as the Ladyada's Electronics Toolkit.  Your first step up from this should be a better soldering iron such as the Weller WES51 once you've done enough projects to know why you need it :-)


问:
Will a 20amp ESC run a Turnigy 2213-980?
I'm a noobie just starting out and trying to come up what I need to build my first quadrocopter, I just wanted to run something by people with some experience before I commit to buying anything.

Would this esc be fine for running this motor? As I understand it the ESC should be rated for slightly above what the max amps are for the motor?

On top of that, should this battery be able to run all of the motors without any issue?

答: The motor/esc pair you selected look fine. However, you should probably use a larger battery. 2.2 Ah * 25C = 55 amp continuous current draw. Each of your motors is rated 15 amps, but the speed controllers can handle more which means that they will probably occasionally draw more. 15 amps * 4 motors = 60 amps which is 5 amps higher than your battery is rated at. While this might work, the battery probably wouldn't last very long, and I personally wouldn't want to be near it while it is on. I would strongly suggest that you either find a larger battery or one with a higher C rating. Pushing lipos to their maximum ratings is almost never a good idea. </p>


问:
iRobot Create without ROS?
Is it possible to control the Create without using any ROS whatsoever? I know it has all these serial/Digital I/O pins that connect to ROS which controls it using drivers/libraries. But how hard would it be to do so using, say, a PCduino?

I'm asking this because I'm having trouble launching the create using ROS (question)

答:
It is very easy to control an iRobot Create with an Arduino or other microcontroller.

If you have one of the Mini-DIN cables (circular ones) that you are willing to cut up you can wire the correct pins into the TX and RX of an Arduino or PCDuino.

I have found that it is easier though to use the large DB-25 connector (which is the same one used on old printers and scanners) because it can provide 5v regulated power directly to an Arduino (but it can't provide enough current for a PCDuino) along with the serial data.

The pinouts for both of the these connectors can be found here: http://www.irobot.com/filelibrary/pdfs/hrd/create/create%20open%20interface_v2.pdf, along with a lot of other information.

For software I recommend this Arduino library: http://www.airspayce.com/mikem/arduino/Roomba/, which is simple and easy to use.

Edit: I just realized that you wanted to do this with a PCDuino, which I have never used, but I think you would have to port the library. The pdf I linked provides information on the entire protocol. If you don't need the processing power of the PCDuino it might just be easier to use an Arduino.

I hope this helps.

Title: iRobot Create without ROS?


问:
Why linkage-based haptic devices are much more common than cable (tension)-based ones?
According not only to this link, but in my humble opinion to common sense as well, cable-based haptic devices have got lower inertia and are less complicated mechanically. I also believe that controlling them is not that big deal - the inverse kinematics should be quite straightforward. Moreover, the play should be easy to compensate - if there occurs any at all, since the cables are tensioned. Cables should also be easy - ? just a guess from me - to be equipped with strain gauges or to become strain gauges themselves, allowing to enhance control capabilities of a device.

Where am I wrong? Why is that the links-based systems (e.g. PhaNTom or Falcon, although that latter has got cable transmission), especially with impedance control, are the only I seem to be able to buy? Is it because of cable elongation (creep)? Or too constrained workspace (esp. angles)?

答: why not to consider a hybrid cable which can be stiff ("frozen") like a pipe or flexible as a rope? In such a case it can push not only pull. By the hybrid cable I mean a cable covered with many small cylindrical pulleys.</p>


问:
Path comparison
Problem: the cartesian position of an end effector (no orientation) of a robot arm is recorded, say, every millisecond (the time steps can not be changed), during a motion. The robot arm is commanded the same path but with different velocities. So I get different trajectories. I want to calculate the deviation of the paths, which is the distances of equivalent points of two paths. The problem is to find equivalent points. Since the two velocities are different the comparison at the same time steps of the trajectories makes no sense. I can assume that the paths underlying the trajectories to be compared are rather similar. The deviation for the ideal path being smaller than 1% of a typical length dimension of the path. I want to detect deviations of much lass than that.

I have to map the timestamp of the recorded points to the path length, and make comparison of points at the same path length. But of course also the path lengths differ for different paths, so any deviation would distort the result for all later points. How can I compensate for this ?

Is there a reliable algorithm ? Where can I find information ?

Note: time warp algorithms (even memory optimized ones) are out of the game because of memory consumption.

答:
The problem you are describing sounds like you need to calculate Frechet distance.

If you take a point at each of your paths, connect them with a string and move them along the path (not necessarily with the same velocities), then Frechet distance of the paths is a minimum length of the string necessary.
Not a good description :-)

The formula from the wikipedia page is much better:

$$F(A,B) = \inf_{\alpha, \beta}\,\,\max_{t \in [0,1]} \,\, \Bigg \{d \Big ( A(\alpha(t)), \, B(\beta(t)) \Big ) \Bigg \}$$
where $\alpha$ and $\beta$ are mappings from time to the position on the curve.

The only problem is, that calculating the Frechet distance between two polylines takes $O(n^{2}m + m^{2}n)$ of memory (and even more time). There are some approximations you could use that only take the turning points of the polyline into account, but I don't know much about them.

And some resources:

More detailed description of the calculation:
http://www.cim.mcgill.ca/~stephane/cs507/Project.html

Implementation in matlab:
http://www.mathworks.com/matlabcentral/fileexchange/38714-frechet-distance-calculation/content/frechet_compute.m

My buggy implementation in python:
https://github.com/bluecube/robomower2/blob/master/src_python/util/frechet_distance.py

Title: Path comparison


问:
Velocity Control via Vibration
I am working on a robot that has an accelerometer. This accelerometer measures the vibration of the robot. When the robot hits a certain vibration, I would like it to slow down in order to reduce the vibration. I thought about a PID controller, but I don't think it would work. Does anybody have some input on different types of controllers I can use?

Mechaman

答:
Your main problem is that vibration isn't a well-defined measurement; what number do you assign to vibration? Peak accel value? Average accel value? And over what time range; peak value over the last 1s, 2s, 3s?

Once you've decided precisely what measurement you plan to use, then I would initially go ahead and try a PID. If it works then you're set. Beyond that, it's hard to say what will work well. Ideally, you would use a controller that minimizes energy (e.g. $\mathcal{H}_\infty$ control) but those are quite complex and take a lot of advances math to understand and create.

Title: Velocity Control via Vibration


问:
Autodesk Inventor 2013: Rounding only at specific edge
I am using Autodesk Inventor 2013 and I need to round a component of a device. I want to round the green marked edges, but not the red marked. But when I click "round", then the bottom edge will always be added to the rounding and I cannot de-select it. Any hints how to solve this problem?

答:
The problem is the fillet is reaching the long edge by following the smooth curve around your previously-filleted edges.  The solution is to undo or delete features to get rid of the existing fillets on the left and right sides, then do all the fillets on those sides at once.

Often you need to be strategic in choosing the order of chamfering and filleting.  This can get complicated for a real project with lots of different intersecting features!


问:
How can I manipulate real-time sonar data from my Arducopter in Arduino?
I have a APM 3DR Quad with a 3DR radio telemetry kit.  I would like to send real-time sonar data to my laptop (running Windows 7) in order to manipulate it in an additional Arduino Sketch.

The sonar sensor is connected to an Analog In channel on my Arduino. That data is processed for altitude calculations, and I would like to send this altitude data to some sort of ground station on my computer through the use of a telemetry kit (2 3DR Radios: 1 on the quadcopter and 1 on my computer).

I am not quite sure how to go about this task.  Is there a way that I can modify the source code (GCS.h or GCS_Mavlink.pde) in conjunction with Mission Planner Mav 1.0 ground station to do this?  Or would I need to write a python module to accomplish this?

答:
Setting up the software to extract new custom sensor data via MAVLink seems to be harder than it should be.

Step one is to make the quadcopter send off the data.

First, you need to define a new MAVLink message type using XML in mavlink/message_definitions.  You can just make up a new unused integer for the message_id.

Second, you generate the message pack/unpack functions using the MAVLink generator.

Then you'll need to add code to ArduCopter/GCS_Mavlink.pde in data_stream_send to build and send off your message.  You do need to be a little careful here, because the flight dynamics start to degrade if your sensor reads stop the main loop for more than a few milliseconds, especially for a small quad or flying indoors (that's what the "gcs_out_of_time" business is about).  I'd add a new sensor to the STREAM_EXTRA3 trigger.

Rebuild and upload the new flight firmware.

The other half of the project is on the PC, where you need to modify the ground station software to read your MAVLink packets out of the telemetry stream.  I have no clue where you'd begin to do this to Mission Planner, which seems like a really sophisticated piece of software.  But luckily it dumps raw radio telemetry to the "tlog", so you might be able to build a completely separate program that looks for your new MAVLink packet from the tlog.  (You certainly don't want an Arduino Sketch for this, since a Sketch runs on the Arduino, not the PC.)

If this sounds intimidating to you, you're not alone!  For our indoor quad, we ended up building our own radio communication protocol and "ground station", since we couldn't use GPS or waypoints or the other MAVLink features, and dealing with the complexity of MAVLink wasn't worth it to us.


问:
Implementing Slip Compensation into a Half-Size Micromouse
I would like to know if there are any other solutions to implement slip compensation into a Half-Size Micromouse other than the conventional method. I have spoken to a few Japanese competitors, and they told me that the only solution they have to such a problem is creating a table of predetermined values and using these values to increase or decrease the before turn/after turn distances. The values used are determined by the Mouse's intelligence. Due to the fact that this method has too many limitations, I would like to hear more suggestions from people who are familiar with this matter.</p>

答:
Wheel slip is a serious limitation for any odometry-based robot tracking system.  The big problem is a wheel will slip when the force due to wheel torque exceeds the tire/ground static friction force.  Wheel torque depends on not just the PWM commanded power, but also the battery voltage and the gearbox.  The drive friction depends on the vehicle dynamic weight, and the tire and surface properties, both of which can change dramatically over short periods (e.g., when crossing a bump).

At low torques and speeds, slip is a small effect, mostly noticable as a small deviation in the distance turned.  At high speeds or torque, which is what wins competitions, wheel slip dominates the vehicle's dynamics.

But there are lots of possible tools to detect and compensate for wheel slip:

An accelerometer and gyro based IMU can be used to cross-check wheel odometry, since slip will cause a mismatch between these two.  Magnetometer (9-axis) IMUs are better for big applications, since the magnetic axis helps stop gyro drift, but you need to be careful about shielding the fields from the motors on a small robot. Surface mount MEMS IMU packages can be quite lightweight.

A downward-facing optical sensor, like the optic flow motion sensor in an optical mouse, can be used to estimate vehicle motion.  I've seen these used on micro-mouse sized platforms.  Like a black mousepad, the track typically has enough optical roughness to allow the sensor to work reliably, although depth of focus blur and motion blur can be a problem.

Separate non-powered odometry wheels are another option, although these are difficult to fit even in a full size micro mouse platform.

Outward-looking wall tracking sensors are very useful in micro mouse localization.  Of course, you need to detect the walls to map the maze, but you can also use them to calibrate your motion, especially if you can reliably measure distances in the forward direction, such as via ultrasonics or laser distance measurement.

OwnerDisplayName: Lai Feng


问:
Making a Gripper Changer for a Robotic Arm
How do you make a gripper changer for a robotic arm like this? I don't see how you could connect power/control wires or what you use to hold the gripper to the arm.</p>

答:
Mechanically, there are a variety of ways to fix the gripper to the arm.  I think the easiest way is to have a little tab rotate under an overhang.

At least one of the grippers shown in your video is pneumatic.  (It is quite possible both are).  In which case, the pneumatic connection is just a hole with a gasket or O-ring to seal it.

Electrically, you can have pins on a connector slide into the housing on the other end.  But i think that requires some pretty tight tolerances, and might wear out quickly.  More likely, you can use something called "pogo pins".  these are spring loaded contacts made for just this type of thing.

it is also possible that your end-effector gripper can be actuated mechanically.  this can be accomplished with gears, splines, or push rods i think.


问:
What's the most effective type of rechargeable battery when taking into account size / weight / Ah?
I'm looking to build an underwater glider robot that will need to remain autonomous for long periods of time, perhaps even months. Power draw should be minimal, and I'm thinking of including some form of charging device (such as a solar charger) however I'd also like the battery capacity to be large enough so I don't hugely need to worry about this. Large current draw isn't really needed, but the battery does need to hold its charge effectively for long periods of time. Considering this is an underwater vehicle, weight and size are also a concern.

Cost isn't too much of an issue, as long as it's within reason of a hobbyist project.

I am looking to understand the pros and cons of each technology (Lead acid, LiPo, NiCad, fuel cell?), so I can decide what type of battery would be best suited to my purpose. As such, I'm looking at battery technology rather than looking for a specific shopping recommendation.

答:
Lithium Ion Polymer batteries are probably your best bet.

They will present the least amount of magnetic interference (followed by Alkaline... NiCD interferes the most).

Unlike the regular lithium ion cells (which are usually round), these ones will stack nicely.

I hope you'll check the manual before trying this -- many of them are pressure tolerant.  I know of some AUV labs that just put stacks of cellphone-sized batteries into rectangular boxes filled with oil (for pressure compensation) and go with it.  For example, Autosub 6000's battery packs -- depth-rated to 6000 meters, without the aid of a cylindrical or spherical pressure housing:

(http://www.thesearethevoyages.net/jc44/autosub6000_page1.html).
For other battery technologies, you'll have to decide how to pack them into your pressure housing, which may be a bit more complicated.


问:
Controlling a system with PID that resists backdrive
I'm controlling the angular position of a pendulum using a DC motor with a worm gearbox. Mechanically, worm gears are impossible to backdrive.

Using a PID controller on a pendulum system with a regular DC motor (no worm gear), the integrator would help the motor find the appropriate constant power setting to overcome gravity so the pendulum can hold any arbitrary position. With the worm gear, however, there is no need to apply constant power to the motor once the desired position is achieved. Power to the motor can be cut off and the worm gear will resist gravity's force to backdrive the pendulum to the lowest gravity potential.

It seems to me, then, that the integrator of the PID algorithm will cause large overshoots once the desired position is achieved. I want the integrator initially to help control the pendulum to the desired position. But once the position is achieved, I'd need the integrator to turn off.

The only solution I can come up with is to test for a special condition in the PID algorithm that checks if the position has been reached AND the angular speed is small, then instantaneously reset the integrator to zero. Is there a better way to handle the integrator in a system that resists backdrive?

** EDIT *

When I originally worded my question, I was mostly just interested in the academic approach of backdrive resistance in a PID loop. But it'll help if I explain the actual mechanism I'm building. The device is a robotic arm that rotates on a car window motor. It will also occasionally pick up and drop small weights at the end of the arm. Manufacturing variability in motors and the difference in drive torque when picking up the small weights led to me consider a PID loop.

答: I would find something like a leaking integrator. The primary component will integrate error but there is also another component that will always slowly decay the integral value over time.</p>


答: Why not just have a deadband region?  (when position is close enough to target, stop controlling the motor).</p>

Title: Controlling a system with PID that resists backdrive

Body:
I'm controlling the angular position of a pendulum using a DC motor with a worm gearbox. Mechanically, worm gears are impossible to backdrive.

Using a PID controller on a pendulum system with a regular DC motor (no worm gear), the integrator would help the motor find the appropriate constant power setting to overcome gravity so the pendulum can hold any arbitrary position. With the worm gear, however, there is no need to apply constant power to the motor once the desired position is achieved. Power to the motor can be cut off and the worm gear will resist gravity's force to backdrive the pendulum to the lowest gravity potential.

It seems to me, then, that the integrator of the PID algorithm will cause large overshoots once the desired position is achieved. I want the integrator initially to help control the pendulum to the desired position. But once the position is achieved, I'd need the integrator to turn off.

The only solution I can come up with is to test for a special condition in the PID algorithm that checks if the position has been reached AND the angular speed is small, then instantaneously reset the integrator to zero. Is there a better way to handle the integrator in a system that resists backdrive?

** EDIT *

When I originally worded my question, I was mostly just interested in the academic approach of backdrive resistance in a PID loop. But it'll help if I explain the actual mechanism I'm building. The device is a robotic arm that rotates on a car window motor. It will also occasionally pick up and drop small weights at the end of the arm. Manufacturing variability in motors and the difference in drive torque when picking up the small weights led to me consider a PID loop.


答: It sounds like you don't need a PID controller at all.  You're trying to move a worm gear until it reaches a given set point, then turn it off -- proportional control sounds like all you'd need.</p>


问:
BS2 inconsistant pin state when connected to wire?
I have a BS2 mounted on a Parallax Board of Education Rev D.
I was trying to use a wire to determine whether a control was pressed.
however, whenever there's a wire connected the state seems to fluctuate between 1 and 0 instead of staying one or the other. when connected to the desired button it still exhibits this behavior but has the added quality of switching to zero when the button is pressed. ideally it will stay zero while the buttons pressed and 1 when it's not, but instead it flickers between 1 and 0 when unpressed.
what causes this behavior and why does it occur even when the wire is not connected to anything except the bus?
the code used to get the state is </p>

```<code>DO
DEBUG CRSRXY,0,3,
"P5:", BIN1 IN5,
LOOP
</code>```

答: I think you're in need of a pull-up resistor.  This will help keep the input fixed at one value when disconnected.</p>


问:
Adding external magnets to a DC motor
Is it possible to strengthen permanent magnet DC motors by simply attaching extra magnets on the outside of the motor casing - adding to the magnetic field?

If this is not possible, the question becomes; what happens if I replace the magnets inside the motor with better magnets?

I know that the coils will not handle more current than they currently do, so what will the net effect on the motor be?

答:
First, consider that the purpose of the magnets in a motor are to create a permanent magnetic field.  The magnetic flux associated with this magnetic field follows a path from one pole of the magnet, through the air gap to the armature, then through the opposite air gap, then through the other magnet, then around the housing of the motor back to the opposite pole of the first magnet.  The magnets are embedded in the motor's magnetic circuit.  If you place magnets on the outside of the motor, they will not be in the magnetic circuit of the motor.  Rather, one pole of the magnets will be on the housing that the other will be facing out away from the motor.  Little to no flux will be added to the motor's magnetic circuit.  </p>

<p>If you took the motor apart and replaced the standard magnets with new magnets, then that is a different question.  This is a complicated subject and there is no definite answer to your question other than "it depends."  Most motors are designed so that the steel in the motor is near magnetic saturation.  Increasing the strength of the magnet will drive more of the steel into saturation.  How much and what affect it will have depends on the motor and how much you change your magnet by.  But you will increase Kt, which means for a given torque, your current will be lower.  And your speed will be lower.  Your ability to dissipate heat will not change.  However, your magnet may be more susceptible to demagnetization.  You'd want to make sure your magnet's coercivity (Hc) is high enough. </p>

Title: Adding external magnets to a DC motor

Body:
First, consider that the purpose of the magnets in a motor are to create a permanent magnetic field.  The magnetic flux associated with this magnetic field follows a path from one pole of the magnet, through the air gap to the armature, then through the opposite air gap, then through the other magnet, then around the housing of the motor back to the opposite pole of the first magnet.  The magnets are embedded in the motor's magnetic circuit.  If you place magnets on the outside of the motor, they will not be in the magnetic circuit of the motor.  Rather, one pole of the magnets will be on the housing that the other will be facing out away from the motor.  Little to no flux will be added to the motor's magnetic circuit.

If you took the motor apart and replaced the standard magnets with new magnets, then that is a different question.  This is a complicated subject and there is no definite answer to your question other than "it depends."  Most motors are designed so that the steel in the motor is near magnetic saturation.  Increasing the strength of the magnet will drive more of the steel into saturation.  How much and what affect it will have depends on the motor and how much you change your magnet by.  But you will increase Kt, which means for a given torque, your current will be lower.  And your speed will be lower.  Your ability to dissipate heat will not change.  However, your magnet may be more susceptible to demagnetization.  You'd want to make sure your magnet's coercivity (Hc) is high enough.


问:
How much can working with CNC machines teach you about robotics?
I have built a few simple X/Y/Z CNC machines.  I've learned about G-Code, motor control, firmware and open loop systems.  I see machines like rovers, big dog and factory arms that seem incredibly complex by comparison, yet they don't seem that magical any more.

What are the important skills to pick up from working with CNC machines?  What's the next logical thing to learn?  What things would CNC machines never teach me?

答:
Building CNC equipment may teach you:

Motor control

Kinematics and coordinated movement

How to choose motors for a given load

Mechanical movement (torque, moment, etc)

Simple electronics

Running CNC equipment may teach you:

Software control of hardware

Timing (at least on the gross level)

Feedback

Hardware error detection and recovery

While the fields are different, very broadly speaking CNC machines are merely robots.  The reverse is true.  Due to their specific use there's different terminology and typically different control and usage schemes and scenarios, but at the end of the day you are moving things under electronic, and often autonomous, control.

Even today's high speed circuit board assembly machines use computer vision in complex ways similar to today's advanced robotics.  You'll find that the two fields share most things in common such that everything you learn in one will apply to the other in some way.


问:
Maximum likelihood estimator (ML Data Association) EKF
This question is an extension to my previous problem (Data association with ekf). My problem here is in the line 16 in the aforementioned link.

16.     $ j(i) = \underset{k}{\operatorname{arg\,max}} \ \ det(2 \pi S^{k})^{-\frac{1}{2}} \exp\{-\frac{1}{2} (z^{i}-\hat{z}^{k})^{T}[S^{k}]^{-1} (z^{i}-\hat{z}^{k})\} $

When I compute this line, I'm getting huge number 1.0e+09 * 3.5230. This is probability density function. Why is the pdf getting bigger than 1 in a huge way?

答: Getting a value larger than 1 in a pdf is normal. Remember that the pdf does not actually evaluate to a probability itself, but to a density. Only the integral over the function has to evaluate to 1. For a continuous variable the probability of getting exactly one particular value approaches zero. In this case you can only give the probability that the variable is within a certain interval, or you can compare the relative probability. </p>


答:
Just like Jacob said. The integral of pdf from $\int_{-\infty}^{\infty}{f(t) dt}=1$ for some pdf $f(t)$.
This does not mean the pdf cannot be more than one at some point (i.e. infinitesimal interval). Thinking about dirac delta function might help.</p>

Title: Maximum likelihood estimator (ML Data Association) EKF

Body:
This question is an extension to my previous problem (Data association with ekf). My problem here is in the line 16 in the aforementioned link.

16.     $ j(i) = \underset{k}{\operatorname{arg\,max}} \ \ det(2 \pi S^{k})^{-\frac{1}{2}} \exp\{-\frac{1}{2} (z^{i}-\hat{z}^{k})^{T}[S^{k}]^{-1} (z^{i}-\hat{z}^{k})\} $

When I compute this line, I'm getting huge number 1.0e+09 * 3.5230. This is probability density function. Why is the pdf getting bigger than 1 in a huge way?


问:
Passive ego-motion estimation vs active
I am doing research of ego-motion estimation and positioning in 6DoF space. And I found that apparently all systems are based on active RGB-D sensors, like Kinect. I understand, that such sensors provide greater accuracy, and requires less computational resources.

But if such systems will be used, for example, for augmented reality or robot navigation, how they are going to solve the problem of the interference of signals from different systems, operating in the same space? If many people will wear AR glasses with active sensors - they will interfere with each other, aren't they?

Are there big commercial projects, that use passive visual odometry with multiple camera units and IMU sensors? I found some good papers on this topic, but I have not found commercial application of such technology. I am going to make research of passive odometry method for AR, but is it actually a problem with active depth sensors, that i described earlier?

UPD:
The main question:

Is passive odometry, based on video flow analysis and IMU, worth to make deep research in this topic, or active sensors - is our future, and the signal mix is not a big deal, and passive odometry is a dead end of such kind of technology? Because it will be not very useful to make research in useless technology...

答:
Regarding interference of active sensors: Yes, this is a problem for Primesensor-based RGBD cameras (like the Kinect), but it does not make these sensors completely useless. There are even some clever hardware hacks to work around this problem. A much bigger problem of these sensors is exposure to direct sunlight. This has slightly improved with Kinect 2.0.

About your main question: The different approaches you mentioned all have different advantages and problems/failure cases. RGB-D sensors suffer from interference (the worst being interference with sunlight). A similar alternative is relying on stereo vision, but this is computationally more expensive and may fail in textureless environments. Monocular camera + IMU requires the least space/weight but is less accurate.

Neither option is going to become completely irrelevant in the near future, but the ideal approach depends on the exact problem you need to solve.

Title: Passive ego-motion estimation vs active


问:
Where to go to purchase parts for XY Plotter
I am trying to build a 2ft square an XY Plotter. I have seen three designs so far: 1)Rack and Pinion 2)Threaded Screw 3) belt-driven. all these use a stepper motor to drive the system.

Each one has their obvious pros and cons but correct me if i am wrong, i believe the rack and pinion system is the most sturdy and easiest to put together.

I googled for Rack and pinion but all i get is industrial websites. Is there any place that sells cheaper rack and pinion sets for hobbyists? The payload of the XY Table is an eletro-magnet that isn't extremely heavy (maybe a half kilogram at most).

So obviously the motor must be strong enough to move anothe rack which will be significantly heavier than the payload.

This is my first real robotics project so i am new to all this.

答:
Check out pololu.com and sparkfun.com

Each of the motors you will find will have a torque rating which indicates how much torque they can produce. Stepper motors require stepper motor drivers to operate. The drivers usually take an input voltage pulse of 5 volts, and will then move the stepper motor attached to it 1 step.

This is the stepper driver I just used for a project where I used the stepper setup to drive my little 5 lbs robot around on a ping pong table. I used this with a 68 oz.in stepper motor from sparkfun and an Arduino.

I imagine for a rack and pinion setup you would have to do some math to determine how far 1 step of the motor would move the tray based on the diameters of the gears and the degrees traveled by one step of the motor. Stepper motors have a paramater, steps per revolution, that specifies how much rotation happens for one step. There is a thing called microstepping which allows you to turn a stepper motor less than this rating.