问:
Roomba 500 Series - Raw encoder counts readings
I have been trying to read Roomba raw encoder counts I am receiving values, but I have a sudden increase/decrease in values as can be seen over here.

142 152

153  166

167  180

181  196

50101  33280

207  223

222  238

236  252

```<code>#include <SoftwareSerial.h>
#include <Wire.h>
// Roomba Create2 connection
int rxPin = 10;
int txPin = 11;
SoftwareSerial Roomba(rxPin, txPin);
void setup() {

pinMode(10, INPUT);
  pinMode(11, OUTPUT);
  pinMode(5, OUTPUT);
  Serial.begin(115200);
  Roomba.begin(19200);
  delay(1000);
    Roomba.write(128);  //Start
  Roomba.write(132);  //Full mode
  delay(1000);
}
char command;
void loop() {

  if (Serial.available()){
    command=Serial.read();}
switch (command)
  {
    case '8':
  Roomba.write(byte(145));
  Roomba.write(byte(0));
  Roomba.write(byte(0x28));
  Roomba.write(byte(0));
  Roomba.write(byte(0x28));
  delay(50);
  encoder_counts();
  break;
  case '0':
    Roomba.write(byte(145));
  Roomba.write(byte(0));
  Roomba.write(byte(0));
  Roomba.write(byte(0));
  Roomba.write(byte(0));
  break;
  }
}

void encoder_counts()
{
   unsigned int  right_encoder;
    unsigned int   left_encoder;
   byte  bytes[4];

  Roomba.write(byte(149));
  Roomba.write(byte(2));
  Roomba.write(byte(43));
  Roomba.write(byte(44));
  delay(50);
   int i=0;
while(Roomba.available()) {
  bytes[i++]=Roomba.read();
left_encoder = (unsigned int)(bytes[0] << 8)|(unsigned int)(bytes[1]&0xFF);
right_encoder =(unsigned  int)(bytes[2] << 8)|(unsigned int)(bytes[3]&0xFF);
}

Serial.print(right_encoder);
Serial.print("  ");
Serial.println(left_encoder);

}
</code>```

so please kindly advice, Thank you

答:
Welcome to Robotics, Ahmed. You have posted the code you use to build the encoder counts, but not the code you used to display the counts. I mention this because you have the encoder counts displayed in your post as:

13786.00 13938.00

as in, with a trailing decimal, but your encoder counts are defined in your code to be integers. This could be problematic if the print function is treating your two-byte integer as the first two bytes of a floating point number.

The second issue it looks like you've got is that you're defining your encoder variables as int instead of unsigned int. Per the manual,

encoder [count] is returned as an unsigned 16-bit number, high byte
  first

Try redefining your right_encoder and left_encoder as unsigned int, and then also try changing the formatting in your print command to something like Serial.print(right_encoder) instead of Serial.print(right_encoder, 2).

If that doesn't work, please edit your question to post the code you're using to display the values.


问:
Can a mu-metal enclosed compass measure the earth's field?
I am thinking about using a combination of mu-metal, a faraday cage, and spacial separation to reduce magnetic interference from a brushless motor on a compass sensor.

The compass will be used to calculate heading.   If the vehicle that it is attached to is standing still or slowly rotating, however, will earth's magnetic field be shielded by the mu-metal?   The following is a quote from Wikipedia:

The high permeability of mu-metal provides a low reluctance path for
  magnetic flux, leading to its use in magnetic shields against static
  or slowly varying magnetic fields

A slowly rotating or fixed compass would experience a static or slowly varying magnetic field from the earth, no?   So would the mu-metal interfere with the compass's readings?

I could always just eliminate the mu-metal and use only a faraday shield, which I know don't affect static or slowly changing magnetic fields.

EDIT: someone please let me know if there is a more appropriate SE site on which to ask this question.

答: It is possible to use mumetal to shield the magnetic field of the motor from affecting the magnetometer. The magnetometer should not be shielded though, because any shielding will prevent the earths magnetic field from reaching the magnetometer.</p>

ContentLicense: CC BY-SA 4.0


问:
How to calculate my power supply voltage and current?
My stepper motor specifications:

Phase = 2

step angle = 200 step/rev

voltage = 12 V

current = 0.33A/phase

resistance = 34ohm/phase

Inductance = 46omh/phase

holding torque = 23N.cm min

detent torque = 4.6N.cm min

I am making a CNC machine so I need the power supply to power 3 of my stepper motor with these ratings. Can someone calculate the power supply voltage and the current I should get to power my CNC stepper motors?

答:
The average current consumed by the stepper motors is what is most important for sizing the power supply.  The peak current listed in the datasheet is only achieved for a brief period during the motor coil charge cycle.  Not only that, the charge on one motor coil will recirculate and end up charging the other coil.  Back EMF is also captured in the driver's capacitors which also ends up charging the motor coils.

Rule of thumb:

```<code>Power_supply_current = number_of_motors * 1/3 * motor_peak_current
</code>```

for typical motors wired bipolar series.  However, if you have an 8 wire motor and have wired it bipolar parallel then you will need to double the value calculated above.  There is no need to go above this value.  The estimate already contains a healthy margin of error.

In testing, I have found that stepper motors often draw an average current about 1/4-1/5 of the rated peak current when idle or running slowly.  This goes up at midrange speeds and then drops off at higher speeds.  The current goes up in the middle, not because the motor is getting more power, but because of energy losses.  It goes down at high speeds as increasing back EMF cancels out the incoming voltage from the power supply.

So finally, to answer the original question.  You should only need about 0.33A to run all three motors, assuming they are wired bipolar parallel and your driver does not have any gross inefficiencies.

ContentLicense: CC BY-SA 3.0

Body:
The average current consumed by the stepper motors is what is most important for sizing the power supply.  The peak current listed in the datasheet is only achieved for a brief period during the motor coil charge cycle.  Not only that, the charge on one motor coil will recirculate and end up charging the other coil.  Back EMF is also captured in the driver's capacitors which also ends up charging the motor coils.

Rule of thumb:

Power_supply_current = number_of_motors * 1/3 * motor_peak_current

for typical motors wired bipolar series.  However, if you have an 8 wire motor and have wired it bipolar parallel then you will need to double the value calculated above.  There is no need to go above this value.  The estimate already contains a healthy margin of error.

In testing, I have found that stepper motors often draw an average current about 1/4-1/5 of the rated peak current when idle or running slowly.  This goes up at midrange speeds and then drops off at higher speeds.  The current goes up in the middle, not because the motor is getting more power, but because of energy losses.  It goes down at high speeds as increasing back EMF cancels out the incoming voltage from the power supply.

So finally, to answer the original question.  You should only need about 0.33A to run all three motors, assuming they are wired bipolar parallel and your driver does not have any gross inefficiencies.


问:
PID control related to lagrange equation
I'm a beginner in robotics and so far followed the lecture series by Prof. Oussama Khatib and some blogs and papers. currently I'm following this studywolf blog. in the end I plan on building a simple robot arm capable of moving a weight. since all questions I have are regarding the lagrange equation, I'll ask all here.

blog says that we can ignore the Coriolis and centrifugal part of the equation and instead use a PD controller. is it OK?

"we’re actually going to have a PD controller for each joint." does that mean different $kp$, $kv$ values to each joint in a matrix form? or separate equations for each joint?

the control signal here is the torque. does that mean I need to have a current feedback(torque feedback) or is it just feedback from encoder (speed and position required for PD controller) and current feed-only?

when practically implementing this, do I need a current-mode pwm to apply the torque or is a voltage pwm is enough?

答:
Welcome to Robotics, kingKong. Your question title makes it seem as though you're going to ask about Lagrange equations, but the content all appears to be about PID controls. I'm not sure if you had meant to include some other content or not.

Regarding your questions:

1) blog says that we can ignore the Coriolis and centrifugal part of the equation and instead use a PD controller. is it ok?

As with any other term (friction, mass, etc.), it's okay to ignore it if it's negligible. If leaving those terms off has a big impact on your control performance then obviously you need to include them.

2) "we’re actually going to have a PD controller for each joint." does that mean different kp, kv values to each joint in a matrix form? or seperate equations for each joint?

It depends on how you're doing the controls. You could, for example, try to implement a feed-forward controller and use the PID controller to correct for any error in your feed-forward estimate of the required control torque (friction, etc.). In that case, if the point of the PID controller is to make minor corrections to a pre-existing controller's output, then you could probably use the same controller for each joint.

If you're looking to do the complete controller with just a PID controller, then (1) I'm not sure why you're looking at Lagrange equations at all, and (2) you would need a different controller for each joint. A shoulder joint would typically see the mass of the load/end effector acting across a longer effective distance than the wrist joint would. This means the shoulder joint has a higher moment of inertia (parallel axis theorem states the moment of inertia increases by distance squared). Higher inertias at the joint means you'll need higher gains to get higher torques to move said inertia.

3) the control signal here is the torque. does that mean I need to have a current feedback(torque feedback) or is it just feedback from encoder (speed and position required for PD controller) and current feed-only?

The reference/feedback signal doesn't need to be the same units or physical signal as the control signal. Cruise control in a car uses desired speed and actual speed, and it sends a control signal of throttle position to the engine. The engine (plant) "converts" throttle position to torque and that generates the acceleration to change the speed.

Same deal for you - you could have joint position as feedback and a desired position as reference, the PID controller acts on position error and generates a current reference as an output.

4) when practically implementing this, do i need a current-mode pwm to apply the torque or is a voltage pwm is enough?

I don't think it matters.


问:
Inductive Charging for Alphabot
I am looking into building a self-docking robot that can charge itself when needed. To accelerate the prototyping phase, I am considering AlphaBot2 with Raspberry Pi 3 B+ as a development platform. I have two main concerns:

1) AlphaBot2 docs have very little information on power consumption and providing an alternative battery source. I am worried about the tightly designed PCB not providing a way to charge the battery pack or add an alternative power source. Does anybody have experience with this kit?

2) Would an inductive charging set like this one be able to charge a 3.7V Li-Po or Li-Ion battery through the PowerBoost 500 charger? I don't care about charge-time being too long, as long as it's possible since I am more interested in the software challenge of finding the dock and aligning with it.

I appreciate any guidance and information you can provide. Thank you!

答:
Answering you direct question:

AlphaBot2 docs have very little information on power consumption

A RaspberryPi is a full blown computer.  As such you can expect a fraction of the battery time if you run something like OpenCV compared with sitting idle.  So, the power consumption is very dependent on the application.  Adding more features such as keeping the robot in motion and running the WiFi radio adds to the power consumption.

Would an inductive charging set like this one be able to charge a 3.7V
  Li-Po or Li-Ion battery through the PowerBoost 500 charger?

USB 2.0 only supports up to 500mA.  The inductive link you pointed to appears to provide up to 500mA under ideal conditions.

Title: Inductive Charging for Alphabot


问:
Is a virtual machine with ros-kinetic available anywhere?
I want to learn ros-kinetic from a virtual machine. I found that ros-indigo  is available from nootrix; similarly, is there a virtual machine with ros-kinetic version available anywhere?

答:
This is the only Vagrant box I've found for kinetic:

https://app.vagrantup.com/pstizzy/boxes/ubuntu-xenial64-ros-kinetic-desktop-full


问:
ROS for Ubuntu 18.04 and x86
I am trying to put ROS on my Intel-based Ubuntu 18.04 laptop and it seems by the documentation that they only made if for Amd?  Am I missing something.  It never finds any of the packages.

Unable to locate package ros-melodic-desktop-full.

Any solutions except formating the machine and going back to 14.04

答: amd64 is just a name for the 64-bit x86 architecture which the one used by both Intel and AMD processors, so you don't need to worry that it's AMD specific. Just go ahead and follow the usual steps for installing ROS (http://wiki.ros.org/melodic/Installation/Ubuntu).</p>

Title: ROS for Ubuntu 18.04 and x86


问:
How to control velocity ratio when turning angle is θ?
Im designing a differential steering mechanism for my robot. Supposing my robot is going in a straight line and I want it to change it direction by a certain angle( $θ$ in the diagram). What should the velocity ratio be of the 2 wheels so that it gradually turns and starts moving along a line that is $θ$ degrees to the initial line of movement?
If there's any ambiguity in the question please take a look at my earlier question which is similar. How to design a differential steering mechanism?

答:
In your previous question, we calculated the <s>velocity</s> speed ratio that would be required to make a turn of a given radius.  I'm going to reuse those formulas with inner and outer replacing left and right, and $d_{axle}$ replacing $A$.

In those terms, the ratio of the outer wheel's speed to the inner wheel's speed is still what it was before:
$$\frac{v_{outer}}{v_{inner}} = \frac{r+d_{axle}}{r}$$

However, in this question, you're trying to determine how much time should pass with the wheels turning at those speeds (in other words, following a circular path of a given $r$) before you come to a desired turning angle of $\theta$.

Here is the distance equation from before:

$$d_{inner} = \frac{\theta*2\pi{r}}{360}$$
$$v_{inner} = \frac{d_{inner}}{t} = \frac{\theta*2\pi{r}}{360*t}$$

So, solving for $t$:
$$ t = \frac{\theta*2\pi{r}}{360*v_{inner}}$$

This is essentially saying "how long will it take me to travel along a circular arc defined by $r$ and $\theta$ if I move at the given speed $v_{inner}$".

Now for the bad news: achieving this is impossible in practice.  The equations above are assuming that your acceleration is infinite, meaning that you would change your speed from $0$ to $v_{inner}$ instantly.  This has never happened.

If you need to be sure that you've reached a desired heading, you'll need to start working with sensors.  A GPS, a compass, or even wheel odometry would be good places to start.


问:
Is a compilers course or a databases course more relevant for robotics engineering?
I am trying to decide between taking a compilers and interpreters course where we create an OpenGL shader compiler and a databases course. My aim is to go into robotics engineering and I am wondering which of these courses would provide the most benefit for that career path?</p>

答: I think the database course is much more related to robotics than the compiler course. Almost every robot needs some kind of long term memory to store tasks, parameters or facts it learned about objects, itself or the environment. Compiler design for shaders is a much smaller niche and could maybe help you if you want to go into computer vision or visualization, but for a general roboticist I'd definitely go for the database course. </p>


问:
SEIF slam: Effect on information matrix when there is no landmarks
I studied about Sparse Extended Information Filter slam. I want to clarify some points regarding this topic. As per the sparse extended information(SEIIF) slam when the robot sees some landmarks it can update the information matrix according to it's position and landmarks number. Lets the robot at $x_t$ position and sees landmarks $m_1$ and $m_2$. So according to the algorithm it update rows and columns of $x_t$,$m_1$,$m_2$. Then it move and at $x_{t+1}$ position it sees landmark $m_3$ ,then it update rows and columns of $x_{t+1}$,$m_3$ and also there is a weak link between $m_1$ , $m_2$, $m_3$. At the $x_{t+1}$ position it discard previous position and the rows and columns corresponding to $x_t$.

Now my doubts is that what happened with the information matrix when the robot moving around to arena without observing any landmarks.Say, $x_1$ is the robot initial position then it go to the next position say, $x_2$ then as per the algorithm $x_1$ position will be discard. So if the robot only moving around without observing landmarks means only the 1st cell of information matrix say(0,0) is overwrite all the time. Then what is its effect on $\mu$?

The key formula on which the algorithm based is $\mu=\Omega^{-1}Xi$ where $\Omega$ represent information matrix and Xi represent information vector.

The algorithm taken from Probabilistic Robotics Chapter 12 page 315[pdf] and page 304[hard copy].

答:
I'm not sure I fully understand the scope of your question - are you asking what happens if you don't have any landmarks?

SLAM is simultaneous localization and mapping. I don't think you can localize or map without any landmarks.

Table 12.2 gives:

$$
\bar{\mu}_t = \mu_{t-1} + F^T_x\delta \\
$$

which is just the previous $\mu$ plus the incremental position change from motion $\delta$; $F_x$ is a block identity matrix.

Table 12.5 updates/corrects the state estimates as you mentioned, but $\mu$ and $\Omega$ get build in Table 12.3, the $\rm{\textbf{Algorithm SEIF_measurement_update}}$. Specifically, line 3 says:

$$
\mbox{for all observed features } z^i_t= \left(r^i_t\ \ \phi^i_t\ \  s^i_t\right)^T \mbox{do}
$$

This is a loop, so if there are no observed features then it doesn't execute the code inside, which means line 5 never happens:

$$
\mbox{if landmark } j \mbox{ never seen before} \\
$$

which consequently means that line 6 also never gets called, which is where the the $\mu$ gets built:

$$
\left(\begin{array}{ccc}
\mu_{j,x} \\
\mu_{j,y} \\
\mu_{j,s}
\end{array}\right) = \left(\begin{array}{ccc}
\mu_{t,x} \\
\mu_{t,y} \\
s^i_t
\end{array}\right) + r^i_t\left(\begin{array}{ccc}
\cos\left(\phi^i_t + \mu{t,\theta}\right) \\
\sin\left(\phi^i_t + \mu{t,\theta}\right) \\
0
\end{array}\right)\\
$$

Finally, since $H^i_t$ isn't preallocated or predefined, it also fails to be built on line 11 (I'm not rewriting that definition here). Since $H^i_t$ isn't built, $\Omega_t$ and $\xi$ fail to update (lines 13 and 14).

So, as mentioned at the top of the post, if you don't have any landmarks, $\mu$ never gets built, ever.

Also, if you don't currently see any landmarks, then the same loop that has the potential to build $\mu$ never runs and you cannot update $\mu$ (because $\xi$ and $\Omega$ don't get updated).


问:
EKF Slam algorithm doubt at observation update
I have some doubt on EKF Slam with known correspondence in the measurement update state. I follow the algorithm from Probabilistic Robotics by Sebastian THRUN. This Algorithm is on Chapter 10 page No:249 of this books.

I attached a snapshot of my doubt.

In this algorithm line No: 10 and 12 create some doubts.

I want to know  what is $\bar\mu_{t,x}$ and $\bar\mu_{t,y}$.

As per my understanding, it is the robot position in the given timestamp when it sees landmarks.

But I have some confusion, so it would be very helpful for me if anyone could clarify line 10,12.

答:
Line 10 just uses trigonometry to compute the position of the landmark μ¯j,xyz (left of equals sign) based on the current estimate of the robot's position μ¯t,xyz and the sensed range r and the sensor's line-of-sight angle phi.  This only happens the first time that it is seen by the sensor.  This initializes the state estimate for that landmark, as there is no other information to use at that point.  After that, there will always be an entry in the state matrix which represents an estimate of that landmark's position, and it will be further refined by multiple "looks" at the landmark.

Line 12 finds the 2D difference vector between the current estimate of the landmark's position μ¯j,xy and the filter's current estimate of the robot's position μ¯t,xy.  This is later used to estimate what the robot thinks a measurement of that landmark will be, and will be used to compare against any actual measurement of that landmark.

If by "doubt" you mean that you believe that these equations are incorrect, I can assure you that they have been vetted by many people.  However, there are some simplifications (such as a flat world) that usually results in a need for additional enhancements in a real-world application.

My apologies if the math did not render correctly.  I am not sure how to do this.


问:
What is appearance-based SLAM?
To my understanding appearance-based SLAM uses only information coming from sensors for mapping and localization. It completely discards control information from actuators. I'm I correct?

答:
Appearance-based SLAM methods model the set of discrete locations in a space and the existence of paths between these locations. </p>

<p>I suggest you first read this paper Appearance based slam for mobile robot . Try to know the basic idea behind the appearance based slam.  </p>

Title: What is appearance-based SLAM?

Body:
Appearance-based SLAM methods model the set of discrete locations in a space and the existence of paths between these locations.

I suggest you first read this paper Appearance based slam for mobile robot . Try to know the basic idea behind the appearance based slam.


问:
Does SolidWorks CAD-to-URDF (ROS robot definition XML) exporter works from open source alternatives (e.g. FreeCAD, Blender) as well?
It is quite hard (or almost impossible for large robots) to hand code ROS robot definitions in URDF XML files, so that is why SolidWorks has model exporter http://wiki.ros.org/sw_urdf_exporter. SolidWorks has open source alternatives like FreeCAD and Blender. My question is - does SolidWorks CAD-to-URDF exporters works from FreeCAD or maybe other open source CAD programs?</p>

答:
As it is the answer to your question is no.
It is developed, by the community, as a plugin specifically for SolidWorks.

If you are a student the fastest workaround would be to get a free student license from SolidWorks. You can then try to export your project to SolidWorks and convert it or directly do it in Solidworks.

Otherwise, for Blender there is the possibility to use Phobos, another dedicated plugin.
I am not aware of a method to generate URDF automatically from FreeCAD. And I have no clue for BRL-CAD and OpenSCAD


问:
How to deal with sonar crosstalk
Our robot has a circular array of 12 sonar sensors that looks like this:

The sonar sensors themselves are pretty good. We use a low-pass filter to deal with noise, and the readings seem pretty accurate. However, when the robot comes across a flat surface like a wall, something weird happens. The sonars don't show readings that would indicate a wall, instead, it appears like a curved surface.

The plot below was made when the robot was facing a wall. See the curve in the blue lines, as compared to the straight red line. The red line was produced by using a camera to detect the wall, where the blue lines show filtered sonar readings.

We believe this error is due to crosstalk, where one sonar sensor's pulse bounces off the wall at an angle and is received by another sensor. This is a systematic error, so we can't really deal with it like we would with noise. Are there any solutions out there to correct for it?

答:
Is it possible to use multiple ultrasonic sensors on a single robot? Yes: "Using Multiple Sonar Sensors".

As you have already figured out, one sensor often receives echoes of pings sent by another sensor.
There are several ways to deal with cross-sensitivity, roughly in order of simplest first:

Ping only one transducer at a time, ignoring all the other transducers while waiting for the "ghost echoes" from the current transducer to die down before pinging the next transducer. This is much faster than mechanically rotating a single transducer. Perhaps this will be fast enough, unless your robot is ramming into things at nearly the speed of sound.

Use relatively narrow beam angle transmitters or receivers (or both) per sensor, and increase the angle from one sensor to the next so one sensor can't hear the echo from another (unless the stuff in front of the transducer causes some weird lateral reflections) — sensors angled apart roughly the same as the beam angle. Alas, this leaves "blind spots" between transducers where objects can't be seen by any transducer.

Some combination — for example, increase the angle from one sensor to another so one sensor only hears echoes from its 2 neighbors (about half the beam angle); then alternate between pinging the even transducers (ignoring the odd transducers) and pinging the odd transducers (ignoring the even transducers).

Each transducer operating at a different frequency. Alas, all the low-cost ultrasonic transducers, with few exceptions, are tuned to resonate at 40 kHz. When listening to a variety of signals, these transducers can only "hear" signals that are within a few kHz of 40 kHz. You'll have to balance (a) The further away from 40 kHz you use on a transducer designed for 40 kHz, the less sensitive it is, so you want a frequency "relatively close" to 40 kHz; and (a) The closer all the frequencies are together, the more difficult it is to discriminate between them, so you want a set of frequencies that are spread "relatively far apart". I don't know if there is a good compromise or not — if not, you're stuck with (c) use more expensive sensors tuned to other frequencies, or more expensive "wide-bandwidth" sensors not tuned to any particular frequency.

Use various transmit timings to rule out ghost echoes. Say you transmit from the left, delay 2 ms (not nearly enough to let the echoes die down), then transmit from the right,... after the echoes die down, then transmit from the left, delay 3 ms, then transmit from the right. If the right receiver gets an echo back 5 ms later both times, then you can be pretty sure it's a real echo; if the right receiver gets an echo back 5 ms later the first time, 6 ms later the second time, it's probably a ghost from the left receiver. (There are much more sophisticated "spread spectrum" techniques for separating out many transmitters all using the same frequency at the same time.)

Combine the signals from all the receivers. If you have one central transmitter that pings in all directions (or equivalently you have transmitters pointed in every direction, and you ping them all at the same instant), and the first echo you get back hits the left receiver first (then later the right receiver hears an echo), you know that the nearest obstacle is closer to the left side than the right side. (There are more sophisticated "phased array" techniques that combine signals from all the receivers, and even more sophisticated "beamforming" techniques for slightly adjusting the transmit times of all the transmitters.)

P.S.: Have you seen "Infrared vs. Ultrasonic — What You Should Know" ?

(Yes, I've said this all before, at "Multiple Ultrasonic Rangefinder Question".)

Title: How to deal with sonar crosstalk


问:
Follow up question to Robot path planning
So I was browsing through the localization section and found this question and the code which answered it. https://robotics.stackexchange.com/a/7932/21145 but I have a follow-up question to this. So the code is exactly what I need but my "beacon" isn't in the middle but in the front (image following). Do I have to change the code or is the solution implemented general enough, I am not quite sure? The beacon is marked as point A.

Edit: Code and clarification better showcase of beacon location

So I chose the mathematical convection and I took the code from the previous question and modified it. The heading is alligned with the x-Axis. Is it theoratically right?
So new it would be:

A_x = M_x + cos(θ + (-25))*r

A_y = M_y + sin(θ + (-25))*r

```<code>//current points
    float xc = -300;
    float yc = 300;

//target points

    float xt = -300;
    float yt = -300;

//turning  angle
    float turnAngle;

    //***************
    float beaconHeading = -25;
    float startingHeading = 0;
    float currentHeading = startingHeading + beaconHeading;
    //***************

    //***************
    float turnRight = 1;
    float turnLeft = -1;
    float wheelBase = 39.5;
    float tireRadius = 7;
    float speedModifier = 0;
    float vRightMotor = 0;
    float vLeftMotor = 0;
    float vMotor = 0;
    float theta = 0;
    float distance = 0;
   //**************

    void setup() {
    // pin setup
    Serial.begin(9600);
     }

    void loop() {
    //*************
    destinationHeading = atan2((yt-yc), (xt-xc)); //calculate turning angle
    destinationHeading = destinationHeading * 180/3.1415; //convert to
    degrees
    turnAngle = destinationHeading - currentHeading;
    //*************

    if (turnAngle > 180) {
    turnAngle = turnAngle-360;
    }

    if (turnAngle < -180) {
    turnAngle = turnAngle+360;
    }

    //***************
    if (turnAngle < 0) {
    speedModifier = turnRight;
    }

    if (turnAngle > 0) {
    speedModifier = turnLeft
    }

    theta = 0;
    while abs(abs(theta)-abs(turnAngle)) > 0
    {
    vRightMotor = speedModifier * <100 percent speed - varies by your
    application>;
    vLeftMotor = -speedModifier * <100 percent speed - varies by your
    application>;
    <send the vRightMotor/vLeftMotor speed commands to the motors>
    vMotor = vRightMotor;
    thetaDot = (tireRadius * vMotor) / (wheelBase/2);`
    theta = theta + thetaDot*dT;
    }
    <send zero speed to the motors>

    currentHeading = destinationHeading;
    distance = sqrt((xt - xc)^2 + (yt - yc)^2);
    if (distance > 0) {
    // go forward
    }
    xc = xt;
    yc = yt;
    //****************
    }
</code>```

I feel like I only had to change one line or am I wrong? I mean if I change the currentheading so that beacon is on a straight line with the next point it works. Maybe I didn't clarify it but I want to reach the next point so that the point A is the same as the point I'm heading to. I did make the angular offset a negative number because if I compare the angle to x-Axis it does go cw and not ccw, I tested it with geogebra and it is fine if I do it like this.

The robot I use is a Arlo Complete Robot System so I could let the robot turn with other commands.

答:
Welcome to Robotics, Sentrinity! I'm glad the other answer helps!

In the other question, the beacon was being tracked by a camera to establish where the robot was located. I'm assuming your beacon is being used for the same purpose here.

I'm assuming that the distance from your robot's turning center $M$ and the beacon center $A$ is $r$, i.e. $r = \overline{MA}$.

You'll need to be tracking your robot's heading in order to do any of the path planning as described in the other answer, but now you're stuck with additional task of relating the measured beacon location back to the turning center location to be able to orient correctly to reach the target location(s).

This is fortunately a relatively straightforward task, but you need to be careful with the conventions you choose. Is your heading along the +y-axis, or the +x-axis? Does your heading angle increase clockwise or counterclockwise (anti-clockwise)?

I'm assuming here the y-axis points "up," x-axis points "right," the heading zero angle is aligned with the +y-axis, and heading angle increases CW. Refer to the diagram below:

This is where you need to be careful with the convention that you choose. It might not be the same as what I chose, but the method should be the same. You need to create a drawing that shows your choice of axes and take the same steps.

The easiest way to go about this is to put your axes centered on the turning center $M$, as I did in the graphic above. Next, find the relationship between your beacon location $A$ and the heading angle $\theta$. Given an $<x, y>$ coordinate scheme, at a heading of $\theta = 0$, the location of $A$ would be $<0, +r>$. If $\theta = 90^{\circ}$, then $A = <+r, 0>$.

This is a trig problem, and you can see now that you need $\mbox{Trig Function 1}$, or $\mbox{TF1}$ such that $\mbox{TF1}(0^{\circ}) = 0$ and $\mbox{TF1}(90^{\circ}) = +1$, then you need a second trig function $\mbox{TF2}(0^{\circ}) = +1$ and $\mbox{TF2}(90^{\circ}) = 0$.

Then you get:

$$
A_x = M_x + TF1(\theta)*r \\
A_y = M_y + TF2(\theta)*r \\
$$

This problem was simplified by putting the coordinate axes on $M$ such that $M_x = 0$ and $M_y = 0$. The trig functions that satisfy the criteria above are $\mbox{TF1} = \mbox{sine}$ and $\mbox{TF2} = \mbox{cosine}$. I'm not sure that there's a good way to intuitively explain how to determine this other than practice, learning the special values for trig functions, and then more practice (do all the homeworks!).

So, this means that you can find the coordinate of $A$ as:

$$
A_x = M_x + \sin{(\theta)}*r \\
A_y = M_y + \cos{(\theta)}*r \\
$$

You're not trying to find $A$, though, you're given $A$ and you're trying to find $M$! This is now straightforward - solve for $M$!

$$
M_x = A_x - \sin{(\theta)}*r \\
M_y = A_y - \cos{(\theta)}*r \\
$$

Again, as discussed in the other question to the other OP, you haven't described your method for determining heading, so I'm assuming it's just dead reckoning as described under the "Last Update" heading in the other answer.

The scope of your question seemed to be more about how you relate beacon location back to turning center location, so hopefully this covers it all in enough detail for you. Again, remember to do the same steps with your own coordinate system and reference datums - they might not be the same as what I've used!


问:
DC geared motors or leadscrew and motor for joints
I'm trying to build a quadruped robot. I studied dynamics and to get an idea, I read and watched papers and videos related to robots like ALof and StarlETH and some more. But since this is my first project it would be pretty difficult to follow everything and technically I won't be able to, because of no prior experience.

To get to the problem, I'm stuck on choosing an actuation method. I plan to build the thing using aluminum and keep it lightweight. Hopefully 10kg and battery powered. so hydraulics is a no go. Currently I am on the designing stage. I have considered using dc geared motors directly on joints rather than -keeping on hip and transferring via gears and chains- to keep the design simple, but I guess it adds more strain on hip motors with my design. due to budgetary limitations and availability, I'm stuck with motors like XD37GB520 (currently 12v 100rpm but can change it) and no harmonic drivers or maxon motors. but I'm concerned with its ability to hold the weight of the robot. if I try to increase the torque capacity I lose angular velocity.

I have also considered about lead-screw and motor method. but have little or zero knowledge about it. I know that the linear actuation's speed depends on the number of threads per unit length of screw and rpm of the motor, but how should I estimated the torque of the motor and the torque or force that can be expected from the mechanism (something like rated and stall torques of DC motors, I suspect stall torque would just depend on screw joints to the leg links) does the torque of the motor only depend on the friction of the nut?

I hope to have the arrangement of motors as follows

left: 3 DoFs leg with DC geared motors on each joint top motor is parallel to the drawing-plan.

right: same leg with lead-screw, top screw is in the plane

So how should I select a motor (torque rating) if I want to
implement lead screw and motor?

if I'm to stick with DC geared on joints, how much minimum rpm should I keep at a joint? (so that I can try to find a motor with that rpm and torque required).

what is better for this kind of thing dc geared or lead-screw?.

PS: I'm still designing this and I still need to start implementing  Matlab or Simulink simulations. So I don't really know which rated torque will be required. I just need to decide on an actuation method to finish the design and move forward.

答:
Welcome to Robotics, kingKong. The problem you're facing is a common one - you need to specify the motors, but the motors you specify will add to the load and require larger motors, which add to the load, etc.

The general approach is to add some "headroom" to your design, such that each actuator is capable of meeting your performance requirements with maybe 60% or 75% of its rated capacity. This makes the process of iterative design go a little easier.

You need to establish your project goals - are you trying to create a functional design, or are you trying to create the optimal design? As it stands, it sounds like this is a learning project where you're more interested in getting something that works. If that is the case, then I would urge you to focus more on the details that matter, like the planning software, motion software, sensing and feedback, controls, etc. The actual physical manifestation is less important - if you can get the software right, then scaling up is just a matter of purchasing larger motors. Conversely, optimizing would just be a matter of purchasing smaller motors.

To your question, though: "How do I determine what torque would be required?"

This is where performance specifications, models, and simulations are useful. Here are the useful steps:

Determine how fast you want to accelerate, top speed, and how fast you want to turn.

Determine how you want the robot to be structured,

From (1) and (2), perform a kinematic analysis to determine the peak acceleration and speed for each joint,

From (2), create a simple model for how the robot will be fabricated - this would be where you specify the material and shape of the linkages, which would give you masses and moments of inertias for each link,

From (3) and (4), perform a dynamic analysis to determine the peak power and torque requirements at each joint,

Double the results of (5) and find actuators that meet or exceed those needs, then

Include those actuators in your model from (4), then repeat 5-7 until your design doesn't change.

This isn't a product plug or anything, but just a mention because you stated you would be simulating in Matlab or Simulink. I have found the Simscape Multibody Toolbox to be super useful for doing iterative design work like this. You can model the parts in Inventor, Solidworks, etc., then import them to Simscape. You can send speed references to the joints and tick the box in the joint settings to have the joint output the torques required to meet your speed references. Then you use those torques and speeds to find the motors, add the motors to the model, and repeat.


问:
Tamiya Dual Gearbox attached to an Arduino Uno Board
I'm building a robot that uses the arduino uno microcontroller, and the tracks system is run by the tamiya 70168-Double-Gearbox-Kit.

Each Tamiya motor only uses 3V which is fine but it seems the stepper will help to control speed and direction of the motors. Does the Arduino Uno Microcontroller not allow you to control speed and direction?

Do I need a stepper to have control of the tamiya gearbox?

答:
You can not plus the motors T130 motors directly to your arduino because of the current they require.  These motors  need up to 2.1 A, which you can not get directly from the arduino.

The motors need to be plug to the battery via an adequate motor driver (common electronics board). And the arduino needs to be connected to the motor driver, to send the commands tot he motor driver.

If you want precise control of the speed you also need to have encoders to get information about the output shaft speed and do a control loop (like PID) in the arduino.


问:
sampling algorithms in motion planning and local minima
I am trying to run RRT algorithm for motion planning for a quadrotor. The quadrotor ends up sometimes in corners without reaching the goal. I realized from sources online, that it is due to local minimum occuring. I want to know what is it and why they occur and avoid the quadrotor getting stuck in corners.

Do effective methods exist to overcome local minima in smapling based motion planning algorithms?

答:
Local minima exists, because the shape of the error mountain is unknown. What sampling based planners are doing, is to calculate the outcome of a certain point in the map. For the input value f(x,y)=z the resulting value z is determined. To get the global minimum of the error function not a single point but all possible values for (x,y) have to be calculated which is not possible on standard-hardware.

The answer to the second question (how to overcome local minima) is called knowledge based planning. That means, a sampling planner is combined with domain specific heuristics. In the case of the RRT planner, this can be done with motion primitives which are sampled. A motion primitive is some kind of abstract input value which helps to reduce the possible numbers of (x,y) values down to a small lexicon of meaningful actions like “move forward”, “stop” and “move left”.


答:
Local Minima is a common problem encountered in sampling based planners. In such planners random points(x,y) are generated and are each evaluated by a function. The point generation being completely random there is a possibility that in some cases no points are generated near the global minimum and hence the algorithm converges near a local minimum.

I used GA for path planning and the mutation capability of GA solved this issue.
you can see a more detailed explanation  here.

Title: sampling algorithms in motion planning and local minima

Body:
I am trying to run RRT algorithm for motion planning for a quadrotor. The quadrotor ends up sometimes in corners without reaching the goal. I realized from sources online, that it is due to local minimum occuring. I want to know what is it and why they occur and avoid the quadrotor getting stuck in corners.

Do effective methods exist to overcome local minima in smapling based motion planning algorithms?


问:
Best way to estimate velocity of motor with encoder
I'm designing a PMSM controller with the motor has an optical encoder, so I can get position information from the motor. But how to measure the velocity of the motor. Now, my design is to calculate the difference, then add a low pass filter to estimate velocity. The approach is not a good way when the motor runs at a low speed. I have read some research to improve velocity estimation, like Luenberger Observer, Extended State Observer, or Kalman filter. But I don't know what should I choose since I have almost no theoretical basis.</p>

答: In slow velocity error will be more since you are PWM mode. Try to use one Schmidt trigger circuit followed by a counter t measure speed. No need to use even filter. </p>


答:
You could employ all the techniques you mentioned that are model-based though, meaning you need to provide a good model of your system and then tune the parameters.

Alternatively, there are other methodologies needing less tuning. Among all these, one of the best technique to use in this situation is definitely the Savitzky-Golay filtering, which performs least-squares fitting over a given time window.

In a nutshell, you have to fit in the least-squares sense the position samples contained within a temporal moving window using a line. The coefficient of this line represents the velocity.

Also, to improve robustness, you may want to make the window adaptive, as done for example in this work, one possible code implementation of which is available here.

Title: Best way to estimate velocity of motor with encoder

Body: I'm designing a PMSM controller with the motor has an optical encoder, so I can get position information from the motor. But how to measure the velocity of the motor. Now, my design is to calculate the difference, then add a low pass filter to estimate velocity. The approach is not a good way when the motor runs at a low speed. I have read some research to improve velocity estimation, like Luenberger Observer, Extended State Observer, or Kalman filter. But I don't know what should I choose since I have almost no theoretical basis.</p>


问:
How many independent control inputs does a hexarotor have?

6, because a rigid body has six degrees of freedom

4, since it is similar to a quadrotor, except with more motors

6, because there are six motors

I was taking an online quiz, and I thought option 3 is the correct one, only to find out I got the answer wrong. I know that I could change the answer 2 times and by chance I finally got it right, but I want to understand why option 3 is wrong?

答:
When assuming that the axles of all the rotors are oriented parallel to each other then the thrust will also only be along the same direction as these axles, so this only adds one degree of freedom. The other three degrees of freedom come from the effective torques due to thrust imbalance in front-back (pitch) and left-right (roll), and imbalance in the torque applied by the motors that rotate clockwise-anticlockwise (yaw). The total torque can at most be a three dimensional vector, so adding more rotors with an axle parallel to the others can't increase the span of the possible torque that can be applied.

If you remove the constraint that the rotors all have their axles parallel to each other then six degrees of freedom can be achieved. However most conventional hexacopters do have their axles parallel to each other, so would also only have four degrees of freedom.


问:
Move robot to a goal avoiding u-shaped obstacle
I have to develop an algorithm using reactive paradigm and potential fields to avoid an obstacle like this one:

My robot can go inside the U, and it has to know how to go out. The problem is that between robot's position and its goal there is a u-shaped obstacle, with the U pointing to the robot. The robot has to move to its goal, but it can fall inside the U-shaped obstacle.

Any idea about how can I do it?

答:
I was just reading a paper on this yesterday : here
I am still in the process of understanding it properly. will update the answer soon.

PS: I don't have enough reputation to add comments yet that's why I answered directly.


问:
How to implement a novel control algorithm for a drone
I and my research team are working on a novel drone design based on trirotor. The difference between this design and a trirotor is that it has an extra propeller to generate additional thrust, therefore we can not use the open-source autopilot ArduPilot anymore. I have prototyped a control algorithm on MATLAB/Simulink but I don't know how to implement this algorithm on the drone. I have encountered this on so many papers but I still don't know how they did it.

What type of hardware and coding should I need to prepare and learn in order to realize the algorithm? Should we continue to learn and modify the source code of open-source Autopilot like Ardupilot or it would be easier for us to start from scratch with a hardware?

答:
You need to assess 2 things:

which sensors are needed and their interface

which ESCs you have and their interface.

Once you know that it is possible to find the proper control board can fit your purpose. You should go for something micro-controller based like arduino.
I suggest you not to start from scratch but from an available open source project and replace in the code what is needed for you tri-copter. This way you don't need to rewrite all the utilities for communication, sensors readings and so on.

You will need to have some skill in C/C++ to do that. You might be able to retrieve your matlab prototype via a library using matlab c-code generating tools.


答:
Solving this miracle can be done with a combination of a story graph, interactive execution of high-level commands and a planner. At first, the robot needs a control interface which accepts high-level commands, e.g. “go to south of u-shape”, “go to inside u-shape”. Then a random sequence of such motion primitives is generated until a valid plan is found.

In the figure the semantic enriched motion plan is shown. At first, the robot has go back to it's root position, the next subgoal is “south of the u-shape” and then the robot can go to the goal. For realizing such a planner a datastructure is needed which can be realized as a class. This datastructure contains the graph. It has fields like “parentid”, “name of motion primitive” and “costs”. Such a datastructure is similar to Probabilistic roadmap (PRM), but is enriched with domain knowledge. Here, domain knowledge is the natural language description for the motion primitives.

Title: Move robot to a goal avoiding u-shaped obstacle

Body:
I have to develop an algorithm using reactive paradigm and potential fields to avoid an obstacle like this one:

My robot can go inside the U, and it has to know how to go out. The problem is that between robot's position and its goal there is a u-shaped obstacle, with the U pointing to the robot. The robot has to move to its goal, but it can fall inside the U-shaped obstacle.

Any idea about how can I do it?


问:
Mobile robot navigation without static map
I am working on an autonomous mobile robot based on ROS. All the tutorials and examples requires a static map which need to be generated in order to do the localization and mapping.
     Do i need to scan the environment using stereo camera or lidar and generate a static map before doing the path planing and navigation of mobile robot? If so why? and for autonomous car did google and other companies mapped the whole city and generated map?</p>

答:
I think you are looking for SLAM - Simultaneous localization and mapping
This is where you build the map and locate yourself within it as you go.

There is a popular python library for SLAM here: https://github.com/simondlevy/BreezySLAM


答:
I think you're confused on a few points.

Mapping is when you try to build a map, given a known location.

Localizing is when you try to locate yourself, given a known map.

SLAM is simultaneous localization and mapping, where you try to build a map and localize yourself in that map on-the-fly.

You mention "localization and mapping" in your question, but in your comment to Chris Charles you mention specifically the AMCL package.

The AMCL package is for localization only. It does not do localization and mapping so, per point (2) above, you need a known map.

There are SLAM packages available for ROS, but the one you're referencing doesn't do SLAM, it does L.

Title: Mobile robot navigation without static map

Body:
I am working on an autonomous mobile robot based on ROS. All the tutorials and examples requires a static map which need to be generated in order to do the localization and mapping.
     Do i need to scan the environment using stereo camera or lidar and generate a static map before doing the path planing and navigation of mobile robot? If so why? and for autonomous car did google and other companies mapped the whole city and generated map?</p>


问:
WHY are there no operating torque specifications on steppers?
I have been looking online for a while, and I cannot seem to find any steppers without any torque ratings. (Operating torque, not holding torque.) I even looked on hobby sites that usually have all the ratings, including Adafruit and Sparkfun. I only have found one ever that said the operating torque, however, it didn't seem that reputable and it didn't have holding torque, so it might be likely that it's a mistake. I might contact them and ask.

Am I missing something? Can I calculate what it will run at with certain factors? (How long in between each step, etc.)

The reason that I say that is I found a tutorial saying how much torque (didn't specify which kind, but I kinda assume it isn't holding) you need for a CNC machine (what I'm building).

Equation (From this site):

```<code>Torque = ((weight)(inches/revolution))/2(pi)
</code>```

Also on the page:

By the way, we are talking about torque during a continual turning motion, not at a holding position.

That seems like operating torque, but what makes it the most confusing is they sell steppers and they only list the holding.

What am I missing?

答:
Stepper motors are nasty little beasts and I don't like them.

Actually, stepper motors are perfectly good as far as they go, but there are subtleties involved in selecting them and running them -- and I've had a couple of projects where the incorrect motor was chosen, then the problem of driving it was dumped unceremoniously in my lap.

Given a stepper motor without feedback, if you ask for too much torque from the motor then it will slip, and you won't have any clue where your mechanism is until you home it again.  Given a stepper motor with feedback, you have all the pieces you need to use a DC motor, perhaps with a gearbox, in a smaller package that won't get as hot.

You want to design your mechanism with lots of torque overhead.  The article that ott references says you got a guideline to overdesign by a factor of 2 -- that's probably wise, unless you really flog the numbers, test the snot out of things, and are ready to fail anyway.

With constant-voltage drive, torque drops with speed.  I believe that this is mostly due to the inductance of the motor, which is listed in the good data sheets.  Fancy stepper drives are current-controlled, to try to drive the current to the data sheet value quickly, in spite of the stepper's inductance (and maybe back-EMF).  They do this by driving higher voltage into the stepper than its continuous-duty rating.

More subtly, accelerating a mechanism requires torque, and decelerating it requires torque in the other direction.  If you're trying for speedy transitions this can make a stepper slip.  You need to calculate the acceleration that you can achieve, and stay below it both coming and going.


问:
What is the best way to power source small Robot
I am trying to make a small robot with 4 12 v DC Motor + Raspberry PI + camera possibly a USB camera.

I am very confused with power source.
Is it possible to get all of them powered by a single power source? Can you recommend some of them?  I am really in a need.
Also is there any software where I can design electric circuit of this robot before burning my actual hardware.

Edit:
I have 4 dc
 12 v motors with 60 mamp without load and  300 mamps with load and it have torque of 1.5 kgcm

答:
I would recommend using only one source of energy on your robot otherwise, you could have some grounds problems.

Your motors are not consuming a lot (max ~ 1.2 Amps) and you can consider that the Raspberry Pi could consume up to 3A if you plug your camera (Could be less but with 3A your are safe).

So in your case, I would use a 12V battery with a DC/DC converter to power to Raspberry Pi in 5V (Here you need to make sure that the converter can deliver 3 A in 5V from a 12V source, like this one).

For the kind of battery, if you don't care about the size, capacity, weight etc you can go for a Lead–acid battery that is cheap and easy to use (Like this one). Otherwise, you can check for a Lithium-ion battery for example that has more capacity for the same size/weight. Lithium batteries are mostly more expansive and could be dangerous if you are not charging/discharging properly.


问:
Challenges involved in designing an Industrial Robotic Arm
I was wondering if any robotics engineers around would kindly, provide suggestions on the following:

I was recently hired by a company that wants to implement a robotic solution in manufacturing for a client. It is companies first time venturing into robotics and I am the robotics intern (I recently graduated). They want me to construct a ROS compatible collaborative antropomorphic robotic arm from scratch in four months with a very limited budget (under 10000 USD). I've observed that such kinds of robot arms at the very minimum cost about 30000 USD. And based on a little research my conservative estimate of designing such an arm is more than 30000 USD (assuming if we choose off the shelf solutions such as modular robotic joints with in-built sensors).  Additionally, looking at the history of the state-of-art cobots, I've come to realize that it took many years of research and design to come up with such perfection.

As I've understood, the budget and time-frame sounds preposterous, maybe I am wrong. I want to give them a practical time-frame and estimated cost with sound reasoning, because so far they don't seem to be convinced by my reasoning. So anyone who has had experience in designing industrial robot, could kindly answer the following for me:

Is it really possible to design industrial robots in such a time frame? How much time does it usually take to design such a robot usually by a seasoned robotics engineer?

What kind of costs should I bear in mind other than just the cost of individual components?

Are there any constraints/risks (other than time and money) that I haven't foreseen that one could tell me?

Any suggestions are appreciated. Thanks in advance.

答:
How did you come up with the 30.000$? You can't even pay a single Engineer for the four months and then you still don't have any hardware.

If it's possible in the time and budget completely depends on the task the robot has to solve. Do they want to built something like a LBR iiwa or a UR10 or a small picking robot with a reach of 20cm that moves with less than 10cm/s? Should it be a one-trick-pony or a general purpose arm?

The arms from UR cost around 20-30k, iiwa easily twice that amount, the Franka Emica around 10 (without software). UR just raised it's price and sold 25.000 arms and they can buy in bulk and have a lot of experience.

Industrial arms start already a bit cheaper (e.g. from Igus) and you could spend the months on a ROS Interface.

A collaborative arm needs a certification and that's not something to get over a weekend.

Another point against the 4 months is delivery time for you components. I use some bearings that have a delivery time of more than two months.

If you are good and lucky(!) you could manage to hack a prototype in some months.

But it's not possible to guess the time you need without knowing the task your robot should solve.


问:
Rover style robots with less motors than wheels
In all of the designs that I have seen for rockie bogie suspensions, each wheel has a separate motor. Can a rover be driven with less motors? Does each wheel need to spin independently?</p>

答:
Not necessarily. But not having independent motors would cause a lot of traction from rotating the body around the axis when you use differential drive.

The dimensions of the rover matters. Having a long body might not be favourable with only 2 motors at the back. The traction can be compensated by adding weight on the side with the motors.

It is definitely recommended having a separate motor driving each wheel of your robotic system.


问:
Dynamixel MX-64T ID Problem
I have WidowX Robot Arm Mark II and I'm trying to give IDs to my servo motors. I could give IDs to two MX-28T motors and two AX-12A motors. However, there is no way I could assign IDs to two MX-64T servos.

I'm using a Windows 10 PC and trying to assign IDs with DynaManager v1.4 software. It doesn't recognize the servos.

What do you think might be the problem? How can I fix it?

Your help would be very appreciated! Thanks!

答:
Welcome to Robotics, Poyraz Sagtekin. Is your problem just that you can't assign IDs to the motor or is it that you can't communicate to the servos at all?

What IDs have you given to the other servos? There is a guide here that says, in part:

Before you set your servo IDs, here are some things to keep in mind.

You can only ID one servo at a time. Do not plug multiple servos into the ArbotiX when using the DYNAManger.

Make sure you label your servos as you ID them! This will make the assmebly phase go much faster

All servos come pre-set to ID # 1. However we still recomend that you use the DynaManager to set the ID on servo #1. This will make sure the servo's baud rate is set correctly, as well as allow you test the servo.

Most kits use only AX-12A or AX-18A servos. For these kits, you can simply ID the servos in sequential, increasing order for however many servos you have. The exceptions are:

If you have a PhantomX Reactor Robot Arm without wrist-rotate then skip servo 7 (ID the first 6 servos normally, then set the last servo to ID #8)

If you have a WidowX Robot Arm MK-II, see this diagram. (The MK-I diagram is availbe here)

The things I would ask you to verify are that:

You're only trying to setup one servo at a time,

The servo is plugged into the correct port (view the image on the instructions of how to connect), and

That you've set the IDs on the other servos correctly. It looks like the MX-64 servos should be set to IDs 2 and 3.

If you do this and you're still having trouble, please edit your question to include what exactly the problem is - if you're getting an error, what the error is (verbatim), how you're connecting it, how you're powering it, etc.

Title: Dynamixel MX-64T ID Problem


问:
How do I calculate the required loop frequency for a servo controller?
I have a motor which drives a string connected to a load cell. I would like to implement a closed loop controller to control the load applied by the motor to the string.

How do I go about determining the required loop frequency in order to create a stable control system? Is it something like the Nyquist frequency, where the loop speed should be at least twice the highest frequency inherent in the mechanical system?

答:
The loop frequency is a parameter that needs to be tuned just like your proportional, integral, and/or derivative terms. Varying it has a similar affect on your output as varying your other parameters. Too low a frequency and you'll never reach your desired steady state. Too high and the output will oscillate.

To determine the optimal loop frequency, you will first need to construct Bode plots from real world test or simulation data:

Bode plots concisely display all relevant frequency input and output
information on two plots: amplitude ratio as a functions of frequency
and phase shift as a function of frequency. The amplitude ratio plot
is a log-log plot while the phase angle plot is a semilog (or
log-linear) plot.

To construct a Bode plot, an engineer would have
empirical data showing input and output values that vary as sinusoidal
functions of time. For instance, there might be inlet temperature data
that varies sinusoidally and the outlet temperature data that also
varies sinusoidally.

The amplitude ratio, AR, is the ratio of the amplitude of the output
sinusoidal curve divided by the amplitude of the input sinusoidal
curve.

$$AR = \dfrac{outputamplitude}{inputamplitude}$$

To find the phase shift, the periods of the input and output sine
curves need to be found. Recall that the period, P, is the length of
time from one peak to the next.

$$P = \dfrac{1}{f} = \dfrac{2\pi}{\omega}$$
$$f = frequency$$
$$\omega = frequency(rad/sec)$$

Rules of Thumb when analyzing Bode plots

Generally speaking, a gain change shifts the amplitude ratio up or
down, but does not affect the phase angle. A change in the time delay
affects the phase angle, but not the amplitude ratio. For example, an
increase in the time delay makes the phase shift more negative for any
given frequency. A change in the time constant changes both the
amplitude ratio and the phase angle. For example, an increase in the
time constant will decrease the amplitude ratio and make the phase lag
more negative at any given frequency.

Then you will need to determine the cross-over frequency:

The proportional term moves the magnitude of the frequency response of
the open loop up or down and hence is used to set the cross-over
frequency of the open loop. The cross-over frequency is the frequency
at which the magnitude has a gain of 1 (or 0dB). This frequency is
important as it is closely related to bandwidth of the closed loop
response.

In an ideal system the proportional gain could be made (almost)
infinitely large leading to an infinitely fast, yet still stable,
closed loop. In practice that is not the case. Rather, two design
rules of thumb come into play.

Firstly the sample rate of the digital hardware on which the
controller is going to be executed needs to be considered. A typical
rule of thumb is that the cross-over frequency should be set to be at
least 10 times lower than the sample rate of the controller.
Conceptually this ensures that the controller is running at a fast
enough rate that it can adequately handle changes in the signal being
controlled.

The second rule of thumb is related to the slope of the frequency
response at the cross-over frequency. If the roll-off of the open-loop
magnitude response at cross-over can be made to be close to
-20dB/decade then the closed-loop bandwidth can be expected to be close to the cross-over frequency. Note that the integral and
derivative terms, not just the proportional term, are used to control
the slope at cross-over.

(emphasis mine)

So the optimal control loop frequency should be around 10 times that of the cross-over frequency of your system's phase delay which can be obtained through empirical test data or, ideally, computer simulation.


问:
Paper work before I do make my own Line follower Robot
I am a graduate student trying to make my own Line follower Robot for my minor assessment, I've all hardware parts and all data-sheets with me, I've attended a workshops of Robotics and studied a lot on Line follower robot. I have a good knowledge of C Programming and Embedded systems, but the problem is I've a very limited amount of time(2 days).

Please help me to suggest a good paper work about my Project - Line follower robot, where should I start from ? I am getting myself confused should I start from Programming or should I first do circuit simulations as I know It is not a better approach to use directly hardware.

Please suggest me a fine Paper work or some links/videos so that I can make my Robotics projects fast. Any help would be really appreciated, Thanks.

答:
Two days?  Eeek!

I wouldn't try to simulate the thing at a circuit level.  If you're an EE and you're familiar with circuit simulation packages then using SPICE (or whatever) to simulate the system may let you slide by with an acceptable performance.

Personally, if I were designing one of these for money, I'd probably simulate it in Scilab, possibly using Xcos -- but that's because I'm familiar with that tool.

Given your limited time I wouldn't try to do more than make something that follows straight lines and gentle curves at some fixed speed.


问:
How to deal with current spikes due to fast direction-switching motor commands?
I'm trying to build a self-balancing two-wheeled segway-like robot.  I'm currently using two 12v DC motors that draw approximately 600milliamps of current each.  I've noticed that when my robot tries to switch directions, it often does weird things like not switch at all or completely stop rotating altogether.  I suspect that when the motor controller (L298N H-Bridge) switches direction, it may be drawing even more current on it and this current is somehow affecting my microcontroller. </p>

<p>If that is the case, what can I do about it?  How can I prevent this large spike in motor current draw from affecting my microcontroller?  </p>

答: You can try to put a capacitor in the motor terminal. Very close to the motor. </p>


问:
Dynamic model using identification for control
I'm currently working of a 5 DOF robot, for which i'd like to compute the dynamic model through identification. I have experimental data representing torques (inputs) and positions (outputs). How can i obtain the closest dynamic model to the structure? and how to validate the obtained model. The objective is to design some non linear control using the obtained model. Could you help me out. Thank you so much. Regards  </p>

答:
Given that you have your forward kinematics already, you can formulate the dynamic model with the two methods mentioned in the answer by Ababu.

Then you can put estimates of your robot parameters (masses and inertias ) and compute the regressor with the experimental data.

From the dynamic model you can parametrize the model in terms of mass/inertia parameters instead of joint positions. This parametrization let you build the regressor matrix.

A very nice method is explained in Dynamic Model Identification For Industrial Robots - Ieee Journals & Magazine.


答:
As explained in my answer to What is stall current and free current of motors? when switching direction on a motor, you can end up drawing more than the maximum normal current rating. This can cause trips to be thrown, amplifier shutdown or voltage drops and loss of control.

One option is to try to reduce the stress on the motor and amplifier. For instance instead of going from -100% to +100%, try going from -100% to 0% briefly, before going to +100%, or limiting the rate of change of the torque demand.

What you specifically need to do will depend on the time constant of your mechanical system, the control loop update rate and the responsiveness/stability that you require. All of these factors should be balanced to keep you system within it's physical limits.

Title: How to deal with current spikes due to fast direction-switching motor commands?

Body:
I'm trying to build a self-balancing two-wheeled segway-like robot.  I'm currently using two 12v DC motors that draw approximately 600milliamps of current each.  I've noticed that when my robot tries to switch directions, it often does weird things like not switch at all or completely stop rotating altogether.  I suspect that when the motor controller (L298N H-Bridge) switches direction, it may be drawing even more current on it and this current is somehow affecting my microcontroller. </p>

<p>If that is the case, what can I do about it?  How can I prevent this large spike in motor current draw from affecting my microcontroller?  </p>


问:
Is it better to have batteries distributed at the rotors or the center of the multicopter?
I've seen 3 approaches to mounting batteries on a multicopter:

All the batteries rigidly mounted near the center of the airframe

All the batteries in a bag hanging under the center of the airframe

Each rotor has its share of the batteries rigidly mounted near/under it. (For example, a quadcopter with 1/4 of all the batteries mounted underneath each motor).

Which design is the best, and why?
If there is no one best design, what are the advantages/tradeoffs between the designs?
Is there some other design I'm overlooking that is better in some way?

(This question focuses on multirotor flying machines.
For ground vehicles, see " Is it better to have weight distributed over the wheels or the center of the robot? ").

答:
Definitely rigidly mounted to make use of the batteries mass for vibration damping but where?
Depends if you want an agile acrobatic machine or a stable camera platform. Spread the mass out if you want to reduce the wobbles in turbulence.</p>


问:
PID and Kalman filters
Both PID and Kalman filters are used extensively in Robotics. I gather, Kalman filters for sensing and PID for control. What is the mathematical, statistical or other relationship between them?</p>

答:
There isn't really a relationship between them, unless you're asking how the dynamics feed each other when combined into a system.

If that's the case, then I would suggest maybe starting with a review of the Luenberger observer. It's typically taught as the "dual" of the state feedback control problem - state feedback controls attempt to drive the system states to zero, and the observer design "rephrases" the problem to make feedback error the state and then attempts to drive the feedback error to zero with the same "pole placement" mechanic.

The filter has some error dynamics, and that dynamic error will get sent to the PID controller. The PID controller acts on the feedback + error dynamics and the resulting control signal gets sent to the plant.

I suggested starting with the Luenberger observer because IMO it's easier to look at with regards to error dynamics than the Kalman filter (try this, starting at equation 25). The process for evaluating the effect of the error is otherwise the same - filter generates feedback error until the filter states converge, and that error is fed to the controller.

This may be way off your intent with your question too, though. Please let me know if this is along the lines of what you're asking.

Title: PID and Kalman filters


答:
I've experienced a similar problem before. For me, the root cause was insufficient battery power. When my motor tried to draw peak power it caused the battery supply bus to brown out. This led to supply voltage dropping below the minimum rated voltage for the motor controller. The master board was fine as the brownout voltage was still above that minimum.

When the motor controller browned out it cleared its own enable bit and the motor stopped responding. Additionally, it required a certain "arming" sequence before it would respond to speed commands, and I had only programmed those to be sent on initial startup. Since the master board was never reset, the master continued sending valid speed commands to the motor controller, but the motor controller failed to respond because it hadn't been (re-)armed.

Potential solutions for you:

Check that your existing battery is actually fully charged.

You can add more batteries (or battery packs, depending on your configuration) in parallel to boost your supply capacity. As with all batteries, they should all be fully charged before you connect them all together.

If your issue is that your controller is getting reset, you could provide two different batteries. One larger battery to run the H-bridge chip and the motor and a (not necessarily) smaller battery to run your controller. You will need to ensure that the controller, H-bridge, and motor all share a common ground or the H-bridge may fail to respond to PWM signals. This is a less-desirable option, because the motor response will be limited by your supply power (they'll accelerate slowly), but it's a quick/cheap fix if your existing batteries are hard to source.

You could try adding a capacitor as jdios said. I would argue it would be better to use a large capacitor on the battery-supply-side of the H-bridge than to put it next to the motor, but just because the motor is bidirectional. Large capacity electrolytic capacitors are pretty easy to come by, but they're polarized. As I mentioned in my comment in jdios' post, the capacitor does smooth voltage, and it provides a short-duration current surge during high-demand conditions by preventing the supply voltage from falling.

Mark Booth's answer is also valid, and would probably be my go-to answer (it was how I solved my own problem), except for the fact that you're trying to do control. Adding a rate-limiting scheme as described there is effectively creating an actuator saturation limit, which then will cause more problems for your controller (control windup).


答:
It's maybe not this at all, but when a motor or any inductive system suddenly stop it create a short opposite surtense that can affect your microcontroleur. The solution is to ad a flyback diode within your motor driver. Most of the motor's driver (including the H-bridge) are provide with flyback diode built-in but you can check if yours got one.

Here the wiki if you want to lear more about flyback diode https://en.wikipedia.org/wiki/Flyback_diode

Hope I've help you.


答:
Allow me to summarize and add to Chuck's great answer.

You use a filter to make sense out of your raw sensor readings. They mathematically reduce noise, or coalesce multiple data points into a single useful measurement.

The difference between the actual measurement and the desired value is called error. The job of a PID controller is to minimize the error, keeping your robot as close to the target as possible. For example, a line-following robot may filter multiple light sensor values to determine how far away is is from the line. It uses a PID to adjust steering to minimize its distance from the line.

Title: PID and Kalman filters

Body: Both PID and Kalman filters are used extensively in Robotics. I gather, Kalman filters for sensing and PID for control. What is the mathematical, statistical or other relationship between them?</p>


问:
How does structural/installation errors have to be modelled in a gyroscope IMU?
I have the model for a gyroscope from an IMU given by

$$
\omega_{meas} = (I-S)\omega_{true} + \beta + v
$$

$S$ is the scaling and misalignment of the sensor, which I understand is a parameter I get from datasheet. $\omega_{true}$ is the true value of the gyro rates, $\beta$ is the bias defined by the bias instability, and $v$ is the noise
defined by the ARW parameter and bias instability.

After installation of the IMU, there will be an error due to structural misalignments between the IMU and whatever my structure will be. So, this structural error, $R_{struct}$, will generate a frame rotation, so I am a bit confused on how this error has to be modelled. I modelled it as affecting the whole measurement:

$$
\omega_{meas} = R_{struct}\left((I-S)\omega_{true} + \beta + v\right)
$$

But someone told me it has to be applied only to the true measurement:

$$
\omega_{meas} = (I-S)R_{struct}\omega_{true} + \beta + v
$$

I think is has to be applied on the whole system as otherwise, even do small, I will be applying the bias and noise in another frame.

答:
It's a little difficult to visualize rotations of a rotation sensor, so let's consider an accelerometer instead. You've got the same problem with an accelerometer: if the sensor isn't aligned with the chassis frame, you introduce a relative rotation $R_{struct}$.

Now, let's suppose some properties to go along with the accelerometer. We'll say it measures x- and y-axis accelerations, where +x is right/starboard and +y is forward. +z is up.

Let's also say that accelerometer has a y-axis bias of $1$ and an x-axis bias of 0. The chassis frame is currently accelerating at a rate of 1 $g$ forward.

If the accelerometer is well aligned to the chassis such that $R_{struct} = I$, then you get:

$$
a_{meas} = \left[\begin{array}{ccc}
0 \\
g \\
\end{array}\right] + \left[\begin{array}{ccc}
0 \\
1 \\
\end{array}\right]
$$

That is, for a well-aligned accelerometer, the x-axis output is $0$, from the fact that the chassis isn't accelerating along the x-axis, plus $0$, from the fact that the bias on the x-axis of that sensor is also zero.

The y-axis output is $g + 1$, from the chassis motion and the bias along the y-axis.

NOW, consider what happens if you rotate the sensor by +90 degrees about the z-axis. The sensor (+y) is now oriented along the chassis (-x) and the sensor (+x) is now oriented along the chassis (+y). Repeat the same measurement and now you get a reading of:

$$
a_{meas} = \left[\begin{array}{ccc}
g \\
0 \\
\end{array}\right] + \left[\begin{array}{ccc}
0 \\
1 \\
\end{array}\right]
$$

The chassis is accelerating at a rate of $g$ along its +y-axis, which the sensor is registering as a +x motion. However, the sensor is going to output a y-axis bias of $+1$ regardless of the orientation of the sensor.

That is, if there were no bias, your reading would be:

$$
a_{unbiased} = R_{struct}a_{chassis} \\
$$

The sensor bias is independent of the sensor orientation, so you add that to the unbiased reading:

$$
a_{biased} = a_{meas} = a_{unbiased} + bias \\
\boxed{a_{meas} = R_{struct}a_{chassis} + bias} \\
$$

Lastly, I believe if the bias were applied to all parameters, as you wrote:

$$
\omega_{meas} = R_{struct}\left(\left(I-S\right)\omega_{true} + \beta + \nu\right) \\
$$

That you could distribute the $R_{struct}$:

$$
\omega_{meas} = R_{struct}\left(I-S\right)\omega_{true} + R_{struct}\beta + R_{struct}\nu \\
$$

And then you could cleverly rotate your sensor to an angle of $\theta_{clever} = \mbox{atan2}\left(\beta_y,\beta_x\right)$ and have the entirety of the bias occur on one axis only and have the other axis be bias-free. That is, if the bias is based on sensor orientation, it would then become possible to affect bias or noise by altering the orientation of the sensor.


答: The Kalman filter optimizes the estimate of the system state in the presence of measurement errors and model errors.  PID tries to drive a particular model/measurement system to a chosen state.  </p>

Title: PID and Kalman filters


问:
Sporadic sensing rates for hc-sr04 ultrasonic distance sensor
Been working on a robot recently which uses ultrasonic sensors for an integral part of the navigation.
While testing the sensors I noticed a strange behaviour, the sensors seem to frequently stop functioning and bring the entire Arduino Mega I'm working with to a stop. The strange part is that these stops seem to be entirely random, on some occasions the sensor will read values consistently (at maybe 20 vals per second) for 10+ seconds, then all of a sudden the sensor will slow to reading only 2-3 values per second with stalls between.

I have tested several sensors and different codes for pinging distances yet the problem has persisted.

This leads me to believe the issue is with the arduino mega itself, but I am unsure how to verify this. Any advice?
Thanks in advance!

PS: other pins on the Mega seem to be working fine, i.e. analog pins for IR reflectance sensors and PWM pins for driving 2 DC motors.

答:
I had similar issue recently and it looks it's rather hardware related problem (power of input source???). As you see on pictures below the width of the echo pulse has been sent inconsistently across measurements. I had it powered from Arduino Mega 2560 board (digital +5v and gnd), but it shouldn't cause such issue by me. When I was trying to connect external 12V to the board it got fired :( so I have to order new one board and then to repair the first one unit...)

The shorter one pulse is below (see measurement values on the right side of the picture). The upper wave is Trigger line, the lower line (channel 1) is Echo line...

This is the longer one pulse:

The test has been done against normal wall. The interesting point to notice here is it contains (more or less) two values only when the second one is almost twice as the first one value...

Edit after receiving the new one board:

I have connected regulated power source to vcc ofhc-sr04 with values equal to 5.0V and 5.1V and it didn't change the behavior of echo line. It looks this chip doesn't know how to deal with reflections or something similar so it can work on very short distances only (up to 30 cm?) or maybe less :(


问:
Robots without microcontrolers (beam robots). Are they technologically limited?
BEAM robotics seem to be a good approach to teach learners about electronics in robotics. But can these robots be like regular programmed "cognitive" robots? Can these robots, with just analog circuits, take us to the level of robotic assistants, worker robots and other kinds of self sufficient autonomous robots?

I specifically want to know that, when creating mission critical robots ->

1) What are the areas in robotics which are practically impossible without a real time software system?

2) What areas of the field can be done without programming? If yes, are these areas feasible without an onboard software system?

3) Could an intelligent space rover, work without a cpu in the future?

答:
0) Implicit (?) question about BEAM robots: These represent only a subset of cpu-free robots. Although you can build pretty complex robots without a microprocessor/microcontroller, BEAM robots (based on Mark Tilden's work) are mostly stimulus-response simple machines, where simplicity on itself is a design goal.

1) I'm not aware of any robotics area where building a software-free robot is "impossible". I support this answer on the fact that analog circuits (and the subset called analog computers) played roles even in different hard real time systems in the past. There are modern developments for bringing back combinations of analog and digital computers for different applications. So, making a robot using analog circuits, even a complex robot, is perfectly possibly. But please note that that does not mean that it wouldn't be much more easier/cheaper/faster/flexible to build the same robot using modern CPUs/MCUs.

2) This is related to 1, and also related to your definition of programming. I've seen robots where some of the functionality was solved using MCUs, but where other subsystems of the same robot (for example vision processing) were solved using FPGAs. Being reconfigurable hardware, FPGAs can fit a reconfigurable CPU on a given configuration, or not. So if your question is not excluding FPGAs, then I would say that you can do whatever you do with CPUs with FPGA based implementations. Again, this does not mean that it will be easier, etc. But in some cases, the performance of an FPGA is highly desirable. Also, as FPGAs are today reconfigurable in the field, you do not lose flexibility either. If you exclude FPGAs, then you can still implement most functions with analog circuitry. NOTE: You asked specifically about fields that can be done "without programming". Someone may question that hardware description languages are a kind of programming. But it can also be argued that they are just equivalent to defining a circuit on paper and then building it. That's why I mentioned FPGA based systems here.

3) Based on what I think about 1 and 2, then: yes.

I worked once on a small cheap robot of which we were going to produce between 200 and 500 units. It was for promotional usage, so we wanted to make it with some analog componentes that we had in stock already. It only needed to follow a line. So I started making it fully analog. But at some point we found some problems with the thresholds, etc., and decided to use a very small microcontroller (an 8 pins ATTiny), which resulted also in a very cheap design, and saved us some development time. So what I mean is that sometimes even the simplest designs may justify using a small CPU today, even if the same thing can be done without it.


问:
Why we want to write all linear system into form of first order differential equations?
It seems to be taken granted that when we deal with some control system, the first thing we want to do is to linearize the system and put it in form of first order differential equations like $\dot x = Ax + Bu$.

But why do we want to do this? And most importantly, why it is always first order? Why we don't want to write the dynamics like $\ddot x = A\dot x + Bx + Cu$?

答:
I believe this is done for generality. You can always see a $n^{th}$ order differential equation as a system of $n$ coupled first order differential equations. Therefore it is a good practice to first bring back your higher order system to a first order system so that it can then be solved in the standard way.

The first order is the lowest order that you can use to describe your higher order differential equation. Being the lowest order it is also the most compact (the resulting matrices are more dense).

If the scientific community decided to use second order diff. eq. as a new standard form then the resulting solution matrices would be very sparse (lots of null coefficients) and we could not use that procedure for solving first order diff. equations anyway.


问:
Position Tracking using IMU
I am working on a robot tracking application, where our main tool (a camera) for locating the x & y position of the robot is working on a quite low frequency.
Therefore, I am looking for ways to intermediately track the position of the robot without directly measuring it.

The robot has a built in accelerometer, gyroscope and magnetometer.
I know that I can double-integrate the acceleration measurements to get a (very noisy) estimate of my current position. I also can use gyroscope and magnetometer to track the pose of the robot (which I am not primarily interested in).

Is there anything else I could do to improve the position estimate given those three sensors, besides double-integration of acceleration?

答:
You linked your question with a kalman filter. I guess that's the right way.

Basically it solves your problem: Estimation of a position, based on different sensor signals. It is usually used for sensor fusion with gps data and acceleration data. But you can use any kind of  mesuarements of the robots dynamic. It is possible to implement a kalman filter with different sample times for the different signals. I can edit this post later, if I have my lecture notes with me for the equations. But maybe you find them with the help of google in the mean time.

If the quality of your available signals is not good enough, you could maybe use additional bluetooth bacons. But I never tested this by myself and read the accuracy is quite low. How about a laser distance sensors to allocate the distance to a wall? What kind of robot do you use?

Another interesting concept is the particle filter.

Title: Position Tracking using IMU


答:
I will use Mr. Richard Feynman's quote to answer your first question:

Finally, we make some remarks on why linear systems are so important.
The answer is simple: because we can solve them!

Yes. That's all there is to it. It is well understood how to deal with linear systems. It is possible to generalize any notion about linear systems, but not about nonlinear systems (i.e. nonlinear systems need to be thoroughly studied). There are some systems, however, that cannot be linearized, so nonlinear methods exist to deal with these nonlinear systems (e.g., a very fast pendulum cannot be modeled accurately with a linearized model).

The second question involves why differential equations are converted into first order systems. Once again, solving them is the answer. First order differential equations are much simpler and easier to handle than higher order differential equations. In control systems, this representation is called space-state representation. You can read more about this technique.

Title: Why we want to write all linear system into form of first order differential equations?

Body:
It seems to be taken granted that when we deal with some control system, the first thing we want to do is to linearize the system and put it in form of first order differential equations like $\dot x = Ax + Bu$.

But why do we want to do this? And most importantly, why it is always first order? Why we don't want to write the dynamics like $\ddot x = A\dot x + Bx + Cu$?


答:
:EDIT:

I was writing a comment that I don't think there's going to be a definitive answer on this question, that the question is akin to "Why do we draw free body diagrams for an engineering analysis?" or, "Why do we factor polynomials?"

I then realized that this question is very much like, "Why do we factor polynomials?" Factoring a polynomial is useful because it reduces a higher order expression into products of first order expressions.

Translating a system's dynamics equations into a series of coupled first order linear ODEs does the same thing. This still isn't an answer more than the original answer below, just a reinforcing concept that we generally choose to start with the simplest representation available because it affords the simplest means of solving the problem.

:Original post:

Dynamic systems are usually represented that way because it's a "canonical form" for control problems.

A canonical form is advantageous because, if you can express your problem in a canonical format, you get to use all of the preexisting tools that have been developed to analyze and solve that problem.

Consider standard interfaces in other settings - I can connect my watch, a printer, an Arduino, a game controller, etc. to my computer because they all use the USB standard interface. I don't need to keep a kit full of proprietary cables, or have a laptop that has a bank of proprietary connectors, thanks to the standard interface.

Similarly, I don't need a "toolkit" of methods to evaluate or solve controls problems if I can get to the canonical control form. In particular, some important "standard tools" include:

Eigenvalues of $\bf{A}$ reveal system stability,

Standard methods to check for observability and controllability,

The separation principle, which shows that you can design the controller and observer independently,

Standard method for modifying system response (pole placement),

Scalability from single input, single output (SISO) systems to multi-input, multi-output (MIMO) systems, and the associated linear quadratic regulator,

Relatively easy to construct a Kalman filter from that representation (if the Kalman filter has $\hat{x}_{k|k-1} = F_k \hat{x}_{k-1|k-1} + B_k u_k$, then you can use $F_k = (I + A\Delta t)$ and $B_k = B \Delta t$, and then $H_k = C$).

This is a list of things that rely on your system to be in the form:

$$
\dot{x} = Ax + Bu \\
y = Cx + Du \\
$$

If you want (or need) to express your problem differently then the tools I've mentioned above are no longer valid and you need to find/make equivalents for your application. The hard part there isn't just finding something that "looks like" the tools mentioned, or that has "similar looking step responses," but proving things like BIBO stability, etc. This is the hard work that has been done for you already if you (can) use the existing tools.


问:
How can I get data from my kinect?
Whenever I try using openni_launch, it works normally, however, when I try viewing an image using the kinect's rgb or depth camera, or even recording a simple bagfile with data from the kinect, I am unable to see any picture and rosbag does not record any data, and after a few seconds of running image_view or rosbag record, I got this error:

```<code>terminate called after throwing an instance of 'openni_wrapper::OpenNIException'
  what():  virtual void openni_wrapper::OpenNIDevice::startImageStream() @ /tmp/buildd/ros-groovy-openni-camera-1.8.8-0precise-20130418-2203/src/openni_device.cpp @ 224 : starting image stream failed. Reason: Xiron OS got an event timeout!
[camera_nodelet_manager-2] process has died [pid 3788, exit code -6, cmd /opt/ros/groovy/lib/nodelet/nodelet manager __name:=camera_nodelet_manager __log:=/home/rosbotics/.ros/log/16b63744-e043-11e2-ac16-080027486aa8/camera_nodelet_manager-2.log].
log file: /home/rosbotics/.ros/log/16b63744-e043-11e2-ac16-080027486aa8/camera_nodelet_manager-2*.log
</code>```

After searching around and trying various fixes, I figured it might be a problem with openni and started using freenect, however I encountered the same problems, I could not record any data using bagfiles or see any images from the kinect (using rviz or image_view)

Then someone asked me to use something completely unrelated, freenect-glview, however that too gave me a black screen.

lsusb shows that all 3 parts of the kinect are connected and I've been able to control the kinect's motor through ubuntu so I know that there is at least a connection established between both.

Additional Info:

I run ROS on Ubuntu using VirtualBox V.4.2.14 and Windows 7 with USB 2 ports

I am using ubuntu 12.04 and ROS-Groovy (all up to date)

I've had the exact same errors on my Mac OSX Lion

When I try using Rviz with the kinect, VirtualBox crashes all together

I would appreciate anyone's help on the matter.

答: It turns out VirtualBox was causing everything to not work properly for some reason. Now I'm using VMware and everything's running fine. What confused me was that I was getting errors that I found online and that even after trying every fix I could find some would still be there. Next step is getting XYZ coordinates of a moving robot, I'll start looking for tutorials right away (I'm still new to ros).</p>

Title: How can I get data from my kinect?


问:
Any reference for "3D feature matching + ICP"?
One of the simple tricks in getting high performance for a global 3D point cloud registration is combining "3D feature matching + ICP". For example FPFH matching + RANSAC for initial pose estimation and ICP for pose refinement.

Does anyone know a good reference paper for this method? I am referring to this method in my paper but don't know who first proposed it.

答:
Have you reviewed this article?

An Explicit Loop Closing Technique for 6D SLAM

It consists of building the 3D model of environment with heuristic loop closure using ICP and reliable feature extraction.


答:
I'm not sure if this is the paper where the method was first proposed, but the 1992 paper A Method for Registration of 3-D Shapes by Best and McKay (published in IEEE Transactions on Pattern Analysis and Machine Intelligence 14(2):239-256 · March 1992) does describe a method of the kind you are looking for.

More importantly from your perspective, it includes a fairly detailed review of the literature at that date.

Title: Any reference for "3D feature matching + ICP"?

Body:
One of the simple tricks in getting high performance for a global 3D point cloud registration is combining "3D feature matching + ICP". For example FPFH matching + RANSAC for initial pose estimation and ICP for pose refinement.

Does anyone know a good reference paper for this method? I am referring to this method in my paper but don't know who first proposed it.