问:
Accelerometer calibration - how to get cross-axis sensitivities
I've already asked a related question (accelerometer bias removal) here on robotics and got a bit better results on corrected accelerometer output. To get even better results I found the calibration equations (7th & 8th paragraph) from Vectornav which are just a bit enhanced than the solution in the linked question:

However, six more variables are needed:

Sensitivity of sensor X-axis to Y-axis inputs ($M_{xy}$)

Sensitivity of sensor X-axis to Z-axis inputs ($M_{xz}$)

Sensitivity of sensor Y-axis to X-axis inputs ($M_{yx}$)

Sensitivity of sensor Y-axis to Z-axis inputs ($M_{yz}$)

Sensitivity of sensor Z-axis to X-axis inputs ($M_{zx}$)

Sensitivity of sensor Z-axis to Y-axis inputs ($M_{zy}$)

Below it is also stated:

IEEE-STD-1293-1998 [...] provides a detailed test procedure for
determining each of these calibration parameters

However, after searching through the 1293-1998 standard (especially page 201 in Google Docs) I didn't find any clue on how to calculate the $M$ values. Also, $B_{d}$ and $V_x$ values from Vectornav equations is not explained anywhere. Can someone point me further?

答:
I realize this question is 2 years old, but I have direct recent experience with this.  The way I did this is with 6 rotated cube positions with 1000 points at each position, so a total of 6000 samples.

I'm assuming Matlab/numpy nomenclature, where NxM means N rows and M columns.

I assume an equation like Ax = B where B is the measured values matrix (6000x4, with right column all ones) and A is the "real" values matrix (also 6000x4, which has six 1000-value sections, with 1000 copies each of [1,0,0,1], [-1,0,0,1],[0,1,0,1], [0,-1,0,1], [0,0,1,1], [0,0,-1,1], corresponding to Xup, Xdown, Yup, Ydown, Zup, Zdown.  x is a 4x4 matrix where the upper left 3x3 components are the gain and cross-axis sensitivities, and the right 3x1 components are the offsets; the bottom row is all zeros.  By using a 4x4 matrix we can do everything in linear math and avoid the separate offset computation.

I then let numpy compute x as the least squares division of B/A.  I think in Matlab it would be B\A.  I'm not sure how least squares works in this case, but the result is a 4x4 matrix that minimizes the errors and averages out all the samples.  Conceivably you could also do this with only two positions, where each axis is diagonal to gravity, then upside down from there, and you adjust the expected "ideal" values accordingly.

The result is a 4x4 matrix that fixes scale, offset, and cross axis errors, which also means it corrects for any rotation error you have between the sensor and the reference edge hardware.

Here is the python code, assuming numpy:

```<code>def least_squares_fit(A, B):
    """Does least squares fit to find x of Ax = B.  Returns best guess of original distortion
     matrix x and its inverse.  A is ideal values.  B is distorted values.  Use inverse to
     correct real data back to ideal data."""

    # Need to extend A and B
    A = np.hstack((A, np.ones(len(A)).reshape(-1, 1)))
    B = np.hstack((B, np.ones(len(B)).reshape(-1, 1)))

    X, res, rank, s = np.linalg.lstsq(A, B)
    X = X.T # Not sure why we need T
    Xi = np.linalg.inv(X)
    return (np.asmatrix(X), np.asmatrix(Xi), np.sum(res))
</code>```

Body:
I realize this question is 2 years old, but I have direct recent experience with this.  The way I did this is with 6 rotated cube positions with 1000 points at each position, so a total of 6000 samples.

I'm assuming Matlab/numpy nomenclature, where NxM means N rows and M columns.

I assume an equation like Ax = B where B is the measured values matrix (6000x4, with right column all ones) and A is the "real" values matrix (also 6000x4, which has six 1000-value sections, with 1000 copies each of [1,0,0,1], [-1,0,0,1],[0,1,0,1], [0,-1,0,1], [0,0,1,1], [0,0,-1,1], corresponding to Xup, Xdown, Yup, Ydown, Zup, Zdown.  x is a 4x4 matrix where the upper left 3x3 components are the gain and cross-axis sensitivities, and the right 3x1 components are the offsets; the bottom row is all zeros.  By using a 4x4 matrix we can do everything in linear math and avoid the separate offset computation.

I then let numpy compute x as the least squares division of B/A.  I think in Matlab it would be B\A.  I'm not sure how least squares works in this case, but the result is a 4x4 matrix that minimizes the errors and averages out all the samples.  Conceivably you could also do this with only two positions, where each axis is diagonal to gravity, then upside down from there, and you adjust the expected "ideal" values accordingly.

The result is a 4x4 matrix that fixes scale, offset, and cross axis errors, which also means it corrects for any rotation error you have between the sensor and the reference edge hardware.

Here is the python code, assuming numpy:

def least_squares_fit(A, B):
    """Does least squares fit to find x of Ax = B.  Returns best guess of original distortion
     matrix x and its inverse.  A is ideal values.  B is distorted values.  Use inverse to
     correct real data back to ideal data."""

    # Need to extend A and B
    A = np.hstack((A, np.ones(len(A)).reshape(-1, 1)))
    B = np.hstack((B, np.ones(len(B)).reshape(-1, 1)))

    X, res, rank, s = np.linalg.lstsq(A, B)
    X = X.T # Not sure why we need T
    Xi = np.linalg.inv(X)
    return (np.asmatrix(X), np.asmatrix(Xi), np.sum(res))


问:
3 DOF Inverse Kinematics Implementation: What's wrong with my code?
I am currently trying to implement an Inverse Kinematics solver for Baxter's arm using only 3 pitch DOF (that is why the yGoal value is redundant, that is the axis of revolution). I for the most part copied the slide pseudocode at page 26 of http://graphics.cs.cmu.edu/nsp/course/15-464/Fall09/handouts/IK.pdf .

```<code>def sendArm(xGoal, yGoal, zGoal):
    invJacob = np.matrix([[3.615, 0, 14.0029], [-2.9082, 0, -16.32], [-3.4001, 0, -17.34]])
    ycurrent = 0
    while xcurrent != xGoal:
        theta1 = left.joint_angle(lj[1])
        theta2 = left.joint_angle(lj[3])
        theta3 = left.joint_angle(lj[5])
        xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
        xIncrement = xGoal - xcurrent
        zIncrement = zGoal - zCurrent
        increMatrix = np.matrix([[xIncrement], [0], [zIncrement]])
        change = np.dot(invJacob, increMatrix)
        left.set_joint_positions({lj[1]: currentPosition + change.index(0)/10}) #First pitch joint
        left.set_joint_positions({lj[3]: currentPosition + change.index(1)/10}) #Second pitch
        left.set_joint_positions({lj[5]: currentPosition + change.index(2)/10}) #Third Pitch joint

def forwardKinematics(theta1, theta2, theta3):
    xcurrent = 370.8 * sine(theta1) + 374 * sine(theta1+theta2) + 229 * sine(theta1+theta2+theta3)
    zcurrent = 370.8 * cos(theta1) + 374 * cos(theta1+theta2) + 229 * cos(theta1+theta2+theta3)
    return xcurrent, zcurrent
</code>```

Here is my logic in writing this:
I first calculated the Jacobian 3x3 matrix by taking the derivative of each equation seen in the forwardKinematics method, arriving at:

[370cos(theta1) + 374cos(theta1+theta2) .....

0                                               0                      0

-370sin(theta1)-374sin(theta1+theta2)-......                            ]

In order to arrive at numerical values, I inputted a delta theta change for theta1,2 and 3 of 0.1 radians. I arrived at a Jacobian of numbers:

[0.954  0.586   .219

0.0000          0.000         0.0000

-.178   -.142   -0.0678]

I then input this matrix into a pseudoinverse solver, and came up with the values you see in the invJacob matrix in the code I posted. I then multiplied this by the difference between the goal and where the end effector is currently at. I then applied a tenth of this value into each of the joints, to make small steps toward the goal. However, this just goes into an infinite loop and my numbers are way off what they should be. Where did I go wrong? Is a complete rewrite of this implementation necessary? Thank you for all your help.

答:
The (inverse) Jacobi Matrix is pose dependent. It is not constant, it is dependent on pose (joint angles or TCP coords, based on formulation) and so it characterizes a pose not a robot. By implementing it as a constant you basicly assume that the same joint velocity will always cause the same TCP velocity. In reality it is clear that joint positions play an important role in how joint velocities are transformed to the TCP.

I recommend you generate the (inverse) Jacobi matrix in a symbolic form, similarly as your forward kinematics, dependend on variables (joint angles of TCP cooridnates) and write a function that calculates the value of the matrix for each current pose.
Then recalculate the matrix in every iteration and it should be fine.

Furthermore, in this form, if you have a 3x3 matrix, you can easily calculate its inverse, you do not need a pseudoinverse. Later, if you have 7 DOFs you might...

ContentLicense: CC BY-SA 3.0


问:
What is the easiest and efficient way to detect human in close range distance and make the robot follow it?
I am having a thesis right now regarding a robot. My research requires the robot to be attached to linear guide rail. A robot has to detect human in a very close range (of about 2 meters distance). What easiest and efficient method or components shall I use?</p>

答:
Following a human can be relatively easy, but it depends on your requirements and your sensors on how easy this is. If you use ROS there are some available packages:

people_tracker which uses a Kinect.

Person-following and Detection in an Indoor Environment: combines a face and leg detector.

ppl-detection also uses a Kinect.

lidar-tracking: lidar used to track people, but they say it is not robust.

cyphy_people_mapping: other that uses Kinect. (See their paper)

We [1] use a boosting leg detector [2] which provides the position of potential people using horizontal front and rear range laser sensors.
A Multiple Hypothesis Tracking For Multiple people [3] keeps the track of the people and assigns them identifiers.
Since we also want to identify the person for large distances we use AR tags which has as advantage that it is robust and easy to install.

So depending on what sensors you have, I think, the easiest way might be to use a leg detection algorithm (using range lasers) or an AR tag (using a camera and tag).

[1] A. Goldhoorn, A. Garrell, A. Sanfeliu, and R. Alquézar, “Continuous
real time pomcp to find-and-follow people by a humanoid service robot,”
in Proceedings of the IEEE-RAS International Conference on Humanoid
Robots, 2014, pp. 741–747.

[2] K. O. Arras, O. M. Mozos, and W. Burgard, “Using boosted features for
the detection of people in 2d range data,” in Proceedings of the IEEE
International Conference on Robotics and Automation (ICRA), 2007, pp.
3402–3407.

[3] S. S. Blackman, “Multiple hypothesis tracking for multiple target
tracking,” IEEE Aerospace and Electronic Systems Magazine, vol. 19,
no. 1, pp. 5–18, 2004.

Other references:

On the robotshop.com - how to make a robot guide they propose to use an ultrasonic or infrared distance sensor(s), a camera and GPS:

... the most appropriate sensors to allow a robot to follow a human may be ultrasonic or infrared distance sensor(s), a camera and GPS. A camera may be used to pick up a specific pattern placed on the shirt of the individual to follow while GPS units mounted on the robot and on the human would help the robot find the human if she cannot be seen visually. Distance sensors would ensure the robot does not get too close to the human. Therefore when choosing sensors to help your robot follow a human, the sensors listed above would be a good starting point.

On societyofrobots.com promote to use computer vision:

The most reliable way to do this is using computer vision. If I were to do it, I would do middle mass detection on the color red, and wear a bright red shirt. As long as a Ferrari doesn't drive by, your robot will always follow you.

On norrislabs.com they explain how they made a robotic stool which is able to to follow a person using heat sensing. Which is based on their Follow Me Rover. They have all the schemas and source code on their page.

On makezine.com there is a simple robot Stalker Bot that uses ultrasonic sensors to follow an object.

In the article A Study on Techniques of Person Following Robot they give a nice overview of different detection and tracking techniques and sensors used by several researchers: laser range finders, stereo cameras, Kinect.


问:
What is inverse depth (in odometry) and why would I use it?
Reading some papers about visual odometry, many use inverse depth. Is it only the mathematical inverse of the depth (meaning 1/d) or does it represent something else. And what are the advantages of using it?</p>

答:
The inverse depth parameterisation represents a landmark's distance, d, from the camera exactly as it says, as proportional to 1/d within the estimation algorithm. The rational behind the approach is that, filtering approaches such as the extended Kalman filter (EKF) make an assumption that the error associated with features is Gaussian.

In a visual odometry setting the depth of a landmark is estimated by tracking the associated features over some series of frames and then using the induced parallax. However for distant features (relative to the displacement of the camera) the resultant parallax will be small, and importantly the error distribution associated with the depth is highly peaked close to the minimum depth with a long tail (i.e. it is not well modelled via a Gaussian distribution). To see an example should refer to Fig. 7 in Civera et al.'s paper (mentioned by @freakpatrol), or Fig. 4 of Fallon et al. ICRA 2012 "Efficient Scene Simulation for Robust Monte Carlo Localization using an RGB-D Camera".

By representing the inverse depth (i.e. 1/d) this error becomes Gaussian. Furthermore it permits representing very distant points e.g. points at infinity.

The important aspect of the representation used is Civera's paper is explained in Section II B of his paper (see Equation (3)). Here, a landmark is represented relative to the pose (position and orientation) of the first camera from which it is seen. This pose is capture in the first five parameters of Eq (3), whereas the sixth parameter, $\rho_{i}$, represents the inverse depth. Eq (4) provides an expression for recovering the world position of the point (i.e. this where the inverse depth gets converted to depth as $1/\rho_{i}$)

ContentLicense: CC BY-SA 4.0


问:
Using an RGB + Depth Camera to locate X,Y,Z coordinates of a ball
I've recently been trying to use Gazebo to do some modelling for a couple tasks. I have a robot that's effectively able to locate a ball and get x,y coordinates in terms of pixels using a simple RGB camera from the Kinect. I also have a point cloud generated from the same Kinect, where I hope to find the depth perception of the ball using the X,Y coords sent from the circle recognition from my RGB camera. My plan earlier was to convert the X,Y coordinates from the RGB camera into meters using the DPI of the Kinect, but I can't find any info on it. It's much, much harder to do object recognition using a Point Cloud, so I'm hoping I can stick to using an RGB camera to do the recognition considering it's just a simple Hough Transform. Does anybody have any pointers for me?</p>

答:
The critical part is the registration between depth data and RGB data. If the registration is calibrated properly then you can just extract the depth for the particular target pixel (X,Y), using interpolation for sub-pixel coordinates. See this answer for help with the registration -- it is a common problem that has already been solved.

Once you have the depth for the pixel coordinates of interest, you can easily get the Cartesian coordinates relative to the camera using the camera matrix (based on the field of view and image size). Note that you also have to account for distortion in the RGB camera. This OpenCV documentation page should help start you off, and there are plenty of resources out there addressing transformation between camera pixel coordinates, camera homogeneous coordinates, and actual world Cartesian coordinates given the pixel depth.


问:
How to tilt a camera 180 using mirrors
How would you vertically tilt a camera 180 degrees using mirrors?

I'm trying to add a pan/tilt mechanism to a Raspberry Pi's camera. The camera uses one of those flat cables with unstranded wires, and even with a strain gauge, I don't trust it to handle repeated bending, so I'm trying to design a tilt mechanism that allows the camera to be rigidly mounted so no wires move. The tilting also has to happen very quickly, so I'm trying to minimize the amount of mass I need to move.

Then I saw the Oculus kit that actuates a mirror to effectively tilt a laptop's fixed webcam. I'm trying to extend this idea, but I having trouble working out the mechanics that would allow the tilt to extend to 180 degrees. The layout in the Oculus's mechanism only supports a tilt angle of about 90 degrees, and the mirrors are relatively large. Is it possible to modify this to support 180 degrees?

Are there other ways to "bend" the view of a camera without having to move the actual camera?

答:
You could place the camera looking upwards and a mirror above it.
The mirror is attached to a motor so that it's rotation axis is parallel e.g. to the vertical center line of the camera. If the mirror is parallel to the camera, then you get a camera-selfie, if you rotate it by 45deg, you look to one side and with -45deg you look to the other side. So you just have to move the mirror in a range of 90 deg to be able to look to both directions.  </p>

Title: How to tilt a camera 180 using mirrors


问:
One propeller Drone?How well it works?Hope
Can a one propeller drone work efficiently for a good flight and stable camera footage in a drone flight</p>

答: Helicopters are a quasi-single propeller drone, but they require a tail propeller to counter-act the effects of the lift propeller.  Due to newton's third law of motion, the lifting propeller's spin in one direction will cause the the body of the helicopter to spin in the other direction.  Without a tail propeller to overcome this effect, A single motor drone would simply spin out of control.</p>


问:
What microcontroller should be used for QuadCopter flight control and ESC?
I am working on building my own quadcopter from scratch. I noticed that many solutions available online use arduino, but I am not a fan of arduino. So my questions are: what microcontrollers should be used, what are the crucial features of those microcontrollers etc. I would like to build it from total scratch. I was thinking about PIC microcontrollers.

Also what should be used for ESC, since I would build that from scratch too.

Summing it all up:

4 ESCs

Gyro,acceloremeter,gps

transceiver

which is about 8 slaves and one master microcontroller.

答:
You're asking about microcontrollers, but I get the sense that you're asking it for the wrong reasons.  Since you don't list a technical reason for being "not a fan of arduino", I get the sense that you're trying to make a quadcopter that is different in every way from existing solution.  This decision sounds at best arbitrary and at worst misguided.  Why doesn't arduino fit your needs?  What are your needs?

If many quadcopter designs are using arduino, that's a good indication that arduino is a useful element of getting quadcopters to work.  There may be a better microcontroller to use, but how will you know what to look for until you experience firsthand a shortcoming in the arduino platform?

If your desire is to make a quadcopter from scratch, the best way to approach it is not to conceive the design from first principles.  Take an existing design, study it, and improve it once you understand how it works.  It will take a lot of prototypes, trial, and especially error.


答:
Very common problem which calls for using the "Pointcloud Library" PCL: www.pointclouds.org
This datastructures in the library also make it easy to find according 3D-Points when you segmented your RGB image. There are lots of tutorials and a very busy community.</p>

Title: Using an RGB + Depth Camera to locate X,Y,Z coordinates of a ball

Body: I've recently been trying to use Gazebo to do some modelling for a couple tasks. I have a robot that's effectively able to locate a ball and get x,y coordinates in terms of pixels using a simple RGB camera from the Kinect. I also have a point cloud generated from the same Kinect, where I hope to find the depth perception of the ball using the X,Y coords sent from the circle recognition from my RGB camera. My plan earlier was to convert the X,Y coordinates from the RGB camera into meters using the DPI of the Kinect, but I can't find any info on it. It's much, much harder to do object recognition using a Point Cloud, so I'm hoping I can stick to using an RGB camera to do the recognition considering it's just a simple Hough Transform. Does anybody have any pointers for me?</p>


问:
Joint Space Singularities
I would like to clarify my self on singularity configurations. If I am moving the robot in joint space only one joint at a time, can I come to a singular configuration? If so how?
Thanks</p>

答:
Assuming it is a robot with a serial structure:

You will always be able to move every joint of the robot in any pose.

However the singularitites still exist, and you can end up in a singular pose, but if you do not have any cartesian space contrains  (and do not even calculate inverse kinematics/inv. jacobi), then from a motion point of view these are not significant.

Title: Joint Space Singularities


问:
Image Based Visual Servoing algorithm in MATLAB
I was trying to implement the IBVS algorithm (the one explained in the Introduction here) in MATLAB myself, but I am facing the following problem : The algorithm seems to work only for the cases that the camera does not have to change its orientation in respect to the world frame.For example, if I just try to make one vertex of the initial (almost) square go closer to its opposite vertex, the algorithm does not work, as can be seen in the following image

The red x are the desired projections, the blue circles are the initial ones and the green ones are the ones I get from my algorithm.

Also the errors are not exponentially dereasing as they should.

What am I doing wrong? I am attaching my MATLAB code which is fully runable. If anyone could take a look, I would be really grateful. I took out the code that was performing the plotting. I hope it is more readable now. Visual servoing has to be performed with at least 4 target points, because else the problem has no unique solution. If you are willing to help, I would suggest you take a look at the calc_Rotation_matrix() function to check that the rotation matrix is properly calculated, then verify that the line ds = vc; in euler_ode is correct. The camera orientation is expressed in Euler angles according to this convention. Finally, one could check if the interaction matrix L is properly calculated.

```<code>function VisualServo()

    global A3D B3D C3D D3D A B C D Ad Bd Cd Dd

    %coordinates of the 4 points wrt camera frame
    A3D = [-0.2633;0.27547;0.8956];
    B3D = [0.2863;-0.2749;0.8937];
    C3D = [-0.2637;-0.2746;0.8977];
    D3D = [0.2866;0.2751;0.8916];

    %initial projections (computed here only to show their relation with the desired ones)
    A=A3D(1:2)/A3D(3);
    B=B3D(1:2)/B3D(3);
    C=C3D(1:2)/C3D(3);
    D=D3D(1:2)/D3D(3);

    %initial camera position and orientation
    %orientation is expressed in Euler angles (X-Y-Z around the inertial frame
    %of reference)
    cam=[0;0;0;0;0;0];

    %desired projections
    Ad=A+[0.1;0];
    Bd=B;
    Cd=C+[0.1;0];
    Dd=D;

    t0 = 0;
    tf = 50;

    s0 = cam;

    %time step
    dt=0.01;
    t = euler_ode(t0, tf, dt, s0);

end

function ts = euler_ode(t0,tf,dt,s0)

    global A3D B3D C3D D3D Ad Bd Cd Dd

    s = s0;
    ts=[];
    for t=t0:dt:tf
        ts(end+1)=t;
        cam = s;

        % rotation matrix R_WCS_CCS
        R = calc_Rotation_matrix(cam(4),cam(5),cam(6));
        r = cam(1:3);

        % 3D coordinates of the 4 points wrt the NEW camera frame
        A3D_cam = R'*(A3D-r);
        B3D_cam = R'*(B3D-r);
        C3D_cam = R'*(C3D-r);
        D3D_cam = R'*(D3D-r);

        % NEW projections
        A=A3D_cam(1:2)/A3D_cam(3);
        B=B3D_cam(1:2)/B3D_cam(3);
        C=C3D_cam(1:2)/C3D_cam(3);
        D=D3D_cam(1:2)/D3D_cam(3);

        % computing the L matrices
        L1 = L_matrix(A(1),A(2),A3D_cam(3));
        L2 = L_matrix(B(1),B(2),B3D_cam(3));
        L3 = L_matrix(C(1),C(2),C3D_cam(3));
        L4 = L_matrix(D(1),D(2),D3D_cam(3));
        L = [L1;L2;L3;L4];

        %updating the projection errors
        e = [A-Ad;B-Bd;C-Cd;D-Dd];

        %compute camera velocity
        vc = -0.5*pinv(L)*e;

        %change of the camera position and orientation
        ds = vc;

        %update camera position and orientation
        s = s + ds*dt;

    end
    ts(end+1)=tf+dt;
end

function R = calc_Rotation_matrix(theta_x, theta_y, theta_z)

    Rx = [1 0 0; 0 cos(theta_x) -sin(theta_x); 0 sin(theta_x) cos(theta_x)];
    Ry = [cos(theta_y) 0 sin(theta_y); 0 1 0; -sin(theta_y) 0 cos(theta_y)];
    Rz = [cos(theta_z) -sin(theta_z) 0; sin(theta_z) cos(theta_z) 0; 0 0 1];

    R = Rx*Ry*Rz;

end

function L = L_matrix(x,y,z)

    L = [-1/z,0,x/z,x*y,-(1+x^2),y;
       0,-1/z,y/z,1+y^2,-x*y,-x];
end
</code>```

Cases that work:

```<code>A2=2*A;
B2=2*B;
C2=2*C;
D2=2*D;

A2=A+1;
B2=B+1;
C2=C+1;
D2=D+1;

A2=2*A+1;
B2=2*B+1;
C2=2*C+1;
D2=2*D+1;
</code>```

Cases that do NOT work:
Rotation by 90 degrees and zoom out (zoom out alone works, but I am doing it here for better visualization)

```<code>A2=2*D;
B2=2*C;
C2=2*A;
D2=2*B;
</code>```

答:
You are using a target set of image points that are impossible to achieve. Simply shifting two of the points in one direction within image coordinates does not correspond to a rigid transformation of your 3D set of points. It may make sense for orthographic projections in CAD software, but cameras have perspective so you need to include that in your transformation -- if the plate is rotating towards the camera the shifted points will also move outwards in the vertical direction. Here is a figure to clarify what I mean:

The easiest fix is to actually generate a true transformation in 3D (rotation and/or translation), then determine the new pixel coordinates and use that for testing -- this also gives you something against which you can check your solved camera transformation.

It also explains why zooming and translation work fine.


问:
Sonar for obstacle avoidance: how many sensors and where to place them?
For avoiding obstacles during 2D robot navigation what is the best position/angle to place the sonar sensors? How many should there be?

I would like to know if there is some theory or examples for the problem of placing. I realize that it depends on the way that the robot moves and its geometry, but I am searching for general answers.

答:
Generally the main factor in positioning sensors is the actual beam width of the sensors themselves. It's usually the case that the longer range the sensor is, the narrower the beam width.

So firstly you need to work out the range you are aiming to sense at and pick some sensors that work at that range.

Then you've got to decide on how wide an angle span you want to sense distance at. For instance, you may decide to cover everything in-front and to the sides of a robot (a 180 degree range, 90 degrees to either side of straight-ahead).

You then divide the angle span by the beam width of your chosen sensor to get the number of sensors you need.

Using the above example, if you have sensors with a 90 degree beam width, you'd only need two of them, each at 45 degrees either side of straight-ahead. If you had longer-range sensors with, say, a 20 degree beam width, you'd need 9 of them to cover the same area.

Obviously the beam width is not an exact measurement so its probably safer to have some overlap of the beams. Finally, the sensors should be installed symmetrically between the left and right sides of the robot.


问:
Why does it require more force to turn a servo if it is electronically connected to another servo?
I have two servo motors that I rigged up to use as a telescope remote focuser. The idea is to turn one servo by hand and use the power generated to turn the other, which is geared to a telescope focuser knob. I noticed that when the two servos are electrically connected, it is noticeably harder to turn a servo compared to turning it by itself. I tried changing the polarity of the connection hoping it would help, but it is still harder to turn the servo when they are connected. Does anyone know why this is?</p>

答:
Do I understand correctly that you do not use any external power supply?

You said it yourself, you use one servo to generate power to the other. If it is not connected it is easy to turn since it is not generatrin power (not 100% exact but let's run with this in this case).

If you connect the servo, your mechanical energy will be transformed to electrical energy transfered to the other servo and transformed back to mechanical energy. So you still have to generate the energy required by the mchanical system connected to the second servo. If the servos are the same you gain nothing, you might as well turn the mechanical system directly, if they are different you might have to exert less torque on the first motor, then the second one is producing, but the velocity of the second one will be then slower. (similarly to mechanical gears)


问:
I can't get motors to turn with Raspberry pi
I want to turn some motors using my raspberry pi. I am able to turn an LED on and off using the 3.3V GPIO pin. For the motors, I tried using a L293D chip as per the instructions on this link.

What happened is that the very first time I set the circuit up for one motor, it worked perfectly. But then, I moved the pi a little and the motor has since refused to work. I even bought a new pi and still no luck with the circuit. I then bought a L298N board that fits smugly on top of the GPIO pins of the pi and followed the instructions on the this video

Still no luck, the motor just won't run with either pi. I am using four AA batteries to power the motor and a connecting the pi to a power supply from the wall. What could possibly be the problem here?

答:
If you have changed the Pi and changed the L298N board then I would suspect there is a problem with the motor.  Is it possible to drive the motor without the Pi?

You could try replacing the batteries with a second power supply, I'm assuming you have checked the batteries aren't flat :)


答:
The other servo, being an electrical device, has some finite resistance.

When the servos are not electrically connected, the output of the manually turned servo is an open circuit, meaning that there is infinite resistance and no current flows. Because no current is flowing, the electrical output power of manually turned servo is

$P = IV$

where $I = 0$, so

$P = (0)(V) = 0$.

When you connect another servo, there is now a finite resistance connected to the manually turned servo's leads, so now current may flow. Now the current is given by

$V = IR$

$I = V/R$

so the electrical output power of the servo is

$P = IV$

$P = V^2/R$

There are two "types" of voltage in a motor when you operate it normally; the applied voltage and a back-voltage, commonly called "back EMF". This back EMF is a byproduct of motor motion.

The requirements for motor action are:

Current-carrying conductor

Applied magnetic field

Applied voltage differential on the conductor

The output of motor action is relative motion between the current-carrying conductor and the magnetic field.

The requirements for generator action are:

Current-carrying conductor

Applied magnetic field

Relative motion between the conductor and field

The output of generator action is a voltage differential in the conductor.

So you can see that if you meet motor action then you get generator action and both happen simultaneously.

When you back-drive a motor, you can get an output voltage at the motor terminals, if you have an applied magnetic field. In some instances, electric vehicles for instance, the motor is created such that the magnetic field is in the form of an electromagnet, called field windings. In this version, it is possible to vary the strength of the magnetic field by varying the current in the field windings; this varies the output current of the motor during back-driven operations and produces a variable strength braking effect.

In your case, with servo motors, the magnetic field typically comes in the form of permanent magnets in the motor housing. This means that the only way to vary output current (assuming a fixed output resistance) is to vary speed, as this varies the voltage you generate as dictated by the back-EMF constant;

$ V_{\mbox{back EMF}} = K_{\omega} \omega \phi$

where $K_{\omega}$ is the back-EMF constant, $\omega$ is the speed at which you are driving the motor, and $\phi$ is the strength of the magnetic field.

Looking again at the electrical output power of the servo:

$P = V^2/R$

Output power of the servo goes up with voltage squared. Since voltage is proportional to the driving speed of the motor, you can see that output power goes up based on speed squared; if you double the speed at which you drive the servo you quadruple the output power of the servo. This is why the servo gets "very hard" to drive.

There will always be some resistance when you try to drive a servo or motor, even with an open circuit, because they are real devices and thus have mass and inertia. You apply a torque to accelerate the motor:

$ \tau = I\alpha$

where $\tau$ is the torque you apply, $I$ is the effective motor inertia, and $\alpha$ is the rate at which you are accelerating the motor shaft. Output power varies with torque and speed:

$P_\mbox{mechanical} = \tau \omega$

so it requires more power to accelerate an already-moving object than it does to accelerate a stationary object.

Finally, the total power you apply to the servo is given by:

$P = P_{\mbox{mechanical}} + P_{\mbox{backEMF}}$

$P = \tau \omega + V^2/R$

$P = I\alpha \omega + (K_{\omega} \omega \phi)^2/R$

$P = (I \alpha)\omega + \frac{(K_\omega \phi)^2}{R}\omega^2 $

Where again, if the back-driven servo is not electrically connected to anything, then $R$ becomes infinitely large and the second term in the above equation becomes zero.

Title: Why does it require more force to turn a servo if it is electronically connected to another servo?

Body: I have two servo motors that I rigged up to use as a telescope remote focuser. The idea is to turn one servo by hand and use the power generated to turn the other, which is geared to a telescope focuser knob. I noticed that when the two servos are electrically connected, it is noticeably harder to turn a servo compared to turning it by itself. I tried changing the polarity of the connection hoping it would help, but it is still harder to turn the servo when they are connected. Does anyone know why this is?</p>


问:
What charger to use with my ZIPPY Compact 6200mAh 4s 40c Lipo MultiRotor Battery
Hello I am trying to build a Quadcopter for a school project and I need to finish quick before our mission trip because I was asked to finish it before then so that I could take it. But I am having a problem figuring out which charger would work with my ZIPPY Compact 6200mAh 4s 40c Lipo Pack

Here are the specs on the battery

Capacity: 6200mAh

Voltage: 4S1P / 4 Cell / 14.8V

Discharge: 40C Constant / 50C Burst

Weight: 589g (including wire, plug & case)

Dimensions: 158x46x41mm

Balance Plug: JST-XH
Discharge Plug: HXT4mm

Also I will be running the Tarot T4-3D Brushless Gimbal for GoPro (3-Axis)
and if anyone can tell me a good battery to run it off of or maybe it would be better to run it off my main battery.

Thanks in Advance

答: Buy the imax b6. They're cheap to replace at $26, I would recommend buying the imax b6 with the built-in power supply as it saves you having to buy an extra 12v 5A psu. I own 4 imax b6's and they work wonders.</p>


答:
To expand on thisismyrobot's answer, beam width is indeed important.  However, there are a number of other factors, such as the reflectivity of the environment (acoustic "brightness"), transmission frequency, etc.

Although it is from 1988, Obstacle Avoidance with Ultrasonic Sensors covers the challenges well - the physics of echo-ranging appear to have changed little over the years :)

The Ultrasonic sonar sensors article on Generation Robots introduces some of the more interesting issues in ultrasonic ranging: beam shapes and lobes (see the 50kHz figure).

From there, you should visit these more detailed articles on beam characteristics and sensor selection:

Choosing an Ultrasonic Sensor for Proximity or             Distance Measurement Part 2: Optimizing Sensor Selection

Transducer Beam Spread

Overview for Applying Ultrasonic Technology

Important Characteristics of Sound Fields of Ultrasonic Transducers [pdf]

Title: Sonar for obstacle avoidance: how many sensors and where to place them?

Body:
For avoiding obstacles during 2D robot navigation what is the best position/angle to place the sonar sensors? How many should there be?

I would like to know if there is some theory or examples for the problem of placing. I realize that it depends on the way that the robot moves and its geometry, but I am searching for general answers.


答:
run a continuity test on the windings using your voltmeter and let us know what the resistance is compared to what the datasheet on your motor states.
That will give you a clue as to whether your motor is ok or not, if you get no reading, then your motor is gone.</p>

Title: I can't get motors to turn with Raspberry pi

Body:
I want to turn some motors using my raspberry pi. I am able to turn an LED on and off using the 3.3V GPIO pin. For the motors, I tried using a L293D chip as per the instructions on this link.

What happened is that the very first time I set the circuit up for one motor, it worked perfectly. But then, I moved the pi a little and the motor has since refused to work. I even bought a new pi and still no luck with the circuit. I then bought a L298N board that fits smugly on top of the GPIO pins of the pi and followed the instructions on the this video

Still no luck, the motor just won't run with either pi. I am using four AA batteries to power the motor and a connecting the pi to a power supply from the wall. What could possibly be the problem here?


问:
Running my 3 DOF Inverse Kinematics Code: Works in MATLAB, not in Python
I asked a question similar to this earlier, but I believe I have a new problem. I've been working on figuring out the inverse kinematics given an x,y,z coordinate. I've adopted the Jacobian method, taking the derivative of the forward kinematics equations with respect to their angles and input it into the Jacobian. I then take the inverse of it and multiply it by a step towards the goal distance. For more details, look at http://www.seas.upenn.edu/~meam520/notes02/IntroRobotKinematics5.pdf page 21 onwards.

For a better picture, below is something:

Below is the code for my MATLAB script, which runs flawlessly and gives a solution in under 2 seconds:

```<code>ycurrent = 0; %Not using this
xcurrent = 0; %Starting position (x)
zcurrent = 0; %Starting position (y)
xGoal = .5; %Goal x/z values of (1, 1)
zGoal = .5;
theta1 = 0.1; %Angle of first DOF
theta2 = 0.1; %Angle of second DOF
theta3 = 0.1; %Angle of third DOF
xchange = xcurrent - xGoal %Current distance from goal
zchange = zcurrent - zGoal
%Length of segment 1: 0.37, segment 2:0.374, segment 3:0.2295
while ((xchange > .02 || xchange < -.02) || (zchange < -.02 || zchange > .02))
        in1 = 0.370*cos(theta1); %These equations are stated in the link provided
        in2 = 0.374*cos(theta1+theta2);
        in3 = 0.2295*cos(theta1+theta2+theta3);
        in4 = -0.370*sin(theta1);
        in5 = -0.374*sin(theta1+theta2);
        in6 = -0.2295*sin(theta1+theta2+theta3);
        jacob = [in1+in2+in3, in2+in3, in3; in4+in5+in6, in5+in6, in6; 1,1,1];
        invJacob = inv(jacob);
        xcurrent = .3708 * sin(theta1) + .374 * sin(theta1+theta2) + .229 * sin(theta1+theta2+theta3)
        zcurrent = .3708 * cos(theta1) + .374 * cos(theta1+theta2) + .229 * cos(theta1+theta2+theta3)
        xIncrement = (xGoal - xcurrent)/100;
        zIncrement = (zGoal - zcurrent)/100;
        increMatrix = [xcurrent; zcurrent; 1]; %dx/dz/phi
        change = invJacob * increMatrix; %dtheta1/dtheta2/dtheta3
        theta1 = theta1 + change(1)
        theta2 = theta2 + change(2)
        theta3 = theta3 + change(3)
        xcurrent = .3708 * sin(theta1) + .374 * sin(theta1+theta2) + .229 * sin(theta1+theta2+theta3)
        zcurrent = .3708 * cos(theta1) + .374 * cos(theta1+theta2) + .229 * cos(theta1+theta2+theta3)
        xchange = xcurrent - xGoal
        zchange = zcurrent - zGoal
end
</code>```

Below is my Python code, which goes into an infinite loop and gives no results. I've looked over the differences between it and the MATLAB code, and they look the exact same to me. I have no clue what is wrong. I would be forever grateful if somebody could take a look and point it out.

```<code>def sendArm(xGoal, yGoal, zGoal, right, lj):
    ycurrent = xcurrent = zcurrent = 0
    theta1 = 0.1
    theta2 = 0.1
    theta3 = 0.1
    xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
    xchange = xcurrent - xGoal
    zchange = zcurrent - zGoal
    while ((xchange > 0.05 or xchange < -0.05) or (zchange < -0.05 or zchange > 0.05)):
        in1 = 0.370*math.cos(theta1) #Equations in1-6 are in the pdf I linked to you (inv kinematics section)
        in2 = 0.374*math.cos(theta1+theta2)
        in3 = 0.2295*math.cos(theta1+theta2+theta3)
        in4 = -0.370*math.sin(theta1)
        in5 = -0.374*math.sin(theta1+theta2)
        in6 = -0.2295*math.sin(theta1+theta2+theta3)
        jacob = matrix([[in1+in2+in3,in2+in3,in3],[in4+in5+in6,in5+in6,in6], [1,1,1]]) #Jacobian
        invJacob = inv(jacob) #inverse of jacobian
        xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
        xIncrement = (xGoal - xcurrent)/100 #dx increment
        zIncrement = (zGoal - zcurrent)/100 #dz increment
        increMatrix = matrix([[xIncrement], [zIncrement], [1]])
        change = invJacob*increMatrix #multiplying both matrixes
        theta1 = theta1 + change.item(0)
        theta2 = theta2 + change.item(1)
        theta3 = theta3 + change.item(2)
        xcurrent, zcurrent = forwardKinematics(theta1, theta2, theta3)
        xchange = xcurrent - xGoal
        zchange = zcurrent - zGoal
        print "Xchange: %f ZChange: %f" % (xchange, zchange)
    print "Goals %f %f %f" % (theta1, theta2, theta3)
    right.set_joint_positions(theta1) #First pitch joint
    right.set_joint_positions(theta2) #Second pitch
    right.set_joint_positions(theta3) #Third Pitch joint

def forwardKinematics(theta1, theta2, theta3):
    xcurrent = .3708 * math.sin(theta1) + .374 * math.sin(theta1+theta2) + .229 * math.sin(theta1+theta2+theta3)
    zcurrent = .3708 * math.cos(theta1) + .374 * math.cos(theta1+theta2) + .229 * math.cos(theta1+theta2+theta3)
    return xcurrent, zcurrent
</code>```

答: I found out what was wrong. The pdf I linked (as well as many others) state that you need to multiply your inverse jacobian matrix by a step x/y/z distance, but that results in an infinite loop. Multiplying the inverse jacobian matrix by the overall change in distance from x/zcurrent to the goals made the python code work smoothly. I'll keep this question up in case anybody wants to see the code.


问:
How to use SLAM with simple sensors
What 2D SLAM implementations (preferably included in ROS) can be used with simple distance sensors like IR or ultrasonic rangefinders?

I have a small mobile platform equipped with three forward facing ultrasonic sensors (positioned at 45 degrees, straight ahead, and -45 degrees), as well as a 6-DOF accel/gryo and wheel encoders, and I'd like to use this to play around with a "toy" SLAM implementation. I don't want to waste money on a Kinect, much less a commercial laser rangefinder, so methods that require high-density laser measurements aren't applicable.

答:
The actual implementation of SLAM won't care about whether you are using high fidelity laser range finders or cheaper ultrasonic sensors. Both are providing range measurements with the biggest difference being the uncertainty. Of course ultrasonic sensors work on different principles so there is more to it than that, but both are providing range measurements so you could swap between either one and much of your SLAM algorithm won't change.

The biggest challenge will likely be identifying landmarks or features in the environment that will form the map. With a Kinect or sweeping laser scanner you can pick out and track features relatively easily. However, with only 3 ultrasonic sensors whose field of view is rather wide and are subject to echoes and other complications, you will have a hard time recognizing objects or features in the environment.

Title: How to use SLAM with simple sensors


问:
Relationship between earth frame attitude and acceleration for a quadcopter
For a quadcopter, what is the relationship between roll, pitch, and yaw in the earth frame and acceleration in the x, y, and z dimensions in the earth frame? To be more concrete, suppose roll ($\theta$) is a rotation about the earth frame x-axis, pitch ($\phi$) is a rotation about the earth frame y-axis, and yaw ($\psi$) is a rotation about the z-axis. Furthermore, suppose $a$ gives the acceleration produced by all four rotors, i.e. acceleration normal to the plane of the quadcopter. Then what are $f, g, h$ in

$$a_x = f(a,\theta,\phi,\psi)$$
$$a_y = g(a,\theta,\phi,\psi)$$
$$a_z = h(a,\theta,\phi,\psi)$$

where $a_x$, $a_y$, and $a_z$ are accelerations in the $x$, $y$, and $z$ dimensions.

I've seen a number of papers/articles giving the relationship between x,y,z accelerations and attitude, but it's never clear to me whether these attitude angles are rotations in the earth frame or the body frame.

答:
The orientation angles will be provided in the Earth frame (global or world frame is more appropriate). It is pretty much impossible to provide a frame orientation with angles with respect to that same frame.

Then, given some acceleration $a_b$ in the body frame, you can find the acceleration in the world frame $a_w$ by pre-multiplication with the rotation matrix $R$.

$a_w = R a_b$

If you assume a typical roll-pitch-yaw sequence, then this will look like:

$\begin{bmatrix} a_{w,x} \\ a_{w,y} \\ a_{w,z} \end{bmatrix} = \begin{bmatrix} c_\psi c_\theta & -s_\psi c_\phi + c_\psi s_\theta s_\phi & s_\psi s_\phi + c_\psi s_\theta c_\phi \\ s_\psi c_\theta & c_\psi c_\phi + s_\theta s_\psi s_\phi & -c_\psi s_\phi + s_\theta s_\psi c_\phi \\ -s_\theta & c_\theta s_\phi & c_\theta c_\phi \end{bmatrix} \begin{bmatrix} a_{b,x} \\ a_{b,y} \\ a_{b,z} \end{bmatrix}$

Where $c_x = \cos x$ and $s_x = \sin x$.

Of course, you can expand this to specify the x-y-z components of the world frame acceleration as individual equations as you mentioned:

$a_{w,x} = f(a_b, \phi, \theta, \psi)$

$a_{w,y} = g(a_b, \phi, \theta, \psi)$

$a_{w,z} = h(a_b, \phi, \theta, \psi)$

Note that I am using the convention where $\phi$ is roll (about x-axis), $\theta$ is pitch (about y-axis), and $\psi$ is yaw (about z-axis).

When the rotation sequence roll, pitch, yaw is applied, each rotation occurs with respect to a world frame axis. We could get the same final result by applying a yaw, pitch, roll sequence but about each new axis. This latter method is more intuitive when visualizing roll-pitch-yaw (or rather Euler angle) rotations.

Here is a figure to clarify the rotation sequence in case it helps. The world frame is shown in black, the body frame in red-green-blue, and intermediary frames during the "intuitive" rotation sequence are included in grey.


问:
Denavit Hartenberg parameters - 3DOF articulated manipulator
I am trying to solve a forward kynematics problem for a 3DOF manipulator.

I am working with the Robotics Toolbox for MatLab created by Peter Corke and after calculte the DH parameters and introduce them into MatLab to compute the fordward kynematics the plotted robot is not what it should be.

I guess I made some mistakes calculating the DH parameters.

Attached is the file where you can see what are the DH frames calculated for each joint and the DH parameters for each frame.

Anyone could give me a clue whether this is the correct answer?

Here is the image with the frames calculated by me.

And here the robot I get from Matlab (using the Robotics Toolbox by P.Corke)

答:
Try these:

```<code>Theta = [pi/2, -pi/2, -pi/2];
D     = [L0,    L2,    L1  ];
A     = [0,     0,     L3  ];
Alfa  = [pi/2, -pi/2,  0   ];
</code>```

with

```<code> T = [cos(theta) -sin(theta)*cos(alpha) sin(theta)*sin(alpha) a*cos(theta);
      sin(theta) cos(theta)*cos(alpha) -cos(theta)*sin(alpha) a*sin(theta);
      0          sin(alpha)             cos(alpha)            d;
      0          0                      0                     1];
</code>```

i added the matrix to make sure the differences do not come from the differences in the DH and modified DH paramters.

Body:
Try these:

Theta = [pi/2, -pi/2, -pi/2];
D     = [L0,    L2,    L1  ];
A     = [0,     0,     L3  ];
Alfa  = [pi/2, -pi/2,  0   ];

with

 T = [cos(theta) -sin(theta)*cos(alpha) sin(theta)*sin(alpha) a*cos(theta);
      sin(theta) cos(theta)*cos(alpha) -cos(theta)*sin(alpha) a*sin(theta);
      0          sin(alpha)             cos(alpha)            d;
      0          0                      0                     1];

i added the matrix to make sure the differences do not come from the differences in the DH and modified DH paramters.


答: The datasheet of the l298n motor clearly states that you need a minimum of 4.5V of Vss,that is logic supply.Try giving it a higher voltage. 3.3V wont work.</p>


问:
Is there a tool for building and analysing robots (kinematics, control) visually?
I am reading research papers about robotics and many of them follow the same pattern:

some construction is established

kinematical formulas are read from the mechanical structure

the state space is analysed (e.g. how far the robot can reach, what the maximum speed can be, what is left underspecified and how to handle such mathematically incorrect systems and so on)

Is there some tool or software product that can receive (as input) the mechanical structure and then output the kinematical formulas?  Preferably, it would provide some kind of plots, analysis, suggestions for optimal design parameters (e.g. length, angles of the sturcture, optimum parameters of motors and so on).  Does this exist?

答:
The Actin toolkit is the only one I know of that sounds like what you want.

It integrates with SolidWorks to provide the kind of analysis you are talking about.

Other people may know of other similar tools though.


问:
Solar panel set rotation: How to achieve both vertical and horizontal rotation?

How can we achieve this kind of rotation to enable maximum trapping of solar rays during the day?

答:
Your question is very broad... what have you tried already? SE can help with specific issues, but not design an entire sun tracking system.

However, a simple google for "sun tracker DIY" should give you some ideas. 50k4's suggested link is a very good example of a DIY sun tracking system.

Basically you need to track the Sun, on a daily basis, throughout the year. So a mechanical system with 1 or 2 DOF (degree of freedom) is required to tilt the panels, along with a mechanism to track the Sun.

Tilt

There are two types of tilt required - vertical and horizontal:

For vertical tilt, along the N-S axis, this is easy as it (generally)
remains constant, and is equal to the latitude of the installation. So
at the equator the panels are parallel to the ground, angle of tilt
is 0°; in Paris that angle would be 48.8; at the North Pole the panels would be perpendicular (90°). Obviously there is some seasonal variation, between the
solstices, and a vertical tracking system can be added (hence the 2
DOF). However it is not essential, and it is better to concentrate on
the horizontal tracking;

For horizontal tilt, along the E-W axis, then a 1 DOF arc of 180
degrees, maximum, is required to track the Sun. So, only one
servo/actuator, or bank of parallel servos, would be required, per panel or array of panels.

How you mount the panels on to the servos is up to you, either:

One servo/actuator to one panel;

One servo/actuator to an array of panels.

Remember the larger the number of panels in the array (2x2, 3x3, 4x4...), the heavier the array will become, the greater its mechanical inertia and the larger the required actuator will be. You could use one actuator for each panel, but then the maintenance required will be greater, as there are more servos to maintain. Also, from a cost perspective, is one big actuator cheaper than 9, or 16, smaller servos?

Tracking

There are a number of ways to actually track the Sun, to keep the panels facing the Sun, including:

The simplest form of tracking would employ a light sensor, mounted in
the same plane as the panels, that, when maximum light output is
achieved then  it can be assumed that the panel (sensor) is pointing
directly at the Sun. One downside is that the sensor, and hence the panel array, would need to be
constantly shifting orientation, and sampling the light, to ensure that maximum luminosity is achieved.

A more complex solution would be to have an array of Solar coordinates over time for
that specific date, which can be used to control the servos, to simply point the panels in the direction of where the Sun should be at that particular time. However this requires the preparation of tables, and access to an almanac. Although, it would be possible to programmatically derive the coordinates - using a model of the Solar System in Mathematica, for example.

Get the angle of the Sun's path for that day, divide that by the number of daylight hours for that date, and you have the required angular velocity of the panel/array. Point the panel to the angle of the Sunrise and then at sunrise start the rotation at the calculated angular velocity. This will keep the panels pointing in roughly the correct orientation, without the requirement for a sensor.


问:
iRobot Create 2: Can I load the code in instead of connecting cable? (new learner)
I am a new learner of iRobot. I am trying to program it to control the movement of the Create 2. After glancing through the existing project, I find most of them are based on sending commands to Roomba through a cable. </p>

<p>Is there anyway to embed the code in and let the Roomba behave accordingly? If there is not such method, which kind of API tool do you think is easiest for beginner? </p>

答:
Unlike the old Create, there is no way for the new Create2 to store any user program.

Be warned, easiest is very subjective.  For me, the easiest thing is to write python code and place a small netbook on the robot.  For others, the easiest thing is to write Arduino code and wire that in...


问:
Is there a way to turn the sound off of a Roomba?
I am working with an iRobot Create 2 and I work with others around me. Whenever I turn the robot on, send it an OI reset command, etc., it makes its various beeps and noises. I would like to not have this happen since I find it a little annoying and I'm sure those who have to work around me would like to have things quiet so they can concentrate on their work. Is there a way to accomplish turning off the beeps (while still being able to easily re-enable them), or am I out of luck?</p>

答:
No, there is no software or hardware volume control on the Roomba.

You could probably put a potentiometer inline with the speaker wire to manually change the volume.  However, getting to the speaker is a bit of work.  But I believe is totally doable.  You just have to disassemble (and reassemble) lots of the robot.  This would make a great project, be sure to submit it!

P.S. I just found this page (http://www.schneordesign.com/Avi/irobot/roomba_spk1.htm) on how to access the Roomba speaker.  The page is actually about how to fix a broken speaker, but there are step-by-step instructions on how to get to the speaker.  And once you are are there, you can cut a wire for no sound, or add in some resistance for a quieter sound.


问:
How to detect when a stepper motor has stalled?
How can I detect when a stepper motor has stalled?

A google search led me to some people who say that
when the stepper motor stalls, the current spikes up,
which is easily detectable with a Hall sensor.
(Or, I suppose, by any of the other current sensors mentioned at
"How can I sense the motor's current?"
).

However, I measured the current through (one of the 4 wires of) my stepper motor,
and it's always within a few percent of 0.5 A, whether my stepper driver is holding one position, moving it normally (which in my application is very slowly), or the stepper driver thinks it is telling the stepper to move normally, but the motor has pegged out against the hard limit.
Measuring the current in the +12V power supply going to the stepper motor driver, also seemed to give a fairly constant current.
This may be because I turned down the current limit to that amount on my "chopper" stepper motor driver.

Am I missing some key detail in the "measure the current" approach?

A google search led me to some other people that measure the back-EMF (BEMF) in one coil of the stepper during the time the stepper driver is only driving the other coil.
But that only seems to distinguish between "a motor moving quickly" vs "a motor stopped", and doesn't seem to distinguish between my case of "a motor moving slowly" vs "a motor stopped".

Is there some way to apply the BEMF approach even in a system where I always drive the stepper slowly, and never spin it quickly?

I'm currently using a stepper driver board with the TI DRV8825 chip on it, and I hoped the "fault" pin would tell me when the stepper motor has stalled against my hard stop.
But it doesn't seem to be doing anything -- is it supposed to tell me about a stall, but I just have it wired up wrong?

Is there some other chip or drive technique that detects when the stepper has stalled out against the hard stop?

Is there some other technique for detecting a hard stall that I can "add on" to a system using an off-the-shelf stepper motor driver?

(Is there some other StackExchange site that is more appropriate for questions about motors and motor drivers?)

答:
You need to quantify : "I measured the current through (one of the 4 wires of) my stepper motor, and it's always within a few percent of 0.5 A". A 'few percent' may be all you need to detect a little extra current during stall (if there is extra current as I would also assume but would need to prove), which can be sensed and compared to normal stepping current.  In some cases 40 uA is major and in some cases 4 mA is major difference. Without measurement parameters from you it is impossible to really advise you.

So, what exactly is the current for a step versus stall, and is the difference consistent? I would measure all the wires as well...  You are using a unipolar correct? I have used steppers but never bothered to measure current as the steppers I used matched the load requirements and never stalled. So one quick answer is just to get a bigger stepper.


问:
What are hardware components to build a modular robot which consists of several 5x5x5cm modules?
I am computer science student and I have no knowledge on robotics.

In my project, I am trying to find controllers for modular robots to make them do specific tasks using evolutionary techniques. For the moment I am doing this in a simulator, but if I want to make physical robots I have to know a priori the components to add to the robot, where do I place them, especially if modules of robot are small (cubes of 5*5*5cm)...

So my questions are:

What are must have components to make physical robot ? (arduino, batteries, sensors, ...)

For a small robot how many batteries do I need ?

If modules have to communicate with wifi, do I have to put a wifi card on each module?

I want to add an IMU. Is its position important, I mean do I have to put it in the middle of the robot ?

Thank you very much.

答:
Its very difficult to answer this question because you haven't asked specific enough questions.  Its very difficult for you to ask specific questions because you don't know the answers to the questions you have.

That depends on what you want the robot to do, swim, walk, fly or wheels.

You need enough batteries to meet the power requirements of your robot for the time you want it to run.  Leave batteries till last.

That's your decision.  Do they need Wi-Fi, what about cheaper blue tooth, or could you have on transmitter per robot and all the cubes use wired comms, SPI, Serial or I2C?

If the IMU is a cube then it doesn't matter now, you can experiment and move it around based on you results.

Don't limit yourself at this early stage.  You have said you are using an Arduino and then said you want Wi-Fi, what about an ESP8266 instead (I have seen something about mesh computing on them)  There are probably other more suitable processors out there, just leave that cube as "Processor" until you get things a bit firmer.

It sounds a really interesting project


问:
What is the easiest yet precise method one can make a track and a train
I would like to put a train on a track and control its movement with high precision left and right using a wireless controller.

What is the best way to do it?

答:
Buy a train set, build it, put the train on it.

Now take the Train track controller take the speed/direction knob off.
Buy a remote control car, take the rear wheel off, hook the axel of the car to the train controller and use the RC controller to control your train.

If you want a more detailed answer then you need to put more detail in your question.
What model train is it?
How do you currently control the trains speed and direction?
What distance does the control need to operate at?
What is your definition of high precision, a few mm or nanometres?
What do you mean by best?  Cheapest, easiest, highest precision?
What is the maximum lag between command and response?


问:
Quadrotor - Control system, where to begin?
I am starting to assemble a quadrotor from scratch.

Currently, I have this:

Structure;

an IMU (accelerometer, gyro, compass);

4 ESCs and DC motors;

4 propellers;

Raspberry Pi to control the system, and;

LiPo battery.

I have calibrated the ESCs and the four motors are already working and ready.
But now I am stuck.

I guess the next step is to dive deeply in the control system, but I am not sure where to begin. I read some articles about the control using PIDs, but I don't know how many should I use, or whether I need to model the quadrotor first to compute kinematic and dynamic of the quadrotor inside the RPi.
Sorry if the question is too basic!

More details

The structure is from a kit. Well, all I have now is the ESCs calibrated, although I do not have documentation of them to adjust the cut off voltage for the LiPo battery. I have been made tests with some Python code I found to have PWM outputs for the motors and to control I2C bus to communicate with IMU.

One of my problems now is that I need RPIO library for PWM and the quick2wire-python-api to work with the I2C libraries from the MIT to control my IMU but as far as I know RPIO works with Python2 and quick2wire works with Python3 so I don't know how to manage this.

So actually, I have no code yet to control the four motors in parallel, only have testing code to test them separately and also with the IMU.

About the IMU, I am still learning how to work with it and how to use the MIT library. The unit includes those sensors:

ADXL345

HMC5883L-FDS

ITG3205

You can see a picture of the quadrotor below,

So as I said before, I would like to know how to handle the control system and how it is implemented inside the Raspberry Pi, and then start to work with the Python code to assemble the motors, the IMU and the control.

答:
I would advise against using a Raspberry Pi for your flight control. The Raspberry could be used for higher level decision making algorithms with regards to automation of your vehicle, but the vehicle also needs some real-time algorithms that can react instantaneously to deviations from desired attitude, etc.

The reason the Raspberry is not the best for this is because it is OS based which means that at any moment in time it could preempt your flight control logic in order to service another request from the OS. This is not what you want. I'm not saying its impossible to do this on an ARM chip but using a Linux based solution would be less than optimal.

There are Arduino boards that are ARM based which are not pre-emptive, but then there are also less expensive arduino (AtMel chips) that would have ample processing speed to handle the flight controls.

There are several affordable of flight controllers that are available to the hobbyist including:

Naze

Ardupilot

MultiWii

CC3D

KK2

If you are wanting to write the software yourself, I would suggest buying a MultiWii or CC3D board. Those are basically an arduino with all of the sensors that you would need to control a flying vehicle already attached to the board (accelerometers, gyros, barometer, magnetometer) and with serial ports so you can easily attach GPS, On-screen displays, radio links, etc, etc. Then you only need the basic Arduino developer's kit (opensource) to start coding in C.

You can check into other opensource software solutions that will work on some of these boards such as MultiWii, ArduPilot or OpenPilot.

I would strongly suggest starting with one of these ready-to-go solutions first as you will soon discover that your vehicle will require plenty of attention as far as tuning, balancing and calibrating before it will be airworthy. You might discover that your design isn't well suited to the motors you bought and you might have to buy different kV motors or adjust prop sizes to compensate. Once you know it can fly then you might want to start experimenting with adjusting the code in the existing opensource packages or if you're really bold, build new code from scratch.


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

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

答:
A surface that appears black doesn't reflect much visible light (it's the absence of visible light reaching your eye that makes it look black), if the surface also doesn't reflect IR light very well, then IR sensors will not work very well (they work by shinning IR light and measuring the intensity of the IR light reflected back). Note you can not tell with certainty whether a surface will reflect infrared by looking at it since you cannot see IR, but if it is the case that your surface isn't reflecting IR, then no IR sensor will work.

Have you considered using an ultrasonic distance sensor (aka ultrasonic rangefinders)? They work using the same principal but with sound (outside of auditory spectrum) instead of light. Or a mechanical sensor?


答:
I agree that this is quite an interesting project. There are several concerns here.

I think you need to check the dimensions of all the small arduinos to determine whether it can fit in your modules. If not, you probably have to create your own circuit with atmega chip as the controller.

The positioning of the IMU is not crucial if you are only concerned about the robot's orientation like yaw, pitch and roll. But if you want to measure angular velocity and angular acceleration, then the positioning is important because you have to take into account the centripetal force effect on the IMU.

Title: What are hardware components to build a modular robot which consists of several 5x5x5cm modules?

Body:
I am computer science student and I have no knowledge on robotics.

In my project, I am trying to find controllers for modular robots to make them do specific tasks using evolutionary techniques. For the moment I am doing this in a simulator, but if I want to make physical robots I have to know a priori the components to add to the robot, where do I place them, especially if modules of robot are small (cubes of 5*5*5cm)...

So my questions are:

What are must have components to make physical robot ? (arduino, batteries, sensors, ...)

For a small robot how many batteries do I need ?

If modules have to communicate with wifi, do I have to put a wifi card on each module?

I want to add an IMU. Is its position important, I mean do I have to put it in the middle of the robot ?

Thank you very much.


问:
Create 2 CAD files
I found CAD files for the Create on the ROS TurleBot download page (.zip),
and shells on the gazebo sim page.

Any ideas where the files for the Create 2 could be found?

答:
The CAD you pointed out is for the Turtlebot, and includes electromechanical CAD for that assembly. I only spot-checked a few files, but the only Create-relevant CAD in that package I found was an STL of the robot's outer dimensions. The Create 2 manual should have enough information for someone to produce a solid model of similar precision, but I do not believe iRobot has released a shell for the robot, yet. Maybe you should make one and put it on a site like Thingiverse? There are other designs by iRobot that can be found there for various parts of the robot, like the bin.

 Please note that I am an iRobot employee, but the postings on this site are my own and don't necessarily represent iRobot's positions, strategies, or opinions.

Title: Create 2 CAD files


问:
Angular velocity to translational velocity
I have a 3D point in space with it's XYZ Coordinates about some Frame A. I need to calculate the new XYZ coordinates, given the angular velocities of each axis at that instant of time about Frame A

I was referring to my notes, but I'm a little confused. This is what my notes say:
http://imgur.com/yJD8OUi

As you can see, i can calculate the angular velocity vector w given my angular velocities. But I'm not sure how this translates to how to calculate my new XYZ position! How can i calculate the RPY values this equation seems to need from my XYZ, and how can i calculate my new position from there

答:
Overall, you simply need to rotate each point in your cloud using the rotation matrix $R$. That rotation matrix will be the latest rotation matrix for your vehicle/sensor. You can compute the rotation matrix based on the current values for roll, pitch, and yaw according to the following:

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

Where $\psi$ is yaw, $\theta$ is pitch, and $\phi$ is roll.

To get the latest roll, pitch, yaw angles you will need to integrate the current roll, pitch, yaw angle rates. Typically, you will be measuring the body angular rates using an IMU, but these rates are (a) not in the world frame and (b) not in roll, pitch, yaw form.

First, you need to transform the body-frame angular rates into world-frame angular rates. To do that, simply pre-multiply the body rates by the current rotation matrix:

$\omega_o = R \omega_b$

Where $\omega_o = \begin{bmatrix} \omega_{o,x} \\ \omega_{o,y} \\ \omega_{o,z}\end{bmatrix}$ are the world-frame angular rates and $\omega_b = \begin{bmatrix} \omega_{b,x} \\ \omega_{b,y} \\ \omega_{b,z}\end{bmatrix}$ are the body-frame angular rates.

Now that you have the angular rates about each axis in the world frame, you can use that equation you linked to in your question to convert to roll, pitch, yaw rates:

$\begin{bmatrix} \omega_{o,x} \\ \omega_{o,y} \\ \omega_{o,z}\end{bmatrix} = \begin{bmatrix} c_\psi c_\theta & -s_\psi & 0 \\ s_\psi c_\theta & c_\psi & 0 \\ -s_\theta & 0 & 1 \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta} \\ \dot{\psi} \end{bmatrix} $

$\omega_o = E \omega_{rpy}$

Note that you are starting with $\omega_o$ and finding $\omega_{rpy}$, so that means you need the inverse of $E$, and you'll need to watch for singularities (when $\cos \theta = 0$).

$\omega_{rpy} = E^{-1} \omega_o$

Then integrate the rates to get new roll, pitch, yaw angles, where $\tau$ is your time step:

$\phi_{k+1} = \phi_k + \dot{\phi}_k \tau$

$\theta_{k+1} = \theta_k + \dot{\theta}_k \tau$

$\psi_{k+1} = \psi_k + \dot{\psi}_k \tau$

Those new roll, pitch, yaw values give you a new rotation matrix. Then just rotate the points in your point cloud accordingly. Keep in mind that you want to predict the new point cloud in the body frame as your question states. This rotation matrix takes vectors in the body frame and defines them in the world frame, so you need to do the opposite, which just means using the inverse of the rotation matrix.

So, for a point $p_{o,i}$ in the world frame, its coordinates in the body frame $p_{b,i}$ are defined by:

$p_{b,i} = R^{T} p_{o,i}$

Where the transpose $R^T$ is the same as the inverse $R^{-1}$.

Also note that my equations might look a bit confusing since I am only including the time step index $k$ when showing the forward integration of roll, pitch, yaw angles. You'll be using the rotation matrix from the previous time step to convert the angular rates in the current time step to the world frame, then updating the roll, pitch, yaw rates and angles, and then computing the rotation matrix for the current time step in order to transform your point cloud (unless this is part of a graph-based solution).


问:
Real-time video processing on video feed from a drone's camera
I am working on a project where I want to run some computer vision algorithms (e.g. face recognition) on the live video stream coming from a flying drone.

There are many commercial drones out there that offer video streams, like

http://www.flyzano.com/mens/

https://www.lily.camera/

etc..

But none of them seem to give access to the video feed for real-time processing.

Another idea is to have the drone carry a smartphone, and do the processing on the phone through the phone's camera. Or just use a digital camera and an arduino that are attached to the drone.

Although these ideas are feasible, I would rather access the video-feed of the drone itself. So my question is that are there any drones out there that offer this feature? or can be hacked somehow to achieve this?

答:
I bought an AR done 2.0 for my research.

I used Labview to process the realtime video feed from either the bottom camera of the drone or the front camera.

You can read more details on how to setup the 3rd party free library to use Labview to control and to receive realtime sensors data and video feed as well:

AR Drone Toolkit for LabVIEW - LVH


问:
Sizing high current power supplies for large robots
I'm a researcher in a lab that's starting work on some larger humanoid/quadruped robots as well as a quadcopter. Currently, we have several power supplies that have a max rating of 30V/30A and our modified quadcopter easily maxes out the current limit with only half of its propellers running. It seems like most power supplies are meant for small electronics work and have fairly low current limits. I think that I want to look for power supplies that are able to provide between 24-48V and higher than 30A for an extended period of time.

1.) Is this unreasonable or just expensive?
2.) Do most labs just connect PSUs in series to get higher voltages?

Thanks for the input.

答:
1) A powersupply with 1kW is definetly not enought for lab tests with mobile robots, especially with quadrotors. If you do naive fallacy your quadrotor is limited to around 4 kg. Take the main frame with the motors, place a decent 2D or even 3D scanner on it and a CPU which can handle some data, and the quadrotor will be more than 4kg. I have seen quadrotors with peak power of around 10kW. I recommend using a power supply which can provide a bit more then the power which is needed to hover the quadrotor (rule of thumb: 250Watt/kg).
 The mobile robot should use less then the quadrotor in most cases.

2)Connect them in series for more Voltage... sure no problem at all.
But connecting them in parallel for more current...Don't do this the current flowing across the PSU can fry them easily.


答:
Ultrasonic sensors have a deadband of about 2-5 cm, so wouldn't be useful for close-range sensing. Also ultrasonics work best with hard, solid surfaces. Carpet, clothing, drapes, cushions, etc. will absorb much of the ultrasonic pulse and are likely to result in a faulty reading with the target appearing much further away than it really is.

The key for any sort of "cliff sensor" is that you are looking for a change in measurement by a significant value from previous measurements. I've built robots before that are programmed to avoid table edges and were using IR sensors. The heuristic for avoiding a table edge or stairway isn't to look for a specific value but a large change.

So, something like:

```<code>//assuming distance is measured in raw sensor values vs. cm or inches.
if ( abs(cur_distance - last_distance) > 100)
{

 //do some avoidance logic here

}
</code>```

This will work even if the sensors return weak or off-scale measurements when passing over a dark surface.

Title: Small IR distance sensor that works on black surfaces

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

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

Body:
Ultrasonic sensors have a deadband of about 2-5 cm, so wouldn't be useful for close-range sensing. Also ultrasonics work best with hard, solid surfaces. Carpet, clothing, drapes, cushions, etc. will absorb much of the ultrasonic pulse and are likely to result in a faulty reading with the target appearing much further away than it really is.

The key for any sort of "cliff sensor" is that you are looking for a change in measurement by a significant value from previous measurements. I've built robots before that are programmed to avoid table edges and were using IR sensors. The heuristic for avoiding a table edge or stairway isn't to look for a specific value but a large change.

So, something like:

//assuming distance is measured in raw sensor values vs. cm or inches.
if ( abs(cur_distance - last_distance) > 100)
{

 //do some avoidance logic here

}

This will work even if the sensors return weak or off-scale measurements when passing over a dark surface.


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

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

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

I have two questions regarding the heating:

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

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

thanks a lot!

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

Yes plain copper wire does have very low resistance, so I guess you would need a power supply which has a low voltage and high current to do this. (And a suitable high current controller to do the actual switching, unless you're starting with just a manual switch.)

Alternatively you could perhaps look at nichrome wire which has a higher resistance and is commonly used for lots of heating wires.

Whichever heating wire you use, beware of hot wire touching the nylon directly and cutting or otherwise damaging it. I assume these "muscles" work by heating the nylon to some specified, fairly low temperature but I haven't seen any real detail about how they arrange the heating...


问:
How to Identify Objects in Space
Using a depth sensing camera like Kinect, I would like to retrieve the position of an predetermined object (e.g. a cup, fork etc so that I would ultimately be able to grab the object). What would be a way to achieve this?</p>

答: If you want to recognise a predetermined object (so one that you have seen before) in a 3d scene. It seems this would work similar to the 2d case: using features. Only in this case using 3d feature extractors/descriptors. You provide your model (so the object that you have seen before), and find salient features in the model. In your new scene you also perform feature extraction and then compare the features with your model. If they match well enough, you have found your object. Have a look at the pcl tutorials on the subject.</p>

Title: How to Identify Objects in Space


问:
Kinematic decoupling
Is kinematic decoupling of a 5DOF revolute serial manipulator also valid?
The three last joints is a spherical joint. Most literatures only talks about decoupling of 6DOF manipulators.

Thanks in advance,
Oswald

答:
Kinematic decoupling really depends on the configuration of your particular manipulator. When you decouple the wrist, it is typically so that you can take any given end-effector pose and determine the required wrist configuration separately before determining the required arm configuration that puts the wrist-connecting joint at the required location.

Typically, the wrist needs to be able to provide the 3 DOF necessary to achieve any orientation for this to be possible. The position of the innermost wrist joint itself is then the desired position for the end of the rest of the manipulator (3 or 4 other DOF). If your wrist provides 3 DOF with a spherical configuration as you mention, then it meets this requirement.

However, if you only have 5 DOF then that means you are underactuated for full 6 DOF end-effector space -- you could come up with an end-effector pose that is impossible to achieve. On the other hand, if you are constraining yourself to work with end-effector poses that you know are possible, then decoupling the wrist will work.

Decoupling the wrist just makes it easier to analyze the inverse kinematics since you can solve for the wrist joint angles separately. In general, the technique could be applied to a wrist that is constrained to planar motion or pan-tilt type rotation only, as long as the desired end-effector pose is achievable.

Title: Kinematic decoupling


问:
How can I reduce a motor's maximum current draw?
I have a motor with a stall current of up to 36A. I also have a motor controller which has a peak current rating of 30A. Is there any way I could reduce the stall current or otherwise protect the motor controller?

I realize the "right" solution is to just buy a better motor controller, but we're a bit low on funds right now.

I thought of putting a resistor in series with the motor and came up with a value of 150mΩ, which would reduce the maximum current draw to 25A (given the 12V/36A=330mΩ maximum impedance of the motor). Is there any downside to doing this? Would I be harming the performance of the motor beyond reducing the stall torque?

答:
Heat is an important problem with a series resistor used to limit stall current.  Wattage of I amperes through R Ω is I²R, so 7.35 watts of heat are produced at the motor's nominal 7 A operating current, and 93.75 W at a 25 A stall current.

You can avoid some loss at the 7 A level by using an inexpensive light bulb as a resistor.  The filament's resistance increases approximately as the square of current (more accurately, as the 1/.55 power; see page 3 of A Primer on Driving Incandescent Lamps via PDF link at allegromicro.com ).  For example, a 100 W, 4 V light bulb will drop about 3.75 volts at 25 A, vs. about 0.37 V at 7 A, for a loss of only 2.6 W instead of the 7.35 W a fixed .15 Ω resistor would be dissipating at those currents.  However, in general light bulbs are more fragile than fixed-resistance power resistors.

Various motor starters are available that shut off in case of overload.  Typically, in case of overload a small resistor heats up a bimetallic strip – somewhat like a thermostatic action – causing it to open a contact.  Different resistors can be used to select different opening currents.  See eg a practicalmachinist.com thread about heaters.  More-modern motor starters may use Hall-effect sensors.


答:
UPDATE Based on the comment below that the answer is not correct:

Kinematic decoupling divides the inverse kinematics problem into two parts. Coordinates of the wrist center point are calculated and based on those all the joint angles behing the wrist center point have to be determined. If this is possible, kinematic decoupling can be applied in you case. In other words if you can calculate a number of coordinates of the wrist center point that fully determines all joint angles behind your wrist center point than ... there you have it... kinematic decoupling works for you...

The original answer:

Yes, kinematic decoupling will work under 1 condition. You have to be able to determine the XYZ coordinates of your wrist center point (where the wrist axes intersect eachother) from the desired end effector coordinates. If the IK is solvable or not for the given input (i.e. the pose can be reached) is not a question of the kinematic decoupling but a question of the inverse kinematics

I may have been to fast in assuming XYZ, other coordiantes might be OK, depending on how many joints are there behind the wrist, XY could be enough.

If you have 5 DOF and have the desired TCP coordinates (X, Y, A, B, C) you cannot calculate XYZ of the wrist center point, but not calcualting XYZ may be ok, if the coordinates you can calculate are enough to determine all joint angels before the wrist center point., So if you have X and Y of the wrist center point, and 2 joint before the wirst center point, if the X and Y coordaintes fully determine the q1 and q2 angles, kinematic decoupling can be used to write the IK equations.

Title: Kinematic decoupling

Body:
Is kinematic decoupling of a 5DOF revolute serial manipulator also valid?
The three last joints is a spherical joint. Most literatures only talks about decoupling of 6DOF manipulators.

Thanks in advance,
Oswald


答:
First of all the link you posted states that your motor driver carrier board has built-in overcurrent protection...so...where is the problem?

If it does not have:

Put a fuse in series with the motor that will protect the controller (you can find slow fuses that allow higher current for short time). Then implment a current control loop with output saturation, basicly you give the pwm to the motor based on current (in mechanical terms it will be a torque controller with a maximum torque as a parameter). That way you have the fuse as a fallback safety and operationally if everything works finewith the current controller you can be sure that the fuse will not be used.

I assume you need velocity controll or position control for the motor, that is no problem, just use cascading control loops where the inner loop in is a current (torque controller) the middle loop is a velocity controller and the outer loop is a position controller, like this. It is the way industrial drive amplifiers for motion control work...

Title: How can I reduce a motor's maximum current draw?

Body:
I have a motor with a stall current of up to 36A. I also have a motor controller which has a peak current rating of 30A. Is there any way I could reduce the stall current or otherwise protect the motor controller?

I realize the "right" solution is to just buy a better motor controller, but we're a bit low on funds right now.

I thought of putting a resistor in series with the motor and came up with a value of 150mΩ, which would reduce the maximum current draw to 25A (given the 12V/36A=330mΩ maximum impedance of the motor). Is there any downside to doing this? Would I be harming the performance of the motor beyond reducing the stall torque?


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

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

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

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

答:
It is arguable what is called reactive and what is not... however what is measured by sensors and what information the controller possesses is not arguable.

In feedback control, the system's outputs are measured and if they do not match the desired output (reference) the controlled parameter is recalculated. If the input does not change, these differences usually come from disturbances. The controller has a feedback from the system's output which quantifies "how far" it is from the desired state, regardless of what causes this difference.

In feedforward control, the disturbances are measured and the controlled parameter is calculated based on some mathematical (or logical) model. There is no feedback to see if the system is really in the desired state or "how far" it is from the desired state. If disturbances that are not measured cause the system's outputs to differ from the desired one, the controller will not react.

So to formulate it with "reactive" I would say that feedback control is reactive since it reacts to changes in the system's output while feedforward is proactive since it acts before the system's output change. The important factor in control theory is the controlled system output; that is probably why reactive is defined from the point of view of the change in the system's output.

Feedforward also reacts to something, but this something is not the system's output so from the point of view of the system's output it is not reactive. In feedforward control, the system's output can change without any reaction from the controller while in feedback control any change in the system output will provoke a reaction of the controller. Since the important aspect is the system's output and the feedforward controller does not react to changes in the output it can be considered a non-reactive control method.

Illustration from Wikipedia, (a) open loop, (b) feedforward, (c) feedback


问:
Dynamic simulation of compliant elements in quadruped robot
I have a preliminary design for a legged robot that uses compliant elements in the legs and in parallel with the motors for energy recovery during impact as well as a pair of flywheels on the front and back that will oscillate back and forth to generate angular momentum. I'd like to create a dynamic simulation of this robot in order to be able to test a few control strategies before I build a real model. What simulation package should I be using and why?

I have heard good things about MSC Adams, namely that it is slow to learn, but has a lot of capability, including integration with matlab and simulink. I have also heard about the simmechanics toolbox in matlab, which would be nice to use since I already am decent with CAD and know the matlab language. I am not yet familiar with simulink, but have used Labview before.

答:
Matlab Simulink has a blockset called Simmechanics. It is very well suited for robotic simulation (it is ment for multibody mechanics simulations). It is a bit tricky to set it up for mobile robots (get the force reaction from the ground) but you can find demos and examples to do that. Like this.

Compliance is however more tricky. If you want to simulate it exaclty, you will need to used a Finite Element Analysis software (e.g Ansys, CosmosWorks for SolidWorks, ...). If you are fine with very very rough approximations of the compliance simulation you can set up additional joints in SimMechanics with a spring damper actutation which will act as a comliant joint. Like this.

I have never worked with Adams, but I assume in your case it does not offer any additional functionality when compared to SimMechanics. However it might be easier to implement mobile robots in Adams. I do not know if Adams can also do finite element simulations.

I am a bit worried about simulating the oscillations with any multibody simulations tool. Normally in multibody simultations a sample time of 1ms is enough. In your case the sample time will very much influence how precisly the oscilations will be simulatied and a 1 ms sample time might make your model unusable (if you have 1khz oscilations, you would have 1 sample from each oscillation, which is unusable).Pease make sure to colerate the sample time with the oscilations, as a rule of thumb I would recommend 10 samples per oscilation (I think the Nyquist theorem recommends at least 2)


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

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

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

Thanks!

答:
Working with a low voltage power supply, which is not modified/hacked is way less dangerous then a robot arm with 120Watt. This guy will hurt you more. Anyway your idea with the power supply of a computer is a pretty economic one. Sure there are 6Volt AC/DC Converters on the market. They just cost a bit in a 120Watt version. But the question which remains is how to get the 6Volt out of the 12Volt power supply?

My suggestion: Use basic LM350 chips. Those little guys provide you with an adjustable voltage and up to 3amps. Place one curcuitry before each motor and you are fine. These chips are not voltage controlled. You adjusted them with a resistor at one pin. There are other chips which are voltage controlled (also for 6volt) but I can't remeber their names right now. With this setup you have to buy parts for around 10USD (I assumed you will find an old computer power supply).