问:
State Space model for bouncing ball
In lecture 5.5 Bouncing ball, slide 26, Coursera's Control of Mobile Robot course, how are the state space equations formed in "Equations of motion in-between bounces"? Why is [0 -g] added?

And how is the state space equation for bounces formed?

P.S. The ball released from a height h.

答:
Matrix notation in general is nice because of how compactly you're able to write and especially read everything, similar to using descriptive variable names in programming or performing algebra with variables instead of values with units.

In your case, state space notation typically has the state vector $x$ that is comprised of a "list" of derivatives. This is the result of decomposing a higher order differential equation into a set of coupled first order differential equations. In your case, it looks like you have a height $h$ as a state, with a first derivative:

$$
x = \left[\begin{matrix}
h \\
\dot{h}
\end{matrix}\right]
$$

If you take the derivative of your state vector $x$, you get $\dot{x}$, which is equivalent to:

$$
\dot{x} = \left[\begin{matrix}
\dot{h} \\
\ddot{h}
\end{matrix}\right]
$$

Basically, everyone gets an extra "dot" (derivative). Now the thing to do is to find expressions for $\dot{x}$ in terms of $x$.

So, for the first entry in $\dot{x}$, in terms of a value from the state vector $x$, you can only say:

$$
\dot{h} = \dot{h}\\
$$

Since $\dot{h}$ is the second entry in the state vector $x$, you would write that as:

$$
\dot{h} = \left[\begin{matrix}
0 & 1
\end{matrix}\right] x \\
$$

Again, remember that $x$ is really equal to $\left[\begin{matrix} h\\\dot{h}\end{matrix}\right]$, and so you are saying:

$$
\dot{h} = \left[\begin{matrix}
0 & 1
\end{matrix}\right] \left[\begin{matrix} h\\\dot{h}\end{matrix}\right] \\
$$

If you multiply that out, you get:

$$
\dot{h} = \left(0*h\right) + \left(1*\dot{h}\right) \\
$$

which obviously then is the same as $\dot{h} = \dot{h}$.

Great!

Now, to the second entry in $\dot{x}$, again in terms of a value from the state vector $x$, well.... the second entry in $\dot{x}$, which is $\ddot{h}$, doesn't have anything to do with either entry in $x$!

Instead, the expression for $\ddot{h}$ is just $\ddot{h} = -g$; that is, the vertical acceleration is just gravity. But, you have to include the values from $x$, which means you have to explicitly state that you aren't using any:

$$
\ddot{h} = \left[\begin{matrix} 0 & 0 \end{matrix}\right] \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right] + \left(-g\right) \\
$$

Now, go back to the expression for the first entry in $\dot{x}$, and be more explicit that you aren't using any constants:

$$
\dot{h} = \left[\begin{matrix} 0 & 1 \end{matrix}\right] \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right]  + 0 \\
$$

When you write the two equations together, then you see that you get:

$$
\dot{h} = \left[\begin{matrix} 0 & 1 \end{matrix}\right] \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right]  + 0 \\
\ddot{h} = \left[\begin{matrix} 0 & 0 \end{matrix}\right] \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right]  + \left(-g\right) \\
$$

Regroup it a little and you end up with the matrix notation from your slide:

$$
\left[\begin{matrix} \dot{h} \\ \ddot{h} \end{matrix}\right] = \left[ \begin{matrix} 0 & 1 \\ 0 & 0 \end{matrix}\right] \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right] + \left[ \begin{matrix} 0 \\ -g \end{matrix} \right] \\
$$

And again, if you let:

$$
x = \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right] \\
$$

Then

$$
\dot{x} = \left[\begin{matrix} \dot{h} \\ \ddot{h} \end{matrix}\right] \\
$$

And finally you can rewrite the matrix notation as:

$$
\boxed{\dot{x} = \left[ \begin{matrix} 0 & 1 \\ 0 & 0 \end{matrix}\right] x + \left[ \begin{matrix} 0 \\ -g \end{matrix} \right]} \\
$$

The other way to get there is to just start with the equation of motion:

$$
\ddot{h} = -g \\
$$

That's it; the ball is only accelerating because of gravity. There's a technique to get to the state space equation from here that, like most other math/algebra stuff, will become second nature with practice. Essentially, re-write the equation to include the "missing" terms:

$$
\ddot{h} + 0*\dot{h} + 0*h = -g \\
$$

And you have to know that you're trying to get to a final form of:

$$
\dot{x} = Ax + Bu\\
$$

So you rearrange and get a little closer:

$$
\ddot{h} = -0*h - 0*\dot{h} - g \\
$$

Obviously $-0 = +0 = 0$, but I'm just highlighting that the expression's getting rearranged. Now you can see that you have a constant of $-g$, and it looks like your state vector is then $\left[\begin{matrix} h \\ \dot{h} \end{matrix} \right]$. Now you can write:

$$
\ddot{h} = \left[\begin{matrix} 0 & 0 \end{matrix}\right]\left[\begin{matrix} h \\ \dot{h} \end{matrix}\right] - g \\
$$

And here again it looks like you could say $x = \left[\begin{matrix} h \\ \dot{h} \end{matrix}\right]$, and if you're trying to get to:

$$
\dot{x} = Ax + Bu \\
$$

then you need to figure out to write for the other terms in $\dot{x}$. First, define what $\dot{x}$ is equal to:

$$
\dot{x} = \left[\begin{matrix} \dot{h} \\ \ddot{h} \end{matrix}\right] \\
$$

and you've already got the expression for $\ddot{h}$, so now you just need an expression for $\dot{h}$ that fits in the framework. Again, this winds up with the trivial

$$
\dot{h} = \dot{h} + 0 \\
$$

and you again wind up with:

$$
\left[\begin{matrix} \dot{h} \\ \ddot{h} \end{matrix}\right] = \left[\begin{matrix} 0 & 1 \\ 0 & 0 \end{matrix}\right]\left[\begin{matrix} h \\ \dot{h} \end{matrix}\right] + \left[\begin{matrix} 0 \\ -g \end{matrix}\right] \\
$$

or, again,

$$
\dot{x} = \left[\begin{matrix} 0 & 1 \\ 0 & 0 \end{matrix}\right]x + \left[\begin{matrix} 0 \\ -g \end{matrix}\right] \\
$$

This is like factoring polynomials, trig proofs, or any other skill - it's something that's awkward at first and only gets easier with practice. Hopefully this is all clear enough to show you how that particular expression was derived. If not, please leave a comment and I'll try to help clarify.

Title: State Space model for bouncing ball


问:
Representation of 2D coordinate space with orientation
I wanted to know what is the mathematical representation of 2D coordinate space with orientation in the same plane.

2D coordinate space is represented as $R^{2}$, how do I include orientation in the same? or is it included in it?

答:
You need to resort to the Special Euclidean groups.

In particular, in your planar case, the group is $SE\left(2\right)$ and thus the representation is the following:

$
T=\left(\begin{matrix} R & v \\ \mathbf{0} & 1\end{matrix}\right),
$

where $R \in \mathbf{R}^{2\times2}$ is the matrix accounting for the rotation, whereas $v \in \mathbf{R}^2$ is the translation part.

Therefore, if you want to roto-translate a point $p \in \mathbf{R}^2$, just do this:

$
p'=T \cdot \left(\begin{matrix} p \\ 1\end{matrix}\right)
$

Finally, to invert this kind of transformations, have a look at this Q&A.

ContentLicense: CC BY-SA 4.0


答:
From Newton's second law, we have
$$
\sum F = m\ddot{h}
$$
Assume for simplicity the only force acts on the ball is the gravitational force $f_g$ (i.e. for more accurate model, you may consider the drag force as well)
$$
\begin{align}
-f_g &= m\ddot{h} \\
-mg &= m\ddot{h} \\
\ddot{h} &= -g \tag{1}
\end{align}
$$
Eq.(1) is a second order differential equation. We need to convert it to a first order differential equation by introducing two variables as follows:
$$
\begin{align}
x_1 &= h \tag{2} \\
x_2 &= \dot{h} \tag{3}
\end{align}
$$
Now differentiate Eq.(2) and Eq.(3) with respect to time, we get

$$
\begin{align}
\dot{x}_1 &= \dot{h} \tag{4} \\
\dot{x}_2 &= \ddot{h} \tag{5}
\end{align}
$$
From Eq.(3) and Eq.(4), we have
$$
\dot{x}_1 = \dot{h} = x_2
$$
From Eq.(1) and Eq.(5), we have
$$
\dot{x}_2 = \ddot{h} = -g
$$

The new representation is now

$$
\begin{align}
\dot{x}_1 &= x_2  \\
\dot{x}_2 &= -g
\end{align}
$$

In a matrix-vector form,

$$
\begin{align}
\begin{bmatrix}
\dot{x}_1 \\ \dot{x}_2
\end{bmatrix}
&=
\begin{bmatrix}
0 & 1 \\
0 &  0
\end{bmatrix}
\begin{bmatrix}
x_1 \\ x_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\ -g
\end{bmatrix}
\end{align}
$$
This is what in the presentation, however, a more correct model would be
$$
\begin{align}
\underbrace{
\begin{bmatrix}
\dot{x}_1 \\ \dot{x}_2
\end{bmatrix}
}_{\dot{x}}
&=
\underbrace{
\begin{bmatrix}
0 & 1 \\
0 &  0
\end{bmatrix}
}_{A}
\underbrace{
\begin{bmatrix}
x_1 \\ x_2
\end{bmatrix}
}_{x}
+
\underbrace{
\begin{bmatrix}
0 \\ -1
\end{bmatrix}
}_{B}
g
\end{align}
$$

The system is now in this form:
$$
\dot{x} = Ax + Bu
$$
where $u=g$ is the input of the system. In this case, the gravity is considered as an input that governs the ball's motion.

For the output, we assume the height $h$ is the output (i.e. it is an arbitrarily choice, we may choose the velocity $\dot{h}$), therefore, the output in the new representation is constructed as follows:
$$
y =
\underbrace{
\begin{bmatrix}
1 & 0
\end{bmatrix}
}_{C}
\underbrace{
\begin{bmatrix}
x_1 \\ x_2
\end{bmatrix}
}_{x}
$$

Title: State Space model for bouncing ball

Body:
In lecture 5.5 Bouncing ball, slide 26, Coursera's Control of Mobile Robot course, how are the state space equations formed in "Equations of motion in-between bounces"? Why is [0 -g] added?

And how is the state space equation for bounces formed?

P.S. The ball released from a height h.


答:
g is added because it is needed for initializing the physics engine. Box2d takes before the first run a value which is usually -9.81 but the user can change it to 9.81 if is his coordinate system works different or he can use even zero gravity. In contrast, the term state space refers to the action space in which the overall system can be. For example, if the ball is at position=30,20 and then moves to 30,10 this has to do with the state space transition.

```<code>import Box2D
g = 9.81
world = Box2D.b2World(gravity=(0,g), doSleep=True)
</code>```

The matrix notation in the original posting is very illustrative, because it makes clear that bouncing balls have to do with mathematics and linear algebra. It is the lingua franca in science and should be used as much as possible to prevent the fuzzy logic enthusiasts from taking over our control-theory.

Title: State Space model for bouncing ball

Body:
g is added because it is needed for initializing the physics engine. Box2d takes before the first run a value which is usually -9.81 but the user can change it to 9.81 if is his coordinate system works different or he can use even zero gravity. In contrast, the term state space refers to the action space in which the overall system can be. For example, if the ball is at position=30,20 and then moves to 30,10 this has to do with the state space transition.

import Box2D
g = 9.81
world = Box2D.b2World(gravity=(0,g), doSleep=True)

The matrix notation in the original posting is very illustrative, because it makes clear that bouncing balls have to do with mathematics and linear algebra. It is the lingua franca in science and should be used as much as possible to prevent the fuzzy logic enthusiasts from taking over our control-theory.


问:
Is rospython subscriber thread safe?
I'm trying to write a python node, which has one class and two member functions as callback functions.
so a TimeSynchronizer and Subscriber in a node.
I saw in this link and tested that python subscribers are event-driven model and are in separate threads.
How to get a python node in ROS subscribe to multiple topics?

My question here is , are they thread safe when they are working on the same class member? e.g. self.a below. Do I need to write a lock? Where can I find more information about this?
Thank you in advanced!!!!

class mr_listener(object):

```<code>def __init__(self):
    self.a =  [1,2,3,4,5]
    rospy.init_node('mr_listener', anonymous=True)
    scan_subscriber = message_filters.Subscriber('/scan',LaserScan)
    pose_subscriber = message_filters.Subscriber('/slam_out_pose', PoseStamped)
    ts = message_filters.ApproximateTimeSynchronizer([scan_subscriber,projected_scan_subscriber,pose_subscriber], 10, 0.1, allow_headerless=True)
    ts.registerCallback(self.callback1)
    rospy.Subscriber("chatter", String, self.callback2)
    rospy.spin()

def callback1(self,scan,pose):
    somthing

def callback2(self,chatt):
    somingthing
    rospy.sleep(1.)
</code>```

答:
For a particular topic, there is only one thread that all the
  subscribers share.

Each service callback does get its own thread because there can only
  be one service callback for a particular service.

Future versions of rospy will likely have a different, more
  versatile threading model for subscriptions.

rospy.spin() is a built-in asynchronous method in contrast with roscpp::spin() which is single thread (roscpp::AsyncSpinner() is async).

Callbacks in rospy in general is they're essentially handled
  sequentially during calls to Sleep and Spin, meaning they're
  implicitly threadsafe and I can modify the same data from multiple
  callbacks within a node without locks or other safeguards.

Unfortunately, no. Unlike roscpp, rospy creates a new thread for every
  Subscriber and Timer. In fact, rospy.spin() is just an infinite loop
  of half-second waits. As such, callbacks in rospy are not threadsafe.
  You should use locks in any rospy node where multiple callbacks of any
  kind might interact.

Title: Is rospython subscriber thread safe?


问:
PID vs Fuzzy line follower
I am making a line follower to follow a white line (approx 1.7 cmm wide) on a black track. I am using an array of 5 TCRT5000 (IR led+phototransistor) to detect the line. I was previously working with PID but recently I found a few papers on fuzzy logic. Some of them showed fuzzy logic being better than PID. Is fuzzy logic a better choice than PID for my case? I want my bot to as fast as possible.

P.S- The bot is just following a constant width line on a track with a few slopes of 18 deg.

答:
Fuzzy logic is the weaker choice. It would make the robot no longer working. The better idea is to stay within the classical pid control paradigm which is based on mathematics and is teached in universities. Fuzzy logic was only a period in AI history which was restricted to japan in the 1990s and then it was forgotten, because the engineers have recognized that they need a different kind of controller in their robots.

For a classical pid controlled line follower, the current situation is compared with the desired state. This is done by calculating the error value. The algorithm has to minimize the error value which is equal to move the robot closer to the line. This can be done with policy iteration which is a heuristic search technique in the state space. Another option is a neural network which can learn the policy with trial and error. That means the distance to the line is used as the error value, and the weights of the neural networks have to adjust to provide better control signals. This kind of neural network pid control is state of the art in robotics and will result into good results in professional robotics competitions.

ContentLicense: CC BY-SA 3.0

Title: PID vs Fuzzy line follower


问:
How to approach any advanced control problem in robotics
I have worked on a couple of projects like control of a quadrotor/ self balancing robot/ 6 dof robotic arm using nonlinear, optimal and adaptive control. So, in all these projects I have first basically tried to understand the dynamics of the system, then I modeled it. Next I applied different control strategies and compared their responses and chose the best one.

My question is when approaching problems in industry or in research, is the approach for these simple bots fine or are there other things that I should consider.

EDIT:
Can someone who has worked/ has experience in this area, put a step by step approach that should be done to approach any control problem in any field. With the necessary concepts and skills needed.

答:
Models.

If you want to get good at control engineering, get good at modeling. If you want to impress a controls professor, get good at modeling. Models are how you're going to do 90 percent of your job, regardless of the controller style you choose to implement, so get good at modeling!

If you want to try building a PID controller, first build a model of the plant and then wrap the PID controller it.

If you want a state feedback controller, first build a model of the plant and then move the poles wherever you want.

Real machinery costs money, real process lines cost money to shutdown for testing and upgrades, real equipment has limited availability.

For me professionally, I wind up working a lot of long hours in remote locations, away from my family, and in the middle of the night because that's where the equipment is and that's the only time it's available for testing.

The best thing I can do for myself, for my employer, for the client, and for my family is to try to build a model of the system and design some model validation tests that can be used to determine if I have an accurate model or not.

I do some work in the office, make a brief trip to site for a validation test, then return to the office to develop the controller, then return to site to implement and test the controller.

Having good models minimizes the need for site visits, which is expensive for my company and takes me away from my family, and it minimizes the amount of time that we need to ask the client to take their equipment out of service. Better models means the controller is more likely to work correctly "out of the box," which means it's more impressive for the client because I can show up and basically flip a switch and everything runs the way it's supposed to. I look more competent because I don't spend a lot of time making mistakes in front of the client (I do that back at the office, with a software model, while I'm trying to develop the controller).

Finally, it's a lot less expensive and/or scary to screw up a software model of a system than to screw up the actual system. Make your mistakes in software! Learn to model and the rest of control engineering is knowing which controller would probably work best and which book has the steps to implement it.

Unless you're doing some fundamental control research, modeling will definitely be the most challenging aspect of control engineering.


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

答:
Basically the solution is to not try to reference where rob is.  What you do is create a notional starting point,and then develop a sensor that measures x&e coupled to a time sensor.  You can develop the notional starting points in time and “Tx&e” units.  Thus you know where you are once you arrive at a known position.

So
NSP X T X x&e = CURRENT POSITION & TIME. Any changes in position applied from known current position gives us a constant position and also a vector

Doesthathelp. Robin

Title: Position Tracking using IMU


问:
Turning a Roomba 980 into a Create
I have an old 980 that I want to turn into a Create.  Is this possible?

I've seen some posts that seem to indicate that it is, and I'm wondering if there are any more up to date instructions on how to do this.  I'm strong on the programming side, but not so much on the hardware side.

Any help would be appreciated.

答: Unfortunately, iRobot 900 series robots do not support the "Open Interface" spec that the Create uses.  It is only on 500, 600, 700, and 800 series models.  See this thread for more info: What iRobot products support the open interface besides the iRobot Create?</p>

Title: Turning a Roomba 980 into a Create


问:
Does MIT Cheetah uses Series Elastic Actuator?
I have been wondering does MIT cheetah purely only use electrical active compliance on it's robot or did they use a Series elastic actuator since they have this webbing tendon?</p>

答:
It seems that the answer is that it doesn't actually use either of those designs.

According to the paper Proprioceptive Actuator Design in the MIT Cheetah: Impact Mitigation and High-Bandwidth Physical Interaction for Dynamic Legged Robots by Patrick M. Wensing et al, the MIT Cheetah robot actually uses a proprioceptive force-control actuator Design.

The development and design principles that led to that design were described in the earlier paper Design Principles for Energy Efficient Legged Locomotion and
Implementation on the MIT Cheetah Robot by Sangok Seok et al.


问:
how to control servo motor with potentiometer in arduino
I'm working on a robotic arm which uses 3x MG995 servo motors, 3x potentiometers (10k), and 1 Arduino Uno.

I uploaded the code to the Arduino but the servo won't stop. I want to control it with the rotation of the potentiometer knob. In other words, as I rotate the knob on the potentiometer the servo should rotate by the same angle.

But it won't work. What do I need to do to complete the function?

Here is my code..

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

//define our servos
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;

//define our potentiometers
int pot1 = A1;
int pot2 = A2;
int pot3 = A3;
int pot4 = A4;

//variable to read the values from the analog pin (potentiometers)
int valPot1;
int valPot2;
int valPot3;
int valPot4;

void setup()
{
  //attaches our servos on pins PWM 3-5-6-9 to the servos
  servo1.attach(3);
  servo1.write(0);  //define servo1 start position
  servo2.attach(5);
  servo2.write(90); //define servo2 start position
  servo3.attach(6);
  servo3.write(90); //define servo3 start position
  servo4.attach(9);
  servo4.write(70); //define servo4 start position
}

void loop()
{
  //reads the value of potentiometers (value between 0 and 1023)

  valPot1 = analogRead(pot1);
  valPot1 = map (valPot1, 0, 1023, 90, 180); //scale it to use it with the servo (value between 0 and 180)
  servo1.write(valPot1); //set the servo position according to the scaled value

  valPot2 = analogRead(pot2);
  valPot2 = map (valPot2, 0, 1023, 0, 180);
  servo2.write(valPot2);

  valPot3 = analogRead(pot3);
  valPot3 = map (valPot3, 0, 1023, 0, 180);
  servo3.write(valPot3);

  valPot4 = analogRead(pot4);
  valPot4 = map (valPot4, 0, 1023, 0, 180);
  servo4.write(valPot4);

}
</code>```

答:
Could you please upload a schematic of the circuit as well. There might be several possibilities for what could be wrong in your system. First try to pass some angle values to the servos and make sure that those are working correctly.

If it's okay, try to read the inputs from potentiometers and print them in the Serial monitor. Observe the values in serial monitor while rotating the knobs and make sure that they are working well.

These two are the most possible cases for the problem.

Make sure that the potentiometer is connected between the 5v and Gnd.


问:
Detect Nao robot in Kinect
I am not sure if this has been tried before but I am trying to use Kinect and detect gestures made by the Nao robot.

I have made a Kinect application, a gesture based picture viewer and it detects humans fine(Obviously it does!) What I wanted to try was (lazy as I am), to see if I could use some (say, voice) command to tell the Nao to do a Swipe Right gesture and have my application identify that gesture. The Nao can easily identify my command and do some gesture. The problem however is, when I put the Nao in front of the Kinect sensor, the Kinect does not track it.

What I want to know is, are there some basics behind Kinect's human body motion tracking that essentially fails when a robot is placed in front of it instead of a human?

PS: I have kept the Nao at the right distance from the sensor. I have also checked if the entire robot is in the field of view of the sensor.

EDIT: This has been posted on stackoverflow and on msdn by me so as to target a large audience as this problem has not been encountered by anyone in the past.

答:
You should read the paper published by Microsoft research on the actual algorithm behind the human motion tracking.

Real-Time Human Pose Recognition in Parts from a Single Depth Image, Shotton et. al,
http://research.microsoft.com/apps/pubs/default.aspx?id=145347

It relies on large labeled training data from the human body. That is why the Nao cannot just be tracked with the same method out of the box. To achieve that, you would need to re-train the algorithm with labeled data from the Nao in different poses.

Title: Detect Nao robot in Kinect


问:
Tiny high torque actuator/sensor design
I need to assemble a small (about 8cm x 5cm x 5cm maximum), actuator with as much torque as I can get at that size. It will be driving a small reel and pulley (reel is ~1.25cm^3, 5mm center diameter), and needs to respond to load (eg. stop if the load increases beyond a certain threshold). Power to the actuator will be provided via a common bus line, so the space limit isn't further limited by the size of the battery.

My thought is to use a worm drive for this (for torque) and watch for change in current/voltage (for load), but I'm not sure if that is mechanically sound. It seems like the mechanical advantage provided by the worm would make it hard to detect a change in load.

Plan B

I could add another sensor that would gauge the force being exerted. I'd prefer to avoid adding too many points of failure to the system, but if I did what sort of sensor would I use?

How should I approach this?

答:
With a series of planetary gear sets aligned axially, one can gear down by high ratios.  For example, the picture below (a wikipedia commons image used in the planetary gear article) shows a 2.5-cm gearset with ratio -5/352, about 1:70.  Stacking three of these would give a ratio of about 1:343000.  Some torque and power would be lost to friction, and plastic gears would not be strong enough to deliver all of the torque possible at the output, but the concept should be clear.  If multiplying motor torque by 1/3 of a million isn't enough, add a fourth gearset, giving a torque multiplication from motor to output of about 24 million.  Note that rotation speed would be correspondingly divided (by about 24 million) and only about 1/2 to 3/4 of the motor power would arrive at the output, due to friction losses.

To stop turning the pulley if load gets too high, you could use a torque-limiter (or, safety clutch or  slip clutch) at the output.

Title: Tiny high torque actuator/sensor design


问:
What are the equations of a s-curve position path?
I have a decoupled mechatronic system with two motors. I want for each motor to give a s-curve path as reference. You can see in the image below the position path, velocity and acceleration.

All information that I have are extracted from these plots.

The way I have designed the system, the position is given as the reference. So I need the equations for it. From what I saw, this is what is referred to as a "s-curve" path. The way I understand it, the equation is broken down in to 4 different parts:

$0\le t\le 0.05$

$0.05<t\le 0.2$

$0.2<t\le 0.25$

$t>0.25$

This seems like a fairly standard equation but I have not  been able to find anything that works. I have tried to used the equations from Constant Jerk Equations For A Trajectory Generator1 but the results where not the same. I also found Mathematics of Motion Control Profiles, and maybe I don't understand it, but the equations found there do not seems to be enough for what I want.

Can anybody provide the correct equations (preferably in a generalized form, so I can apply them else where in the future) or some other help?

1 From ME EN 537 - Advanced Mechanisms/Robotics > Notes.

答:
The S-Curve profile can have several divisions along the time axis

7 divisions as per this image. This example has a constant positive jerk zone, a constant acceleration zone, a constant negative jerk zone, a zero acceleration zone and then the vice-versa. This is the S-Curve in its most general form

5 divisions if there exists no constant acceleration zones like t1-t2 and t5-t6

4 divisions if there exists no constant velocity (zero acceleration zone) like t3-t4

There are more possible cases that depend upon initial and final desired conditions and constraints on the positions, velocities, accelerations and jerks.

While the equations are pretty straight forward, mentioned in this paper Jeong, Soon Yong, et al. "Jerk limited velocity profile generation for high speed industrial robot trajectories." IFAC Proceedings Volumes 38.1 (2005): 595-600.
for almost all possible test cases, there are issues with constant jerks and other constraints that limit the feasibility of an S-curve.


答:
To come up with a mathematical expression of the position reference $x\left(t\right)$ as a function of time $t$, we can inspect the profile of the acceleration $a\left(t\right)$. It is piece-wise linear and defined as follows:

$
a\left(t\right)=\begin{cases} \Delta \cdot t, & t \in \left[0,0.025\right] \\
                 2000 - \Delta \cdot \left(t-0.025\right), & t \in \left[0.025,0.05\right] \\
                 0, & t \in \left[0.05,0.2\right] \\
                 -\Delta \cdot \left(t-0.2\right), & t \in \left[0.2,0.225\right] \\
                 -2000 + \Delta \cdot \left(t-0.225\right), & t \in \left[0.225,0.25\right] \\
                \end{cases},
$

where $\Delta=\frac{2000}{0.025} \cdot \frac{\text{mm}}{\text{s}^3}$.

If we now integrate $a\left(t\right)$ twice in $t$, we will get two expressions representing the velocity $v\left(t\right)$ and the position $x\left(t\right)$, respectively, that contain $10$ unknown constants in total. These unknowns can be easily retrieved if we guarantee that both $v\left(t\right)$ and $x\left(t\right)$ are continuous at the extrema of the time intervals given above.

Alternatively, you may consider letting the machine do the integration for you, offline or in real-time, depending on your kind of application. Your code might look something like this:

float get_acceleration(const float t) {
    // put here the code implementing the above
    // definition of the acceleration profile

    float delta = 2000.0f / 0.025f;
    float a;
    if (t <= 0.025f) {
        a = delta * t;
    }
    else if (t <= 0.05f) {
        a = 2000.0f - delta * (t - 0.025);
    }
    // ...
    return a;
}

int main() {
    float T = 0.001f;    // the integration time
    float v = 0.0f;      // the starting velocity
    float x = 0.0f;      // the starting position
    float t = 0.0f;      // the increasing time

    while (t <= 0.25f) {      // the main control loop
        float a = get_acceleration(t);
        v += a * T;
        x += v * T;
        // use x to feed the motor controller
        // (or store it for later usage)

        // make sure that you wait T seconds
        // to enforce the control rate (use e.g. a thread)
        t += T;
    }
    return 0;
}
```
</code>```

Title: What are the equations of a s-curve position path?

Body:
I have a decoupled mechatronic system with two motors. I want for each motor to give a s-curve path as reference. You can see in the image below the position path, velocity and acceleration.

All information that I have are extracted from these plots.

The way I have designed the system, the position is given as the reference. So I need the equations for it. From what I saw, this is what is referred to as a "s-curve" path. The way I understand it, the equation is broken down in to 4 different parts:

$0\le t\le 0.05$

$0.05<t\le 0.2$

$0.2<t\le 0.25$

$t>0.25$

This seems like a fairly standard equation but I have not  been able to find anything that works. I have tried to used the equations from Constant Jerk Equations For A Trajectory Generator1 but the results where not the same. I also found Mathematics of Motion Control Profiles, and maybe I don't understand it, but the equations found there do not seems to be enough for what I want.

Can anybody provide the correct equations (preferably in a generalized form, so I can apply them else where in the future) or some other help?

1 From ME EN 537 - Advanced Mechanisms/Robotics > Notes.


问:
Is ROS 2 due to replace ROS 1?
I have read ROS 2 document and they did not give many clues on the subject.

Does anybody have more insight on the subject?

答:
From here

In principle, the changes described above could be integrated into the
  existing core ROS code. E.g., new transport technologies could be
  added to roscpp and rospy. We considered this option and concluded
  that, given the intrusive nature of the changes that would be required
  to achieve the benefits that we are seeking, there is too much risk
  associated with changing the current ROS system that is relied upon by
  so many people. We want ROS 1 as it exists today to keep working and
  be unaffected by the development of ROS 2. So ROS 2 will be built as a
  parallel set of packages that can be installed alongside and
  interoperate with ROS 1 (e.g., through message bridges).

I don't see this happening soon, but I can imagine this happening in the future. For now, ROS 2 will be developed in parallel with ROS 1 and as such these are two different projects. As like other projects in the past (the one that comes to my mind is Python 2 vs Python 3) they are supported (including releases of new features) for a long period but at some point the community wants to focus on one. I think this will happen with ROS 2 once ROS 2 reach a stable and mature state and when most of the people start using ROS 2.

Title: Is ROS 2 due to replace ROS 1?


答:
In general

If I would be you I would first break down my code to a simple example only addressing a single servo instead of four at the same time. Then check if all the pins you use are capable of PWM by using a single servo on each output.

Coding style

Your definition of the input pins looks weird to me:

```<code>int  pinWhatever =  A1
</code>```

I am not sure of the Arduino ide takes care of it but why not just using

```<code>int pinWhatever = 1
</code>```

Other than that you are already following the basic example posted in Servo Arduino Page. If you can't get it running with their minimal example and a single servo, check your hardware.

Title: how to control servo motor with potentiometer in arduino

Body:
I'm working on a robotic arm which uses 3x MG995 servo motors, 3x potentiometers (10k), and 1 Arduino Uno.

I uploaded the code to the Arduino but the servo won't stop. I want to control it with the rotation of the potentiometer knob. In other words, as I rotate the knob on the potentiometer the servo should rotate by the same angle.

But it won't work. What do I need to do to complete the function?

Here is my code..

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

//define our servos
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;

//define our potentiometers
int pot1 = A1;
int pot2 = A2;
int pot3 = A3;
int pot4 = A4;

//variable to read the values from the analog pin (potentiometers)
int valPot1;
int valPot2;
int valPot3;
int valPot4;

void setup()
{
  //attaches our servos on pins PWM 3-5-6-9 to the servos
  servo1.attach(3);
  servo1.write(0);  //define servo1 start position
  servo2.attach(5);
  servo2.write(90); //define servo2 start position
  servo3.attach(6);
  servo3.write(90); //define servo3 start position
  servo4.attach(9);
  servo4.write(70); //define servo4 start position
}

void loop()
{
  //reads the value of potentiometers (value between 0 and 1023)

  valPot1 = analogRead(pot1);
  valPot1 = map (valPot1, 0, 1023, 90, 180); //scale it to use it with the servo (value between 0 and 180)
  servo1.write(valPot1); //set the servo position according to the scaled value

  valPot2 = analogRead(pot2);
  valPot2 = map (valPot2, 0, 1023, 0, 180);
  servo2.write(valPot2);

  valPot3 = analogRead(pot3);
  valPot3 = map (valPot3, 0, 1023, 0, 180);
  servo3.write(valPot3);

  valPot4 = analogRead(pot4);
  valPot4 = map (valPot4, 0, 1023, 0, 180);
  servo4.write(valPot4);

}
</code>```

Body:
In general

If I would be you I would first break down my code to a simple example only addressing a single servo instead of four at the same time. Then check if all the pins you use are capable of PWM by using a single servo on each output.

Coding style

Your definition of the input pins looks weird to me:

int  pinWhatever =  A1

I am not sure of the Arduino ide takes care of it but why not just using

int pinWhatever = 1

Other than that you are already following the basic example posted in Servo Arduino Page. If you can't get it running with their minimal example and a single servo, check your hardware.


问:
SEIF ,online version of Graph slam create doubt in Motion Update state
I have a thesis work about Graph Slam The GraphSLAM
Algorithm with Applications to Large-Scale Mapping of Urban Structures

 I try to implement it with the help of this paper but during the implementation stage I came to know that it requires a huge memory space if your dataset is huge. It is a offline slam algorithm so everything that it computes store in the memory. So basically  for this boundary, I fail to implement it.

Next, I am looking for a alternative solution and from Probabilistic Robotics
I got one name Sparse extended Information Filter which is referred as online algorithm of GraphSlam.

To implement SEIF, Lectures on Youtube is very helpful.

This picture define motion update for SEIF slam

How many time this algorithm iterate?. There is no looping concept.

From line 9, I understand that $\Omega$ is a 33*33 matrix if I have a 15 landmark. 1st 3*3 matrix for pose update and rest of them is for landmarks.

For line 10, I understand that Xi is also a (3*3) matrix. Am I correct? But as per the algorithm develop Xi should be a (3*1) dimension matrix. $\bar\Omega_tF_x^t\delta_t$ represent a 3*3 dimension matrix. As per matrix addition both matrix must have same dimension for addition. The resultant matrix also have same dimension with additive matrix. So, I understand Xi is a 3*3 matrix. What is the signification of Xi? What should represent using 3*3 matrix block?

It is describe that Just like the EKF, the SEIF integrates out past robot poses and only maintains a posterior over the present robot pose and map.Can any one clarify this line with respect to this algorithm?

If in a data set 1st 500 data are only the odometer data and from 501 measurement data are integrated then how does the algorithm work? Which blocks updated time to time?

答:
First of all, I am also new to the algorithm, so I might be wrong.

There is no loop concept for this routine. Once your system has a new state, this will be run to produce a predicted state with information from previous state and motion model.

As I understand, $\bar{\xi_t}$ is the predicted information vector at time t. So it should be as the same dimension of your state vector, which might be (3+2N * 1).

The basic step of Kalman filter is an iterative process including two steps, predict and update. Only information matrix and information vector is maintained during the process. It includes the current pose and landmark information, and the relationship between them(not accurate term). As in the code, the input needed for the routine are $\xi_{t-1}$ and $\Omega_{t-1}$


问:
Localising a robot swarm non-optically
This question is further to Localizing a swarm of robots.

In summary: I want to create a swarm of robots which can each measure their own position in a 3x2m room with a 25cm high ceiling, to an accuracy of ±5mm.

There were some good answers, but most of them were optical methods. I would be interested to hear some non-optical localisation ideas, so I will impose the following further constraints:

Localisation method cannot use optical means, either visible or invisible.

Nothing can be added to the floor or ceiling.

There's no appreciable gap between the top of the robots and the ceiling.

There are no walls, and equipment can be added around the perimeter of the room.

I look forward to hearing some creative ideas.

答:
I guess after optic (direct-line of sight) solutions, triangulation via sonic/radio frequency seems to be a possible solution.

A factor that needs to be decided is how the triangulation will be achieved. Will your transmitters be stationary, or will your receivers be stationary. In other words, will you synchronize your transmitters or your receivers.

Stationary transmitters

In other words, your robots will have receivers, while your room has 2 or more stationary transmitters (each synchronized). Each transmitter will continuously broadcast a unique identifier (for instance, each transmitting on their own frequency). The mobile receiver (robot), will then measure the phase shift between each transmission and triangulate.

Stationary Receivers

In other words, your robots will have speakers, while your room has 2 or more microphones (each synchronized). Each mobile transmitter (ie, each robot), will have an unique id (again for example their own frequency), while the stationary receivers (synchronized) will listen for broadcasts. The only problem of course is the stationary receivers will need to communicate the triangulated position back to the robot via a parallel channel (eg Bluetooth).

Implementation

Since trying to sample time-of-flight for RF waves isn't exactly cheap/easy (299 792 458 m / s at 5 mm : 16.7 ps ~ sampling rate in excess of 50 GHz), I'd recommend going for sonic.

The only problem of course is the desired resolution. Given the speed of sound at sea level 340.29 m/s, a signal pulse will take 14.7 us to travel 5 mm. And since we'd like to take a sample at least twice per our base period, we need to sample at a rate of at least 1/7.35 us = 136 kHz.

While you do get system's that can sample the audible range at that rate (professional audio recording equipment usually goes up to 192 kHz and above), easily accessible recording equipment usually samples at 48 kHz (PC sound cards).

Ultimately I think I'd try and go for stationary (expensive) recorders, and cheap speakers on the robots.

External links

Cornell University - PeanutBot, The Audio Homing Robot (uses a single stationary speaker, with three microphones on the robot itself).

Title: Localising a robot swarm non-optically


问:
Singularity problem at Inverse kinematic solver
I am struggling with this problem for days. I really hope that someone could give me a hint what the problem is.

The robot consists of 5 axes. The first axis rotates around the z-axis and other 4 axes rotate around the y-axis. And the solver basically works.

Here is what I have done so far:

I calculate the manipulability factor with my Jacobian matrix (only translational part, since only the position is tracked here. Actually, I also tried with a combined Jacobian matrix, so not only the translational part but also the rotational part. But jerky motion was there anyway):

Then the damping factor is:

The damping factor is then integrated into the pseudo inverse calculation :

As you can see, this is just a classical pseudo inverse kinematic solver with damped least square method. The manipulability factor according the second (problem) movement is :

The manipulability drops in the beginning of the video. But why? As far as I know, this manipulability factor indicates the linear dependence of the axes. To me the axes don't seem to be linearly dependent in the beginning part.

This jerky motion drives me crazy. As you can see in the first animation, the solver seems to work properly. What am I missing here?

答:
I think you have introduced an algorithmic singularity at the first wrist axis.  It appears to me that, when it reaches 90 degrees “down,” that instead of going to 91 it tries to flip back through zero to -269 degrees.  </p>

<p>Of course this is speculative without seeing the code. </p>

Body:
I think you have introduced an algorithmic singularity at the first wrist axis.  It appears to me that, when it reaches 90 degrees “down,” that instead of going to 91 it tries to flip back through zero to -269 degrees.

Of course this is speculative without seeing the code.


答:
As others have already pointed out, there must be an issue with your implementation of the IK algorithm since there shall not be any singular behavior in the descriptions you gave.

Now you have two alternatives: either you start off debugging the code or you might want to exploit the fact that the problem can be easily broken down in two subproblems for which you can readily employ the most part of the code written so far.

Given the desired 3D target $\left( x_d,y_d,z_d \right)$, it's straightforward to observe that the desired value of the first joint is: $\theta_{1d}=\arctan\left( \frac{y_d}{x_d}\right)$.

The control law to drive the first joint of the manipulator to $\theta_{1d}$ can be as simple as:

$
\dot{\theta_1}=K_1 \cdot \left( \theta_{1d}-\theta_{1} \right).
$

Then, let $R \in SO(3)$ be the matrix that accounts for the rotation of $\theta_{1d}$ around the $z$ axis:

$
R = \left( \begin{array}{cccc}
    \cos{\theta_{1d}} & -\sin{\theta_{1d}} & 0 \\
    \sin{\theta_{1d}} & \cos{\theta_{1d}} & 0 \\
    0 & 0 & 1 \\
    \end{array} \right).
$

Through $R$, you'll get the new target $\left( x_d,0,z_d \right)_1=R^T \cdot \left( x_d,y_d,z_d \right)^T$ that will establish a new IK 2D planar problem in the $xz$ plane.

At this point, you can solve for $\left( x_d,z_d \right)_1$ by using the Jacobian of the remaining 4-DOF manipulator.

Title: Singularity problem at Inverse kinematic solver

Body:
I am struggling with this problem for days. I really hope that someone could give me a hint what the problem is.

The robot consists of 5 axes. The first axis rotates around the z-axis and other 4 axes rotate around the y-axis. And the solver basically works.

Here is what I have done so far:

I calculate the manipulability factor with my Jacobian matrix (only translational part, since only the position is tracked here. Actually, I also tried with a combined Jacobian matrix, so not only the translational part but also the rotational part. But jerky motion was there anyway):

Then the damping factor is:

The damping factor is then integrated into the pseudo inverse calculation :

As you can see, this is just a classical pseudo inverse kinematic solver with damped least square method. The manipulability factor according the second (problem) movement is :

The manipulability drops in the beginning of the video. But why? As far as I know, this manipulability factor indicates the linear dependence of the axes. To me the axes don't seem to be linearly dependent in the beginning part.

This jerky motion drives me crazy. As you can see in the first animation, the solver seems to work properly. What am I missing here?


问:
Powering servos for quadruped spiderbot using arduino uno
I am using 12 towerpro SG90 servos. What battery should I use for powering 12 servos for my arduino uno? Can i use the 12v battery, plug it in to 12v dc jack of arduino and tap the 5v output of arduino uno to power all the 12 servos? Is it enough to supply exact power for each servo?

Planning to use 5v powerbank, 12v battery or 2x 18650 battery (7.4v).

答:
Arduino is micro-controller and not a raw power source. It should NEVER be used to supply power to any peripherals or sensors because even though the voltage at the GPIO pins is 5V, the current is only limited to 50 mA per pin and total of 200 mA. Thus, having 12 SG90 servos connected to the Arduino is not possible.

You can use the 12 V battery and plug it into the 12V DC jack of the Arduino board to run the board. But, to power up the 12 servos, use the same 12V battery (assuming that it has a current capacity of around 3.0 - 4.0 A or more with a total of 5000 mAH capacity for enough duration) and connect it to a voltage regulator like LM 7805 to obtain 5V output for the servos. However, an LM 7805 IC has a current limitation of 1A and I found this FEETECH (Fitec) FS90 9G Mini Servo with Accessories with specifications for the motor mentioning that the servo could be pretty current greedy at times. My best call would be to use one voltage regulator for 2 servos each and you should be good to go.

PS - Do not forget to make Arduino's GROUND and the LM 7805 output GROUND common (not needed if the same battery source is used) otherwise the PWN signals sent from the Arduino to servos won't work.


问:
How does fast slam creates grid maps?
I've implemented fast slam using landmark detection and the map stored is a feature map, made of landmarks positions.
I would like to create a grid map, and my questions are about how does the robot create a grid map in slam:

Another landmark class is used, or the occupancy grid is the landmark itself? In other words, the grid map generation is made separatly of the feature map?

About the alignment of the map with the previous maps measures, this is similar to the fast slam 2.0 due to the fast  that considers the robot pose and the measurement of t-1?

Thanks in advance

答:
Grid based FastSlam relies on the same principle that Landmakr based FastSlam. The difference is that we are not working with each grid cell as a landmark, but the whole gridmap itself.

For Grid based FastSlam, each particle updates its own grid-map using the data from the range sensor (Lidar, UltraSound, etc.) and its odometry. This is called "Mapping with known poses", which is an easy problem (basically update the probability of a grid cell being occupied based on the data from the range sensor and the odometry, supposing the odometry data is totally correct). Then, and here is where the FastSlam algorithm plays its role, we compute the weight of each particle based on its own grid-map and the new measurements. With all the particles weighted, we then can do resampling. In fact, resampling will be only practical after loop-closings, since it is only when we can compare new data with our previously computed grid-maps. After that, we will keep only particles whose map was closer to reality, since the weight of that particles after resampling on loop-closings will be higher.

The steps would be similar to Landmark based Fastslam:

Get Data from sensors

Estimate motion based on odometry measurements

Estimate grid-map based on range measurements

Compute Weight based on range measurements and grid-map

Resample.

The difference between FastSlam and FastSlam2.0 is that in the motion estimation we will use also the range measurements to get a better estimate of the robot position after the movement (typically using scan-matching with Iterative Closest Points algorithms).

Get Data from sensors

Estimate motion based on odometry and range measurements

Estimate grid-map based on range measurements

Compute Weight based on range measurements and grid-map

Resample.

Title: How does fast slam creates grid maps?


问:
Inverse Kinematics Problem of Articulated Manipulators Arm
I have a robotic arm consist of three joints (servomotor for each joint), as shown in the figure below:

Notes:

Each servomotor rotates around 180 degrees.

The angles of the theta2 and theta3 represent 90 degrees in the figure above.

I found the forward kinematics by using the parameters of DH convention, as shown in the figure above.

The Final Transformation Matrix is:

The position of the robotic arm end-effector is correct for any angle of theta1, theta2, and theta3 between -90 and 90 degrees.

My problem is in the inverse kinematics of the robotic arm, where, the theta2 always affected by theta3 and thus the response of theta2 incorrect, while theta1 and theta3 are always correct. Please see the cases below that show this problem.

Thank you.

答:
Calculating the forward kinematics with a mathematical equation is straight forward and recommended for all robotics arms. Trying to do the same with inverse kinematics results often in troubles. The problem is, that a given goal coordinate in the 3d space can be reached with different poses and during it's nonlinear nature it's not easy to find an explicit formula. The problem is, that a forward model can't be transformed into an inverse model by simply modifying the equation into a new one. Instead an approximate IK-solver is needed here.

For realizing such a solver the forward model gets random values as input and the best node of the resulting graph is identified with the help of constraints. The principle is called monte carlo IK solver or sampling based ik solver and is a standard widget in animation programs like Blender.

Perhaps a short note at the end: even the problem looks easy to solve on the first look, inverse kinematics is one of the hardest problems in robotics control. Running into trouble is the normal case and Google Scholar provides many thousands of papers about the pros and cons of different solvlng techniques. For some researchers the problem is so hard, that they give up the idea of a kinematic chain at all and use a more simpler mechanic design which is a linear robot. Such a design can reach a point in the space with lower amount of calculations.


答:
I’ll get you started, and see if you can calculate all three joint angles given values for $X$, $Y$, and $Z$.   If you cannot, we can continue peeling the onion until you are able to do that.

You will have to manipulate the expressions for $X$, $Y$, and $Z$, and use trigonometric identities to solve for the individual joint values.

Start with the easiest:  using the $X$ and $Y$ terms only, you should be able to write an expression that only involves th1.  It will be a tangent function that can be inverted to find th1.

Next, square the $X$ and $Y$ terms, and add them together.  This will eliminate th1 from the expression.   Subtract $Z$ squared from the remaining terms.  You should be left with expressions of a constant times [cos(th2 + th3) cos(th2) + sin(th2 + th3) sin(th2)].   Using a trigonometric identity, this can be solved for th3 using the inverse cos function.

See if you can get to this point, then try other manipulations to solve for (th2 + th3), which will get you the last value.

Title: Inverse Kinematics Problem of Articulated Manipulators Arm

Body:
I have a robotic arm consist of three joints (servomotor for each joint), as shown in the figure below:

Notes:

Each servomotor rotates around 180 degrees.

The angles of the theta2 and theta3 represent 90 degrees in the figure above.

I found the forward kinematics by using the parameters of DH convention, as shown in the figure above.

The Final Transformation Matrix is:

The position of the robotic arm end-effector is correct for any angle of theta1, theta2, and theta3 between -90 and 90 degrees.

My problem is in the inverse kinematics of the robotic arm, where, the theta2 always affected by theta3 and thus the response of theta2 incorrect, while theta1 and theta3 are always correct. Please see the cases below that show this problem.

Thank you.


问:
I must determine the resolution of a control system when using an 8-bit encoder for a single-rotation joint

The length of the link is 50 cm and the arm moves 180 degrees. Can anyone help me?

Out of the cosine theorem, $d = \ell \sqrt{2\left(\ell-cos\right)}$, I calculated the distance traveled by a linear axis and the rotation arc through the rotation connection.

The circumfence is $2\pi R$. And $d$, for my drawing is $d=50\sqrt{2\left(50+1\right)}=50\sqrt{101}$

The distance is 502 cm and the rotation is 9000 cm. From here, I don't know what to do. I can't find any equation for the resolution.

I only have the values that I said, and I need to determine the resolution for the control system, when an encoder of 8-bit is used. I don't have anything else..This is the whole exercise. I understand if it's not clear enough. It isn't for me, either.

答:
I think I understand what you need. You have an arm (length L) rotating (a maximum of Θmax radians) around an axis (similar to the hand of a watch), and the motion is generated by some motor. The motor's position is read by an encoder with a resolution of 8 bits.

We assume that the 8 bits cover the angles between 0 and 2*PI radians. In this case, the resolution of the encoder is:

resEnc=2*PI/(2^8)

The resolution of the angle of the arm would be:

res(Θ)=resEnc

In the same way, the resolution of movement of the tip of the arm is:

resTip = l * res(Θ)

Note: we do not know how the motor is connected to the arm and we do not know how the encoder is connected tot he motor.

Note2: I may have understood why d is needed :D


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

答:
Multiple channels are time sliced onto "one-wire".  The real wire count is usually three.  Typically there is a positive voltage wire (may not be there depending on whether both ends have their own power or not) and always a shared ground wire.

Perhaps 40-100 times per second the transmitter broadcast the settings of all controls which map to servos on something.  At the beginning of each broadcast, the voltage level on the output wire (the "one-wire") is held low for a sync'ing low pulse.  After that, each servo gets a time slot.  Servo #1 gets the first time slot, servo #2, the second, and so on.

Hope the illustration is clear.  Although my drawing only shows 1.0, 1.5 and 2.0ms time pulses any value between 1.0 and 2.0 is valid and correlates to "proportional" values at the servo (hence the "proportional" term once used to describe these).


问:
Humanoid robot with Raspberry pi
I am in the midst of designing a humanoid robot, and I am very new at this technical stuff, but I have found servo motors which are capable of producing 500 kg.cm.

Now I am looking at making a raspberry pi cluster for controlling the robot, running different python scripts on each cluster node.
I imagine one raspberry pi dedicated to getting a depth map by use of webcams, and another raspberry pi downloading the frames and recognizing objects in the frames, and then both raspberry pis creating a 3D map of the environment..
But how do I go about making a wireless cluster of raspberry pis which run node specific individual codes?

答:
I don't say this negatively, but - that's a mouthful. I recommend subdividing the problem into smaller tasks that you can simulate first, to help you get a sense of the magnitude of what you're trying to do. Clustering RPis is one of the smallest problems on that list.

To answer your direct question, you would build networked service apps with those responsibilities, start the correct one on the correct node, and have them communicate with each other. You would need to also provide networking gear (a regular switch is easiest, maybe even gets you PoE) to link them together. You aren't really doing "clustering" in your model, you're just delegating responsibilities to different nodes.

Title: Humanoid robot with Raspberry pi


问:
Input/output linearization
I am studying the book "B. Sicilliano -Robotics. Modelling, Planning and Control" chapter 11, Input/output linearization topic. Where does the formula for theta in 11.75 come from?

In the case of the unicycle, consider the following outputs:

$ y_1 = x + b cos θ; $

$ y_2 = y + b sin θ $

with $ b \neq 0 $. They represent the Cartesian coordinates of a point B located along the sagittal axis of the unicycle at a distance |b| from the contact point of the wheel with the ground. How to find the following input-output linearization?

$ \dot{y_1} = u_1; $

$ \dot{y_2} = u_2; $

$ \dot{\theta} = \frac{u_2 \cos\theta − u_1\sin\theta}{b} $

I am not very good at robotics, I would like to get an answer simple to understand.

Thank you for all the help.

答:
If you observe that $\omega = \dot{\theta}$, you can readily derive the equation at hand from:

$
\left[ \begin{array}{c} v \\ \omega \end{array} \right] = \
\left[ \begin{array}{cc} \cos\theta & \sin\theta \\
       -\sin\theta/b & \cos\theta/b \
       \end{array} \right] \
\left[ \begin{array}{c} u_1 \\ u_2 \end{array} \right].
$

Title: Input/output linearization


问:
Identify contacts on wires of an electronic speed controller
I have got an electronic speed controller as pictured in the first image.
What kind of contacts are those on the left? The second image is a closeup.

edit to clarify question

I am asking how to physically connect these contacts.

Are these pins or plugs?
Are they for soldering? If yes what is the advantage over just soldering two wires together.

答:
In your second image, they look very much like the connectors used on the standard XT-60 connector which are design to be soldered onto.

edit:
To clarify, I'm not saying to use an XT-60, just that they are a similar design. For help with soldering these have a look at http://www.mindsensors.com/blog/how-to/tutorial-soldering-xt60-connectors


问:
How a quadcopter pitch/roll impacts thrust?
I'm thinking about how a quadcopter flight controller works, and I usually see that each motor speed is determined by a formula like:

```<code>speed_motor_1 = throttle + pitch_pid + roll_pid + yaw_pid
</code>```

This looks fine, but one thing I was considering is throttle -> thrust is not so straightforward.
For instance, a quadcopter in horizontal position have propellers pointing up and the thrust may be X. If you pitch this quadcopter by 30 degrees, now the propellers vector force is inclined and thrust it is X*cos(30 degrees)

Does that make sense? Is that something that must be taking into consideration when calculating "throttle" in the aforementioned formula?

Thanks

答:
The simple answer is yes, to maintain level flight when pitched forward you need more throttle than when not moving forward.

This can be seen from the a simple force diagram.

A corollary to this is that the maximum forward speed is when full trust at the angle of the quad matches the weight.


问:
Connect 2 motor controllers
i have programmed for my two wheeled robot 2 separate controller for each wheel so that afer approx. 1 second both motors reach my desired speed. But my problem is that one of those motors is faster at the desired speed than the other one, so if i turn it on my robot doesnt stay on a straight line but an angle of the desired position.
I wanted to ask how can i realize that both reach the desired speed at the same time so my robot will go straigt.</p>

答:
If going completely straight is the goal then you'll need more feedback than just the wheel speeds. Even if you could guarantee the wheels turned at exact same speed (say for instance they were attached together on the same axle) then it still wouldn't go in a straight line. Any tiny difference in wheel circumference or bump, crumb or surface change will move it off course.

A common approach to this problem is to use an IMU gyro. This gives you a reference for your heading and allows you to change motors speeds to correct.

Title: Connect 2 motor controllers


答:
You should use the individual wheel velocities at all times to compute the robot's heading and angular and linear velocity and super-impose another controller that works to correct the same. This could be a PID that works on the desired changed in angular velocity of the robot which you could reduce down to each individual wheels.

Making both the wheels reach the desired speed at the same time would not be possible because, they are two different wheels with different performance. You should rather aim to solve the larger problem and obtain its dependency on each individual wheel. I believe this picture could be of some reference.

Title: Connect 2 motor controllers

Body:
i have programmed for my two wheeled robot 2 separate controller for each wheel so that afer approx. 1 second both motors reach my desired speed. But my problem is that one of those motors is faster at the desired speed than the other one, so if i turn it on my robot doesnt stay on a straight line but an angle of the desired position.
I wanted to ask how can i realize that both reach the desired speed at the same time so my robot will go straigt.</p>


答:
The one shown in the second image is a type of a bullet connector. If you consider the whole ESC, the black 3 wires goes to brushless motor. Red and black wires on the other side goes to the battery.

The advantage of using bullet connectors is you can unplug the ESC from a motor anytime. This has several uses like,

Test several motors with one ESC.

Change a damaged motor from the system without taking the ESC out.

Reverse the motor when needed.

There is nothing wrong with soldering wires directly if you don't have above concerns.

Title: Identify contacts on wires of an electronic speed controller

Body:
I have got an electronic speed controller as pictured in the first image.
What kind of contacts are those on the left? The second image is a closeup.

edit to clarify question

I am asking how to physically connect these contacts.

Are these pins or plugs?
Are they for soldering? If yes what is the advantage over just soldering two wires together.


问:
Open source robotics projects that have complex software structure?
I've built some robotic systems that rely on handcrafted hierarchical FSM, I'm hoping to learn more by studying codes from some open source system that have more complex structures. Can anyone point out some open source robotics projects that have complex software structure? For example, a service humannoid robot might need to handle different situations, so if it's a handcrafted system then it should have a complex structure storing and retrieving instances of interaction. It shouldn't just be a system like an end-to-end deep reinforcement learning based humanoid walking because this system encapsulates too much its working functions in a blackbox but still pretty straightforward in terms of input-output relationships in control and perception. </p>

答:
4D/RCS  is a more complicated system. I recall that there were only a couple systems implementing it that had publications written. It's the most comprehensive system design I've seen published. I know of others but they are not as well documented.

Understanding the RCS approach and how FSMs fit (or don't) within will definitely give you a better understanding of the pros and cons of FSMs.


问:
What are the differences between wheel and manipulator joint encoders?
As far as I understand the joint encoders output the angle and the wheel encoders output speed. Is that accurate? In either case, how do the differences affect the kinematic calculations, as in path planning, trajectory tracking and motion control?</p>

答:
Encoders used in wheels and manipulator joints are essentially the same. It is the post-processing pipeline that changes their usage and significance. These encoders basically sense the rotational motion.

All optical encoders or magnetic encoders or hall effect encoders record the amount of rotation that occurred in a fixed time. Generally, a magnetic or hall effect sensor has a resolution of somewhere around 12 bits (2^12 = 4096 ticks per revolution = ~0.087 degrees) or higher.

Encoders used for join angle measurement sum the number of ticks obtained per in a definite period of time to measure the motion of the joint. This is added to the existing multi-turn count to express the absolute value of joint angular position.

However, for wheel encoders, they obtain the number of ticks and then divide it by the amount of time passed to express the same result as joint angular velocity.

Sometimes, depending upon the sensitivity and desired accuracy needed in the task, different kinds of encoders may be used. Because robot wheels are expected to rotate faster and continuously gaining multi-turns, one could expect encoders with somewhere around 10-12 bit resolution for them while given that a manipulator arm needs more accuracy and precision, they could have resolutions as high as 16 bits.


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

答:
Are you worried that the Arduino may not have enough pins to control 4 different motors plus the stuff on that other shield?

It is possible to control any number of motors using 4 digital pins from the Arduino.

The STMicroelectronics L6470 stepper motor driver chip is designed to be daisy-chained so 4 digital pins from the Arduino can control any number of motors.
(If you know of any other motor driver that can be daisy-chained to control any number of motors using less than 10 pins from the Arduino, please comment and mention its name).
I built a prototype using the Sparkfun L6470 breakout board.
Apparently several people have made other open-source hardware boards for the L6470.

Title: Arduino Motor control


问:
ABB Object Oriented RAPID language
How do I create something like a class and have instances of it in ABB RAPID language?</p>

答: In reviewing the PDF for the RAPID language, it looks like you don't. I can't see anything online that states the RAPID language is object oriented. The manual doesn't even contain the word "class" once, and the language doesn't seem to support structures or methods. </p>

Title: ABB Object Oriented RAPID language


答:
Turns out the closest thing to a Struct is a RECORD
you can write:

```<code>MODULE myModule
    RECORD myRecord
        pos a;
        num b;
        sring c;
    END RECORD

    PROC main()
        myRecord{1,1}.a.x := 123;
        myRecord{1,2}.b := 1234;
    ENDPROC
ENDMODULE
</code>```

You can put a RECORD within a RECORD but you cannot put an array in a RECORD.

So RAPID is not object oriented

Title: ABB Object Oriented RAPID language

Body: How do I create something like a class and have instances of it in ABB RAPID language?</p>

Body:
Turns out the closest thing to a Struct is a RECORD
you can write:

MODULE myModule
    RECORD myRecord
        pos a;
        num b;
        sring c;
    END RECORD

    PROC main()
        myRecord{1,1}.a.x := 123;
        myRecord{1,2}.b := 1234;
    ENDPROC
ENDMODULE

You can put a RECORD within a RECORD but you cannot put an array in a RECORD.

So RAPID is not object oriented


问:
extended kalman filters, linearization of output
Say, we are dealing with an odometric localization problem.

In the below example, $(x_k, y_k), (x_l, y_l)$ are cartesian coordinates of the sensor and the landmark respectively. Then the output equation is:

$z_k = atan2(y_k − y_l, x_k − x_l)$

Is the following the correct way of linearizing this equation?

$H_{k+1} = (\frac{−(\hat{y}_{k+1|k} − y_l)}{(\hat{x}_{k+1|k} − x_l)^2 + (\hat{y}_{k+1|k} − y_l)^2}  \frac{(\hat{x}_{k+1|k} − x_l)}{(\hat{x}_{k+1|k} − x_l)^2 + (\hat{y}_{k+1|k} − y_l)^2})$

Can you provide other resources and examples to practice?

答:
Hi and welcome to stack exchange: robotics edition.

Yes. Your derivation for the landmark update Jacobian is correct. If you are doing SLAM with respect to the landmarks, don't forget to form the Jacobian with respect to all state variables, including the Robot's $x$ and $y$ points.

What I mean is, if the state of the system is $x_r,y_r,x_t,y_t$, and the measurement equation is as shown, then the Jacbian of the measurement equation $H$ is $[\frac{\partial h}{\partial x_r},\frac{\partial h}{\partial y_r}, \frac{\partial h}{\partial x_t},\frac{\partial h}{\partial y_t}]$

But ... (spoiler alert)

 surprise, surprise, \frac{\partial h}{\partial x_r},\frac{\partial h}{\partial y_r} is the same as those two entries with a sign flip as you'll see.

Some complaints about the question center around the notation and steps. You are very clearly asking if you have formed the correct Jacobian matrix for the bearing measurement equation. But, that's not clear to everyone, so you may want to write a more thorough background of what you're trying to do, and what notation you're using. (If for no other reason than Google will pick it up better).

If you want to practice forming Jacobian matrices, I suggest you choose  $n$ functions of $m$ variables, and practice taking partial derivatives. Use Wolfram Alpha to check the partials, and use the structure of a Jacobian from Wikipedia to check the composition of the matrix. Robotics-specific examples are limited to $h$=range, bearing, or position estimates. So, $h=||r-l||$, the $atan2$ example from above, and $h=(x_l,y_l)$ are the best you can do.  You can always form the measurement function $h$ as being to two or more landmarks simultaneously, as well.  This is not a good discussion for Robotics Stack Exchange, however.


答:
Is the problem that the off-the-shelf motor shields all look like they mechanically interfere with the other shield you want to use?
Perhap you're seeing the "both shields want to be the top shield, so they can't stack" problem?
It's pretty simple to control servo motors with simple wire connections.

Standard off-the-shelf servo motors have a 3-wire cable for servo control.

Many shields -- in addition to their "main" circuit -- throw in a "power connection" and a few servo connections.(a), (b), (c), etc.
They connect the 3 servo wires connected -- the GND (G) and Power (+) wires connected to the appropriate power supply, and the Arduino GND and the power supply GND connected.
Typically the signal wire (S) is connected to one of the six special Arduino PWM pins.
(This method can drive a maximum of 6 motors -- or less if that other shield needs some of these pins).

If you make the same connections between the Arduino and the servo with simple wire connections, it works just as well.
(a), (b), (c), etc.

Title: Arduino Motor control

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


问:
outdoor autonomous robot
i had search over google and found out more or less some sensor that i could use like sonar, gyroscope, accelerometer,magnetometer and gps and 2d lidar (which is less expensive, around $300)
i have cost budget so i couldnt go for those expensive devices.

im new to robotic. thus i want to ask for some recommendation.
i want to build a robot which satisfied these following feature

works on outdoor. look at the image above with some description here:
blue line is the border.
red line is the path.
black line is the building.

when the robot at point A, and i input point B. the robot should be able to find a path from point A to B

if point x is blocked, it should be able to find a way to point B via point Y

ground is not flat. thus there might be need sense some higher ground level to avoid collision and recalculate the position of the robot

works on day and night

therefore, my question is:
what is the best device/sensor i should get to satisfy my features above.
or probably any technique i could use?
Please kindly share with me. maybe there is something i miss out on my research

Gps is good but the error is around 6m.. that is too large
fusion of gyroscope, accelerometer, magnetometer to get a correct position and direction is kinda difficult(oblu maybe)

founding:
i found 2 device that could help me with that

ZED stereo camera which works on 0.5m up to 20m.($499)

Intel RealSense 435i which works 0.1m up to 10m with IR.($200)
both are not working so good in dark area even with IR. but i think a lighting could be installed to help with that

any other device recommendation ?

答:
This is a broad topic you've opened up here. My contribution:

It all comes down of the robot specs. For example, is it a wheeled robot or a legged.? What size of terrain shall it explore? in the scale of meters, centimeters, tens of meters? etc... I think, you should write down all questions you could think of, that will help you specify your sensor options.

I think you need a redundant sensor system. For adequate precision it is inevitable. Multiple sensors that are inaccurate on their own, but combined they give accurate results. Also your sensor data and control data shall be piped through some sort of filtering algorithm to increase performance. It will gain complexity, but that is your tradeoff for accuracy.

You could for example have a nice IMU sensor, it provides 3D accelerometer and compass data. That you can use to determine your relative position, speed, acceleration.

Are you using a wheeled robot? You could use the wheel rotation to determine the relative path your robot has achieved. It may be really inaccurate, since the given terrain, wheel skidding etc.

If you have the two above you may as well can apply an IR or ultrasound sensor, to increase precision.

You still can use a cheap mono camera, to estimate speed and direction.

Also important, how you utilize your sensor data. Building a nice visual map based on the sensor data could help a lot in navigation. AI that can do some extra analysis on the shapes on the map.

Probably, most of the things above were also known for you, what I tried to show here is, that if you want to achieve high or just adequate performance, You can't get away with a simple mighty sensor.

As a concrete example: my master work was a multilegged robot with a single sweeping ultrasound sensor. It had an algorithm, that has built up a map based on the sensor input and run the analysis on it. It actually have solved relatively complex static and dynamic maze problems using the real robot hardware. But, it has flawed accuracy, caused by the monosensory and error in calculated position, that obviously can't reflect measured position, in case of a legged robot, without additional sensors.
I hope I can at least give you some ideas of thinking.

Title: outdoor autonomous robot


问:
Microcontrollers and Python
So I am fairly new to robotics however I do have some background with the python coding language. Recently I set myself the task of learning some basics for robotics just to increase my knowledge base.

My question is about micro-controllers and specifically if I need to buy a certain type of microcontroller to be able to program with the python language. Also are there any recommended python libraries or starting points for robotics with python? I apologize if this question is a bit broad or not well formed as I am very new to understanding microcontrollers.

Thank you

答:
One of the simplest ways to get started with python and robots has to be the microbit: https://microbit.org/

There are many different robot platform which you can buy:

Or with wheels:

Title: Microcontrollers and Python


答:
The question is about the hardware of a robot. What is not asked is how to program a robot by software, this would be an Artificial Intelligence question. I belief, that software is more interesting but to answer the question we have to stay at the hardware side. Hardware and mechanics were invented in the 19th century during the industrial revolution. Toys from that area are sold under the brand name Meccano. If somebody likes to build physical robots or is interested in hardware devices, this is a reference. According to the website, Meccano robots have an infrared sensor as a standard sensor for detecting obstacles. This device can be used for indoor and outdoor problems as well. A dedicated outdoor infrared sensor is often named as laser/IR sensor.

So my recommendation is to focus only on one sensor type which is infrared and use this hardware for obstacle detection, navigation and pathplanning at the same time.

Title: outdoor autonomous robot

Body:
i had search over google and found out more or less some sensor that i could use like sonar, gyroscope, accelerometer,magnetometer and gps and 2d lidar (which is less expensive, around $300)
i have cost budget so i couldnt go for those expensive devices.

im new to robotic. thus i want to ask for some recommendation.
i want to build a robot which satisfied these following feature

works on outdoor. look at the image above with some description here:
blue line is the border.
red line is the path.
black line is the building.

when the robot at point A, and i input point B. the robot should be able to find a path from point A to B

if point x is blocked, it should be able to find a way to point B via point Y

ground is not flat. thus there might be need sense some higher ground level to avoid collision and recalculate the position of the robot

works on day and night

therefore, my question is:
what is the best device/sensor i should get to satisfy my features above.
or probably any technique i could use?
Please kindly share with me. maybe there is something i miss out on my research

Gps is good but the error is around 6m.. that is too large
fusion of gyroscope, accelerometer, magnetometer to get a correct position and direction is kinda difficult(oblu maybe)

founding:
i found 2 device that could help me with that

ZED stereo camera which works on 0.5m up to 20m.($499)

Intel RealSense 435i which works 0.1m up to 10m with IR.($200)
both are not working so good in dark area even with IR. but i think a lighting could be installed to help with that

any other device recommendation ?


问:
Convert local coordinates of a moving IMU to global coordinates
I am trying to compare the performance of an IMU in motion against an optical tracking system. The IMU has an accelerometer and a gyroscope and gives output in the local IMU coordinate frames. The optical tracking system outputs the position and orientation in the global coordinate frame. The IMU is moving.

I need help in understanding how to compare the output of the IMU against the optical tracker.

Is this a common problem in robotics (comparing the output of a coordinate system against the output of another coordinate system and in my case, the IMU is moving)?

How do I approach the issue?

Are any standard libraries in Matlab or python to solve this?

答:
It isn't really a problem but a solution rather. The difficult part is pose estimation, comparison just needs to have a transformation between the estimated poses.

There have been research works on fusing vision information with IMU data to enhance accuracy.Baranek, R. (2012). Inertial Measurement Unit–Data Fusion and Visualization using MATLAB. IFAC Proceedings Volumes, 45(7), 12-16. is one such example.

Comparison between multiple frames information just needs the relative transformation that then all estimations could be compared against one another.

An IMU in motion will give you the acceleration measurements from accelerometer, the angular velocity from gyroscope and potentially the heading from the magnetometer. You could use the acceleration to compute the velocity and position changes over time, subject to accumulation errors and noise. The gyroscope can help alleviate the issue and get you angular velocity and thus the angular position, subject to drift and bias again. The magnetometer can finally help better the estimate and thus, a proper fusion technique like the Kalman filter(like EKF and UKF) can get you  high accuracy localization information(pose and orientation) in the local frame, i.e. the coordinate frame that you started moving from.

Now, if you know where you started in the global frame, then you can easily transform all information obtained from the IMU in local frame to global frame and compare against the vision information.

There are several libraries for pose estimation using IMU and other potential sensors like wheel encoders. Basically there are EKF and UKF libraries to predict pose from the IMU data and I believe vision information (coming from something like the Vicon system) is already processed.
The few libraries that I know are ROS's robot_localization package, Orocos Bayesian Filtering library and FilterPy.

If you have trouble in estimation, this tutorial IMU Odometry by David P Anderson is good but uses C/C++.


问:
Software for designing mechanical systems/robotic parts
Which software can be used to prototype/design robot parts (mechanical parts, body, gears, etc)>

I have some crazy idea I would like to try (quadripedal walking robot, animal-like), but I'd like to design the mechanism and test (to some degree) the mechanism in some kind of simulator before I start wasting money on parts/materials. What tool could I use for that?

I'm only interested in mechanical design (chassis + servo/motor placement + cogs/gears), not in electronic design. I'm not interesting in robot control software, because I'll be probably able to slap something like arduino onto it and program behavior I want (experienced programmer)

Details (what I'd like to see):

Should work in 3d. I.e. finished system should be viewable in 3d.

I should be able to cut materials like plywood/metal, drill holes, place gears on it, etc.

It would be nice if it had some kind of part catalog so to place a gear/cog I wouldn't need to design it from scratch.

It would be nice I could test if parts can actually move. I don't need full-blown simulation, just to see if gears can turn or if they'll get stuck.

Not interested in electronic circuitry, just need mechanical parts, but should be able to place servos.

It would be nice if it could produce blueprints.

cheap/inexpensive, if possible.

Basically, I should be able to construct robot mechanism in it (by placing/connecting parts like gears,cogs, motors, springs), or some kind of clock, and test (to some degree) if it actually works.

I know that I could use blender3d for that, but it wasn't exactly designed for this purpose.

I also heard that solidworks could be used for designing mechanical parts, but it is too expensive, especially for one-time-project.

Any recommendations?

答:
You can use google sketchup. It's free and should be allow you to do most of what you want.

Solidworks would most likely fully match your requirements above. Since it is a one-time project, you could consider evaluating Solidworks by requesting a free trial.

Good luck.


问:
How many encoders should I have?
I'm planning a robot vehicle and plan to get one or more motors that have encoders built in.

How many encoders do I need I really need in order to gather solidly accurate information about speed and distance?  I'll get four if it makes a difference but I'm having trouble seeing much benefit beyond one.  Would averaging across two or four encoders help to mitigate the impact of slipping wheels?

There's about a $20 price difference with and without the encoder, so it would be nice to minimize the number of motors with encoders.

EDIT: This is for a four fixed wheeled robot.

答:
Typically you will only need 2 encoders to estimate the velocity and the angle for a differential vehicle. If you are using more strategies than only the odometry for the localisation, you can estimate the slipping with your range sensors or your IMUs.

Using more encoders is not an strategy that I have seen many times, except for critical applications were the safety is a great requirement.

In any case, the answer will highly depend on the kinematics of your vehicle. I guess you might be thinking in a 4 fixed wheel vehicle. If that is the case, you will definitely need the 4 encoders, since slipping will be continuous when turning and not an exception. But again, if you are using a differential kinematics (which is way easier to model), I'd go only with 2 encoders.

Title: How many encoders should I have?


问:
Are robotics competitions for beginners available?
The micromouse challenge was done since the 1980 in the context of university driven robotics research. The Robocup challenge has a similar approach and provides a competition for university students. Today, Robocup soccer is a regularly event which brings robotics to the mainstream. But there is small problem. Both competitions are not attended by amateurs, that means by non-students. The main reason is, that the task of controlling a team of Nao humanoid robots is difficult and costly at the same time. That means, the Nao robot is too expensive for amateurs and they are not overwhelmed by implementing vision, motor control and self-localization at the same time.

On the other a hand, a robotics competition is a great opportunity to learn from mistakes. The same task is done by others and if strategy A is working it can be copied. A robot competition is a great opportunity to learn something and in most cases it helps to form a community.

My question is: are some entry level robotics competitions available which have to do with reaching objective goals against other participants which are open for amateurs? Open means, that the robot is cheap and the task isn't very hard.

Location

Are you looking for competitions anywhere in particular?

A competition can be held in real life, for example in a city. Or it can run online-only, that means the participants have to send their submission over a website from anywhere. I'm not sure, what the better idea is. offline competitions have the advantage, that a video can made from it, while online challenges have a lower price tag because the travel to the location isn't necessary.

答: There is Eurobot, which concerns these countries. Usually it is organized by universities but non-student teams are welcomed and people are very friendly. It is not very difficult (so not necessarily expensive - you can reach a nice score with robots containing Arduino boards) and your robot competes against another team on the same field, so depending on your strategy the score can change from a game to another!</p>


问:
Which sensors can be used to feel breeze blowing by the robot?
Am faced with a situation where my robot needs to feel breeze blowing by over its artificial skin. While there exist many types of tactile sensors, nothing seems to fit the bill. I might abandon the idea altogether but just wanted to know for the sake of know how if there exist sensors to do this sort of thing. Given significant advances in MEMS/NEMS, am assuming there are sensors as sensitive or even more sensitive than hair follicles in detecting touch</p>

答: Microphone chips have been used as a transducer for this due to their low cost. (This being high density pressure measurements) </p>


问:
How to invert D-H parameters
I currently have a working kinematic chain made by a set of ten links in D-H convention (with usual parameters [ $A_i, D_i, \alpha_i, \theta_i$]).

But my task currently requires the inversion of some of them. Basically, I would have a part of the chain that is read from the end-effector to the origin, using the same links (and thus the same parameters). Is it possible? How to do so?

Please notice that this is not related to the inversion of the kinematic chain. It's more basic: I want to find the dh parameters of the inverted forward kinematic chain.

Let's put it simple: I have dh parameters for a 2 link planar chain from joint 0 to joint 1, so I can compute its direct kinematics. But what if I want to compute the direct kinematics from joint 1 to joint 0?

Given DH parameters [ $A_i, D_i, \alpha_i, \theta_i$], I can retrieve the transform matrix with this formula:

$G = \left[\begin{matrix}
cos(\theta) & -sin(\theta)*cos(\alpha) &  sin(\theta)*sin(\alpha) & cos(\theta)*a \\
sin(\theta) &  cos(\theta)*cos(\alpha) & -cos(\theta)*sin(\alpha) & sin(\theta)*a \\
          0 &              sin(\alpha) &              cos(\alpha) &             d \\
          0 &                        0 &                        0 &             1
\end{matrix} \right]$

This is the transform matrix from the i-th link to the (i+1)-th link. Thus, I can invert it to obtain the transform matrix from the (i+1)-th link to the i-th link, but the problem is that this is not working. I believe that the reason is related to the fact that the DH convention doesn't work any more as it is.

Any help?

答:
As you correctly say, if you want to compute the transform from link $(n+1)$ to link $n$, you should simply invert the matrix $G$. The inverse of a homogenous transformation matrix

$G = \left[\begin{matrix}
  R & p \\
  0 & 1
\end{matrix}\right]$

is

$G^{-1} = \left[\begin{matrix}
  R^T & -R^T p \\
  0 & 1
\end{matrix}\right]$.

If $G$ is already available, this is probably the fastest way of computing $G^{-1}$. Otherwise, if only the DH parameters are known, you can insert the expression for $G$ to find this simplified expression for the translation of $G^{-1}$:

$-R^T p = \left[\begin{matrix}
-a\\
-d \sin(\alpha)\\
-d \cos(\alpha)
\end{matrix}\right]$

Title: How to invert D-H parameters


问:
Why can't motors be as elegant as human muscles? Why do we have to use electromagnetism to create movement?
Pretty much as the title says. Why isn't it possible to build motors as microscopically and simply as they're built in humans? Why can't we recreate electronic nerves and muscles?</p>

答:
Human muscles take 9 months to grow and maybe 18 months to train for useful motions. It then takes years to refine precision and strength ... and still it falls short of an electric actuator arm in terms if holding power and precision ... but they last 80 years.

Robotic arms are optimized for ease of production, reliability, and strength.  Biological arms are optimized for energy efficiency, among other things like being manufacuted from cells.

"elegance" is hard to define, but I think a Kuka beats a human arm in terms of simplicity, strength, and precision any day.


问:
How should I power my servo motor with the Adafruit PCA9685 chip?
So I have an Adafruit pca9685 controlling an HSB-9380TH servo and a MG-996R servo. I recently began learning about building robot so I apologize if these questions seem dumb. I literally spent a days trying to google for answers.

I have two 3.7V lithium ion batteries in series connected directly to the V+ and GND PCB terminal on my Adafruit. This should give me 7.4V directly.

So this setup works to control my MG-996R but my HSB-9380 isn't moving at all for some reason. I assume it's because the HSB-9380 is probably more power consuming I would expect. I can't get seem to get my HSB-9380 to work or even move. I suspect that li-on batteries are not strong enough to drive the HSB-9380TH and I need to switch to lipo batteries. The manual for my HSB-9380 says that the stall current is 2.3 Amps. Shouldn't lithium ion batteries be sufficient?

I'm running the MG-996R on 50z with a PWM range of 150-650. I tried running the HSB-9380TH on a range of 1100-1900 as well as on 150-650.

So I have a few questions. If you could answer the ones you know about, I would really appreciate it.

Do you know why my HSB servo isn't working?

How much current can a Lion battery output?

Should I connect the battery directly to the Adafruit PCA-9380 or do I need to protect it with a resistor? Or do I need to connect the battery to a voltage regulator to the Adafruit PCA-9380?

Can I connect a battery directly to the V+ and GND female connectors of a servo or would this fry my servo because there's no resistor preventing a short circuit? Would I need a voltage regulator or some other component in the middle?

Is it safe to drive different servo motors off the Adafruit PCA-9380 or should I make sure they are all the same type?

Is there a way to power the HSB-9380TH off lithium ion batteries. I prefer to use lithium ion because they can last longer than lipo.

How much current can generic breadboard jumper cables transmit?

答:
Have you tried to connect the PAD supplied with the HSB servo the fifth picture on this page? It is not necessary but in the case that your battery is fully loaded it an cause an overload if you don't have a BMS in your circuit.

This depends on the battery you are using. Usually they are given with a value in mAh which correspond to the maximum amount of mili-Ampere your battery can deliver during one hour. So if your system requires more than this capacity, the battery will last less than an hour and reciprocally if it requires less than this capacity, the battery will last more than an hour. This value is usually given on the battery datasheet.

You should connect directly your power supply to the Adafruit PCA-9380 board as described in the schematics in the bottom of this page, but I would advise you to test each servomotor separately before testing all together (in case of failure you may not burn everything and you will be capable of isolating quickly a problem). A voltage regulator is advised in the case that your power supply is not very stable or if it delivers more Volts than the required ones, so you don't need it here!

The first servo will requires the PAD mention in my answer of your point #1. The Adafruit board your are using does the following things: It is wiring the V+ and GND of your battery to the wires red and black of the servomotor. It links the GND of your battery with the one of your board sending the signal (usually yellow wire of your servomotor) to the servomotor. It converts the orders you are sending via the I2C protocol into PWM signals to each servomotor. You can do all of this with an Arduino board but it will requires that you directly use PWM pins instead of I2C ones (SLC and SDA), and a servomotor library to control it. So I think that it's easier for you to begin with the Adafruit PCA-9380 board! For the voltage regulator, see my answer #3, and no resistor is required at all!

As long as they accept the same input power and are controlled by the same protocol (here it is a PWM signal) at the same power level (here I suppose that it is 5V...), it is safe to use the Adafruit board to control them!

There is no limitations of the tech used inside the battery as long as you respect the maximum value of Volts that the servomotor can handle and that your battery contains the same amount or more in Amps to control it! Don't forget that your servomotor requires its PAD to be safe (see my answer #1)!

See the comment of @Octopus below your question !

Have you also tried using a multimeter to check your circuit?