问:
SLAM system for LIDAR and Stereo camera for cone detection for Autonomous driving
The purpose of the SLAM system is very specific, for detecting cones in an image and triangulate their position to create a map.

The data input would be the camera data, odometry and the LIDAR data.

I have been going through SLAM algorithms on openSLAM.org and through other implementations of SLAM systems.

I would like to know if there are a set of SLAM algorithms specific for the problem I have and what are the most efficient and least time consuming SLAM algorithms available. Any leads would be helpful.

答:
I did a little search and I found some existing research for cone detections in Youtube. One of them is:
OpenCV Traffic Cone Detection Tutorial in Visual Basic
https://youtu.be/Y7SkyY58aUw

I saw in the title you mentioned LIDAR and Stereo camera, however, in the first sentence you just mentioned image rather than 3D point cloud. So I wonder if you mean to get a 3D map first and then detect cones from the 3D map.

As far as I know it is a really challenge to detect objects in 3D maps. It just like an extension of the image processing problem in RGB images.

Maybe you want to learn something like this. It seems to be a cutting-edge technology.

Real-Time Semi-Automatic Object Detection and Measurement with Intel RealSense
https://www.youtube.com/watch?v=nH-bKOZjOec

If you don't mind the short detect range, the RGBD camera like Intel RealSense should be a good option for you.


问:
Is it possible to make Kite flying robot?
This question was asked in electronics stackexchange. I want to know if is it possible to make a robot that can fly kites. Is this idea practical? I was thinking that making a kite is just like making some flying quadcopter or helicopter. I just want to know is this idea really implementable?  Is there an example or similar work in reference to this?     </p>

答:
I read a magazine article many months ago about an automated system of power generation for isolated areas like disaster relief and such where a kite was used instead of a propeller driven wind turbine.  The write-up was not particularly technical but there was a picture of the ground unit and it looked like a winch with a boom like a fishing rod or something in that vein.

I understood it would allow the kite to pull away in the wind and generate power by running the winch motor as a generator and then it would control the kite to either loose drag or swing broadside to the wind so it could be reeled in for much less power draw, to be repeated while the wind lasted.

So it does seem possible to at least partly control kite operation via automation.

EDIT:

I found a company EnerKite that makes use of a controlled kite for electricity generation.  It is self launching by swinging it around on a extensible pole, pretty slick.

ContentLicense: CC BY-SA 3.0


问:
How to decide links length of manipulator?
I'm working on pick and place robotic arm with 4 dof. I'm using MATLAB for inverse kinematics. But, I want to know how to decide links length. Say, I have four point in space upto where my robotic arm should reach i.e at upper most point, lower most point, extreme right point and extreme left point.I want theory or any approach so that I can calculate link length using these points.

Thanks.

Edit: Add picture of robotic arm.

答:
I don't think there is a theoretically best set of link lengths for a set of end-effector poses.  Since inverse kinematics is typically only concerned with the ability or not of achieving the target pose.  So if you find a set that can achieve all 4 poses, then IK doesn't help much more.

Best means optimizing some metric.  My answer to this question lists a number of metrics you can use to evaluate a given arm configuration and compare it to another.  For example: distance from joint limits, manipulability measure, and condition number.  I'd also add the total power required from all your actuators (assuming your payloads and the weight of the arm are non-negligible).  My answer in this other question describes some ways to do that.

So pick some link lengths and do some calculations, see how they compare, then repeat.  One word of caution though, some of these metrics can't really be directly compared across arms with different parameters.


答:
I agree with Ben that there is no established algorithm which you follow and get the link lengths.

Fomrulating an optimization problem and then solving it is one of the viable solutions, as Ben suggested.

A bit more simplistic is just to rely on kinematic capablities, Joint positioning will be always a tradoff between positioning resolution of the end-effector and maximum velocity. The closer the joints are to the end-effector (and to eachother) the more postitioning resolution will the robot have. The further they are (and closer to the base) the faster it will be.

If you take a look at a 6 dof industrial robot like this, you can see that the wrist joints are as close as possible to the endeffector, increasing positioning resolution. These are used to "compensate" for fine motions the first 3 axes cannot make. The first two axes are as close as possible to the base to give velocity.

I am aware that this effect is included in Bens answer, if you optimize for manipulability and load you will get the same effect, however, before formulating and solving a complex optimisation problem a bit of a trial and error experimetns may be helpful.

Title: How to decide links length of manipulator?

Body:
I'm working on pick and place robotic arm with 4 dof. I'm using MATLAB for inverse kinematics. But, I want to know how to decide links length. Say, I have four point in space upto where my robotic arm should reach i.e at upper most point, lower most point, extreme right point and extreme left point.I want theory or any approach so that I can calculate link length using these points.

Thanks.

Edit: Add picture of robotic arm.


问:
Problem with inverse kinematics in robotic arm using Matlab
I define my robotic arm with following code

```<code>% Link('d', 0.15005, 'a', 0.0203, 'alpha', -pi/2)
L(1) = Link([0  0.15   0    pi/2     0], 'standard');
L(2) = Link([0  0     0.15   0       0], 'standard');
L(3) = Link([0  0     0.15   0       0], 'standard');
L(4) = Link([0  0     0.15   0       0], 'standard');
% set limits for joints
 L(1).qlim=[deg2rad(-45) deg2rad(45)];
 L(2).qlim=[deg2rad(-45) deg2rad(45)];
 L(3).qlim=[deg2rad(-60) deg2rad(60)];
 L(4).qlim=[deg2rad(-50) deg2rad(50)];
 %build the robot model
rob = SerialLink(L, 'name','rob');
qready = [0 0 0 0]; % initial position of robot
</code>```

And I solve inverse kinematic and plot robotic arm with code

```<code> Td = transl([0.05 0 -0.20]);
q = rob.ikine(Td, qready,[1 1 1 0 0 0]);
plot(rob,q,'noname');
</code>```

Its results are 0  -139.0348635    82.65184319 -1.286384217 which is four angles named theta1, theta2, theta3 and theta4 respectively. Now the point is I gave joint limit for theta2 as -45 to 45 degree but result output is -139 degree. Same case with theta3. Why it is so? Another thing is when I plot these angles robotic arm cross each other as shown in figure. I want to know what is wrong with code or I'm missing any thing.

答:
In the documentation of the Robotics Toolbox by Peter Corke it is stated that the ikine() method does not regard motion limits. (Notes -> Joint limits are not considered in this solution.)

You can cosider using ikcon() instead.

Solving the inverse kinematics does not guarentee a colision free pose of the robot. That is only guaranteed if a colision check is carried out or if the joint limits are respected (adn set correctly).

Furthermore I would advise to check the exit flag of the method solving the inverse kinematics to make sure that indeed it has found a solution


问:
remote controlled quadcopter : Why is it not possible to send all the commands over one channel?
First of all, this might be a stupid or bad question but i am quite new to this topic.

I want to build a rc transmitter (with some joystick buttons, an arduino and a hc-12 transceiver). I've searched a lot about this topic. But i still have a question that rests unanswered.

Why is it necessary to use multiple channnels to control for example pitch,jaw,throttle of a quadcopter. transmitters in shops have 4 or 6 channels but i don't understand why these different channels are necessary. These transmitter send the information of each button over a different channel, why is this necassary?

Is it not possible to send the commands over one channel (all at the same frequency)? For example send p30 for a pitch of 30 degrees and j30 for a jaw of 30 degrees? Than, the receiver can interpret this as well?

I guess it is to send al the commands on the same time?

Thanks in advance

答: Well, today I was able to finally get my hands on a new Hc-12 transceiver, since one the last batch was burned out by accident and I had to give my project a pause. So today, I lowered the baud rate of both boards to 2400bps, since it offers the best rage and transmitting power possible, and changed from the default channel-01 to channel-02. If I may, let me share a couple of important things about these little things. First, always, if powering from 4.5v to 5v, always use a 1N4007 diode in series with the module, specially if you're transmitting all the time. My transmitter got so hot that I though it was gone for good, lucky enough, I saw this information on the manuals before loosing it. A 100uf decoupling electrolytic capacitor is also recommended, to be put in direct contat with the board after the diode. I think the pourpose here is decoupling, power reservoir and/or noise filtering. It is raining down here, and probably will still rain for a few days, so I am not so eager to take the pair outside for a real trial run. I will need binoculars and a few aluminum foil pieces glued to a stick and then glued to the servos, so I can observe from a certain distance. What I can tell for the indoors performance is that it looks sharp. But the KY-023-type X and Y Joystick really requires skill to operate, it requires you to have hands of a fairy, only after training for like 1h I could move it to the desired positions without making the servos jump around. You need to go slowly but surely. Lag is almost non-existent, I would say looks pretty much real time. What really scared me is the current-hungry pair of sg90 servos! 4 AA batteries are not enough to power them directly and the 32u4-based Arduino board + transceiver. So I am looking into C-type batteries or even a power bank to be able to test outside. Really! This servo-current thing is really giving me something else to think about......


问:
How should emergency stops be wired?
Emergency stops are obviously a good idea on most robots, how should they be wired?  What systems should be killed immediately, and what should stay working?</p>

答:
Emergency stops are a safety feature, normally found on industrial equipment.

They should be used when the robot has a potential to hurt humans or cause harm to other assets. This generally depends on the weight of the robot, and the power of the motors (speed at which the robot moves).

For example, a 1kg robot is too light to cause much damage. Conversely if it is 50kg, it could cause some damage. Similarly, a 5kg flying robot which moves very quickly could be dangerous.

You will want to mount an emergency stop on the robot, and possibly also another one off the robot (although this is a more difficult configuration). The safe way of wiring an emergency stop is in a normally closed manner. That means that the switch is normally closed, and the two terminals are connected. By connecting one end to logical 1, and pulling the other end to logical 0 through a resistor, it can be used to determine the state of the emergency stop.

If the emergency stop is triggered, the switch will open, and the signal will be pulled to logical 0 (0 volts).

This will normally feed into a relay controlling the power to the robot.

Note that another safety requirement of emergency stops is that resetting an emergency stop should not start up the robot again. Turning it back on should require both resetting the emergency stop, and subsequently pressing the on switch.

EHow has a diagram showing how this should be wired:

http://www.ehow.com/how-does_5151421_do-emergency-stop-buttons-work.html

As Mark Booth pointed out, to further increase robustness, you should use the normally open switch as well. To do this, connect this signal (with a pull down resistor), to the STOP signal of a relay (http://en.wikipedia.org/wiki/Relay_logic).

The systems that should be killed should include all actuators. This means anything that can move. If you have a computer on board, you may be able to separate its power to another system to avoid sudden loss of power. However, you will want to ensure that it is not powering any actuators directly (eg. USB).

For low power applications, you might try to save on space by skipping the relay, and wire the emergency stop in series with your main power source (batteries). Don't do this. There are two problems:

This would violate the safety principle that resetting the emergency stop should not by itself turn on the power again.

All the current will be flow through your emergency stop. There are emergency stops rated up to 10A (others are rated only 5A). Your application will probably require more current

If an emergency stop is required on your robot, it is probably large enough to have the space for relays.

Title: How should emergency stops be wired?


问:
What is the name of this mechanical linkage?

I am trying to find a joint like these for a robot I'm building. It is often called a swivel joint or a universal joint, but with a modified spider. I can't find one anywhere and would prefer not to make it. Searching for 'universal joint' returns the standard automotive type. Any help would be appreciated

答: Another name is pin and block - mcmaster carr is a go to place for many different fasteners, and mechanical doo-dads</p>


答:
There may not be a direct way, however, you can derive the forward kinematics to give you more insight in how the links are operating with respect to one another. I have worked out the forward kinematics below:

For this particular serial linkage robot, I locked joints 3 and 4 to stay at 0 degrees since this will maximize reach as far as possible (obtained by observation).

On the bottom right are the X, Y and Z equations. Just stick a point in 3D space that your wanting to reach in the X, Y, and Z variables.

Lets call (L2 + L3 + L4) = a

This will give you:

X = a*c1*c2

Y = a*s1*c2

Z = a*s2

Lets say I wanted to know what the cumulative link length should be if I wanted to reach point (300, 300, 300):

300 = a*c1*c2

300 = a*s1*c2

300 = a*s2

Because there are 3 equations and 3 unknowns, we could try systems of equations, after which I obtain:

Theta1 = 45

Theta2 = 35.2644

a = 519.615

Which means you can play around with link lengths L2, L3, and L4, but they must combine to equal 519.615.

Note: Because we are dealing with something as nonlinear as sines and cosines, there may be more solutions to the equation than what I provided.

Overall, messing around with the end equation I provided by selecting various points in 3D space you want to reach or selecting angles of interest for theta 1 and theta 2 is the best way I can think of to determine link lengths.

Another thought could be to use the equations I provided to create an ellipsoid/sphere that touches your farthest points you can reach based on your link lengths; don't know quite how I would go about doing that of the top of my head though.


问:
How to consider gravity in the design of a compensator?
I have to solve an exercise for the Digital Control System course (using MATLAB software) which stands:

"A ball is suspended inside a vertical tube by airflow 'u' and connected via a spring of stiffness K to the bottom of the tube. The ball is subjected to gravity and a viscous friction with coefficient 'B'. The force 'F' exerted on the ball by the airflow is proportional to the airflow 'u' via the constant G; airflow can only be positive (entering the tube)."

I have also all the data needed to solve the problem numerically, but this is not important for the question. What I need to do is: "Write the system equations in state space form with airflow as input and the ball vertical position 'z' as output.Then, select a sampling time and design a digital control system that regulates the ball position by acting on the airflow to the following specifications:

Zero steady-state error (in response to the desired altitude step input).

Max overshoot: 30%;

Settling time at 5% less than 8 seconds."

After this, we have to compute the transfer function of the plant and put it in unitary feedback with the compensator.

I usually write first the system dynamics equations, then from these I choose a suitable set of state variables and I write the matrices A, B, C and D according to the state variables (I use the 'ss' function). The problem is that I don't know how to consider the gravity in this case because it comes in the system dynamics as a constant term (-g*m). For example by considering the state variables as [z' z] I obtained the following matrices:

A = [-B/m -K/m; 1 0];

B = [G/m; 0];

C = [0 1];

D = 0;

I tried to design the compensator (a simple PID) without considering the gravity and by adding it later in the Simulink model used to test the system (after designing the compensator we have to build a Simulink model in which the discrete time compensator is tested with the transfer function of the continuous time system) but of course the system output is no more able to meet the requirements.
For the gravity transfer function I considered to have the mass as input and the position as output

Am I wrong in not considering the gravity when designing the compensator? Or perhaps, if correctly implemented the gravity should not affect the system output?

答:
The presence of gravity does impact on how fast you can achieve steady-state with zero error, because the integral part of your PID compensator needs to charge in order to counteract the term $mg$. As a result, you won't meet the requirement on the settling time, with the same setting of the gains.

It's still possible to follow your design steps if you consider adding eventually a feed-forward term $u_{ff}=mg/G$ to sum up at the output of your PID.

Therefore,
$$
u=u_{PID}+u_{ff}
$$


答:
Why don't you use pole placement method to meet your control objective. Since you already have a state space model it is much easier. You have to just check the controllability of your system and then based on control requirement decide on the poles. You can use cmu's Controll tutorial. http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&section=ControlStateSpace

At the same time it doesn't not make sense to me to model the whole system just to make a PID controller. With a good enough system model you can make better controllers such lqr etc.

However if you are hell bent on using a PID controller, you can still improve your PID controllers performance by making use of anti-windup and thereby making integral term much more aggressive which will increasing the response time. PID controllers don't require gravity compensators (PD controller does), but you can assist it by providing feed forward and you can always tune it to meet your requirement. At the same time you can use bode plot to check whether it is theoretically possible to attain such a bandwidth of the system without making it unstable.

Title: How to consider gravity in the design of a compensator?

Body:
I have to solve an exercise for the Digital Control System course (using MATLAB software) which stands:

"A ball is suspended inside a vertical tube by airflow 'u' and connected via a spring of stiffness K to the bottom of the tube. The ball is subjected to gravity and a viscous friction with coefficient 'B'. The force 'F' exerted on the ball by the airflow is proportional to the airflow 'u' via the constant G; airflow can only be positive (entering the tube)."

I have also all the data needed to solve the problem numerically, but this is not important for the question. What I need to do is: "Write the system equations in state space form with airflow as input and the ball vertical position 'z' as output.Then, select a sampling time and design a digital control system that regulates the ball position by acting on the airflow to the following specifications:

Zero steady-state error (in response to the desired altitude step input).

Max overshoot: 30%;

Settling time at 5% less than 8 seconds."

After this, we have to compute the transfer function of the plant and put it in unitary feedback with the compensator.

I usually write first the system dynamics equations, then from these I choose a suitable set of state variables and I write the matrices A, B, C and D according to the state variables (I use the 'ss' function). The problem is that I don't know how to consider the gravity in this case because it comes in the system dynamics as a constant term (-g*m). For example by considering the state variables as [z' z] I obtained the following matrices:

A = [-B/m -K/m; 1 0];

B = [G/m; 0];

C = [0 1];

D = 0;

I tried to design the compensator (a simple PID) without considering the gravity and by adding it later in the Simulink model used to test the system (after designing the compensator we have to build a Simulink model in which the discrete time compensator is tested with the transfer function of the continuous time system) but of course the system output is no more able to meet the requirements.
For the gravity transfer function I considered to have the mass as input and the position as output

Am I wrong in not considering the gravity when designing the compensator? Or perhaps, if correctly implemented the gravity should not affect the system output?


问:
Constrained Second Angle Double Pendulum
If I am trying to model the dynamics of a double-pendulum (on a horizontal plane without the effects of gravity), in which the second angle is constrained to range between values of [-10 deg, 10 deg], how would I derive the equations of motion? I'm having trouble identifying whether I would use some method involving solving the Lagrangian with holonomic or non-holonomic constraints. </p>

答:
I don't think you need to worry about the constraint. You can derive the non linear equation using Lagrangian. Once you have the non linear model, you will have to linearize it at the equilibrium point which is simply valid only for angle around 0 deg. This condition is much more strict then your mechanical limitations. Therefore you don't need to consider the limitations that you have mentioned. And I assume you will modeling the friction as a viscous damper which is a linear model. This assumption makes the system holonomic.

Here I assume that you will use linear model to control the system. However, if you want to use non linear control then you will probably need to worry about the constraints.


答: The closest I can find are this and this: "Swivel Joint".</p>

Title: What is the name of this mechanical linkage?

Body: I am trying to find a joint like these for a robot I'm building. It is often called a swivel joint or a universal joint, but with a modified spider. I can't find one anywhere and would prefer not to make it. Searching for 'universal joint' returns the standard automotive type. Any help would be appreciated


问:
Forward and Revers Kinematics For Modified Hanging Plotter
I'm building a modified version of the standard hanging plotter (v-plotter). The basic idea is that you have two cables hanging from stepper motors which form a triangle supporting the pen at the tip.

My design the strings anchored at points $C$ and $D$ which causes the behavior to be somewhat different that the normal plotter, especially when operating close to the motors.

I was able to work out the forward kinematics fairly easily, but the inverse kinematics are turning out to be a real headache. You can see my attempt at a standard geometry solution on math.stackexchange here.

Is there anything specific to calculating kinematics for robotics which could help me?

I'm not interested in modifying the hardware to make the math easier. I'm also not interested in discussing the center of gravity of the pen, cable weight...etc. I want to calculate the kinematics for this as an ideal system.

Any and all advice is appreciated.

Thank you.

答:
All of the effort and credit for this answer go to Keith Selbo, I am simply reproducing his work here to make the explanation public.

Development of a Method for Translating Hanging Carver  (X, Y) Coordinates Into Suspension Lengths That Accounts for Sled Tilt and Finite  Radius of the Suspension Anchors

The figure on the next page represents the convex quadrilateral formed by components of a vertical carver; a plotter that suspends a router sled from two points and moves it about the plotting surface by varying the length of the suspension lines. This development encompasses a sled with center of mass  not co-located with the plotter bit, causing the sled to adopt a  tilt to an angle at which the moment  of the sled mass cancels the net moments exerted by the lateral and vertical forces exerted by the sled suspension.  Also covered is an offset from the plot origin of  the suspension anchor points due to the finite radius of a windlass or sprocket used for pay-out and take-up of the suspension lines as the sled is moved.  This offset results in movement of the effective anchor  point of  the suspension which in turn affects the equilibrium tilt of the sled.

The inputs to the algorithm are the plotter geometry and the x, and y coordinates of the desired bit placement.  The output is the length of the left and right suspension lines.  It includes the straight portion from the attachment at the sled to the variable tangent on the suspension anchor plus the curved portion of the line from the tangent to the top center of the anchor disk.

The sled tilt angle, and the variable left and right anchor points result in three non-linear equations in three unknowns.  The expedient of adding an imaginary extension of the suspension line (see drawing) past the anchor point (tangent) to the y axis allows the use of a pseudo-anchor point that varies only in the y direction which simplifies the equations and the computation.  A simple transformation corrects the line length after the solution is obtained.  This transformation is included in the final equations for the length of the suspension lines.

There was no obvious closed form solution to the equations, so multi-variate a Newton-Raphson algorithm is used to estimate the three unknowns.

Net Forces:

$$\vec{f}_{y_1} + \vec{f}_{y_2} = -\vec{W}\tag{a}$$
$$\vec{f}_{x_1} + \vec{f}_{x_2} = 0\tag{b}$$

Net Moment:

$$\vec{h_1}\times\vec{f}_{y_1}+\vec{h_2}\times\vec{f}_{y_2} +\vec{h_3}\times\vec{W}=0\tag{c}$$

Definitions:

$$\vert\vec{h_1}\vert = \vert\vec{h_2}\vert = h\tag{d}$$

$$\vert\vec{h_3}\vert = h_3\tag{e}$$

$$\vert\vec{f_{x_1}}\vert = \vert\vec{f_{x_2}}\vert = fx(f)\tag{f}$$

$$\vert\vec{W}\vert = W\tag{g}$$

$$\phi_1 = \theta - \phi, \phi_2 = \theta + \phi \tag{h}$$

Moment Cross Product:

$$\vert\vec{h_3}\vert\vert\vec{W}\vert\sin{\phi}+\vert\vec{f_{x_2}}\vert\vert\vec{h_2}\vert\sin{\phi_2}-\vert\vec{f_{x_1}}\vert\vert h_1\vert\sin{\phi_1}+\vert\vec{f_{y_1}}\vert\vert\vec{h_1}\vert\cos{\phi_1} - \vert\vec{f_{y_2}}\vert\vert\vec{h_2}\vert\cos{\phi_2} = 0\tag{i}$$

Given that:

$$\tan{\gamma} = \frac{y+y_1^+-h\sin{\phi_1}}{x-h\cos{\phi_1}}\tag{j}$$
and:

$$f_{y_1} = fx\tan{\gamma}$$

$$\tan{\gamma} = \frac{y+y_2^+-h\sin{\phi_2}}{D-(x+hcos{\phi_2})}\tag{k}$$

$$fy_2 = fx\tan{\lambda}\tag{l}$$

Combining $(a),(j)$ and $(l)$ yields:

$$W = fx(\tan{\lambda}+\tan{\gamma})\tag{m}$$

$$\frac{W}{tan{\lambda}+tan{\gamma}} = fx\tag{n}$$

Then the net moment is zero when:

$$h_3W\sin{\phi}+ \left\vert\frac{Wh}{\tan{\lambda}+\tan{\gamma}}\right\vert(\sin\phi_2 - \sin\phi_1+\tan\gamma\cos\phi_1 - \tan\lambda\cos\phi_2) = 0 \tag{o}$$

Which simplifies to:

$$f(\phi) = h_3\sin{\phi}+ \left\vert\frac{h}{\tan{\lambda}+\tan{\gamma}}\right\vert(\sin\phi_2 - \sin\phi_1+\tan\gamma\cos\phi_1 - \tan\lambda\cos\phi_2) = 0 \tag{1}$$

From the sprocket detail in the figure we have:

$$y_1^+ = r\sqrt{1+tan^2\gamma}\tag{p}$$

Which yields

$$\tan\gamma = \frac{\sqrt{{(y_1^+)}^2-r^2}}{r} = \frac{y+y_1^+-h\sin\phi_1}{x-h\cos\phi_1}\tag{q}$$

or

$$\frac{\sqrt{{(y_1^+)}^2-r^2}}{r} - \frac{y+y_1^+-h\sin\phi_1}{x-h\cos\phi_1} = 0\tag{2}$$

similarly

$$\frac{\sqrt{(y_2^+)^2-r^2}}{r} - \frac{y+y_2^+-h\sin\phi_2}{D-(x+h\cos\phi_2)} = 0 \tag{3}$$

We now have a nonlinear system F(x), consisting of equations (1), (2), and (3):

$$\begin{bmatrix}f_1(\phi,y_1^+, y_2^+) \\ f_2(\phi, y_1^+, y_2^+) \\ f_3(\phi, y_1^+, y_2^+)\end{bmatrix}$$

Applying the  Newton-raphson Method we iteratively solve $J_F(x_n)(\Delta x) = -F(x_n)\tag{r}$ where J is the system Jacobian, x is the vector:

$$\begin{bmatrix}\phi \\ y_1^+ \\ y_2^+\end{bmatrix}  and x_{n+1} = x_n+\Delta x \tag{s}$$

Until

$$F(X_n+1) \approx 0 \tag{t}$$

Then:

$$LeftChain = \sqrt{(x-h\cos(\phi_1))^2+(y+y_1^+-h\sin(\phi_1))^2}-r \tan(\gamma)+r\gamma \tag{u}$$
$$RightChain = \sqrt{(D-(x+h\cos(\phi_2)))^2 + (y+y_2^+-h\sin(\phi_2))^2}-r\tan(\lambda)+r\lambda \tag{v}$$

Again, a HUGE thank you to Keith Selbo for this solution.


问:
Torque in kg/cm?
I was looking up the motor parameters for some stepper motor where they listed the torque of the motor at different current/voltage but the torque they listed was in kg/cm.

How is kg/cm even a remotely acceptable unit for torque?

How do I calculate the torque in Nm from kg/cm?

Clarity note: Its not kgcm which represents [0.098 kilogram force = 1 Nm.]

Website where this happens.

答:
The motor they listed apparently has 1.548 kg·cm of torque at 4.8 V.
(As Ian pointed out, on this website -- like too many other websites -- "kg·cm" is often misspelled as "Kg/cm").

It is apparently a NEMA 17 motor.
From the photo, it looks about half as long as a typical NEMA 17 motor,
so I'm not surprised it has about half the torque of a typical NEMA 17 motor.

A torque of 1.548 kg·cm is more than adequate for many robots --
1.4 kg·cm of torque is adequate for axis motors on a RepRap.

They use this unit only for the stepper motors and not for the DC
  motors

Huh? <s>Every motor</s> Several motors listed on that site, both stepper and DC motor ( a b ), are rated using the "Kg/cm" unit, which in every case is a misspelling of "kg·cm".

0.222 ... its absurdly low again.Most DC motors on the website

The "0.222 kg·cm" applies when driven at 0.4 V. That's a small fraction of its rated voltage, which is 6 V where the motor gives 1.869 kg·cm.

As far as I can tell, all the DC motors on that website include a gear box, which multiplies the torque.

It is unfair to compare motors by comparing only the torque at the output of a torque-multiplying gear box of one motor driven at its full rated voltage, to the torque of some other motor without a gearbox and when driven at a small fraction of its rated voltage.

On the other hand, I have to laugh when this website calls this a "High torque" motor when it is almost the lowest-torque NEMA 17 motor I've ever seen.
It reminds me of the "Schnell-Bahn" (literally "fast train"), which are the slowest trains still operating in Germany.

EDIT:
I shouldn't have said "every motor"; most of the motors are rated in "Kg-cm" or "kg-cm", which is close enough to "kg·cm".

Title: Torque in kg/cm?


问:
Road Detection When the Robot is Off-Road
I'm trying to make a lightweight method of outdoor road following for a small ground robot. In nearly all road detection work that I've seen, they all assume that the robot is already on the road, which allows for techniques like finding the vanishing point or sampling pixels near the bottom of the camera frame. However in my application, the robot can be a few meters away from the road and needs to first find the road. As the robot computation runs on an Android phone, I'm hoping to avoid heavy computer vision techniques, but also be robust to variable outdoor lighting conditions. Obviously there is a trade-off, but I'm willing to sacrifice some accuracy for speed and ease of computation. Any ideas on how to achieve this?</p>

答:
You may be interested in what is called "terrain classification" - not detecting the road itself, but classifying different regions of an image taken by the camera as grass, gravel, road, etc. This will help you to find the road, where you can apply more efficient methods of road following.

A paper "High Resolution Visual Terrain Classification for Outdoor Robots" by Yasir Niaz, Khan Philippe Komma and Andreas Zell, that discusses approach based on SURF features can be found here: http://www.cogsys.cs.uni-tuebingen.de/publikationen/2011/khan2011iccvworkshop.pdf

A list of some other papers on the subject: http://www2.ift.ulaval.ca/~pgiguere/terrainID.html (note that last modification is from 2014, so there may be some new research worth investigating).


问:
How do I interface a TLC5947 with small motors?
This is a follow-up to this question:  Prototyping a device with 25-100 small DC 3.0V motors, is Arduino a good fit?

I've decided based on the answer that sending the control signals through multiple TLC5947 chips, then sending the PWM signal to the motors is the best way to go.  What I need to know is how to turn the PWM signals into something of the required power, since the TLC5947's won't be able to drive the motors by themselves.

I'm guessing an amplifier is what I'll need to make, but what's the best way to boost that many signals?

答:
The accepted answer to your previous question presents several ways of developing enough drive for the vibrating motor, in its section called “Converting PWM signals into something that can drive a motor”.

One of the most direct ways is using one ULN2803 device per 8 motors, or one ULN2003 per 7 motors.  In some packages these devices support up to 500 mA/channel when properly heatsinked; other packages allow less but should have no problem with the 85 mA start current and 75 mA run current of the vibration motor (1, 2).

An alternative is to substitute LED drivers with higher drive capability in place of the TLC5947. For example, the 16-channel Toshiba TC62D722 allows up to 90mA/channel.  (I don't know what the availability of these parts is.)  Like the TI  TLC5947, the TC62D722 has per-channel PWM settings.  Both parts use an external current-limit-setting resistor and the TC62D722 also has an 8-bit (256 level) output current gain control.

Note that TLC5947 channels can be paralleled.  On page 7 the data sheet says multiple outputs can be tied together to increase the constant current capability.  Thus you could use each TLC5947 to drive eight 90mA devices; or could use a 25mA-setting resistor and parallel 3 outputs to get 75mA.  Anyhow, n TLC5947's, daisy-chained together, would drive n·24/3 = 8·n vibration motors.

If you have motors on hand, you could use a 12V power supply in series with a 166 ohm resistor (or 150 or 200 ohms for other testing) to run about 60mA through a motor and see if it starts and runs satisfactorily.  If so, you might be able to use two TLC5947 channels instead of three per motor.

Drivers like ULN2003 or ULN2803 have internal clamp diodes so they can drive inductive loads without needing such diodes added on.  As an LED driver, the TLC5947 doesn't include clamp diodes for high-going voltage excursions since LED's are not much of an inductive load.  (The output diagram on page 8 of specs shows a diode from ground to OUT_n for OUT0 through OUT23, which would clamp negative-going voltages, but no rating is shown for the diode.)  You probably would need to add one clamp diode per motor.  However, it certainly is possible that you could run motor tests and find that the motor transients don't exceed the 33 volt output ratings of the TLC5947 – whenever you test it on the bench.


问:
PID Controller for line following robot
I had this idea of using the PID Controller as the algorithm of the line following mechanism for my Robot. The problem (which is a nature behavior of the PID controller ) on the line gaps ( where there are no line e.g. 10 cm) the robot doesn't go straight forward but turns right .
I thought about it a lot , and i couldn't find any better idea for modifying this algorithm to work in this situation but, adding two more sensors and specify the (white area on the 3 sensors  ) as a special situation where the robot should go straight forward .

Now my question is is there any better idea , that i can use ?

答: There are a lot of methods if your just search this forum of just google it.... For example, please see a similar problem (recapturing when there is a large gap in lines for line tracking) implementing PID algorithm in line following robot</p>

Title: PID Controller for line following robot


问:
Negative torque and negative velocity during reverse dynamics in Matlab Robotics Toolox.
I'm using Robotics Toolox Matlab and I did Reverse dynamics using code below.

```<code>[qreach,err] =  rob.ikcon(T1, qready);
[q,qd,qdd]=jtraj(qready,qreach,t);
    %compute inverse dynamics using recursive Newton-Euler algorithm
tauf = rne(rob, q, qd, qdd);
</code>```

And when I plotted angular velocity and torque it shows some negative values as shown in Fig.
I want to know why so and what is the physical significance of negative veloity and torque in robotics.
Thanks.

答:
If you are thinking about a robotic joint as power comes into the motor and causes the link to move, then you're missing part of the picture.   I say this because in some ways you could then imagine a negative torque meaning that something pushes on the link and provides power back to the motor.

The reality is that each actuator must be given an axis about which to rotate.   Rotation in one direction is given a positive meaning - for example, maybe the encoder counts up when the link moves in a counterclockwise direction.  A positive torque would be required to move the link about the axis in that direction, and would result in a positive velocity.   The positive torque is provided by commanding the motor to spin its shaft in a certain direction.

A negative velocity is simply a motion of that same link, but in the opposite direction.  In the example above, it would be a clockwise speed about the axis.   The motor must exert a negative torque to cause this motion.   In other words, it must be commanded to rotate in the other direction.

It's that simple.


问:
Stereo camera pair focal lengths
I came across the standard representation of stereo cameras where they are side to side and the epipolar lines are the same image scan line and the cameras have the same focal length.

Source: http://vision.deis.unibo.it/~smatt

Now, do all stereo camera pairs need to have the same focal length? And if not then how does that change the stereo depth calculation?

Thank you.

答:
You're just using the focal length as part of a camera model.

All you really care about is exactly what the image you posted depicts - that you can  correlate a particular pixel with an angle. If you know the angle to a point of interest from one camera, and you know the angle to the same point of interest from another camera, and you know how far the cameras are apart, then the law of sines can tell you where that point of interest is actually located.

Like I said above - what you really want to know is how a pixel relates to an angle. If you know that your key point is located 15 pixels from the left edge (the right camera in your image), what angle does that make between the image receptor and that key point? That depends on the focal length of the camera. A lot of techniques use the pinhole camera model, and I believe this is sufficient for most cameras, but especially if you wanted to use a fisheye lens or similar then you need to rectify your output image in addition to applying the camera model.

This might be a straightforward process, but it can definitely get complicated in a hurry, especially if you can't find documentation regarding the characteristics of the lens you're using.

Title: Stereo camera pair focal lengths


答:
The derivation of double pendulum system is indeed trivial but tedious because of computing some derivatives. The first step is to tackle the problem from a geometric perspective. My drawing of double pendulum is shown in the following picture:

From the preceding figure, we can write down some equations. The derivatives of these equations are needed subsequently, therefore, we compute them as well. The independent time variable is omitted for the sake of simplicity.
$$
\begin{array}
xx_1 = a_1 \sin\theta, &
\qquad y_1  = -a_1 \cos\theta, \\
\dot{x}_1  = a_1 \dot{\theta} \cos\theta, &
\qquad \dot{y}_1  =  a_1 \dot{\theta} \sin\theta, \\
%####################################################
x_2 = x_1 + a_2 \sin\phi, &
\qquad y_2 = y_1 - a_2 \cos\phi, \\
\dot{x}_2 = \dot{x}_1 + a_2 \dot{\phi} \cos\phi, &
\qquad \dot{y}_2 = \dot{y}_1 + a_2 \dot{\phi} \sin\phi,
\end{array}
$$
To derive the dynamics equation of the system, I will use the Lagrangian approach. We need the kinetic and potential energies of masses. Let's start off with the kinetic energy.

The kinetic energy of $m_1$ is computed as follows:

$$
\begin{align}
\mathcal{K}_1 &= \frac{1}{2}m_1 v^2_1 \\
              &= \frac{1}{2}m_1 (\dot{x}^{2}_1+\dot{y}^{2}_1) \\
              &= \frac{1}{2}m_1 (a^{2}_1 \dot{\theta}^{2} \cos^{2}\theta+a^{2}_1 \dot{\theta}^{2} \sin^{2}\theta) \\
&= \frac{1}{2}m_1 [a^{2}_1 \dot{\theta}^{2} (\cos^{2}\theta+ \sin^{2}\theta)] \\
&= \frac{1}{2}m_1 a^{2}_1 \dot{\theta}^{2}
\end{align}
$$

The kinetic energy of $m_2$ is computed as follows:

$$
\begin{align}
\mathcal{K}_2 &= \frac{1}{2}m_2 v^2_2 \\
              &= \frac{1}{2}m_2 (\dot{x}^{2}_2+\dot{y}^{2}_2) \\
 &= \frac{1}{2}m_2 [(\dot{x}_1 + a_2 \dot{\phi} \cos\phi)^{2}+(\dot{y}_1 + a_2 \dot{\phi} \sin\phi)^{2}] \\
%===============================================
&= \frac{1}{2}m_2 [(\dot{x}^{2}_1 + 2a_2 \dot{\phi} \cos\phi \dot{x}_1 + a^{2}_2 \dot{\phi}^{2} \cos^{2}\phi) + \\  & \qquad \ \ \  \quad  (\dot{y}^{2}_1 + 2a_2 \dot{\phi} \sin\phi \dot{y}_1 + a^{2}_2 \dot{\phi}^{2} \sin^{2}\phi)] \\
%===============================================
&= \frac{1}{2}m_2 [(a^{2}_1 \dot{\theta}^{2} \cos^{2}\theta + 2a_2 \dot{\phi} \cos\phi a_1 \dot{\theta} \cos\theta + a^{2}_2 \dot{\phi}^{2} \cos^{2}\phi) + \\  & \qquad \ \ \  \quad  (a^{2}_1 \dot{\theta}^{2} \sin^{2}\theta + 2a_2 \dot{\phi} \sin\phi a_1 \dot{\theta} \sin\theta + a^{2}_2 \dot{\phi}^{2} \sin^{2}\phi)] \\
%===============================================
&= \frac{1}{2}m_2 [a^{2}_1 \dot{\theta}^{2} [\cos^{2}\theta+\sin^{2}\theta] + 2a_2 a_1 \dot{\phi} \dot{\theta}[ \cos\theta \cos\phi  + \sin\theta \sin\phi ] + \\  & \qquad \qquad a^{2}_2 \dot{\phi}^{2}[ \cos^{2}\phi+\sin^{2}\phi] ] \\
%===============================================
&= \frac{1}{2}m_2 [a^{2}_1 \dot{\theta}^{2}  + 2a_2 a_1 \dot{\phi} \dot{\theta} \cos(\theta-\phi) +  a^{2}_2 \dot{\phi}^{2} ]
\end{align}
$$
The kinetic energy of the whole system is then:
$$
\begin{align}
\mathcal{K} &= \mathcal{K}_1 + \mathcal{K}_2 \\
&= \frac{1}{2}m_1 a^{2}_1 \dot{\theta}^{2} +
\frac{1}{2}m_2 [a^{2}_1 \dot{\theta}^{2}  + 2a_2 a_1 \dot{\phi} \dot{\theta} \cos(\theta-\phi) +  a^{2}_2 \dot{\phi}^{2} ]
\end{align}
$$

The second step is to compute the potential energy of the whole system. We start off with the potential energy of $m_1$ which is computed as follows:
$$
\begin{align}
\mathcal{P}_1 &= m_1 y_1 g \\ &= m_1(-a_1 \cos\theta)g \\ &= -a_1 m_1 g \cos\theta
\end{align}
$$

The potential energy of $m_2$ is  computed as follows:
$$
\begin{align}
\mathcal{P}_2 &= m_2 y_2 g \\ &= m_2(y_1 - a_2 \cos\phi)g \\
&= m_2(-a_1 \cos\theta - a_2 \cos\phi)g \\
&= -a_1 m_2 g \cos\theta - a_2 m_2 g \cos\phi
\end{align}
$$

The potential energy of the whole system is then:
$$
\begin{align}
\mathcal{P} &= \mathcal{P}_1 + \mathcal{P}_2 \\
&= -a_1 m_1 g \cos\theta -a_1 m_2 g \cos\theta - a_2 m_2 g \cos\phi
\end{align}
$$

To construct the Lagrangian equation, we take the difference between the kinetic $\mathcal{K}$ and potential $\mathcal{P}$ energies of the whole system, hence:

$$
\begin{align}
\mathcal{L} &= \mathcal{K} - \mathcal{P}
\end{align}
$$

At this moment, we will compute dynamics equation of the double pendulum system. Remember this system has two degrees of freedom, therefore, we need two differential equations to describe the motion of the system. Let's start off with the first equation (i.e. the equation for $\theta$). This can be done by determining the following equations:
$$
\frac{\partial \mathcal{L}}{\partial \dot{\theta} }, \ \
\frac{d}{dt} \left( \frac{\partial \mathcal{L}}{\partial \dot{\theta} } \right)
\text{and}
\frac{\partial \mathcal{L}}{\partial \theta}.
$$
For the second equation of dynamics equation, we do the following:
$$
\frac{\partial \mathcal{L}}{\partial \dot{\phi} }, \ \
\frac{d}{dt} \left( \frac{\partial \mathcal{L}}{\partial \dot{\phi} } \right)
\text{and}
\frac{\partial \mathcal{L}}{\partial \phi}.
$$

I will leave the rest as an exercise. Once you came up with the dynamics equation, you can use some controllers to limit the range of the second pendulum.

Title: Constrained Second Angle Double Pendulum

Body: If I am trying to model the dynamics of a double-pendulum (on a horizontal plane without the effects of gravity), in which the second angle is constrained to range between values of [-10 deg, 10 deg], how would I derive the equations of motion? I'm having trouble identifying whether I would use some method involving solving the Lagrangian with holonomic or non-holonomic constraints. </p>


问:
Can high voltage power lines provide a super highway for drones?
Is there a way to convert the EM field that surrounds high voltage power lines for direct usable electricity for air or ground drones for continuous flight or travel?

Added: Yes could the EM field be used for a guide as well?

https://electronics.stackexchange.com/questions/280558/can-high-voltage-power-lines-provide-a-super-highway-for-drones

答:
Sure, a drone can land on a powerline. That's a standard task like the "peg in hole problem" for robotarms. The aim is to maneuver a UAV near to a highvoltage line and eating all the energy. The earliest paper was written in 2009 and has a nice plotchart of the Electro-Magnetic Field on page 8 Powerline perching with a fixed-wing UAV for directing the UAV in 2D space.

A little bit more tricky is the question of how to program such a device, that it can lands autonomously. A behaviortree which is implemented as a Python thread would be a good starting point. Some routines for goalfinding, fallback handling and number of trials has to be implemented.

In pseudocode the landing procedure is:

```<code>class BehaviortreePerching():
  def __init__(self):
    pass
  def BTstart(self):
    t = threading.Thread(target=self.taskmain)
    t.start()
  def taskmain(self):
    if self.landing()==success: self.harvesting()
    else self.retry()
</code>```

ContentLicense: CC BY-SA 4.0

Body:
Sure, a drone can land on a powerline. That's a standard task like the "peg in hole problem" for robotarms. The aim is to maneuver a UAV near to a highvoltage line and eating all the energy. The earliest paper was written in 2009 and has a nice plotchart of the Electro-Magnetic Field on page 8 Powerline perching with a fixed-wing UAV for directing the UAV in 2D space.

A little bit more tricky is the question of how to program such a device, that it can lands autonomously. A behaviortree which is implemented as a Python thread would be a good starting point. Some routines for goalfinding, fallback handling and number of trials has to be implemented.

In pseudocode the landing procedure is:

class BehaviortreePerching():
  def __init__(self):
    pass
  def BTstart(self):
    t = threading.Thread(target=self.taskmain)
    t.start()
  def taskmain(self):
    if self.landing()==success: self.harvesting()
    else self.retry()


答:
I think yes it can but how? My options are here:

Static system for conventional systems

It should stand or hang to line/pole/special place like birds. Please watch video for an example: https://www.youtube.com/watch?v=MvRTALJp8DM

Dynamic system

Harmless/secure distance present day wireless charging methods: use low energy harvesting drone or an alternative design like blimp-drone and use wireless charging along the line.

Title: Can high voltage power lines provide a super highway for drones?

Body:
Is there a way to convert the EM field that surrounds high voltage power lines for direct usable electricity for air or ground drones for continuous flight or travel?

Added: Yes could the EM field be used for a guide as well?

https://electronics.stackexchange.com/questions/280558/can-high-voltage-power-lines-provide-a-super-highway-for-drones


答:
There is nothing that forces both cameras to have the same focal length, but there is also no reason to use different cameras. In a stereo setup you want both cameras to see the same region of the world as only the objects in the overlapping region can be reconstructed. If you use a zoom-lense and fisheye, the overlapping region would be minimal and you could only use a small path of your fisheye-image.

You also want to match the two images so that both camera should have a similar characteristic (consisting of lense, sensor and settings). The similar both cameras are, the better the matching.

So you could built a stereo camera with different camera, but you don't want to.

Title: Stereo camera pair focal lengths

Body:
I came across the standard representation of stereo cameras where they are side to side and the epipolar lines are the same image scan line and the cameras have the same focal length.

Source: http://vision.deis.unibo.it/~smatt

Now, do all stereo camera pairs need to have the same focal length? And if not then how does that change the stereo depth calculation?

Thank you.


问:
What would be the best way to handle food grains?
I'm trying to handle food grains like rice, wheat in an automated way (to cook simple dishes). For this I have to transfer grain from a larger container to a weighing scale. I know I can use solenoid valves for liquids but all solid handling valves seem to be too big (gate valves etc) and for larger applications. Is there any better way to do this ? </p>

答: Mechanism could be similar to bubble-gum machine. Container fills up the cup (for which you know the mass of grains). With motor you need to rotate shaft with few cups from filling to spilling :) This would give you the resolution of mass that fills the cup. From there you can transfer that grains with conveyor to wherever you need.</p>


答:
I suggest experimenting with a rotating cone feeder.  If you make the rotation-speed and the cone's axis-angle adjustable, users could set it differently for different materials.  The cone should be made easily removable, to allow easy cleaning and perhaps substitution of shorter, wider, or longer cones for different materials.

In the diagram, the axis of the cone is horizontal.  The  “natural angle of repose” referred to in the text is material-dependent and rotation-speed dependent.  Up to some point, faster rotation delivers material faster.  Some cone systems periodically reverse the direction of rotation.  If the axis is horizontal, some given amount of material remains in the cone when it stops rotating, which might or might not matter in your process.

For other ideas, also see the Mixers page in the University of Michigan  “Encyclopedia of Chemical Engineering Equipment”, and see the  “Funnel Flow” section near the middle of the Hoppers page.  As seen in the video there, the fairly coarse mixture in the hopper stops running a couple of times, until the mechanism is shaken back and forth.

A vibrating-screen device is shown in Vibrating Sieve Machine, Murat Model IV.  A large rotating spiral brush is shown in AyrKing Breader/Blender/Sifter. An old Gyro-sifter machine appears in The Gyro-Sifter Machine! Odd.

Title: What would be the best way to handle food grains?

Body: I'm trying to handle food grains like rice, wheat in an automated way (to cook simple dishes). For this I have to transfer grain from a larger container to a weighing scale. I know I can use solenoid valves for liquids but all solid handling valves seem to be too big (gate valves etc) and for larger applications. Is there any better way to do this ? </p>


问:
Which is best way to calculate inverse kinematics for scara robot?
I am working on scara robot project and I have one big confusion.  I am using simple trigonometric way(tan inverse traingl formula) to calculate inverse kinematics . But lot of people suggested me to use DH algorithm to calculate inverse kinematics .
Which one is better and faster algorithm for scara robot .</p>

答:
The geometric method of computing inverse kinematics (which you are calling the trigonometric way) and the Denavit-Hartenburg method result in the same kinematic equations.  Neither is better, although DH can be generalized more easily to suit a variety of arm geometries.

Regarding which algorithm is faster, it depends on how you implement the equations in code.   Optimizing the calculations in your software will probably yield performance improvements (I am basing this on assumptions I'm making when reading your question).   But calculating the equations using a different approach should have no impact.


答:
The solution of the inverse kinematics problem and the Denavit Hartenberg method (or algorithm) are two very different things. The DH provides rules on how to define coordinate systems, but it does not constrain or guide to on how to solve the inverse kinematics problem. These are two distinct steps.

Setting the coordinate systems

The DH method is used to set the coordinate systems in the joints of the robot. It is one method of doing this, you do not necesarily have to follow this convention, you can just define which is the positivie and which is the negative direction of tha angle in any arbitrary way you like. It is recommended to use the DH method to set the coordinate systems if you are planning to give the robot to other rooticits who are used to this convention.

Solving the inverse kinematics problem comes after setting the coordinate systems (or at least positive and negative directions of the axis angle)
At this point, you are free to chose:

a matrix based appraoch (sometimes referred to incorrectly as the DH method), where you write all the transformation matrices and identify usefull equation in the elements of the matrices. The DH convention oly helps you to build the transformation matrix, but transfomration matrices can be built also without applying the DH convention.

a geometrical approach, where you do not use matrix relations, but try to find equations based on geometrical equalities

a quaternion based approach, again, it can be in DH defeined coordinate systems or not.

The first two methods lead (as SteveO correctly stated) to exactly the same equations, or at least with equations with very similar complexity. The third methods might lead to equations where elements are calculated redundanlty. However I do not think there is a very significant difference in calculation complexit.

For a Scara robot, I do not think it matters which inverse kinematics solution method you choose, you will end up with roughly (or maybe even exaclty) the same equations. If you plan to interact with ither roboticists, I would definetly recommend defining the joint coordinate systems as the DH convention specifies.

Title: Which is best way to calculate inverse kinematics for scara robot?

Body:
I am working on scara robot project and I have one big confusion.  I am using simple trigonometric way(tan inverse traingl formula) to calculate inverse kinematics . But lot of people suggested me to use DH algorithm to calculate inverse kinematics .
Which one is better and faster algorithm for scara robot .</p>


问:
PID for variable Setpoint
Can a PID with variable setpoint work?

I have already done tests, but these are not conclusive. On the other hand I am not certain of this algorithm.

Background

This project involves improving the tracking speed of a telescope.

An Arduino card (UNO32) that I program gives the instructions in "Pulse and Dir" mode to a driver. This driver controls a two-phase step motor (200 steps) in micro step mode (128 micro steps per step). This stepper motor rotates a worm screw against a wheel that has 360 teeth. And finally, this wheel rotates the axis of the telescope to make one revolution per day.

To reduce the speed error caused by imprecision of the wheel and screw, a high precision encoder (1800 000 PPR) is placed at the end of the axis of rotation of the telescope. My goal is to work in closed loop with the stepper motor and the encoder feedback.

I need your advice for the PID algorithm. Here is my idea but I am not sure that this is valid:

1)   SP (Setpoint) :  the desired position of the encoder. The encoder is in  4x reading mode.

At time t, this gives :  SP(t)= ( t sec) * (4* 1800000 PPR)/(86164 sec/day)

I can convert into micro-step :

(360 turns_motor)(200 steps)(128 micro-steps) = 4*1800 000 encoder pulses

2)   PV : the process variable. This is the measured position of the encoder.

3)   E :  the error , E= SP-PV

4)   Command :  I act on the frequency of the pulses to vary the speed of the motor according to this error

答:
As a general answer:

Yes, PID controller use variable setpoints, in fact, this is what makes them usefull, that you can always change the setpoint of your system (regardless of this varis slowly or fast, stepwise or not).

The general algorithm you have specified is also correct, however you have to make sure that the variable typse you use can handle that large numbers.

SP(t)= ( t sec) * (4* 1800000 PPR)/(86164 sec/day) seems like a really large number if all terms are implemented as variables and are not simplified apriori (at implementation or maybe by the compiler?).

I would recommend giving the setpoint as a float in degrees and converting the encoder readings to degrees when calculating PV. This is just for conveniece.

Acting on the frequency of the pulses is also good idea in general.

In your specific case:
Please keep in mind that in theory you have approx 5 motor microsteps per encoder tick. (200*128*360 = 9 216 000 microsteps and 1 800 000 tocks). This means that you have to have a PID controller that can do very fine adjustments. This should be something doable if overshot of the controller is not a problem. Problems arrise on the practical side.

Microsteps are not very exact. It depends very much on the quality of the motor, usually a half step is correct, hover anything below half of step is not necesarily evenly distribuited between the steps. Ideally you would get 360/(128*200) degrees of rotation for each microstep, however in reality, you might be very far from this. You might have far smaller microsteps and far larger microsteps (but their summ would give you a full step). If the far larger means 5x larger than you cannot position to the given end sensor tick. For motors which are not of high quality, 5x or larger microsteps in my opinion can happen. but I am not a stepper motor expert, you should test the length of your microsteps to make sure.

If you want to hit exactly all ticks with precision it might be a problem. If you want to be only in a certain range, you could add a deadband to your PID and so you can avoid any ocilations caused by not being able to exactly hit one encoder tick.

Title: PID for variable Setpoint


问:
How to remotely send command to a robot connected to a separate machine through serial port?
I work with a XL20 robotic tube sorter(lets say it's called X) which is connected to lets say computer(Y - IP: 10.216.1.222 - Running win7) through serial(com port 8 at 9600 baud and odd parity). If I open putty at computer Y and send my commands to the Xl 20, it works just fine.

Now I have a computer(Z- ip: 10.216.1.223 - Running win7) which is in the same network and I want to connect and send instruction to the Xl20 from this computer via putty or some other means.

Basically I'm trying to remotely communicate to the XL20 which is connected to a computer through serial port, so can anyone point me to any useful guide, documentation, clue or suggestion about how can I do this?

Thanks.

答:
What you need is a TCP server running on computer Y, which listens to any incoming TCP connections. After a TCP connection is established with computer Y it forwards incoming data to X and the responce form X gets forwarded to the incomind connection.

You can find hardware boxes that do this, like this. This yould replace PC Y.

A free software solution would be this.


问:
Robot won't work properly, claw will only go one way and will only open or close once per cycle
We're students trying to make a clawbot for a Science Seminar class. However, for some reason, whenever we try to move the arm or the claw in a certain way, it will lock up and only move that direction. Code attached. Please help.</p>

```<code>#pragma config(Motor, port1, frWheel, tmotornormal, openLoop, reversed) //Setting up the motors
#pragma config(Motor, port5, brWheel, tmotornormal, openLoop, reversed)
#pragma config(Motor, port3, flWheel, tmotornormal, openLoop)
#pragma config(Motor, port4, blWheel, tmotornormal, openLoop)
#pragma config(Motor, port10, Arm, tmotornormal, openLoop)
#pragma config(Motor, port6, Claw, tmotornormal, openLoop)

task main()
{
    int a = 0; //Arm integer
    int c = 0; //Claw integer
    while(true)
    {
        motor[frWheel] = vexRT(Ch2); //Wheels
        motor[brWheel] = vexRT(Ch2);
        motor[flWheel] = vexRT(Ch3);
        motor[blWheel] = vexRT(Ch3);
        if(a >= -30 && a <= 30)  {
            if(vexRT[Btn8D] == 1) //If arm down button pressed...
            {
                motor[Arm] = --a; //then arm will go down.
            }
            else if(vexRT[Btn8U] == 1)
            {
                motor[Arm] = ++a;
            }
            else(vexRT[Btn8U] == 0 && vexRT[Btn8D] == 0);
            {
                motor[Arm] = a;
            }
        }
        else
        {

        }

        if(c <= 30 && c >= -30)
        {
            if(vexRT[Btn7U] == 1) //If claw up button pressed...
            {
                motor[Claw] = ++c; //Claw will open.
            }
            else if(vexRT[Btn7D] == 1)
            {
                motor[Claw] = --c;
            }
            else(vexRT[Btn7D] == 0 && vexRT[Btn7U] == 0);
            {
                motor[Claw] = c;
            }
        }
        else
        {

        }
    }
}
</code>```

答:
Your conditional logic needs to be improved.  Consider the following scenario:

a is initialized to zero.

The operator presses Btn8d (arm down)

a is decremented to -1, then -2, etc.

If the button continues to be pressed, a eventually reaches -30.  Depending on the loop rate, this may happen very quickly.

When a == 30 the statement if(a >= -30 && a <= 30) is still true.

a is decremented to -31.

Recovery is not possible because the conditional will never be true again.

Your code needs to handle this corner condition.

Also, when is the vexRT[] array updated?  If it is not continuously updated with the values of the button presses, then you will need to update it at the top of your while loop.


答:
There are two reasons reason for your problem:

The main loop is executed very fast - you only check conditionals and assign some values to variables. Total execution time will be probably in order of milliseconds. That means that when you press the button for even as short as 0.1s the loop will execute thousands of times. I would advice on checking the button states only every 50-200 milliseconds.

As already mentioned by SteveO, there is also an error in your logic. When variables a and c reach their maximum values, there is no way to reset them to their original state. I would do that like:

```<code>if(buttonIsPressed()) {
  changeVariable();
}
if(variable > maxValue) {
  variable = maxValue;
}
</code>```

Title: Robot won't work properly, claw will only go one way and will only open or close once per cycle

Body:
We're students trying to make a clawbot for a Science Seminar class. However, for some reason, whenever we try to move the arm or the claw in a certain way, it will lock up and only move that direction. Code attached. Please help.</p>

```<code>#pragma config(Motor, port1, frWheel, tmotornormal, openLoop, reversed) //Setting up the motors
#pragma config(Motor, port5, brWheel, tmotornormal, openLoop, reversed)
#pragma config(Motor, port3, flWheel, tmotornormal, openLoop)
#pragma config(Motor, port4, blWheel, tmotornormal, openLoop)
#pragma config(Motor, port10, Arm, tmotornormal, openLoop)
#pragma config(Motor, port6, Claw, tmotornormal, openLoop)

task main()
{
    int a = 0; //Arm integer
    int c = 0; //Claw integer
    while(true)
    {
        motor[frWheel] = vexRT(Ch2); //Wheels
        motor[brWheel] = vexRT(Ch2);
        motor[flWheel] = vexRT(Ch3);
        motor[blWheel] = vexRT(Ch3);
        if(a >= -30 && a <= 30)  {
            if(vexRT[Btn8D] == 1) //If arm down button pressed...
            {
                motor[Arm] = --a; //then arm will go down.
            }
            else if(vexRT[Btn8U] == 1)
            {
                motor[Arm] = ++a;
            }
            else(vexRT[Btn8U] == 0 && vexRT[Btn8D] == 0);
            {
                motor[Arm] = a;
            }
        }
        else
        {

        }

        if(c <= 30 && c >= -30)
        {
            if(vexRT[Btn7U] == 1) //If claw up button pressed...
            {
                motor[Claw] = ++c; //Claw will open.
            }
            else if(vexRT[Btn7D] == 1)
            {
                motor[Claw] = --c;
            }
            else(vexRT[Btn7D] == 0 && vexRT[Btn7U] == 0);
            {
                motor[Claw] = c;
            }
        }
        else
        {

        }
    }
}
</code>```

Body:
There are two reasons reason for your problem:

The main loop is executed very fast - you only check conditionals and assign some values to variables. Total execution time will be probably in order of milliseconds. That means that when you press the button for even as short as 0.1s the loop will execute thousands of times. I would advice on checking the button states only every 50-200 milliseconds.

As already mentioned by SteveO, there is also an error in your logic. When variables a and c reach their maximum values, there is no way to reset them to their original state. I would do that like:

if(buttonIsPressed()) {
  changeVariable();
}
if(variable > maxValue) {
  variable = maxValue;
}


问:
Why there is so much research going on in humanoid robots?
It seems like humanoid robots is the hottest field of research in robotics. Government agencies are giving huge sums of money to private firms and labs to develop them (For example, Boston Dynamics has developed some really amazing humanoid robots, and some of them look scary!).

My question is: The human body is highly inefficient. We can't run for very long times, have to learn for several months before we start walking, have only two hands, and are slow. Then why spend so much money and effort emulating such an inefficient thing? May be it is time that we took a step away from getting "inspired" by Nature, and build a man-made, highly efficient body.

An example: Balancing a robot on two legs in very difficult. My question is, then why use some other method for locomotion, that is easier and more effective. A robot on two legs can run only so much faster. Why not come-up with some optimal shape, and then model your robots on it?

答:
If you can design a robot that consumes meat and vegetables to recharge its power then you will really have something!

There are so many different robot concepts and designs that it is not a productive discussion to lump them into a single category of being designed to mimic the human body.   I can think of many robots that are not like this.   A great example is the Odex 1 from the mid-80's, seen here.

However, if you think about the tasks that many robots are asked to perform, you will find that most of those tasks were designed to accommodate the human body.   Any assembly line that grows from manual, low-volume, production, into a high-speed automation line would be a great example.   Since the tools and tasks started as human-capable chores, it is natural that we would design robots that can accomplish the same chores.

Additionally, many robotic implementations are able to restructure the tools and tasks such that they greatly outperform any human capability.  A simple example is a tool-changing end effector.   I don't know of any humans who are born with a tool turret at the end of their arm!

I also question your statements about human inefficiencies.   For some tasks you are 100% correct.   Running a long distance fast, as you mention, is a good example.   But we can also climb mountains, jump chasms, and ride motorcycles.   Inefficient in one thing might be a consequence of superb adaptability for many things.

The objective way of looking at this question is to first ask, what is the robot being designed to do?  Starting with real requirements is the first step to designing a robotic (or other) system to meet those requirements.   Overly general statements about whether or not the design is anthropomorphic do nothing to lead a robot designer toward a proper solution for the tasks that the device is intended to accomplish.


问:
Dynamic programming algorithm aka Bellman equation in Robotics?
The dynamic programming algorithm refers to the Bellman equation. An open-loop control decides movement at the initial point while a closed-loop control decides control during the movement. Now most robotic application looks like closed-loop control: in every point, it checks how it is doing with respect to some reward function, this is my thinking. Now most participants in threads such as How mature is real-time programming in robotics? do not differentiate their scope, perhaps they haven't thought about it. Anyway, I am interested to know:

How is dynamic programming used in robotics? Is there any research about DP usage in robotics?

答:
I won't answer directly how Bellman equation is used in robotics but DP is used in many areas, see the below. Even though we have a dynamic system with velocity/acceleration, we can still use linear-approximation like linear-programming algorithms here. I provide below some material and lectures about Dynamic programming and robotics. This is pretty interdisciplinary area so hard to find concise description.

Areas

path-planning

vision such as stereo-vision

CSP and VCSP problems (see the cognitive robotics below)

Alert about terminology!

The term "dynamic programming" is a special term referring to special class of mathematical problems. The term "dynamic" system in physics refers to problems in continuum mechanics where objects are not in rest or in constant motion but they can accelerate. Then again Statics considers problems in stable equilibrium.

The term "dynamic programming" is programming for historical reasons but the basic idea is to break the large problem into small problems. It has analogues to fields such as Economics (for example sub-game-perfect equilibrium in game-theory).

Material

Path-planning

Minimax Diﬀerential Dynamic Programming

Efﬁcient Dynamic Programming for Optimal Multi-Location Robot Rendezvous

A dynamic programming approach to trajectory planning of robotic manipulators

Dynamic Programming Algorithms for Planning and Robotics in Continuous Domains and the Hamilton-Jacobi Equation

Vision, Stereo vision and Dynamic programming

Dynamic programming stereo vision algorithm for robotic applications

Stereo by Intra- and Inter-Scanline Search Using Dynamic Programming

Lectures

Underactuated robotics in MIT here
-- this lecture here
about DP

Cognitive robotics has some tasks about DP here


问:
Permanent Magnet DC Motor Calcuations
I have to determine speed and torque suitable for my combat robot.
I've done some calculations and I need to know whether they're right or not (because they don't seem to be right).

Suppose I have 10kg robot, I want to push other 10kg robot to the arena walls. Let's first assume opposite robot is not opposing my push. Suppose I want it to move it with acceleration of 10cm/sec/sec (also lemme know if acceleration assumed is suitable for robowar or not).
Then force required will be,

F = (total mass to be moved) * (acceleration) = (10+10)*(10e-2) = 2 N.
Assume opposite robot is also pushing with me same force, in that case I will need another 2 N for opposing his push, Now taking into account frictional retardation, suppose I need another 2 N so total would be 6 N.

Assuming velocity = 10cm/sec, then Power required will be 6 * velocity = 6*10e-2 = 600mW. For 12V motor even with 20% efficiency it would cause current of 250mA only. Also output power = speed X torque.

Now I've heard that robowars usually require motor with high full load current otherwise they'll be damaged.

So it looks like I am somewhere wrong in my calculations. If so, lemme know where,am I wrong where I assumed that opposing robot will cause just 2 N,  because generally they'd be fitted with more high torque motors. But is it the only thing which goes wrong in above calculations? If opposite bot had to just exert 2N on my bot, are calculations right?

PS: By side-shaft geared motors, it is meant that it is internally geared with horizontal shaft, right? Or "side-shaft" means something more?

答:
The logic for the calculation seems ok, you can also check the results here and here

When building robots that would oviously benefit from as much force (motor torque) as possible, I would suggest the following approach.

Rather than defining speed and acceleration requirements, I would approximate what is the maximum amount of force the wheels can apply to the ground without causing the wheels to slip. This would lead to the maximum torque of the motor by calculating backwards from the wheel force to the motor torque. If you consider that this amount of torque has to be applied to the ground also when the maximum velocity of the robot is reached,  you have defined the motor. You can then check what acceleration will the motor provide. Since it is limited by wheel friction, even if you would increase motor torqe, the acceleration would not incears, since wheels would start to spin.

This way you exploint your wheels to their maximum amount and so deliver the maximum force possible to the oponent robot.

Title: Permanent Magnet DC Motor Calcuations


问:
Adding external heat sinking to a Dynamixel RX-24F servo?
Hobby servos are generally not sufficient for real robotics for a number of reasons: Quality, precision, range of motion, torque, etc.

Meanwhile, industrial servos, such as ABB, Emerson, GE, etc, are generally both heavy and expensive, and not suitable for small-humanoid scale actuation. Similarly, building your own servo from motors, gearboxes, and encoders, is akin to trying to design your own CPU just to control a motor -- too much detail getting in the way of real work.

There exists an in-between level of servos -- reasonably priced, reasonable performance, and reasonably controllable -- in the form of the competing brands of Dynamixel and HerculeX servos.

The smallest offerings in those lines generally are not strong enough for real-world interaction, but the next step up hold a lot of promise. For the Robotis Dynamixel line, this is the RX-24F servo (priced between the cheap AX-12F and the next step up the MX-28R.) Asking around, it seems that the specs and interface on that servo is great, but that it shuts down from thermal overload if you actually try to run it at rated load -- something that I'd expect from a hobby servo, but not a robotics servo.

Now, stepping up to the MX-28R doubles the price. Thus, if the RX-24F heat flaw could be fixed, it would be positioned at a nice price/performance point.

Does anyone have experience in providing additional cooling for this servo? Anything from thermal-gluing heat sinks to the case, to drilling holes and running cooling fluid tubing to any hot parts on the interior would be reasonable approaches. However, before I spend significant time and effort investigating this, I'd like a second opinion -- is it possible, does anyone have experience doing this, is it worth it?

答:
To determine how much cooling you need, you will want to calculate the thermal resistance, and how fast heat is being generated.

To do this, you can start using it for a period of time (at maximum load), then stop using it. During this time, measure how temperature rises and falls.

This will allow you to calculate the amount of heat generated, as well as thermal resistance to the case (as multiples of thermal capacity). You can also measure the difference in power in versus power out to measure heat dissipated inside ($power = voltage \times current$).

Measuring air temperature you also get the thermal resistance between the case and the ambient air temperature.

After that, you can treat thermal resistance like an electrical network (see http://en.wikipedia.org/wiki/Thermal_resistance). Adding heat sinks of heat pipes simply adds another route for the heat, with lower resistance.

You can find the resistance of any heat sink or heat pipe from its datasheets. Then you can estimate how the addition of it will affect the overall thermal resistance of the network. By looking at the rate of heat dissipation, the thermal resistance and the maximum rated temperature, you will know whether it is enough.


答:
I affraid you are very wrong with your assumptions. I'm not exactly sure what competition are you going to start in, but take a look at some videos with 3kg sumo robots:

Vienna: https://youtu.be/7T0en-RcljE

Riga: https://youtu.be/Z_WE-ppaE5A

Japan: https://youtu.be/lUpUQf16qzQ

On all of these videos you will see robots that reach speeds of couple m/s and accelerate in less than 1s. Some of these competitions may be played on metal rings and magnets on the robots to increase friction and in result maximum possible accelerations. Still, I think the smallest reasonable speed is 1-1.5m/s with acceleration at least $1m/s^2$.

Now, let's find out how much force do you need to push your opponent. For a moment let's assume it just a 10kg block of rubber (because a robot will likely have rubber wheels). From a table of friction coefficients you select one between rubber and whatever material the arena is made of - let's say dry concrete. That means that friction coefficient $\mu = 0.85$. Now the friction force $F_f = \mu * m * g$, so for 10kg block of rubber it will be around 85N and that's under the assumption your opponent is doing nothing!

To sum up aim for the biggest motors you can pack in your robot. Also, keep in mind that the more friction you have, the more push you will get. That means that good tires for your wheels are as important as the motors.

Title: Permanent Magnet DC Motor Calcuations

Body:
I have to determine speed and torque suitable for my combat robot.
I've done some calculations and I need to know whether they're right or not (because they don't seem to be right).

Suppose I have 10kg robot, I want to push other 10kg robot to the arena walls. Let's first assume opposite robot is not opposing my push. Suppose I want it to move it with acceleration of 10cm/sec/sec (also lemme know if acceleration assumed is suitable for robowar or not).
Then force required will be,

F = (total mass to be moved) * (acceleration) = (10+10)*(10e-2) = 2 N.
Assume opposite robot is also pushing with me same force, in that case I will need another 2 N for opposing his push, Now taking into account frictional retardation, suppose I need another 2 N so total would be 6 N.

Assuming velocity = 10cm/sec, then Power required will be 6 * velocity = 6*10e-2 = 600mW. For 12V motor even with 20% efficiency it would cause current of 250mA only. Also output power = speed X torque.

Now I've heard that robowars usually require motor with high full load current otherwise they'll be damaged.

So it looks like I am somewhere wrong in my calculations. If so, lemme know where,am I wrong where I assumed that opposing robot will cause just 2 N,  because generally they'd be fitted with more high torque motors. But is it the only thing which goes wrong in above calculations? If opposite bot had to just exert 2N on my bot, are calculations right?

PS: By side-shaft geared motors, it is meant that it is internally geared with horizontal shaft, right? Or "side-shaft" means something more?


答:
From another point of view, bipeds(humanoids) are regardless of their use interesting since they are high dimensional nonlinear hybrid systems. Sure, there are more systems with those qualifications, but the special thing with bipeds is that we have a clear intuition of what is right and wrong even without any mathematical background. Furthermore, take a quadruped(4 legs), those robots are arguably more inherently stable, while with two legs, especially if you remove the feet, that is a different story. So in a way, those humanoids are perfect tools to center nonlinear control theory around.

I think you can cook up a similar argument from an AI point of view. However, I agree with you that for many practical problems a biped makes no sense.

Title: Why there is so much research going on in humanoid robots?

Body:
It seems like humanoid robots is the hottest field of research in robotics. Government agencies are giving huge sums of money to private firms and labs to develop them (For example, Boston Dynamics has developed some really amazing humanoid robots, and some of them look scary!).

My question is: The human body is highly inefficient. We can't run for very long times, have to learn for several months before we start walking, have only two hands, and are slow. Then why spend so much money and effort emulating such an inefficient thing? May be it is time that we took a step away from getting "inspired" by Nature, and build a man-made, highly efficient body.

An example: Balancing a robot on two legs in very difficult. My question is, then why use some other method for locomotion, that is easier and more effective. A robot on two legs can run only so much faster. Why not come-up with some optimal shape, and then model your robots on it?


答:
Fully exploring the reasons for designing humanoid robots would need to explore human psychology and involve lots of discussion with no clear answer, however there is one very concrete reason.

Many robots are given a humanoid form because they must operate in an environment designed for humans, and must use tools designed for humans.

This was the primary criteria for the DARPA Robotics Challenge.


答:
A car is good at driving high speeds on flat ground. A car cannot use a drill. A car cannot climb stairs.

A dishwasher is good at cleaning dishes. A dishwasher also cannot use a drill. A dishwasher also cannot climb stairs.

The human body is highly inefficient.

On the contrary, the human body is extremely efficient. 100 food calories (kcal) will power a person for about a mile (running). A 12oz can of Coke has 140 calories, and there are 128oz in a gallon. That means a person running gets about 15 miles per gallon. If you walk you can double that because walking a mile only burns about 50kcal.

So, 15-30 miles per gallon on soda, to put it into a format that allows for better comparison to cars.

We can't run for very long times

We can run longer than just about any other animal. The earliest form of hunting was the endurance hunt where you basically chase an animal until it collapses.

May be it is time that we took a step away from getting "inspired" by Nature, and build a man-made, highly efficient body.

Build a highly efficient body to do what, exactly? Can you make a list of all the things you want this "body" to do, and then explain how exactly that body is going to traverse sand, rocks, grass, and stairs?


问:
Draw circle with 4-axis robotic arm
I am new in robotics. I am playing with a 4 axis robotic arm called uArm and I was wondering how to draw a circle with it.

For this I mean the math of describing a circle in task space for the robot joints to achieve with the implementation of the algorithm in code.

What will be the best approach? Any sources where to research? I tried to research around the web but I did not find anything useful.

Thank you in advance

答:
Your question is still "I need help with everything about this," so I'll provide a pretty generic response that should get you started.  As you dive into the details you may consider posting questions about specific areas that remain challenges to you.

Overall, you need to accomplish the following steps:

define the circle you are trying to draw in global coordinates (the O system in the document you linked to)

break the circle down into a series of target points that you want the pen to move between.  If you divide the circle into 10 points, you will have a poor approximation to a circle, but it will get you started.  If you break it into 1,000 points, you will follow the circle fairly closely.  You will need to experiment to see what accuracy you want to achieve (you could define this mathematically but that seems beyond the scope of what you are trying to do)

for each target point, define the robot joint angles that will achieve the target position.  This is called Inverse Kinematics.

program the robot to cycle between the target points

Defining the circle in the XY plane is straightforward:  $$z = C$$
$$(x - x_0)^2 + (y - y_0)^2 = r^2$$

where C is the height of the circle above the ground, x and y are the variables of interest, the point $(x_0, y_0, C)$ represents the coordinates of the center of the circle, and $r$ is the circle's radius.  In your case, I believe $z$ is a constant due to the kinematics of the arm and its inability to rotate the pen through any angle other than vertical.

The inverse kinematics will be a bit challenging for a newbie.  From the mechanics of that arm, however, it appears the two parallel 4-bar mechanisms will keep the end effector perpendicular to the ground.  That simplifies your task a bit.  Basically you need to find, for each (x, y, z) target position, what joint angles will achieve this position.  There are many papers and sites that describe the inverse kinematics of an articulated arm manipulator - I'd start with these if I were you, and post specific questions when you get stuck.  It is too broad to describe in this general answer.

Once you have the inverse kinematics, you simply program the arm to cycle from one pose to the next.

When you post follow-up questions, if necessary, please describe in detail the steps you've taken that have resulted in you getting stuck.

Title: Draw circle with 4-axis robotic arm


问:
Proper cable to connect 12 V, DC 6 Ah batteries to Sabertooth Motor Controller for Lawnbot?
I am building a (fork of) the Lawnbot-400 robot found on Instructables.com and in the book Arduino Robotics.

The author, while brilliant, tends to gloss over and omit details, one of those being how he actually connected the 2 recommended 12 V DC batteries to anything (I realize for the more experienced builder this is probably obvious though).

Could you please provide guidance on the types of cables to use to do this?

It seems like I have seen some which use little clamps on one end and / or which have a plastic terminal in the middle of the cable that can be disconnected while the other 2 ends are connected to the battery and motor controller. Do I need those features?

The batteries I am using are Mighty Max 12 V 6 Ah high-rate gel series.

答:
If you search for "battery quick connect" you will see for little plastic connectors that will enable you to connect/disconnect the batteries.

These are not 100% necessary, yet they do make life easier when working with things: you just unplug the batteries when you don't want your circuits "live".

The "cables to use to do this", just your regular cables.  The size of the cable depends on what power you will be transmitting through it.  There are nice charts on the net giving you info on what size you should use depending on the power draw.  You can search for "cable sizing chart" to check which would work for you.


问:
Why do space probes need heating?
I know that temperature influences the characteristics of semiconductors and other materials, but we know how and can take that into account. Furthermore, lower temperatures makes electronics more efficient, sometimes even superconducting.

I remember reading somewhere that engineers building Curiosity even considered low temperature electronics for the motors driving the wheels but still decided against it in the end.

Why is it, apparently, so hard to build components with operating temperatures matching those on Mars, Europa, or in space?

Edit: None of the answers address my question thus far. I know that all parts, both electronic and mechanical, and greases and so on have relatively narrow working temperatures. My question is, why don't we build special cold metals and cold greases and cold chips that have their narrow operating temperature band at -100 C or whatever?

Valid answers could be: it's too expensive, insufficient science has been done to determine materials appropriate for such cold, such cold materials cannot be manufactured in the sweltering heat of planet Earth.

答:
Because there is not enough research and development done in the manufacturing process of electronic components in low temperatures. And the probes must be reliable.

You can not make parts in i.e. 250'C and expect them to work in -100'C because for example a chip has silicon parts as well as tungsten parts. These two have different temperature versus extension characteristics, so the parts would simply fall apart.

In low temperatures you can't use tin for soldering see tin pest.

Title: Why do space probes need heating?


问:
Parallel connection of batteries with equal voltage but different Ah?
I bought some batteries for a project with the recommended voltage but too weak Ah.

The batteries are to be connected in parallel. I can't currently afford to upgrade both batteries, but I was curious if I can try upgrading one of them and connecting it in parallel to one of the ones I have now? My robot is going to weigh less than the one on which it is based, so perhaps just upgrading one is sufficient.

Or is that unsafe?

答:
You aren't being specific enough. Some chemistries would possibly allow this but others would not. If the batteries have the same nominal voltage than theoretically they should work fine in parallel with no issues. The problem is when you start discharging them.

See the graph below:

(source: mpoweruk.com)

Batteries with different capacities would discharge at different rates, so if you had two batteries in parallel of say 1000mAh and 500mAh, there would be a heavy imbalance in the rates of discharge, causing them to be at different state-of-charge percentages. If one were at 80% and another at 40% then there would be a huge issue because even though the difference in the voltages could be as small as .1v it would be enough to cause a short and cause heavy damage to your batteries. This is true for all batteries, though some like the NiMH batteries are more tolerant and could potentially survive if the currents aren't that far off. But definitely NEVER try this with a LiPo unless you are a fan of melting your hands off.

To quote SparkFun:

Be careful when connecting batteries in parallel! All the cells should have the same nominal voltage and same charge level. If there are any voltage differences, a short circuit could occur causing overheating and possibly fire.

TL;DR Hella unsafe, use at your own risk. I would not recommend.


问:
Robot detection in motion
In the environment, I have two robots and a couple of fixed obstacles. In order to detect obstacles I am using ultrasonic sensors. For robots, they need to detect each other and from which side other robot is coming (front, left, right or back), and do this during the motion. For this purpose, I cannot use PIR sensors, because robots are constantly moving. Also, I need to differentiate between moving robots and stationary obstacles, so ultrasonic sensors are also not helpful.

So I came up with idea to somehow mark the robots with some property unique to environment, so when we detect object with that property, we know that it is a robot, and not another obstacle. One of ideas might be to put lasers on one robot, and on other robot put four laser sensors, one for each side, so we precisely can say from which side the other robot came from. Another option might be to use IR transmitters on one robot and four IR receivers on other robot? What do you suggest, is there any other type of sensors that might help?

答:
My solution disadvantages/limitations are:

Needs computation/processing power

Robots should move slowly

Robots scan environment quickly as possible as you can

Here are the steps:

Create a radar like system with a servo and two ultrasonic distance sensor or use 360 deg. servo and a ultrasonic. (http://www.instructables.com/id/Arduino-HC-SR04-Ultrasonic-Rover/)

Add a compass sensor for deciding absolute angle of ultrasonic sensor.

detect the environment by scanning.

after the scan, you have signal which have a size of 360 in each robot. Because of static obstacles, the scan signals should have similarities. you can compare scans with correlation / convolution. delay gives you distance vector of your robot. (https://www.mathworks.com/help/signal/ref/xcorr.html)

also you can compare the the scan signals and decide where is the other moving robots. Moving robots creates difference in correlation and you can detect it.

Title: Robot detection in motion


问:
Going around Voltage Limitation on Battery for Steppers?
Am building a device that will use two stepper motors and a servo. One of the main requirements, is that the on-board battery cannot exceed 9.6 volts.
The stepper motors have not been picked yet, and thus I have the option of choosing one with a lower voltage.

Which method would be the best:

Use two 12v stepper motors with a 9.6 volt battery, and simply have them run at lower voltage.

Or, Use two 12v steppers, and use a DC to DC voltage booster to increase voltage to 12v. ( I don't know how well this would work, regarding constant current and whatnot.)

Or, Use two 6v steppers, and use a ~6v battery. (Not fond of this idea, as 6v steppers seem to have much different specs than normal Nema17 12v ones. However, I would still use them if needed.)

答: I use Step-Up breakouts from SparkFun and Pololu all the time. They provide a consistent, continuous flow at the desired voltage. I recommend this one, or if you need more than 1.4A current than this one. Beware that these components can be easily damaged by heat, and too much will damage the Step-Up, causing it to actually lower the voltage. As long as you don't burn the thing it will provide more than useful.


问:
How can I calculate Center of mass for each link of Robot?
I want to calculate 'r'

I know , and the Position of(X, Z)
But I don't know how to apply it in this robot.

答:
Since it is not sure that your robot is in a plane or not, I would consider it in 3D.

You have all the geometrical dimensions of the robot. And I assume you have also all angles in all joints.

You need to calculate the X Y and Z coordinates of all centers of masses on the image, relative to the same coordinate system. It is important that they are computed relative to the same coordinate system. In order to compute them in the same coordinate system you need to know all the joint angles.

For example:

The X coordinate of the center of mass ($x_{CoG}$) will equal, as the formula says:

$x_{CoG} = \frac{\sum{m_i \cdot x_i}}{M}$

the same is true for all other coordinates:

$y_{CoG} = \frac{\sum{m_i \cdot y_i}}{M}$; $z_{CoG} = \frac{\sum{m_i \cdot z_i}}{M}$

If all y coordinates are 0 (i.e. the robot is in a plane) obviously $y_{coG}$ will also be zero.

You can define a transformation matrix for each joint. The transformation matrices should be set up according to the D-H convention. This is not a must.  The only variable in the transformation matrix will be the joint angle. You will need a vector which points to the CoG from the joint. This will be a constant vector (without variables), form the joint to the CoG (as it seems $[r,0,0]$). Please note that if you are not using the D-H convention the vector coordinates are not valid!

Let the reference coordinate system be $CS_a$ in the ankle.
Assuming you have a 2 dof joint in the "ankle" of the robot

$$
\begin{pmatrix}
x_m5 \\
y_m5 \\
z_m5 \\
1
\end{pmatrix}
=
T_a \cdot T_{ankle_1}(q_{a1}) \cdot T_{ankle2}(q_{a2}) \cdot T_{ll} \cdot T_{knee}(q_k) \cdot
\begin{pmatrix}
r_5 \\
0 \\
0 \\
1
\end{pmatrix}  $$

Where $T_a$ is the transformation matrix of the reference coordiante system ($CS_a$). If indeed this it the reference coordinat system then it equals the $4x4$ identiy matrix $I_{4x4}$. $T_{ankle1}$ is the Dh transformation matrix of the first ankle rotation $T_{ankle2}$ is the transformation matrix f the second ankle joint. $q_{a1}$ and $q_{a2}$ are the joint angles. The translation from the anle joint to the knee joint is sperated to a constant transformation matrix, $T_{ll}$, corresponding to the lower leg.
$$ T_{ll} =
\begin{pmatrix}
1 & 0 & 0 & L_6 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{pmatrix}  $$

Thre reason behing this speparation is that this way you can caluclate the coordinates of the CoG in the lower leg as:
$$
\begin{pmatrix}
x_m6 \\
y_m6 \\
z_m6 \\
1
\end{pmatrix}
=
T_a \cdot T_{ankle_1}(q_{a1}) \cdot T_{ankle2}(q_{a2}) \cdot
\begin{pmatrix}
r_6 \\
0 \\
0 \\
1
\end{pmatrix}  $$

You can calcualte similarly all coordinates of the centers of masses expressed in the same coordinate system (in this case the ankle coordinate system) and the mass associated with each center of mass. Then you start multiplying the masses with the coordinates and summing them up, divided by the total mass (similar to the same equation above). In your case 7 times.

However, I must add that this formula is used for calculating the center of mass of rigid bodies. I am not sure how well it performs for linkages.

When the robot is in motion, in order to calculate the positions of the CoGs, the same principles have to be applied, but cyclically.