答:
As far as how to heat the nylon muscles, one of the articles that you have linked to provides a number of methods for doing so. The two most promising from an experimental perspective are submersing the muscle in water or a flow of air, which you then heat/cool (e.g. with a pool pump or hair dryer), or using silver-coated nylon sewing threads, which integrates the heating element and nylon together.

As far as a circuit for simply heating a wire (like the second option above), I have personally had pretty good success with shape memory alloys by using high-power DC/DC converters to generate a low voltage/high current signal, which can be switched on and off using high current MOSFETs controlled by logic-level outputs (e.g., from an Arduino).

Title: Electronic circuit for heating nylon fishing line muscle

Body:
I'm trying to make artificial muscles using nylon fishing lines (see http://io9.com/scientists-just-created-some-of-the-most-powerful-muscl-1526957560 and http://writerofminds.blogspot.com.ar/2014/03/homemade-artificial-muscles-from.html)

So far, I've produced a nicely coiled piece of nylon fishing line, but I'm a little confused about how to heat it electrically.

I've seen most people say they wrap the muscle in copper wire and the like, pass current through the wire, and the muscle acuates on the dissipated heat given the wire resistance.

I have two questions regarding the heating:

1) isn't copper wire resistance extremely low, and thus generates very little heat? what metal should I use?

2) what circuit should I build to heat the wire (and to control the heating)? Most examples just "attach a battery" to the wire, but afaik that is simply short-circuiting the battery, and heating the wire very inneficiently (and also may damage the battery and it could even be dangerous). So what's a safe and efficient way to produce the heat necessary to make the nylon muscle react? (I've read 150 centigrads, could that be correct?) for example with an arduino? or a simple circuit in a breadboard?

thanks a lot!


问:
Is there a way to disconnect and reconnect from a Create 2 that was streaming sensor readings without having to unplug/replug my USB-serial cable?
I am working with a Create 2 and I am executing a simple sequence like (in pseudocode):

```<code>create serial connection from Macbook to Create

start the OI with by sending the 128 code

send a pause-stream command (just to be safe)

initiate the data streaming with ids: [29, 13]

every 0.5 seconds for 15 seconds:
    poll the streamed sensor data and print it

send a pause-stream command before shutdown

send a 128 to put the robot in "passive mode" (I have also tried 173)

close the serial connection
</code>```

The outcome when I run the above program repeatedly is that it works the first time, I see sensor data (that seems to not change or be reactive) printing to the screen, but on future runs no serial can be read and the program crashes (because I am throwing an exception because I want to get this problem ironed out before getting to far along with other things). If I unplug and replug my USB cable from my Macbook, then the program will work for another run, and then fall back into the faulty behavior.

I do not experience this issue with other things like driving the robot, I am able to run programs of similar simplicity repeatedly. If I mix driving and sensor streaming, the driving works from program run to program run, but the data streaming crashes the program on the subsequent runs.

I have noticed that if I want to query a single sensor, I need to pause the stream to get the query response to come through on the serial port, and then resume it. That is why I am so inclined to pause/restart the stream.

Am I doing something wrong, like pausing the stream too often? Are there other things I need to take care of when starting/stopping the stream? Any help would be appreciated!

EDIT:
I should note that I am using Python and pyserial. I should also note, for future readers, that the iRobot pushes its streamed data to the laptop every 15ms where it sits in a buffer, and the data sits there until a call to serial.read() or to serial.flushInput(). This is why it seemed that my sensor values weren't updating when I read/polled every half second, because I was reading old values while the current ones were still buried at the back of the buffer. I worked around this issue by flushing the buffer and reading the next data to come in.

EDIT 2:
Sometimes the above workaround fails, so if I detect the failure, I pause the stream, re-initialize the stream, and read the fresh data coming in. This seems to work pretty well. It also seems to have solved the issue that I originally asked the question about. I still don't know exactly why it works, so I will still accept @Jonathan 's answer since I think it is good practice and has not introduced new issues, but has at least added the benefit of the robot letting me know that it has started/exited by sounding tones.

答:
I usually do this to disconnect and I've had no issues with it to date:

```<code>128 // To put in passive mode
173 // To stop OI
</code>```

If you only do 128 or 173 on their own, I could see it potentially having issues since it may not exit OI depending on what mode you were in.

I do not request the stream to be paused, though I can't imagine that hurting.

ContentLicense: CC BY-SA 3.0

Body:
I usually do this to disconnect and I've had no issues with it to date:

128 // To put in passive mode
173 // To stop OI

If you only do 128 or 173 on their own, I could see it potentially having issues since it may not exit OI depending on what mode you were in.

I do not request the stream to be paused, though I can't imagine that hurting.


问:
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)

答:
There are two ways to do this without using ROS(and indeed the ROS drivers are in fact, wrapping the commands that are sent to the Create base).

For the original(ca. 2007) Create, you might want to see if you can find a "Command Module" on eBay or something. This has an ATMEGA 168 AVR in it with a USB/serial connection and the pins coming off the ATMEGA connected to several DB-9 connectors.(These are NOT serial ports). You write C code to program the AVR, which talks to the Create through its DB-25 connector.
This tends to involve a lot of bit-masks and bit-shifting since some of the AVR pins are connected to the motors, bumpers, etc. of the Create. If you're not experienced in low-level programming in C or Assembly, this would not be the most productive way for you to control it.

OR

You can send OIS commands to the Create via the DIN-8 connector. This involves sending a series of bytes to the Create through a USB/Serial cable which tell it what to do.

Hope that helps you some.

Title: iRobot Create without ROS?


问:
Why must I loop 127 times for a "7-bit" address in this example?
I am learning about I2C on the Arduino. I was looking at a sample program to scan for I2C devices and saw this:

```<code>// This sketch tests the standard 7-bit addresses
// from 0 to 127. Devices with higher bit address
// might not be seen properly.
</code>```

With the following code.

```<code>    for(address = 0; address <= 127; address++ )
      {
        // The i2c_scanner uses the return value of
        // the Write.endTransmisstion to see if
        // a device did acknowledge to the address.
        Wire.beginTransmission(address);
        error = Wire.endTransmission();

        if (error == 0)
        {
          Serial.print("I2C device found at address 0x");
          if (address<16)
            Serial.print("0");
          Serial.print(address,HEX);
          Serial.println(" !");
    }
}
</code>```

As far as I understand it, a bit is just 1.  So, why how do 7 bits loop from 0 - 127?

答:
If I understood your question correctly, you have a problem understanding binary numbers, right?

Think of a decimal digit. A digit is only either of 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9, right? But a 7-digit number can be between 0000000 and 9999999. I presume you do understand this.

Now a decimal number, for example 2569 is actually a short form of writing like this (again in base 10 (i.e. decimal)):

```<code>9 * 10^0   +   6 * 10^1   +   5 * 10^2   +   2 * 10^3
</code>```

If you have a number in another base, for example 1423 in base 5, then that is equivalent to writing the following (in base 10):

```<code>3 * 5^0   +   2 * 5^1   +   4 * 5^2   +   1 * 5^3
</code>```

Which is basically the same, except all the 10s are changed for 5. That is, in the expanded form, each digit is multiplied by b^p where b is the base and p is its position in the number.

Now you know that in base 10, you have digits from 0 to 9. Similarly, in base 5, you have digits from 0 to 4. In base 2, you have digits from 0 to 1, which in other words is just 0 and 1.

So if you have a binary number like 1101, its expanded form is (in base 10):

```<code>1 * 2^0   +   0 * 2^1   +   1 * 2^2   +   1 * 2^3   = 13
</code>```

If you have a 7 digit number in binary, which we normally call a 7-bit number, you can represent all numbers from 0000000 to 1111111. The first number corresponds to 0 and the second one corresponds to:

```<code>1*2^0 + 1*2^1 + 1*2^2 + 1*2^3 + 1*2^4 + 1*2^5 + 1*2^6
= 1 + 2 + 4 + 8 + 16 + 32 + 64
</code>```

or simply 127.

P.S. The following loop:

```<code>for (address = 0; address <= 127; address++)
</code>```

loops 128 times! ;)

Body:
If I understood your question correctly, you have a problem understanding binary numbers, right?

Think of a decimal digit. A digit is only either of 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9, right? But a 7-digit number can be between 0000000 and 9999999. I presume you do understand this.

Now a decimal number, for example 2569 is actually a short form of writing like this (again in base 10 (i.e. decimal)):

9 * 10^0   +   6 * 10^1   +   5 * 10^2   +   2 * 10^3

If you have a number in another base, for example 1423 in base 5, then that is equivalent to writing the following (in base 10):

3 * 5^0   +   2 * 5^1   +   4 * 5^2   +   1 * 5^3

Which is basically the same, except all the 10s are changed for 5. That is, in the expanded form, each digit is multiplied by b^p where b is the base and p is its position in the number.

Now you know that in base 10, you have digits from 0 to 9. Similarly, in base 5, you have digits from 0 to 4. In base 2, you have digits from 0 to 1, which in other words is just 0 and 1.

So if you have a binary number like 1101, its expanded form is (in base 10):

1 * 2^0   +   0 * 2^1   +   1 * 2^2   +   1 * 2^3   = 13

If you have a 7 digit number in binary, which we normally call a 7-bit number, you can represent all numbers from 0000000 to 1111111. The first number corresponds to 0 and the second one corresponds to:

1*2^0 + 1*2^1 + 1*2^2 + 1*2^3 + 1*2^4 + 1*2^5 + 1*2^6
= 1 + 2 + 4 + 8 + 16 + 32 + 64

or simply 127.

P.S. The following loop:

for (address = 0; address <= 127; address++)

loops 128 times! ;)


问:
Electronic circuit for heating nylon fishing line muscle
I'm trying to make artificial muscles using nylon fishing lines (see http://io9.com/scientists-just-created-some-of-the-most-powerful-muscl-1526957560 and http://writerofminds.blogspot.com.ar/2014/03/homemade-artificial-muscles-from.html)

So far, I've produced a nicely coiled piece of nylon fishing line, but I'm a little confused about how to heat it electrically.

I've seen most people say they wrap the muscle in copper wire and the like, pass current through the wire, and the muscle acuates on the dissipated heat given the wire resistance.

I have two questions regarding the heating:

1) isn't copper wire resistance extremely low, and thus generates very little heat? what metal should I use?

2) what circuit should I build to heat the wire (and to control the heating)? Most examples just "attach a battery" to the wire, but afaik that is simply short-circuiting the battery, and heating the wire very inneficiently (and also may damage the battery and it could even be dangerous). So what's a safe and efficient way to produce the heat necessary to make the nylon muscle react? (I've read 150 centigrads, could that be correct?) for example with an arduino? or a simple circuit in a breadboard?

thanks a lot!

答:
For a heating element you want lower resistance -- remember $V = I R$, so high resistance means lower current, and that in turn means lower power for the same applied voltage since $P = \frac{V^2}{R}$. Resistive heating (or Joule heating) is therefore best achieved with lower resistance elements rather than higher resistance elements (see this explanation). As pointed out in Andy's answer, the preferred metal for resistive heating is nichrome.

However, you might be able to get away with using copper wire if you put it in series with two resistors (one on each end). You want to select resistors so that the voltage across the copper wire heating segment is high enough to generate the heat you want but not so high that you draw too much current.

Take a look at an AWG wire chart to figure out the maximum current for your copper wire gauge, and use that as a ballpark for starting a design. Of course make sure your resistors are also rated for their expected power based on the current.

Considering a circuit with a DC source (say a battery), a resistor, your heating element wire (which is just a resistor too), and another resistor, you have the following equation for the voltage:

$V_{applied} = 2 V_R + V_H$

Where $V_{applied}$ is the voltage of your power supply or battery, $V_R$ is the voltage across each of the two resistors, and $V_H$ is the voltage across the copper wire heating element. Since all the components are in series, we can write:

$V_{applied} = \left( 2 R + R_H \right) I$

Where $R$ is the resistor resistance, $R_H$ is the heating element resistance, and $I$ is the current.

So, if you know your applied voltage and your heating element resistance (easy to compute for a given length of copper wire), you can find the necessary resistor resistance $R$ for a desired current.

$R = \frac{1}{2} \left( \frac{V_{applied}}{I} - R_H \right)$

That desired current will be chosen so that you don't exceed the limit of the wire -- hopefully that gets hot enough. Then select resistors that have the necessary resistance and are rated for the applied power:

$P_R = I^2 R$

This has all been suggested assuming that you can regulate the applied voltage as you desire. In order to do that you'll want some kind of switch and I also suggest using an Arduino as you mention and as pointed out by Brandon J DeHart.


问:
Small IR distance sensor that works on black surfaces
Can anyone recommend an IR distance sensor that works on black surfaces? I'm looking for something to use as a "cliff" sensor, to help a small mobile robot avoid falling down stairs or off a table, and I thought the Sharp GP2Y0D805Z0F would work. However, after testing it, I found any matte black surface does not register with the sensor, meaning the sensor would falsely report a dark carpet as a dropoff.

Sharp has some other models that might better handle this, but they're all much larger and more expensive. What type of sensor is good at detecting ledges and other dropoffs, but is small and inexpensive and works with a wide range of surfaces?

答:
The problems with the Sharp sensor you've listed are: it's infra red only, and it's a digital on/off signal.

As you're hoping to detect a ledge or cliff, perhaps you could use an analogue sensor instead. Looking over the side of the ledge, we might reasonably expect the light level to change in some way, unless the room is in complete darkness - so if you suddenly detect a change in light level, you might be near the edge.

Note this may be affected by patterned carpets/tabletops though, or even by people switching the room lights... the only way is to try it and see.

Another possibility is to abandon visual sensors and use something that gently touches the floor - a flexible feeler like a cat's whisker, or a lever going down to a smooth roller or slider. But this could get tangled if there's clutter in the environment, such as loose wires or the edge of a rug.


问:
Relative orientation of two robots
Given two robot arms with TCP (Tool Center Point) coordinates in the world frame is:

$X_1 = [1, 1, 1, \pi/2, \pi/2, -\pi/2]$

and

$X_2 = [2, 1, 1, 0, -\pi/2, 0]$

The base of the robots is at:

$Base_{Rob1} = [0, 0, 0, 0, 0, 0]$

$Base_{Rob2} = [1, 0, 0, 0, 0, 0]$

(The coordinates are expressed as successive transformations, X-translation, Y-translation, Z-translation, X-rotation, Y-rotation, Z-rotation. None of the joint axes are capable or continuous rotations.)

How many degrees does the TCP of robot 2 have to rotate to have the same orientation as the TCP of robot one?

Is the calculation

$\sqrt{(\pi/2 - 0)^2 + (\pi/2 - (-\pi/2))^2 + (-\pi/2 - 0)^2}$

wrong? If yes, please specify why.

UPDATED:
is the relative orientation of the two robots [π/2,π/2,−π/2]−[0,−π/2,0]=[π/2,π,−π/2]? but the euclidean distance cannot be applied to calculate angular distance?

In other words:

While programming the robot, and tool frame is selected for motion, to match the orientation of the other one, i would have to issue a move_rel($0, 0, 0, \pi/2, \pi, -\pi/2$) command, but the executed motion would have magnitude of $\pi$?

While programming the robot, and world frame is selected for motion, to match the orientation of the other one, i would have to issue a move_rel($0, 0, 0, \pi, 0, 0$) command, and the executed motion would have magnitude of $\pi$?

答:
Applying the rotation sequence (x-y-z) that you specify, your first robot tool will have the following rotation matrix:

$R_1 = \begin{bmatrix} 0 & 0 & -1 \\ 0 & -1 & 0 \\ -1 & 0 & 0 \end{bmatrix}$

While your second robot tool will have the following rotation matrix:

$R_2 = \begin{bmatrix} 0 & 0 & -1 \\ 0 & 1 & 0 \\ 1 & 0 & 0 \end{bmatrix}$

Here is a figure to clarify, where the subscript 0 refers to the world coordinate frame, 1 refers to robot 1, and 2 refers to robot 2. Coordinate frames are shown with the x-axis in red, y-axis in green, and z-axis in blue -- grey lines show the world-frame.

There are actually infinite solutions that would rotate you from frame 1 to frame 2, but the simplest would be to rotate about the world frame x-axis by 180 degrees.

We can get that mathematically by looking at the rotation necessary to transform frame 2 to frame 1:

$R_1 = R_{2\rightarrow 1} R_2$

$R_{2 \rightarrow 1} = R_1 R^T_2$

$R_{2 \rightarrow 1} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix}$

Which can be treated as a rotation about the x-axis by angle $\phi$:

$R_{2 \rightarrow 1} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \phi & -\sin \phi \\ 0 & \sin \phi & \cos \phi \end{bmatrix}$

Where $\cos \phi = -1$ and $\sin \phi = 0$. This leads to the solution:

$\phi = n \pi$

Where $n$ is any odd integer. The smallest rotation is when $n = 1$ or $n = -1$, which corresponds to 180 degree rotation about the x-axis in either direction to bring you from frame 2 to frame 1.

On the other hand, if you consider the angle error to simply be the same as a Euclidean distance, then you get the following (evaluating the formula you give in your question):

$\varepsilon = \pi \sqrt{\frac{3}{2}}$

So why is that different? It's because translation takes place in $\mathcal{R}^3$ space while rotation takes place in $\mathcal{S}^3$ space. Euclidean distance is applicable in $\mathcal{R}^3$ space, but not $\mathcal{S}^3$ space. Rotations are non-linear and order matters, meaning most of the concepts applicable to translation are not applicable to rotation.

In some cases you can use the Euclidean distance in angular coordinates to approximate the angular error between two points, but only when the angle errors are small -- essentially linearizing the trigonometric relations $\cos \theta \approx 1$ and $\sin \theta \approx \theta$.

You cannot take two sets of Euler angles, subtract them, and use that difference as the set of Euler angles defining the rotation transformation between the two frames defined by the original angles. For example, given your defined sets of angles resulting in the difference $\begin{bmatrix} \frac{\pi}{2} & \pi & -\frac{\pi}{2} \end{bmatrix}$, those new Euler angles would yield the following rotation matrix:

$R = \begin{bmatrix} 0 & 0 & -1 \\ 1 & 0 & 0\\ 0 & -1 & 0 \end{bmatrix}$

But we already know that the rotation matrix is:

$R = \begin{bmatrix} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix}$

Once again, you simply cannot apply linear mathematics to rotations. The rotation angles give you rotation matrices, and those matrices multiply. The new rotation matrix will itself have a set of corresponding angles, and those angles are not simply the difference between the original sets. The closest you can get to what you are talking about is by using quaternions, where subsequent rotations can be "added" and "subtracted" but again using non-linear mathematics.

Title: Relative orientation of two robots


问:
What's the difference between feedback and feedforward control?
I'm reading from Astrom & Murray (2008)'s Feedback Systems: An introduction for scientists and engineers about the difference between feedback and feedforward.  The book states:

Feedback is reactive: there must be an error before corrective actions are taken.  However, in some circumstances, it is possible to measure a disturbance before the disturbance has influenced the system.  The effect of the disturbance is thus reduced by measuring it and generating a control signal that counteracts it.  This way of controlling a system is called feedforward.

The passage makes it seem that feedback is reactive, while feedforward is not.  I argue that because feedforward control still uses sensor values to produce a control signal, it is still reactive to the conditions that the system finds itself in.  So, how can feedforward control possibly be any different from feedback if both are forms of reactive control?  What really separates the two from each other?

A illustrative example of the difference between the two would be very helpful.

答:
In the simple models and block diagrams of control systems you will find in basic textbooks, they will show you a single diagram with a feedback section which uses measurements of the target parameter and a feedforward section which does not use the target paremeter.

Be ready to relax that definition when you get to the real world.

Treat it as terminology that helps you talk about a subset of a control system rather than a mathematical absolute.

In simple control, the feedback portion of your control system is that which uses measurements of the parameter you are trying to control in its calculations.

But don't forget that we use the term for systems in general. A microphone pointed at a speaker causes the system to evolve in a predictable way and we say that feedback is causing the loud noise.

So when we talk about feedback we are talking about how some characteristic of a system influences the evolution of that system.

When we talk about the feedback portion of a specific control system, we are focusing the conversation on the target parameter we are measuring and trying to control.

Feedforward control is unrelated. At least that's the best way to start discussing it. In feedforward control, we are creating some model of the system and using that to change the target parameter to what we want. If we have a perfect model of the system then we know exactly what inputs to the actuation we need to change the target parameter. There's no need to measure the target parameter. So in simple theory, feedforward control is control that does not need to use measurements of the target parameter.

But then things get messy. Creating good models is hard and we often use some sort of learning or system identification to create the model and update the model as things change. This will use measurements of the target parameter. Is it feedback? Yes. Do we call this feedback control? No.

Additionaly disturbances are always difficult to predict and if we can measure some or all of them we can improve the model for feedforward control. Are these measurements feedback? Yes. Do we call this feedback control? No.

Hopefully that gives you a little more understanding. I don't know Astrom & Murray's book, but I can see on google that quote comes from the introduction chapter. I expect that they will give you a more nuanced understanding of feedback and feedforward later.


问:
Is it possible to make DIY clone of MakerBeam
Is it possible to make clone of http://www.makerbeam.eu/ of some easy accessible material like:

wood

plywood

OSB

MDF

HDF

others

Using any type of CNC machine to mill some holes and rails in those materials may give sufficient results e.g. to make a prototype of 3D printer of such "beams".

Of course it won't be as rigid and durable but for making prototypes it may be good idea.

Just for reference: when reading this http://www.lowtechmagazine.com/2012/12/how-to-make-everything-ourselves-open-modular-hardware.html I've found this http://bitbeam.org/, this https://www.google.com/search?q=grid+beam&client=ubuntu&hs=zAr&channel=fs&source=lnms&tbm=isch&sa=X&ved=0CAcQ_AUoAWoVChMIiLHdqf2MyQIVQZoUCh1cHwV1&biw=1215&bih=927 and this http://www.gridbeam.com/, and this https://www.tetrixrobotics.com/.

答:
If you don't want to use prepared components, your best bet is using materials that benefit from economies of scale. Find one that suits you (it could be wood boards, steel pipe for plumbing or conduit, steel L or C sections, Aluminum extrusions for architecture, or plastic pipe) and then find where your local builders or tradespeople dump or recycle old material. You should be able to get it for cheap or free.

You will need to learn how to work with the materials you choose; but that is a basic requirement for trying to save money in this way.

A hand saw, a file/rasp, and a drill should be enough to get you started for tools.

Keep in mind that this puts you on a journey of learning to craft some type of material rather than experiment with 3D printing. If the 3D printing part is what's important to you, fundraise or work extra hours until you can buy a kit or a prebuilt printer.


问:
Powering 6 servomotors requiring 6V and 2A each
The title pretty much says it all.  I'm on a team that is currently building a robotic arm for the capstone project of my engineering degree, our design is similar to the Dobot (5 degrees of freedom). We purchased our 6 servomotors, and each one requires 2A at 6V.

From my preliminary research, I haven't been able to find a power source that could satisfy this.  We'd rather not purchase six individual AC/DC power source for each servo, and we've heard that these can introduce problems, as they aren't necessarily voltage-regulated.  Another suggestion we've received is to buy a computer power source, and modify it to output our the voltage and amperage we need. This raises some concerns, since our professor running the course might find this dangerous.

We'd like some input into how we can power our servos effectively, without going overboard on costs (we are students, after all).

Thanks!

答:
Search aliexpress for '6V switching power supply'. You should find 5Amp or 10Amp ones for $10-$20. Silver boxes with holes in them. You can find them on ebay as well (usually the same chinese vendors as aliexpress).

You will need to add your own AC plug.

Keep in mind that you will probably not be using 12Amps because not all motors will be at full torque at the same time.


问:
How to build a fast quadcopter?
I'm currently in a (risky) project that involves me building the fastest quad I can afford.

I'm trying to get something close to this extremely fast warpquad

After reading a lot about quadcopters, as I know I can buy all this and it should fit together and fly without any problem.

```<code>Motors: Multistar Elite 2306-2150KV
ESC: Afro Race Spec Mini 20Amp
Quanum neon 250 carbon racing frame(I love how it looks)
6Inch Props
CC3D flight controller
4S 1400mah 40-80C Battery
Any 6ch radio
</code>```

My questions are:

Am I wrong or missing something? as I had only read about it (thinking this is a common build for racer quad).

Will this overheat (bad consequences) if I let it drain the full battery at 100% throttle?

Will this fly at least 4 minutes under the previous conditions?

Should I get a higher C-rating battery?

As I can't find better motors of that size, is the only way to improve its speed by putting a 6S battery? and what would happen if I do it?

Should I put the 6inch props or 4inch? I know 4inch should get faster rpm changes but will it be noticeable at these sizes?

And in general, any tips to make it faster will be welcome.

Thanks.

答:
We lack of information to answer:

The max speed of your drone will be limited by your Thrust/Weight Ratio (not really, the maneuverability is, but your max speed is limited by the max thrust minus the hovering thrust, but I assume you want your quadrotor to be maneuverable) and the aerodynamic drag of your drone.

Any motor characteristic looks like this one. See efficiency vs torque and power vs torque. The is a peak efficiency and a peak power at 2 different torque.

If you wanted a long flight time, you would choose propellers with low torque, to use the motor at peak efficiency (but propellers with low torque may have a decreased figure of merit).

As you want max speed, you should choose propeller with higher torque, to use the motor at max power.

First, what is the speed/torque of the motor at max power ? We don't know, we need to know know load current and internal resistance of the motor. This would also allow us to get the torque constant of the motor, to check that current doesn't exceed 20A at max power. Btw, if you use a 6S battery, you'll just have more speed and torque. The motor may break due to over-speed, but it's more likely to overheat and burn, due to over-current.

What's the torque vs speed characteristic of your propeller ? I have no idea, I just know it's a 6 inch propeller.

Amateur drone design is very hard because parts sellers provide no spec. We can't do any serious engineering study without quantified data as input. Amateur drone community seems to work with a "buy, try, and share experience" methodology.

ContentLicense: CC BY-SA 4.0

Title: How to build a fast quadcopter?


答: "7-bit" is like saying "7-digit", but implies base two instead of base ten.  So, a 7-bit number can represent $2^7=128$ values in the same way that a "conventional" 7-digit number can represent $10^7=10000000$ values.  </p>

Title: Why must I loop 127 times for a "7-bit" address in this example?

Body:
I am learning about I2C on the Arduino. I was looking at a sample program to scan for I2C devices and saw this:

```<code>// This sketch tests the standard 7-bit addresses
// from 0 to 127. Devices with higher bit address
// might not be seen properly.
</code>```

With the following code.

```<code>    for(address = 0; address <= 127; address++ )
      {
        // The i2c_scanner uses the return value of
        // the Write.endTransmisstion to see if
        // a device did acknowledge to the address.
        Wire.beginTransmission(address);
        error = Wire.endTransmission();

        if (error == 0)
        {
          Serial.print("I2C device found at address 0x");
          if (address<16)
            Serial.print("0");
          Serial.print(address,HEX);
          Serial.println(" !");
    }
}
</code>```

As far as I understand it, a bit is just 1.  So, why how do 7 bits loop from 0 - 127?


问:
Forward kinematic and inverse kinematic... When to use what?
I am not quite sure if I quite understand the difference between these two concepts, and why there is a difference between these two concept.

Yesterday I was trying to compute the jacobian needed for an inverse kinematics, but the usual input I provided my transformation in the Forward kinematics being the Points P and xyz could not be applied, The transformation matrix was given a state vector Q, at which the the Tool position could be retrieved...

I am not sure if understand the concept quite well, and can't seem to the google the topics, as they usually  include terminologies which makes the concepts too simple (Angle calc and so on.. )

I know it might be pretty much to ask, but what form of input is needed to compute the jacobian ?, and what and why is there a difference between forward and inverse kinematics?..

答:
Forward kinematics uses joint angles (with known link lengths) to compute the tool position and orientation.  Inverse kinematics uses tool position and orientation, to compute joint angles.  Note:  if your device has prismatic links (the length changes) then those are used just like joint angles in the above.

To compute the Jacobian, start with the forward kinematics:

$$X = f(q)$$

Here $q$ is a vector of joint angles, and $X$ is the vector of tool position/orientation.

The Jacobian is the partial derivative of $X$ with respect to $q$.  It maps joint velocities to tool positional and angular velocities.


问:
Lifting robotic leg with only one servo
Note before I start: I have not actually put anything together yet, i'm still just planning, so any changes that require a shape change or anything like that are accepted.

I'm working on making a walking robot with my arduino and 3d printing all the pieces I need. It will have four legs, but since it needs to be mobile, I didn't want the power supply to be huge. I've decided it would be best if I can get each leg to only require 1 servo, at 5V each. I know how to get the leg to move back and forth, but i want to be able to lift it in between; before it brings the leg forward, it needs to lift up the foot.
The only thing I can think of is the rotation maybe locking some sort of gear.

When a motor begins rotating clockwise, how can I have it power a short motion to move an object toward itself, and when it begins moving counterclockwise to power the same object a short distance away from itself?

The servos I am using have 180* of rotation, so they don't go all the way around in a loop.

also: don't know if it will be important or not, but because of the peculiar construction of the foot, it would be best if it was lifted straight up, rather than up at an angle, but it isn't 100% necessary.

Are there any robots that already do this? if so, I'm unaware of them. Thanks for your time.

答:
Going forward, a Klann linkage has a near-vertical leg drop action.  (See the legs at left in the wikipedia animated GIF.)
It has a near-vertical leg lift action if running in reverse.  (See the legs at right in the illustration.)

Note, this linkage and some other leg mechanism linkages use a rotary crank; ie, rather than using a 180° back-and-forth motor, they use a motor that turns continuously in one direction.

Also see Jansen's linkage and the source links from wikipedia.

Title: Lifting robotic leg with only one servo


答:
Think of your controller as having several components:

a (mathematical) model of the system,

a measurement subsystem for detecting errors,

a method to input commands to the system.

The feedback controller uses the measured errors, computes changes to the inputs in order to squash those errors, and sends those inputs to the system.  The idea is that all of the dynamics affecting a system won't be known in advance - friction values change, disturbances are encountered, payloads are not constant, etc.  So we measure the error and eliminate it.

The feedforward controller usually wraps around the feedback controller.  Although there are many types, they all generally estimate what the system's response will be for those changed inputs computed above.  They then further "nudge" the inputs to account for the predicted additional errors in order to prevent those modeled errors from occurring.  A good example is when the system knows that the payload changes when a device picks something up - the current to the motors can be increased to account for the additional torque required without waiting for the system to begin moving (too slowly) and seeing the errors occur.

Title: What's the difference between feedback and feedforward control?

Body:
I'm reading from Astrom & Murray (2008)'s Feedback Systems: An introduction for scientists and engineers about the difference between feedback and feedforward.  The book states:

Feedback is reactive: there must be an error before corrective actions are taken.  However, in some circumstances, it is possible to measure a disturbance before the disturbance has influenced the system.  The effect of the disturbance is thus reduced by measuring it and generating a control signal that counteracts it.  This way of controlling a system is called feedforward.

The passage makes it seem that feedback is reactive, while feedforward is not.  I argue that because feedforward control still uses sensor values to produce a control signal, it is still reactive to the conditions that the system finds itself in.  So, how can feedforward control possibly be any different from feedback if both are forms of reactive control?  What really separates the two from each other?

A illustrative example of the difference between the two would be very helpful.


答:
The linkages suggested by jwpat7 are great, and I would probably prefer to use something like that. But, if you want something really simple, then you might be able to get away with a four-bar linkage like this type of thing. Although it does depend on continuous rotation, so maybe not appropriate for your application.

With a servo-motor that rotates back-and-forth, you may be able to build a mechanism similar to what I show in the figure below. The gears (shown in blue) are all free to rotate, but input from the motor will actually rotate the entire leg and foot together until hitting a mechanical stop (some limiting tab that prevents the leg from rotating further). At this point, the input motor will then transfer power by rotating the gears so that only the foot moves.

This will work when there is less torque resistance from rotating the entire leg and foot together compared to rotating the foot with respect to the leg -- assuming the inertia of the foot is small this will always work when the leg is simply moving in free space. However, if you are touching the ground (which I assume a legged robot will be...), then this might get tricky. It would then become a matter of adding more resistance to the gear transmission so that the leg still rotates until hitting the stop.

Another option would be to use some kind of cam, so that when the main input rotation reaches a given point, another arm is lifted by the cam surface to rotate only the foot. If you aren't sure what I mean then check out this video for inspiration.

Title: Lifting robotic leg with only one servo

Body:
Note before I start: I have not actually put anything together yet, i'm still just planning, so any changes that require a shape change or anything like that are accepted.

I'm working on making a walking robot with my arduino and 3d printing all the pieces I need. It will have four legs, but since it needs to be mobile, I didn't want the power supply to be huge. I've decided it would be best if I can get each leg to only require 1 servo, at 5V each. I know how to get the leg to move back and forth, but i want to be able to lift it in between; before it brings the leg forward, it needs to lift up the foot.
The only thing I can think of is the rotation maybe locking some sort of gear.

When a motor begins rotating clockwise, how can I have it power a short motion to move an object toward itself, and when it begins moving counterclockwise to power the same object a short distance away from itself?

The servos I am using have 180* of rotation, so they don't go all the way around in a loop.

also: don't know if it will be important or not, but because of the peculiar construction of the foot, it would be best if it was lifted straight up, rather than up at an angle, but it isn't 100% necessary.

Are there any robots that already do this? if so, I'm unaware of them. Thanks for your time.


答:
There is a handy online Calculator I use to answer such questions. I tried with the data you provided (and had to lookup specs on your motors). I can offer the following insights, but I am only guessing about your model's all-up weight.

If we assume it is roughly 800g with 6x3 props:

max speed: ~66km/h

additional payload: 934g (of course this will affect top speed)

mixed flight time: 3.9min

Everything seems within spec with this data (ie. nothing will burn up, overheat, or be over or under driven)

It probably won't fly at all with 4 inch props (no matter what pitch).

Your flight time is quite low, you might consider a larger battery.

The calculator I used is eCalc

I strongly recommend spending some time with a calculator like that and trying experiments by adjusting only 1 dimension at a time, say motors or battery or props to see what effect it will have on the model before settling on your particular setup. I think that choosing the best motors is always the hardest choice as there are a lot of variants. The calculator has a lot of predefined motor specs by brand/model so you can try different motors quickly. Not all brands are covered though so its good to have access to your motors actual specs if necessary.

Title: How to build a fast quadcopter?

Body:
I'm currently in a (risky) project that involves me building the fastest quad I can afford.

I'm trying to get something close to this extremely fast warpquad

After reading a lot about quadcopters, as I know I can buy all this and it should fit together and fly without any problem.

```<code>Motors: Multistar Elite 2306-2150KV
ESC: Afro Race Spec Mini 20Amp
Quanum neon 250 carbon racing frame(I love how it looks)
6Inch Props
CC3D flight controller
4S 1400mah 40-80C Battery
Any 6ch radio
</code>```

My questions are:

Am I wrong or missing something? as I had only read about it (thinking this is a common build for racer quad).

Will this overheat (bad consequences) if I let it drain the full battery at 100% throttle?

Will this fly at least 4 minutes under the previous conditions?

Should I get a higher C-rating battery?

As I can't find better motors of that size, is the only way to improve its speed by putting a 6S battery? and what would happen if I do it?

Should I put the 6inch props or 4inch? I know 4inch should get faster rpm changes but will it be noticeable at these sizes?

And in general, any tips to make it faster will be welcome.

Thanks.


问:
Mapping between camera pose and image features in visual servoing
I have a robotic arm and a camera in eye-in-hand configuration. I know that there is a relationship between the body velocity $V$ of the camera and the velocities $\dot s$ in the image feature space that is $\dot s=L(z,s) V$ where $L$ is the interaction matrix. I was wondering if one can find a mapping (a so called diffeomorphism) that connects the image features' vector $s$ with the camera pose $X$. All I was able to find is that it is possible to do that in a structured environment which I don't fully understand what it is.</p>

答:
Look up Camera Space Manipulation, which uses the pinhole camera model to map image space and physical space coordinates.  It is not too difficult to do.  </p>

<p>A structured environment is one in which objects which occupy the environment are known, and can be modelled.   It is much easier to program mobility, and to identify objects, in a structured environment.   For example, if you know that a particular circular object has a given diameter, you can use that object's elliptical shape in camera space to determine viewing angle, and dimensions to determine distance between the circle and the camera.  But if you don't know the model of that object, you can't be sure if it is a circle viewed from an angle, or an ellipse viewed head-on.   Therefore unstructured environments are much more difficult for relating camera space coordinates and physical coordinates.  </p>

Body:
Look up Camera Space Manipulation, which uses the pinhole camera model to map image space and physical space coordinates.  It is not too difficult to do.

A structured environment is one in which objects which occupy the environment are known, and can be modelled.   It is much easier to program mobility, and to identify objects, in a structured environment.   For example, if you know that a particular circular object has a given diameter, you can use that object's elliptical shape in camera space to determine viewing angle, and dimensions to determine distance between the circle and the camera.  But if you don't know the model of that object, you can't be sure if it is a circle viewed from an angle, or an ellipse viewed head-on.   Therefore unstructured environments are much more difficult for relating camera space coordinates and physical coordinates.


答:
Let me give you a mathematician's perspective on the difference between the two kinds problems.

Forward kinematics asks the question: given a certain input (i.e. control command), what will be the output (i.e. robot configuration, pose, etc.). Inverse kinematics asks the reverse question: given a certain desired output, what is the necessary input.

Inverse problems are usually much harder to solve (e.g. ill-conditioned or otherwise ill-posed) than forward problems1. This is true not only of kinematics, but also dynamics and a wide range of computational problems as well.

Consider the following analogy. Let's assume we are given a basic algebraic function $f(x)=x^3-5x+1$.  Forward kinematics is like asking to find $f(2)$.  It's easy to do because the equation is already given and all we need to do is substitute the input to get the output. Kinematic equations are also this way:  designed to convert inputs into outputs easily. Inverse kinematics is like asking to solve the equation $f(x)=2$. It's not as easy to find the answer.  Going backwards to find the input that gives a specific output is non-trivial.  An answer may not even exist. If it does exist, it may not be unique. You may require additional information (e.g. regularization) to obtain a unique solution with desirable characteristics.

Often, it's impossible to solve inverse kinematics analytically. This is especially for true for serial arm linkages. This means that you will need a numerical method to solve a system of non-linear equations of the form $F(X)=0$.  Borrowing from calculus, we can use Newton's method. In higher dimensional spaces, Newton's method requires formulating the Jacobian (or at least the approximate Jacobian) of $F(X)$.

Notes

1. For parallel arms (such as a Delta arm or Stewart platform), the difficulty is reversed (i.e. inverse kinematics is straightforward, whereas forward kinematics is more tricky). In general, one of the two problems (either forward or inverse) will always be harder to solve than the other.

Title: Forward kinematic and inverse kinematic... When to use what?

Body:
I am not quite sure if I quite understand the difference between these two concepts, and why there is a difference between these two concept.

Yesterday I was trying to compute the jacobian needed for an inverse kinematics, but the usual input I provided my transformation in the Forward kinematics being the Points P and xyz could not be applied, The transformation matrix was given a state vector Q, at which the the Tool position could be retrieved...

I am not sure if understand the concept quite well, and can't seem to the google the topics, as they usually  include terminologies which makes the concepts too simple (Angle calc and so on.. )

I know it might be pretty much to ask, but what form of input is needed to compute the jacobian ?, and what and why is there a difference between forward and inverse kinematics?..


答:
Image features are connected to the camera pose through two steps: (1) the relationship between the feature pixel coordinates and its homogeneous coordinates in the camera reference frame, and (2) the relationship between the camera reference frame and the world frame. Take a look at this figure, where the world frame is denoted with subscript 0 and the camera frame is denoted with subscript C. A feature is shown as a blue dot, with position $p$ in the world frame.

The camera has a particular field of view (shown with a pyramid in the image), which relates the pixels coordinates to the relative position of the feature in the camera reference frame, $\tilde{p}$, through the camera projection matrix:

$\begin{bmatrix} I \\ J \\ 1 \end{bmatrix} = \begin{bmatrix} k_x & 0 & C_x \\ 0 & k_y & C_y \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} X \\ Y \\ 1 \end{bmatrix}$

Where $I$ and $J$ are the pixel coordinates of the feature in the image, and the camera is defined with parameters $k_x$, $k_y$, $C_x$ and $C_y$ (based on the field of view and output image size). The homogeneous coordinates, $X$ and $Y$ are defined based on the relative position of the feature in the camera frame:

$\tilde{p} = \begin{bmatrix} \tilde{x} \\ \tilde{y} \\ \tilde{z} \end{bmatrix}$

$X = \frac{\tilde{x}}{\tilde{z}}$

$Y = \frac{\tilde{y}}{\tilde{z}}$

That relative position of the feature is then related to the actual position of the feature (in the world frame) as well as the camera pose, according to:

$p = R_C \tilde{p} + p_C$

Where $R_C$ is the rotation matrix defining the camera orientation and $p_C$ is the position of the camera.

One thing I have not discussed is lens distortion, which must be accounted for before using this approach but can be treated separately. Note that the OpenCV Camera Calibration and 3D Reconstruction page provides a more detailed explanation.

Title: Mapping between camera pose and image features in visual servoing

Body: I have a robotic arm and a camera in eye-in-hand configuration. I know that there is a relationship between the body velocity $V$ of the camera and the velocities $\dot s$ in the image feature space that is $\dot s=L(z,s) V$ where $L$ is the interaction matrix. I was wondering if one can find a mapping (a so called diffeomorphism) that connects the image features' vector $s$ with the camera pose $X$. All I was able to find is that it is possible to do that in a structured environment which I don't fully understand what it is.</p>


问:
How to connect absolute encoder on the rotating shaft. Please see the three options?

Hi,
Here I have added 2 options for connecting encoder on shaft.
Motor, gearhead and shaft is connected using coupling. But where will be best place for encoder (To avoid backlash from coupling and gearhead).
whether through hollow encoder is available? (see option 1).
I dont know which one will be best for this kind of system.
Which one is widely using arrangements?

Options 3 is Encoder will be placed before the motor.

答:
Most gear motors with integrated encoders have them placed on the motor shaft, which allows for much finer angle resolution at the output but does not account for backlash. I think this is what you mean by option 3.

Both options 1 and 2 are basically the same thing, with the only difference being that option 2 will account for any elasticity (twisting) in the shaft. Backlash will be measured with both options 1 and 2, since you are measuring the actual angle of the shaft. However, with option 3 you will be measuring the motor shaft angle and therefore need to multiply by the gear ratio to get the output angle -- plus backlash and elasticity will not be measured.

Also, yes you can get hollow shaft encoders, such as this one.


问:
What engineering problems needs to be solved to build a potato-peeling robot?
OK, let's say we have a tech request for a robotic system for peeling potatoes, and a design is as follows:

One "arm" for picking up a potato and holding it, rotating when needed.

Another "arm" for holding a knife-like something which will peel the skin from the potato.

Arm picks up a potato from first container, holds it over trash bin while peeling, then puts peeled potato in second container.

For simplicity a human rinses peeled potatoes, no need to build automatic system for it.

In first iteration even 100% spherical peeled potatoes are OK, but ideally would be good to peel as little as possible, to minimize the wastes.

Question:
I know that we're very, very far away from building such a system. Nevertheless, what are the purely technical difficulties which needs to be solved for such a robot to be built?

EDIT

Let's assume we stick to this design and not invent something radically different, like solving the problem with chemistry by dissolving the skin with something. I know that the problem of peeling the potatoes is currently being solved by other means - mainly by applying friction and a lot of water.

This question is not about it. I am asking specifically about the problems to be solved with the two-arms setup using the humanlike approach to peeling.

答:
There are many difficulties to overcome.  As others have shown, this problem seems like it is well-suited for fixed automation rather than robotics.  I spent considerable time working on telerobotics in the 1980s, and you will be encountering many of the same issues we dealt with then.  Here are a few off the top of my head:

presenting potatoes to the arm individually (or worse, trying to pick them from a bulk collection of potatoes)

protecting from the starches, juices, dirt, and other contaminants that will be thrown around during the peeling process

peeling potatoes that have bulges

peeling potatoes that have concave and convex sections

ensuring growing eyes don't interfere with the cutting

repositioning the potato so you can peel the ends that you were holding when the main part of the potato was peeled

change in friction characteristics between gripping the skin and gripping the already-peeled section

dealing with the size differences (both in gripping and in cutting)

controlling the force between the blade and the potato skin (you can't just program positions because of the size variability)

sizing the cutting blade:  too large and you will either miss indented sections, or remove too large of the outdented sections; too small and your process time will suffer

coordinating between the robot and the blade: how do you ensure your force is correct?  That is probably easiest to do at the blade.  But this means the position of the blade will change as it responds to varying forces, so the wrist might need to account for that.

stability of your grasp (while leaving enough open space for the blade)


问:
Crock Pot Knob Turner
I have a Crock Pot with an analog knob and would like to find a way to turn the knob by using and appliance timer. I have no idea where to begin. I need help.
Thanks</p>

答:
If your analog knob just turns a potentiometer, then you can replace that device with a digital potentiometer (for example, this:  http://www.microchip.com/wwwproducts/Devices.aspx?product=MCP4161).  You need to make sure the Ohm range of your analog potentiometer is covered by the capabilities of the digital potentiometer.  They are typically controlled via commands from a microcontroller.  You can also see if you can find a voltage-controlled resistor (varistor) that covers the range you need.  I've never tried to do that with a varistor, though.

If your analog knob is like the one on my crock pot, then it really isn't analog.  It's a four-position switch.  You can use any little control card with digital outputs to replace that.  Be careful, though, you might need to throw relays in between your digital output and the signal lines, depending on the characteristics of the device that receives the output of the knob.

Title: Crock Pot Knob Turner


问:
Getting pitch, yaw and roll from Rotation Matrix in DH Parameter
I've calculated a DH Parameter matrix, and I know the top 3x3 matrix is the Rotation matrix. The DH Parameter matrix I'm using is as below, from https://en.wikipedia.org/wiki/Denavit%E2%80

Above is what I'm using. From what I understand I'm just rotating around the Z-axis and then the X-axis, but most explanations from extracting Euler angles from Rotation matrixes only deal with all 3 rotations. Does anyone know the equations? I'd be very thankful for any help.

答:
In general, Euler angles (or specifically roll-pitch-yaw angles) can be extracted from any rotation matrix, regardless of how many rotations were used to generate it. For a typical x-y-z rotation sequence, you end up with this rotation matrix where $\phi$ is roll, $\theta$ is pitch, and $\psi$ is yaw:

$R = \begin{bmatrix} c_\psi c_\theta & c_\psi s_\theta s_\phi - s_\psi c_\phi & c_\psi s_\theta c_\phi + s_\psi s_\phi \\ s_\psi c_\theta & s_\psi s_\theta s_\phi + c_\psi c_\phi & s_\psi s_\theta c_\phi - c_\psi s_\phi \\ -s_\theta & c_\theta s_\phi & c_\theta c_\phi \end{bmatrix}$

Note that $c_x = \cos x$ and $s_x = \sin x$.

To get roll-pitch-yaw angles out of any given numeric rotation matrix, you simply need to relate the matrix elements to extract the angles based on trigonometry. So re-writing the rotation matrix as:

$R = \begin{bmatrix} R_{11} & R_{12} & R_{13} \\ R_{21} & R_{22} & R_{23} \\ R_{31} & R_{32} & R_{33} \end{bmatrix}$

And then comparing this to the above definition, we can come up with these expressions to extract the angles:

$\tan \phi = \frac{R_{32}}{R_{33}}$

$\tan \theta = \frac{-R_{31}}{\sqrt{R_{32}^2 + R_{33}^2}}$

$\tan \psi = \frac{R_{21}}{R_{11}}$

When you actually solve for these angles you'll want to use an atan2(y,x) type of function so that quadrants are appropriately handled (also keeping the signs of the numerators and denominators as shown above).

Note that this analysis breaks down when $\cos \theta = 0$, where there exists a singularity in the rotation -- there will be multiple solutions.

Also note that your question is referring to the rotation transformation between two joints ($^{n-1}R_n$), which is indeed composed of an x-axis and z-axis rotation, but the actual rotation of that joint with respect to the base will be different ($^0R_n$) and composed of all the rotations for joints 1 to $n$. I point this out because $^{n-1}R_n$ can be decomposed back into the relevant x-axis ($\alpha$) rotation and z-axis ($\theta$) rotation, whereas $^0R_n$ is better suited to roll-pitch-yaw -- especially for the end-effector.


答: The comments in this example are not quite clear. I2C uses 7-bit or 10-bit addresses. This example simply walks through the address possibilities of a 7-bits only, 0-127 decimal or (0x00-0x7f hex), and tries to read the status from each one. If 'no error' is encountered, it means a valid device(slave) was found at that address. It does not look at 10-bit addresses.</p>


问:
What are the approaches for indoor robot positioning?
I understand that most of the self-driving cars solutions are based on Lidar and video SLAM.

But what about robots reserved for indoor usage? Like robot vacuums and industrial AGVs? I see that Lidar is used for iRobot and their latest version uses VSLAM. AGVs also seem to use Lidar.

答: That's about it for mainstream robots. Lasers, Cameras, Inertial Measurement Units (IMUs), and odometry or kinematic updates. </p>


答:
what metal should I use?

Copper wire works better than nichrome wire, according to
Homemade Artificial Muscles IV.
That says

Nichrome is used in places like your toaster mainly because it can get
  very hot without melting or oxidizing. But I don't need or want the
  heating elements in my artificial muscles to be red-hot. I would like
  to be able to use them in low-voltage systems, say 5-6V. The amount of
  resistive heat you can get out of a wire is proportional to the amount
  of power you pump into it. And since P = V^2/R, increasing resistance
  when voltage is fixed will decrease your power. All else being equal
  (same power supply, same length and diameter of wire, same
  environment), a copper wire will produce more heat, faster, than a
  nichrome wire. Copper also has better thermal conductivity than
  nichrome, meaning it will cool more quickly after the power is turned
  off.

To answer your question,

1) isn't copper wire resistance extremely low,

Not the kind of copper wire used in artificial muscles.

Common copper in-wall power cables are often 10 AWG copper wire, with a resistance of about 3 milliohms per meter, which is extremely low.
Common wire-wrap wire (30 AWG copper wire) has a resistance of 339 milliohms per meter, which is two orders of magnitude more resistance.

People who build artificial muscles use much thinner strands of copper, which have much more resistance per meter -- often a single strand pulled from litz wire or tinsel wire.

and thus generates very little heat?

Power supplies are typically designed to set a fixed voltage.
Once the voltage has been fixed, a lower load resistance generates more heat.

On the other hand, when you wire up your heater circuit, every element of the circuit -- the heater strand itself, as well as the wire from each end of the heater strand back to the power supply -- has the current through it.
Because of conservation of electrons, the same number of electrons per second go through each element.
For a given current, a higher load resistance generates more heat.
Therefore, you want the connection wire between your power supply and the heater strand to be much lower resistance and therefore much thicker than the heater strand, so heater strand is the only element that gets noticeably warmer than ambient temperature.

2) what circuit should I build to heat the wire (and to control the
  heating)? Most examples just "attach a battery" to the wire, but afaik
  that is simply short-circuiting the battery, and heating the wire very
  inneficiently (and also may damage the battery and it could even be
  dangerous). So what's a safe and efficient way to produce the heat
  necessary to make the nylon muscle react? (I've read 150 centigrads,
  could that be correct?) for example with an arduino? or a simple
  circuit in a breadboard?

Yes, short-circuiting a battery with a very low load resistance can damage the battery.
To prevent the internal resistance of the battery from heating up the battery enough to cause damage,
Use heater wires that have much higher resistance than the internal resistance of the battery.
Or in other words,
Pick a battery or other power source with an internal resistance much lower than the load resistance of the heater wires.

The Homemade Artificial Muscles IV article says

I'm powering it with a 3V wall wart, and it is drawing 1.17 A.

which implies that the total load about 2.5 Ohms.

(I expect the heater strand is about 2 Ohms of resistance,
every connection has about 0.1 Ohms of resistance,
and the total resistance of all the hook-up wires and the stuff inside the wall wart is maybe around 0.1 Ohms of resistance).

Lots of power supplies (wall warts, batteries, etc.) can easily supply 3V at well over 2 A without getting noticeably warm, much less hot enough to cause any damage.

The article
"How to Make an Artificial Muscle Out of Fishing Line"
suggests

"it’s best to stay below 150 °C or 300 °F ..."

The article
"Artificial Muscles from Fishing Line and Sewing Thread"
says that they got maximum contraction "at ~130°C",
and most of their tests cycled the temperature of their artificial muscles "between 25° and 95°C".

An Arduino could easily indirectly control a MOSFET or a relay that could handle a few amps of current.
(The high current would go through a circuit that includes only that switching element and the heating strand and the power supply and the thick connector wires between them.
Directly sending over an amp (1 A) through an Arduino or a solderless breadboard would damage those boards).

If you can't get a circuit working after searching the internet for "Arduino relay" or "Arduino mosfet" circuits, come back and ask a separate question.


问:
Which USB interface for Android device I can use for motor driver
I am new to robotics,
I will be controlling DC motors from Android device through USB

For this I have selected L298N motor controller(After watching YouTube videos )
And got some DC motors

I have no idea how do I connect this to Android device via USB cable

Help appreciated

Ref:
https://www.bananarobotics.com/shop/L298N-Dual-H-Bridge-Motor-Driver
https://youtu.be/XRehsF_9YQ8

PS: All I know is programming android

答:
What you want cannot be simply done by using an Android device and a USB cable. You will need a micro controller to process the instruction sent from your mobile device and then control the motor movement.

The android device will communicate to the arduino using say Bluetooth(although there are many other alternatives you can select), the arduino will process your instruction sent over bluetooth and then as per your logic it will drive the motor.

To control L298N a single motor using L298N you will use the input terminals 1&2. These will be connected to your micro controller. The motor terminals will be connected to the Output 1 & 2.
Check this image of a micro controller being connected to a motor driver.
 Motor Driver -> Motors">

L298N is usually used for motors which have a higher current requirement, thus you will also have to look for alternate power supply arrangements too.

P.S. If your motors don't require a lot of power you may consider using L293D which is simpler to use than L298N.

Body:
What you want cannot be simply done by using an Android device and a USB cable. You will need a micro controller to process the instruction sent from your mobile device and then control the motor movement.

The android device will communicate to the arduino using say Bluetooth(although there are many other alternatives you can select), the arduino will process your instruction sent over bluetooth and then as per your logic it will drive the motor.

To control L298N a single motor using L298N you will use the input terminals 1&2. These will be connected to your micro controller. The motor terminals will be connected to the Output 1 & 2.
Check this image of a micro controller being connected to a motor driver.

L298N is usually used for motors which have a higher current requirement, thus you will also have to look for alternate power supply arrangements too.

P.S. If your motors don't require a lot of power you may consider using L293D which is simpler to use than L298N.


问:
Quadrocopter problem with stability
I'm building quadcopter from scratch, software is implemented on STM32F4 microcontroller. Frequency of main control loop equals 400Hz.

I've though everything is almost finished but when i've mounted everything and started calibration of PIDs i faced a problem.
It was impossible to adjust PID parameters properly.
So i started test with lower power (not enough to fly) and i've managed quite fast adjust PID for roll but when i've increased power problems with control came back.

After that i've done more measurements.

I didn't make test with blades but probably this is even worse and that is why i cannot calibrate it.

If problem is due to vibration how can i fix it?

If something else is cause of that symptom, what is it?

Can i solve this through better controls and data fusion algorithms?
Now i use complementary filter for acc and gyro sensors data fusion in roll and pitch.

答:
You have far too much vibration reaching your sensors. Mount the board you're using with vibration damping mounts, this should solve most of your problem. An easy way to do this is to attach each corner of your board to the frame using a small but thick piece of double stick squishy foam[1]. The board will now act as a spring mass damper attached to your frame. By making the pieces of foam narrower you will increase the cutoff frequency of the system. Here is a link to an arducopter page talking about vibration damping to solve this problem[2].

While a complementary filter may be suitable for your application, the correct tool for estimating attitude is a kalman filter capable of handling nonlinear system dynamics and measurement dynamics. The pixhawk uses an extended kalman filter to estimate attitude[3]. It may be overkill for your system depending on how far you want your quad to deviate from level hover.

[1]http://hobbyking.com/hobbyking/store/__26457__anti_vibration_foam_orange_latex_190mm_x_140mm_x_6mm.html

[2]http://copter.ardupilot.com/wiki/common-vibration-damping/

[3]https://pixhawk.org/firmware/apps/attitude_estimator_ekf

Title: Quadrocopter problem with stability


问:
Arduino Motor control
I'm working on a rather low budget project, and need some way to control four or more motors using one Arduino. I've looked at motor shields a little, but I have a shield on top of it already, It does have female input on the top though, so a motor shield may work. Any suggestions?</p>

答:
For a good budget solution used 2 L298D Motor Controller IC chips. Each chip can control 2 motors. They implement an H-Bridge and so can drive motors in forward or reverse and incorperate diodes for current protection and so are safer than implementing a DIY H-Bridge with transistors.

They are simple to use and you could make your own motor board for a fraction of the cost of the motor shields.

Title: Arduino Motor control


答:
Dead Reckoning:

Robot moves and counts its steps (or better said the rotation of its wheels), it tends to drift with longer distances. Can be made robuster by fusing information from an IMU (acceleration plus rotation speed) Needs an exact position initialization, especially the rotation angle.

Montecarlo localization:

Using a known map, the robot compares what it observed using its lidar and tries to fit it to the map, the result is a probabilistic state estimation that tends to converge as the robot moves. It needs an expensive lidar. Can be done with a kinect though. Needs a rough position initialization most of the times.

Purely visual methods:

Observe environment with a camera and find features that belong to one specific position. Not very scalable and needs a lot of computing power. Most of the time not very accurate positioning, but can be used as position initialization for other algorithms.

There is also plenty of other methods that require an additional infrastructure like installing bluetooth beans all over the building, or using Wifi routers if they are already there. Many companies also offer solution with magnetic wires installed under the floor that robots can detect. RFID tags are also another cheap solution but not so accurate. Another classical approach is using AR markers combined with a monocular camera, a cheap localization system with a high accuracy.

Title: What are the approaches for indoor robot positioning?

Body:
I understand that most of the self-driving cars solutions are based on Lidar and video SLAM.

But what about robots reserved for indoor usage? Like robot vacuums and industrial AGVs? I see that Lidar is used for iRobot and their latest version uses VSLAM. AGVs also seem to use Lidar.


答:
For drone tracking my institute uses the commercial system OptiTrack. It uses cameras and special markers placed on the robot and/or other objects to localize them. They have a high precision:

OptiTrack’s drone and ground robot tracking systems consistently produce positional error less than 0.3mm and rotational error less than 0.05°.

Therefore this system is also used as a ground truth to compare and verify other localization algorithms.


问:
Problems about Complementary Filter IMU tuning
I'm developing a project consists of an IMU controlled by Arduino through which you can send via a radio module, the data to the PC of the three Euler angles and raw data from the sensors.
For filtering I used the code made available by SparkFun: Razor AHRS 9 dof

https://github.com/ptrbrtz/razor-9dof-ahrs/tree/master/Arduino/Razor_AHRS

The code does not provide radio transmissions and is tuned for 50 Hz sampling rate, in fact its parameters are:

```<code>// DCM parameters
#define Kp_ROLLPITCH (0.02f)
#define Ki_ROLLPITCH (0.00002f)
#define Kp_YAW (1.2f)
#define Ki_YAW (0.00002f)
</code>```

in this project data is read every 20ms (50Hz) and records of the sensors are set to the accelerometer odr 50hz and 25 bandwidth. with the gyroscope 50 Hz odr.
In my project I used a gyroscope different, namely that I used L3G4200D frequency odr starting at 100Hz, I set then registers with the 100Hz. My global data rate is 33Hz max, beacouse the use of a radio, i read the complete date with a frequency of 33Hz.
How can i tune the Ki and Kp of my setup? the Kp is the period, I have to consider the frequency odr that I set to register in the individual sensors or i have to set the global system sample rate limited to 33Hz by the radio transmission?

答:
the Kp is the period

No it's not, Kp is a proportional gain. If your sampling times are very stable, then it becomes possible to modify gains because of the associative properties of multiplication and division. For a PID controller:

$$
\mbox{Controller Output = Proportional Term + Integral Term + Derivative Term} \\
$$
$$
\mbox{Controller Output} = k_P*e_P + k_I*e_I + k_D*e_D \\
$$

where $e_P$, $e_I$, and $e_D$ are the proportional, integral, and derivative error terms, as defined by:

$$
e_{P_k} = \mbox{reference - output} \\
e_{I_k} = e_{I_{k-1}} + e_{P_k}*dT \\
e_{D_k} = e_{P_k}/dT \\
$$

Note that there is no $dT$ term in the proportional error equation! So you do not tune the proportional gain for any given sample time. $k_P$ should always be the same $k_P$. If the starting errors are all set to zero, then the first sample ($k = 1$) for integral and derivative gains should look like the following:

$$
e_{I_1} = e_{I_{0}} + e_P*dT \\
e_{I_1} = 0 + e_P*dT \\
e_{D_1} = e_P/dT \\
$$

Here, because derivative gain never "remembers" any previous states, it should be clear that you can move the sample rate into the gain as follows:

$$
\mbox{Derivative Term} = k_D*eD \\
\mbox{Derivative Term} = k_D*(e_P/dT) \\
\boxed{\mbox{Derivative Term} = (k_D/dT)*e_P} \\
$$

For the integral error, because the initial error is set to zero, try writing out the first few samples to get the pattern:

$$
e_{I_1} = 0 + e_{P_1}*dT \\
e_{I_1} = e_{P_1}*dT \\
$$

$$
e_{I_2} = e_{I_1} + e_{P_2}*dT \\
e_{I_2} = e_{P_1}*dT + e_{P_2}*dT \\
$$

$$
e_{I_3} = e_{I_2} + e_{P_3}*dT \\
e_{I_3} = e_{P_1}*dT + e_{P_2}*dT + e_{P_3}*dT \\
$$

And so again, if the sample rate is constant, you can simplify:

$$
e_{I_N} = \left( \Sigma_{i=1}^N  e_{P_i} \right) *dT
$$

Which gives:

$$
\mbox{Integral Term} = k_I * e_I \\
\mbox{Integral Term} = k_I * \left( \left( \Sigma_{i=1}^N  e_{P_i} \right) *dT \right) \\
\boxed{ \mbox{Integral Term} = \left( k_I *dT \right) * \left( \Sigma_{i=1}^N  e_{P_i} \right) }\\
$$


问:
Implementing a torque-controlled method on a position-controlled robot
I am working with a position-controlled manipulator. However, I want to implement a torque-controlled method on this robot. Is there any way to convert a torque command to a position command?

I try to find research papers on this but I have no idea where I should start or which keywords I should use in searching. Do you have any suggestion?

答:
Check out this paper by Oussama Khatib, Peter Thaulad, Taizo Yoshikawa and Jaeheung Park from the Stanford Artificial Intelligence Laboratory:

Torque-position transformer for task control of position controlled robots


问:
How can I increase the resolution of a PWM signal?
Say I have a motor and I want it to spin at exactly 2042.8878 revolutions per minute.  Say I have a very precise sensor to detect the RPM of the motor to a resolution of 1/1000th of a revolution per minute.

Can I produce a PWM signal which can match the speed to that degree of
precision?

What variables in the signal parameters would I have to adjust to get the precision if possible?

Would I have to use additional circuitry between the motor and the driver?

Would I have to design the signal/circuitry around the specific specifications of the motor?

Should I just use a stepper motor?

This is assuming I am using a microcontroller to measure the motor's speed and adjust the signal in real-time to maintain a certain speed.

答:
The PWM signal should not be the limiting factor in achieving the accuracy you seek.  For some applications, PWM signals are chopped > 100 kHz, so, given the correct DSP or microcontroller output to create the PWM, you will have as much control over the power going into the motor as you need.

Most of the motion control system I've built have had PWM amplifiers between the microcontroller and the motor.  If you don't have those amplifiers, then yes, you will need to put additional circuitry between your controller and your motor.  You can get these off-the-shelf, or you can chop a power FET (often using another FET to get the speed) based off of a variable duty-cycle pulsed signal.  It is this chopping signal that you will adjust to drive more, or less, power into your motor.  If your system's load varies greatly, you may need to put a control loop around this signal so you can keep it stable.  See Brian's references about speed control of motors.  Loops similar to those position and speed control loops would be used to dampen the rate of change of your PWM driver.

I think you need to look at your specifications, though.  If your sensor has a shaft rotation resolution of 1/1000 rpm, how will you ever control the shaft to a speed of XXXX.YYYY (1/10,000 rpm accuracy)?

For a continuous-rotation application, a stepper might be a better solution.  It is brushless for long life, easy to control, and has its own type of feedback.  But you need to be sure to get enough pulses per revolution to get the accuracy you're looking for.  If you have a 512 pulse/rev stepper, that is only ~ 30k pulses/min.  With that you can barely achieve a speed accuracy of 1/10k.


答:
You won't ever get 'exactly' 2042.8878 RPM, so going with your measurement accuracy I will assume you mean 2042.8878 +/- 0.0005 RPM. This is approximately an error of 1 part in 4 million. So let's assume you can set up a timer which counts up to around 4 million and resets, and use that for the PWM. Assuming a two pole motor, 2042 RPM is 34 electrical rotations per second, and you would want to PWM it at with about ten PWM cycles per electrical rotation, so your PWM timer needs to increment (4 million * 10 * 34 ) times per second, equivalent to 1.4 GHz.

There are microcontrollers with that sort of clock frequency, so it is not downright impossible. You'd also have to do the PID control to calculate what the value should be, and doing that to one part in 4 million will take a time to settle.

Stepper motors typically don't run that fast - torque drops to zero around 1200 RPM, though some specialist steppers can run faster ( see SteveO's comment below ).

Brushless motors would require commutation through six phases, and ideally have a several PWM cycles per phase, so would need around six times the timer frequency and so be out the range of simple PWM.

You can also dither the PWM so of the ten per phase energised you stretch n to give one more digit; this would reduce the clock required by a factor of 10 so may make it practical, but it's not trival to control to that level of accuracy.

Title: How can I increase the resolution of a PWM signal?

Body:
Say I have a motor and I want it to spin at exactly 2042.8878 revolutions per minute.  Say I have a very precise sensor to detect the RPM of the motor to a resolution of 1/1000th of a revolution per minute.

Can I produce a PWM signal which can match the speed to that degree of
precision?

What variables in the signal parameters would I have to adjust to get the precision if possible?

Would I have to use additional circuitry between the motor and the driver?

Would I have to design the signal/circuitry around the specific specifications of the motor?

Should I just use a stepper motor?

This is assuming I am using a microcontroller to measure the motor's speed and adjust the signal in real-time to maintain a certain speed.


问:
Pole-balancing / inverted-pendulum; is there a need for active control?
Not sure if I am posting this question in the correct community, as it relates primarily to reinforcement learning. Apologies early on if this is not so.

In reinforcement learning many algorithms exist for 'solving' the cart-pole problem; that of balancing a mass on the edge of a stick, connected to a cart on a hinge, which has 1 DoF. There is TD learning, Q-learning and many other on and off-policy methods. There is also the more recent, model-based policy search method PILCO.

What I am really wondering, I suppose is more of a physics question: is there a need for active control? Why is it not possible to find the one point for the cart, which prevents the mass to move, even incrementally, left or right as it sits atop the pole? Why does it always 'fall'?

答:
Your question might be better suited to another forum, but is definitely important for robotics in general. You are basically talking about unstable equilibrium, where there does exist a point where the pole is balanced, but any small perturbation (random unforeseen input like wind or vibration) will cause it to diverge away from that balance.

This is one reason why active control is necessary. But even if the pole were a regular pendulum hanging down (with a stable equilibrium point), you still might want active control to stop it from swinging around too much. In the end, active control is what you need if you want to change the system dynamics -- whether that means going from unstable to stable or just improving the response for desired performance.

When you consider this in the context of reinforcement learning, you can think about active control as the input you still need for certain actions to account for effects that cannot be modelled. For example, driving a car involves learned actions that you simply just "do" without any real active control, like moving your eyes to look in the rear-view mirror. However, it also involves lots of active control to react to the changing environment (otherwise you could drive around blind-folded).

Take a look at combined feedback and feed-forward control, where the former is the active control and the latter representative of learned inputs.


答:
Using a hardware PWM system based on a comparison-voltage source, a triangle-wave generator, and a comparator, you can set as many different output levels as your comparison-voltage source can generate.  A charge-transfer system like that diagrammed below can be used to develop almost arbitrarily many different levels.

In operation, the voltage on C1 supplies one input to a comparator, via a unity-gain buffer.  A triangle wave oscillator supplies the other input, generating a PWM signal.

The voltage on C1 is set by turning on, turning off, or setting to high-impedance one or more of digital inputs D1...D3, then turning on D4 for a controlled interval, to slightly raise or lower the voltage on C1.  For example, suppose C1 = 0.1 μF and VC1 = 2 V.  Turning on D4 for 1 ms with D1 on will raise VC1 by .21 V; turning on D4 for 4 μs with D3 on will raise VC1 by 8 μV.

If you want to control to about 1 part in 4 million using this method in simplest form, then R3 may need to be larger.  But of course slightly more involved alternative schemes can get by with smaller resistors.  For example, if R2 is 10 MΩ and R3 is 10.01 MΩ, you could raise VC1 by a few nV by turning on D2 high for a fraction of a microsecond, then returning it to high impedance and turning on D3 low for the same length of time, or could lower VC1 by doing vice versa; or could turn on both briefly high, then one briefly low, etc.  Another approach is to have D4 trigger a one-shot that closes S1 for a few nanoseconds, rather than depending on use of a fast microcontroller clock.

If you actually use a system like this, write a program that computes voltage rates of change for all combinations of your digital inputs, at various voltages on C1.  Also analyze the system for stability.

Note, D4 is controlling a JFET switch S1 to isolate C1 from leakage that could occur through D1-D3 if S1 were left out.  For example, the Atmega328 data sheet shows a max leakage of 1 μA on typical inputs in high impedance state, which is about a million times the leakage of a good JFET.  However, typical leakages of Atmega inputs – rather than max leakages – might be much less.  One could run experiments to see if S1 is indeed necessary.


问:
Backstepping Integrator: changing the virtual control
given the following differential equation 2°ODE in the following form:

$\ddot{z}=-g + ( cos(\phi) cos(\theta))U_{1}/m $

found in many papers (example) and describing the dynamic model of a quadrotor (in this case I'm interested as an example only for the vertical axis $Z$) , I get the movement about $Z$ after integrating the variable $\ddot{z}$ two times. As control input I can control $U_{1}$, which represents the sum of all forces of the rotors.

A Backstepping Integrator (as in many of papers already implemented) defines a tracking error for the height $e_{z} = z_{desired} - z_{real}$ and for the velocity $\dot{e}_{z} = \dot{z}_{desired} - \dot{z}_{real}$ to build virtual controls.

Through the virtual controls one can find the needed valueof $U_{1}$ to drive the quadrotor to the desired height (see the solution later on)

But wait...as said above I need to track both: position error and velocity error.

Now I asked myself, how can I transform such equation and the corresponding virtual controls to track only the velocity??

In my code I need to develop an interface to another package which accepts only velocity inputs and not position information.
I should be able to drive my quadrotor to the desired position using only velocity informations, tracking the error for the z displacement it not allowed.

The solution for the more general case looks like:

$U_{1}=(m/(cos(\phi)cos(\theta))*(e_{z} + \ddot{z}_{desired} + \alpha_{1}^{2}\dot{e}_{z} - \alpha_{1}^{2}e_{z} + g + \alpha_{2}\dot{e}_{z})$

for  $\alpha_{1}, \alpha_{2} > 0$

I could simply put brutal the $\alpha_{1} = 0$ for not tracking the position on Z but I think that is not the correct way.

Maybe could you please point me in the right direction?

Regards

答:
Proces of integration is associated with error accumulation even with more advanced algorythms like RK4. You need another sensor to avoid that and use sensor fusion algorytm (complementary filter or Kalman Filter) to merge the data. You can use sonar to detact distance to the groudn or barometer and differentiatite it to get velocity.

When you get that use regulator to control it's velocity, diference in velocity bacame your error.


问:
Sensors for differential drive
I have the following chassis along with an Arduino and a motor shield.

I'm in the process of developing a tracking mechanism for use with differential drive.

Normally, a photo reflector can be placed adjacent to the wheel that will reflect when each spoke passes through therefore allowing code to be written that will accurately measure each wheels position.

The problem I have is that you cannot see the wheels from inside the chassis, only small holes for the driveshaft. Placing sensors on the outside would look ridiculous and a wall crash would cause havoc.

Would I be able to use a photo reflector on the gears (as shown) if I accurately placed it to count each spoke on the gear itself? I'm a bit hesitant though because even a small bump could misalign the sensor - again causing havoc.

So does any one have an idea on how to track the wheel movements?

答:
Are the wheels essentially hollow except for the spokes? If they were, it would seem to me like adding a small hole a little offset from the front axle (the wheel without gears) would be a good place to put a light detector. Of course that would not work too well in the dark.

Each spoke, or more properly tooth on the gear, while technically would be correct, as you indicated may be hard to accomplish due to size.

Does the non-gear wheels axle come into the chassis? Could you add an optical encoder there? Possibly by making the axle fixed to the wheel but pass through some sort of bearing.

I've never experimented with odometry with tracks, but I assume due to their increased slippage, you will have to deal with greater errors than plain wheels during turns. Have you considered that?

In any case, I think you are going to have to do some 'customization' to get what you want.

I could not find that chassis at Pololu. Is it an older model?

Ah I see now where it has been replaced. The newer chassis has encoders as an option.

Title: Sensors for differential drive


问:
DH parameters and Kinematic Decoupling
Is it possible to decouple a 5DOF manipulator?
This question I asked earlier and I believe I got the right answers but I never show the drawings of the manipulator and now I'm hesitating during setup of the DH parameters for Forward Kinematics. See drawing depicted here.

答:
The first manipulator shown is a typical articulated arm without the final roll about the tool axis.  Just use the DH parameters for a Puma but set joint 6 = 0.

I don't know of any shortcuts for the second manipulator other than working out the DH parameters directly.  However, DH seems like overkill for this design.  DH allows you to handle things like joint twists and other offsets, which your manipulator does not have.  Rather than that, would you consider using simple rotation matrices and a vector loop to describe the end effector position and orientation with respect to the global coordinate system?

In this picture I show your link lengths $L_1$, $L_2$, and $L_3$, along with coordinate systems $0$ through $5$. I left the $\hat Y$ axes out for clarity, but they follow the right-hand rule.

Your positional vector loop is $$\vec P_t = L_1 \hat Z_1 + L_2 \hat X_2 + L_3 \hat Z_5$$
where $\vec P_t$ represents the position of the center of your tool tip.

Now find the rotation matrices to define the unit vectors $\hat Z_1$, $\hat X_2$, and $\hat Z_5$.

I will use $_x^{x+1}R$ for the rotation matrix between coordinate systems $x$ and $x+1$, and $\theta_i$ to represent the $i$th joint angle.

$$_0^1R = \begin{bmatrix}
\cos \theta_1&-\sin \theta_1&0\\
\sin \theta_1&\cos \theta_1&0\\
0&0&1
\end{bmatrix}
$$

$$_1^2R = \begin{bmatrix}
\cos \theta_2&-\sin \theta_2&0\\
0&0&1\\
-\sin \theta_2&-\cos \theta_2&0
\end{bmatrix}
$$
(notice $\hat Y_2$ should point "down")

$$_2^3R = \begin{bmatrix}
0&0&1\\
-\sin \theta_3&-\cos \theta_3&0\\
\cos \theta_3&-\sin \theta_3&0
\end{bmatrix}
$$

$$_3^4R = \begin{bmatrix}
\sin \theta_4&-\cos \theta_4&0\\
0&0&1\\
-\cos \theta_4&-\sin \theta_4&0
\end{bmatrix}
$$

$$_4^5R = \begin{bmatrix}
0&0&1\\
\cos \theta_5&-\sin \theta_5&0\\
\sin \theta_5&\cos \theta_5&0
\end{bmatrix}
$$

Now find the unit vectors needed for your vector loop (all with respect to the global coordinate system $0$).  $\hat Z_1$ is the third column from $_0^1R$:

$$\hat Z_1 = \left( \begin{array}
{c}0\\
0\\
1
\end{array} \right)
$$

$\hat X_2$ is the first column from $_0^2R$, which you find by multiplying $_0^1R _1^2R$:

$$_0^2R = \begin{bmatrix}
\cos \theta_1 \cos \theta_2&-\cos \theta_1 \sin \theta_2& -\sin \theta_1\\
\sin \theta_1 \cos \theta_2&-\sin \theta_1 \sin \theta_2& \cos \theta_1\\
-\sin \theta_2&-\cos \theta_2&0
\end{bmatrix}
$$

$$\hat X_2 = \left( \begin{array}
{c}\cos \theta_1 \cos \theta_2\\
\sin \theta_1 \cos \theta_2\\
-\sin \theta_2
\end{array} \right)
$$

In a similar way you can find $\hat Z_5$:

$$\hat Z_5 = \left( \begin{array}
{c}\sin \theta_4 (\cos \theta_1 \sin \theta_2 \sin \theta_3 - \sin \theta_1 \cos \theta_3) - \cos \theta_1 \cos \theta_2 \cos \theta_4\\
\sin \theta_4 (\sin \theta_1 \sin \theta_2 \sin \theta_3 + \cos \theta_1 \cos \theta_3) - \sin \theta_1 \cos \theta_2 \cos \theta_4\\
\cos \theta_2 \sin \theta_3 \sin \theta_4 + \sin \theta_2 \cos \theta_4
\end{array} \right)
$$

Plugging values for the link lengths, and unit vectors, into your vector loop equation gets you the tool tip position.

For the upper left $3x3$ submatrix of your 4x4 DH matrix, you just use $_0^5R$ (assuming the coordinate system definitions are the same).

Now back to your wrist partitioning question.  You can use the same technique to compute the origin of the $4$ coordinate system ($L_1 \hat Z_1 + L_2 \hat X_2$).  Rotations $\theta_3$, $\theta_4$ and $\theta_5$ do not affect the position of this point, which is often referred to as the wrist center.  Those three joints can then orient the tool with respect to the $4$ coordinate system.

Title: DH parameters and Kinematic Decoupling


问:
What is the difference between motion planning and trajectory generation?
What are the major differences between motion planning and trajectory generation in robotics? Can the terms be used interchangeably?</p>

答:
You can use motion planning and path planning interchangeably. Both of these terms represent a geometric concept. But a trajectory has a higher level compared to a path. It contains the geometric concept of a path but it also encompasses a velocity or even an acceleration profile.

Consider the geometric path the Google Maps gives you when you give it two different points. Google Maps solves a motion/path planning problem based on your travel type, i.e. Car, Bus, Bicycle. But it does not tell you how fast or slow you should go. But for the driver-less cars, after finding a geometric path, you should also find a profile of velocity and acceleration that the car must follow.

Usually the geometric part is considered as a path/motion planning problem while generating the trajectory from a geometric path and following it is considered a controls systems problem.