问:
How can I improve the map in my Mobile Autonomous Robot using KINECT

A little background of my aim

I am in the process of building a mobile autonomous robot which must navigate around an unknown area, must avoid obstacles and receive speech input to do various tasks. It also must recognize faces, objects etc. I am using a Kinect Sensor and wheel odometry data as its sensors. I chose C# as my primary language as the official drivers and sdk are readily available. I have completed the Vision and NLP module and am working on the Navigation part.

My robot currently uses the Arduino as a module for communication and a Intel i7 x64 bit processor on a laptop as a CPU.

This is the overview of the robot and its electronics:

The Problem

I implemented a simple SLAM algorithm which gets robot position from the encoders and the adds whatever it sees using the kinect (as a 2D slice of the 3D point cloud) to the map.

This is what the maps of my room currently look like:

This is a rough representation of my actual room:

As you can see, they are very different and so really bad maps.

Is this expected from using just dead reckoning?

I am aware of particle filters that refine it and am ready to implement, but what are the ways in which I can improve this result?

Update

I forgot to mention my current approach (which I earlier had to but forgot). My program roughly does this: (I am using a hashtable to store the dynamic map)

Grab point cloud from Kinect

Wait for incoming serial odometry data

Synchronize using a time-stamp based method

Estimate robot pose (x,y,theta) using equations at Wikipedia and encoder data

Obtain a "slice" of the point cloud

My slice is basically an array of the X and Z parameters

Then plot these points based on the robot pose and the X and Z params

Repeat

答:
I'd suggest that you try particle filters/ EKF.

What you currently do:

--> Dead Reckoning: You're looking at your current position without any reference.

--> Continuous Localization: You roughly know where you are in the map.

If you don't have a reference and don't know where you are on the map, regardless of what actions you take, you will find it dificult to obtain a perfect map.

For example:
You're in a circular room. You keep moving forward. You know what was your last move. The map which you get will be that of a straight box like structure. This will occur unless and until you have some way to localize or to know where are you precisely on the map, continuously.

Localization can be done via EKF/Particle Filters if you have a starting reference point. However, the starting reference point is a must.


问:
Confusion in fixing DH frames
I am analyzing a concept of a surgical robot with 4 revolute joints and one sliding joint. I am not able to fix the coordinate frame for last prismatic joint.
Following are the schematics of robot and DH frames I have fixed

As X4 axis and X5 axis are intersecting each other, I am not able to capture joint distance variable(di) for the slider. How can I fix this?

Following are the parameters for rest of the frames

Updated Frames:

答:
Add a coordinate system that matches the previous coordinate system exactly.   The last rotary joint will be the parameter for the next-to-last coordinate system, and the link length will be the parameter for the prismatic joint.  </p>

<p>Note:  a simpler approach is possible, but this gets the job done easily.  </p>

ContentLicense: CC BY-SA 3.0

Title: Confusion in fixing DH frames

Body:
Add a coordinate system that matches the previous coordinate system exactly.   The last rotary joint will be the parameter for the next-to-last coordinate system, and the link length will be the parameter for the prismatic joint.

Note:  a simpler approach is possible, but this gets the job done easily.


问:
How many robots is considered to be a robotic swarm not a group of robots?
Does the literature on swarm robotics define the smallest number of robots required to make a "swarm".

Is it 10, 20 or 100 robots, or does the name depend on something other than the number of robots?

答:
A robot swarm is defined by its behaviour, rather than the number of robots it contains. Swarm robots:

"... are coordinated in a distributed and decentralised way"

[Iñaki Navarro and Fernando Matía: An Introduction to Swarm Robotics, 2012]

The key feature of swarm behaviour is self-organisation, i.e. the emergence of a global, complex pattern of behaviour based on local-level interactions between low-level, "simple" but autonomous components of the system.

"Swarms" are typically described in the literature as "large" numbers of robots. However, there is no real reason why much smaller groups of robots couldn't exhibit "swarm behaviour".

In the case of just two robots, they would probably be described as "paired robots", rather than as a swarm. However, I have seen groups of three robots described as "swarms" in research papers (for example, in this 2015 description of a Counter Abstraction Technique for the Verification of Robot Swarms from UCL).

It should be noted that in many applications, a distinction is drawn between "multi-robot systems", where inter-robot communication is not essential to the operation of the system, and true "robot swarms", which are defined by inter-robot communication. The two systems may involve similar, large numbers of robots, but are distinguished on the basis of their behaviour. This idea is explored in some depth in this 2011 paper on multi-robot exploration.


问:
Daisy chaining resistors for an LED circuit
Please note: although this question involves a Raspberry Pi (hereafter RPi), it is really a pure robotics question at heart!

I am trying to connect my RPi 1 Model A to a breadboard with a single, simple LED on it. The LED is rated at 1.7V and 20mA. The RPi's GPIO pins are providing 3.3V of power and are not really meant to exceed 16mA. So my circuit needs a resistor, and I believe its calculation is as follows:

```<code>R = V differential / I
  = (3.3V - 1.7V) / .02A
  = 1.6V / .02A
  = 80 ohms
</code>```

If I'm understanding this calculation correctly, that means that providing my LED circuit with 80 ohms or higher will safely limit the current on the circuit.

Problem is, I only have 47-ohm resistors available to me. So I'm wondering if I can daisy chain two 47-ohm resistors (for a total of 94 ohms, which is greater than the 80-ohm requirement) and not fry the RPi and/or the LED?

Here's my wiring:

In the pic above:

A red jumper connects a GPIO pin to a place on the breadboard; this feeds power to...

The first 47-ohm resistor; this then feeds power to...

The 2nd 47-ohm resistor; this then feeds power to...

The LED's anode; the LED is powered and power flows out of the cathode to...

A pair of jumpers (small yellow one and then a brown one) that lead back to the GND on the RPi

Here's a slightly better angle of the breadboard:

So I ask: will I fry my pi with this setup? Have I calculated resistance correctly (80 ohms)? Can I daisy chain two 47-ohm resistors together? Anything look "off" about my wiring setup in general? Thanks in advance!

答:
Short answer: this will work unless you keep the LED on more than 94% of the time.

The diode will turn on at 1.7V and take as much current as the circuit can provide. Your equation is correct, if you want the circuit to pull current $I$, then your resistance is:
$$R = (3.3-1.7)/I = 1.6/I$$

Using $R=80 \Omega$ will set your current to 20mA, but this is what your LED is rated for and exceeds the raspberry pi's specs. To stay below 16mA, you want $R\ge 100\Omega$.

In practice the limit for the raspberry pi will be based on average power rather than a maximum current. Using your $94\Omega$ resistor should be fine if you use a PWM signal with less than 94% duty cycle. Even with 100% duty cycle you're probably within the margins built into the specifications, but I would advise against it.

If you want to get really fancy, you can put two $47\Omega$ resistors in series with another 8 resistors in parallel to get a $99.875\Omega$ equivalent resistor.

Your wiring set-up looks good, assuming you connect the yellow wire to ground.


问:
How to build an autonomous navigation system for robots?
I like to know can we make a web site or application(or using something free like google map) to routing a way and our robot can follow the line exactly? For example I like to build a quad-copter and specify some streets on the map and my quad-copter flies upon that specified streets.</p>

答:
In order to implement the line following function you need to make several design choices which will affect your robot performance and accuracy.

Here are some examples:

GPS Coordinates: using a GPS receiver the robot can navigate through a set of waypoints represented as coordinates (or elevated coordinates for an UAV) to follow;

Compass Heading: using a calibrated compass can lead the vehicle on a certain path with a given set of headings;

Inertial Navigation: using a IMU and EKF the robot can estimate its position knowing the starting point, however the accuracy will be highly dependent on the quality of the sensors (commercial grade IMUs are not suitable for precise odometry).

To set up waypoints on the run you can use either a radio, a web (socket, HTTPSync, REST, ...) or satellite link.
There's lots of choices for the GUI too, ranging from a native app to a web interface or a traditional software.

To recap, if you can specify the sensors you would like to use and the communication channel I can expand on that.

References

Inertial Navigation System

Compass navigation for robots

ArduPilot Mission Planner

ROS web interface builder


问:
Calculating the covariance matrix of a measurement
I want to estimate the covariance matrix of a measurement for a robot evolving on plane and having the following state vector.
$$
X
=
\begin{bmatrix}
x\\
y\\
\theta
\end{bmatrix}
$$
$x$ and $y$ are the coordinates in $XY$ plane et $\theta$ the heading angle.

The measurement is taken from a place recognition algorithm which returns an pose
         $$z=
      \begin{bmatrix}
         x_{m}\\
         y_{m}\\
        \theta_{m}
      \end{bmatrix}
       $$

The covariance matrix of the measurement should have the following form

$$
\Sigma
=
\begin{bmatrix}
\sigma_{x}^2 & 0 & 0 \\
0 & \sigma_{y}^2 & 0 \\
0 & 0 & \sigma_{\theta }^2 \\
\end{bmatrix}
$$

How to calculate $\sigma_{x}$ for example given that I have the ground truth pose  $$ground_{truth}=
      \begin{bmatrix}
         x_{gt}\\
         y_{gt}\\
        \theta_{gt}
      \end{bmatrix}
       $$
and the measurement $z$

答: The co-variance matrix of the whole system reflects the uncertainty in the system. $\sigma_{xx}$ more precisely than $\sigma_x$ reflects the uncertainty in the x position. Since the off-diagonal elements are zeros (i.e. it is not always the case but for the sake of simplicity one assumes so), there is no correlation. This means the uncertainty in x position has no effect on the y position and the heading angle. The first element in the co-variance matrix is $\sigma^2_{xx}$ in your case, therefore, taking the square root of it, it gives you the uncertainty $\sigma_{xx}$ in the x position. </p>


问:
Project ideas for Robot modeling
I am a 1st-year grad student majoring in robotics. I have the opportunity to select and execute my own projects for a course called Robot Modeling. For the project, I have decided to model a UR5 and perform trajectory planning. The task would be to pick an object from one place and deploy it to another place while avoiding any obstacles in between. I am constrained to use MATLAB Simscape multibody for my project and it will only be a simulation.

Is the problem statement challenging enough to be completed in 8 weeks?(assuming I can dedicate 5 hours a week). I would love to hear some take on problem statements that would make this more interesting or challenging problem statement for me.

Thanks!

答:
Is the problem statement challenging enough to be completed in 8
  weeks?

It is hard to tell. In this project, you are tackling several problems at once. All of them requires a solid and at least an advanced-intermediate level of knowledge in physics, math, programming and robotics. For real-case scenario, probably the problems are less in comparison with simulation because you don't need to handle modeling the system. What I would say is 8 weeks are enough but you need extra work than 5 hours (i.e. may be 10). For your case, what I would suggest is to do the following:

1- (Half Week) Finish modeling the system (i.e. requires physics knowledge and half week for this problem is enough). Use Newton's or Lagrangian's approaches. Come up with the differential equations that govern the motion of the system. For saving time, you may consider reading some articles that already done this work with this robot.

2- (Half Week) Finish solving the differential equations (i.e. requires math and in particular numerical method knowledge and programming, matlab will do the hard work for you). Put the ODEs equations in a compact form.

3- (One Week) Choose control approach to move your robot from one point to another. In your case, I will carry out the PD-computed torque controller. It is simple and efficient if you don't have uncertainty in the system, if you do then choose PID-computed torque approach. Perform several tests to make sure that the robot is ready to follow the trajectory efficiently with a reasonable speed. At this stage your robot can move and follow any trajectory BUT it doesn't react with the environment.

4- (Two Weeks) Be acquainted with how the robot interacts with the environment in order to pick up objects (i.e. requires some robotics knowledge). Also, you need to understand how to get data from sensors and let the robot decide for a proper action. For example, when the robot should pick up an object? How does robot know?

5- (Two Weeks) understand obstacles avoidance approaches (i.e. requires some robotics knowledge). Pick up the simplest approach since you don't have an ample time to handle different approaches.

Title: Project ideas for Robot modeling


问:
Ackerman steering model
I am trying to create a simulation of a robot with Ackerman steering (the same as a car). For now I'm assuming that it's actually a 3-wheeled robot, with two wheels at the back, and one steering wheel at the front:

Knowing the wheel velocity, and the steering angle a, I need to be able to update the robot's current position and velocity with the new values at time t+1.

The obvious way to do this would be to calculate the position of the centre of rotation, where the axles of the wheels would meet, however, this leads to an undefined centre of rotation when a = 0. This means that the model doesn't work for the normal case of the robot just driving in a straight line.

Is there some other model of Ackerman steering which works over a reasonable range of a?

答:
I am not sure if this is what you are looking for but the simplest odometry equations for ackermann steering go as follows:

```<code>//basic velocity inputs
propel = 0.0; //m/s from rear wheels
steer_angle = a; //radians
delta_t = 0.03; //seconds

//compute odometry values from joint angles
//first get the theta update
delta_th = (propel/L)*std::tan(steer_angle);

//compute odometry update values
delta_x = propel*std::cos(position_th + ((delta_th*delta_t)/2.0));
delta_y = propel*std::sin(position_th + ((delta_th*delta_t)/2.0));

//now update our pose estimate
position_x = position_x + delta_x*delta_t;
position_y = position_y + delta_y*delta_t;
position_th = position_th + delta_th*delta_t;
</code>```

Maybe this will help someone.

Title: Ackerman steering model

Body:
I am not sure if this is what you are looking for but the simplest odometry equations for ackermann steering go as follows:

//basic velocity inputs
propel = 0.0; //m/s from rear wheels
steer_angle = a; //radians
delta_t = 0.03; //seconds

//compute odometry values from joint angles
//first get the theta update
delta_th = (propel/L)*std::tan(steer_angle);

//compute odometry update values
delta_x = propel*std::cos(position_th + ((delta_th*delta_t)/2.0));
delta_y = propel*std::sin(position_th + ((delta_th*delta_t)/2.0));

//now update our pose estimate
position_x = position_x + delta_x*delta_t;
position_y = position_y + delta_y*delta_t;
position_th = position_th + delta_th*delta_t;

Maybe this will help someone.


问:
qt ros tutorial issue
I am working on a robotic application under R.O.S. groovy Galapagos.
I would like to make a tutorial about how create a template app with catkin_create_qt_pkg.
I'm unable to call the script catkin_create_qt_pkg from my catkin workspace.
I found it at the root : _/opt/ros/groovy/qt_ros/qt_create/script_
But even if I try to execute it as sudoer I got an error.

ImportError: No module named qt_create

I'm unable to determine what I have to do to make it work.

Why?

答: You will get better help for this question by asking on http://answers.ros.org, which is a similar, but more specific forum.</p>

Title: qt ros tutorial issue


问:
I fused a GPS and IMU and I am wondering if my results make sense
I am trying to fuse a ublox M8 (https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_(UBX-13003221)_Public.pdf) with a MicroStrain IMU (http://www.microstrain.com/inertial/3dm-gx4-25) via a loosely coupled architecture.

I was wondering if there are any suggestions or insights based on the results that I am getting.

I based most of my code off of Paul Grove’s 2nd edition book.
I did a six-point tumble test to calibrate my IMU to get the accelerometer fixed bias, the accelerometer scale factor and the accelerometer misalignment. I also got gyroscope fixed bias. I don’t have a rate table so I can’t get the gyroscope scale factor and misalignment yet.
The filter is not currently estimating any calibration information.

I ran a test of the code for about 6 hours and 40 minutes.

I have a couple of questions about the procedure.

1)  My main difficulty is that I am not sure what I should be expecting from the hardware/integration architecture that I am using. What would you expect after a test of 6 hours with a loosely coupled architecture?

2)  I am also having difficulty deciding on how to tune the filter. Are there any papers/procedures that you recommend for deciding what should go into Q and R Matrices? I tried propagating the IMU standalone to see how quickly it diverged from it’s initial position. I also took gps data to see how it diverged from it’s initial position. I am wondering If the tuning would be a function of my update interval, as well as how long it takes the two systems to diverge to a specified distance.

For my R matrix, I am taking the uncertainty posted by the GPS.
For my Q matrix, I am using the power spectral density. I do have some difficulty understanding the reasoning behind this.

3)  Finally, I am wondering how much you think that estimating calibration information in my filter would help with a long term solution.

EDIT:: Please ignore the xlable for the figures. It says time in seconds was about 28 days. But the test lasted for just 6 hrs and 40 minutes.

答: Do you have a simulation? I would recommend that you simulate the data first to debug and tune your KF. The simulation should model the true IMU outputs (Grove has some details on that) and true position with error models. Start with truth to make sure the KF estimates zero errors, and then add errors one at a time (bias, SF, Misalignment, noise, etc.) to see if those can be estimated. Since it is a simulation you know truth, so you know how well it is working. Once it is debugged and tuned with the errors turned on, then try real data.</p>


问:
Standard deviation calculation for a single measurement
I have a robot that takes a measurement of its current pose in the form

$$
z
=
\begin{bmatrix}
x\\
y\\
\theta
\end{bmatrix}
$$
$x$ and $y$ are the coordinates in $XY$ plane et $\theta$ the heading angle.

I also have ground truth poses
$$
z_{gt}
=
\begin{bmatrix}
x_{gt}\\
y_{gt}\\
\theta_{gt}
\end{bmatrix}
$$
I want to estimate the standard deviation of the measurement.
As the standard deviation formula is:

$\sigma=\sqrt{\frac{1}{N}\sum_{i=0}^{i=N}(x_{i}-\mu)^2}$

Is it correct to calculate in this case where I have only one measurement, i.e

$N=1$:

$\sigma_{xx}=\sqrt{(x-x_{gt})^2}$

and the same for $\sigma_{yy}$ and $\sigma_{\theta\theta}$ ?

Edit
The measurement is taken from a place recognition algorithm where for a query image, a best match from a database of images is returned. To each image in the database is associated a pose where this image has been taken, i.e $z_{gt}$. That's why I only have one measurement. In order to integrate it into the correction step of Kalman filter, I want a model of measurement standard deviation to estimate the covariance having the following form:

$$
\Sigma
=
\begin{bmatrix}
\sigma_{x}^2 & 0 & 0 \\
0 & \sigma_{y}^2 & 0 \\
0 & 0 & \sigma_{\theta }^2 \\
\end{bmatrix}
$$

答:
Short answer: You need at least two measurements and you should use many more.

Definitions

The standard deviation is defined as
$$\sigma = \mathbb{E}[x^2]-\mathbb{E}[x]^2,$$
which is the difference between the first and second moments of $x$.

The sample standard deviation estimates this using $N+1$ samples,
$$\hat{\sigma} = \sqrt{\frac{1}{N}\sum_{i=0}^N (x_i-\bar{x})^2}.$$
Which converges to $\sigma$ as $N\to\infty$. Note that if you use a single sample, then $\bar{x} = x$, and so you get $\hat{\sigma} = 0/0$, which is undefined. This makes sense, since you cannot infer variance (or standard deviation) from a single point.

Convergence Rate

The problem is that $\hat{\sigma}$ is just an estimate of $\sigma$, and that estimate can be very bad for small $N$. Wikipedia has a good article on the convergence properties of the sample standard deviation. For the normal case, the variance of $\hat{\sigma}^2$ is $2\sigma^4/(N-1)$, but in general it may not converge this quickly.

Noise distribution

One last (very important) point: instead of trying to find the standard deviation of the measurement, you should be looking at the standard deviation of the error. So in this case, your $x_i$ are the difference between the ground truth and observed value, and $\sigma_{xx}$ is the standard deviation of the error. The reason to consider error is that this way you don't conflate motion with noise. Furthermore, since you have the Kalman filter tag, the covariance that the filter is expecting is for the errors.


答:
In short; no, you can't estimate standard deviation from a single measurement. Your last equation, assuming $\mu = x_{gt}$ is invalid because you have no guarantee that the mean measurement will match the ground truth (the sensor could have bias error).

The first formula you give is used only if you sample the entire population of possible values, which means the distribution would have to be discrete. I'm guessing in your case the distribution includes all real numbers (a continuous distribution) so the best you can do is estimate the real standard deviation via the sample distribution. In this case the formula you want is:
$$s = \sqrt{\frac{\sum_{i=1}^N \left ( x_i - \bar{x} \right )^2}{N-1}}$$
where as $N \rightarrow \infty, s \rightarrow \sigma ^{(a)}$. Since the denominator is zero for $N=1$ the sample distribution would be undefined.

You can approximate it in a few ways. Most common is to take many measurements and apply the sample standard deviation formula. Another rough option is to look for accuracy specs from the vendor and assume that full range means 6 standard deviations (e.g. $\pm 1$cm -> range of 2cm -> $\sigma = \frac{2}{6}$cm). This is further assuming a normal distribution and the accuracy spec covers 99% of all values.

$^{a}$This isn't exactly true, even for the unbiased estimate I gave, but it's close enough to true to be the most commonly used form

Title: Standard deviation calculation for a single measurement

Body:
I have a robot that takes a measurement of its current pose in the form

$$
z
=
\begin{bmatrix}
x\\
y\\
\theta
\end{bmatrix}
$$
$x$ and $y$ are the coordinates in $XY$ plane et $\theta$ the heading angle.

I also have ground truth poses
$$
z_{gt}
=
\begin{bmatrix}
x_{gt}\\
y_{gt}\\
\theta_{gt}
\end{bmatrix}
$$
I want to estimate the standard deviation of the measurement.
As the standard deviation formula is:

$\sigma=\sqrt{\frac{1}{N}\sum_{i=0}^{i=N}(x_{i}-\mu)^2}$

Is it correct to calculate in this case where I have only one measurement, i.e

$N=1$:

$\sigma_{xx}=\sqrt{(x-x_{gt})^2}$

and the same for $\sigma_{yy}$ and $\sigma_{\theta\theta}$ ?

Edit
The measurement is taken from a place recognition algorithm where for a query image, a best match from a database of images is returned. To each image in the database is associated a pose where this image has been taken, i.e $z_{gt}$. That's why I only have one measurement. In order to integrate it into the correction step of Kalman filter, I want a model of measurement standard deviation to estimate the covariance having the following form:

$$
\Sigma
=
\begin{bmatrix}
\sigma_{x}^2 & 0 & 0 \\
0 & \sigma_{y}^2 & 0 \\
0 & 0 & \sigma_{\theta }^2 \\
\end{bmatrix}
$$


问:
Is it possible to use neural networks with Arduino?
I've got a project in university to build a vehicle on Arduino and I'd like to implement reinforcement learning for it. The processors on Arduino, of course, are too slow for this task so here is my question. Is it possible to perform all the learning in the cloud which will communicate with the vehicle via wifi? And if so, I would really appreciate some hints or references. Thanks.</p>

答:
In general, yes. Just create the network so that it can be run on another machine or the cloud for training. Training basically consists of running many, many test scenarios through the network, and this gradually assigns values to each 'neuron' and connection (I oversimplify slightly).

Once the network is trained, you can copy the trained network onto your Arduino device and use it in your 'real world' experiments. There will be some saved document or file that contains all those weights and biases for the network. The TensorFlow neural network library, for example, has a guide for saving the weights and biases at https://www.tensorflow.org/programmers_guide/saved_model

However, I do not know which neural network libraries can run on Arduino as well as other platforms. And as a sidenote, if you have a budget you may want to look into Nvidia's Jetson platform/chip at http://www.nvidia.com/object/embedded-systems.html    as it is made for both deep learning and embedded systems (arduino is a low-end form of an embedded system). It's not as expensive as I expected, but still may be out of budget and the community isn't anywhere near as large - but it's good to know that the hardware already exists.


问:
Beach Cleaning Robot - Wheel Slip problem
I am building a beach cleaning robot. I am having problems with it moving on the Sand. I have attached a video of it struggling to move. How can I proceed (I think it has enough torque) . it moves comfortably on normal ground. Do I need diff wheels, motors, wheel size etc? Video of slippage</p>

答:
I'd consider using tracks on your robot. Your video shows the very reason why the military use tracks on vehicles intended for operation on sand.

In fact, you can see one example of a beach cleaning robot from DronyX. They use their tracked vehicle for their Solaryno beach cleaning robot.

Of course, that is just one example of a beach cleaning robot. Google will show you plenty of others, and a majority seem to use tracked propulsion.


问:
Replace screws with motors!
I am new to this space and the field. Please pardon my lack of intuition or knowledge. I have a recording stand with a join in between. a pair of screws through which the whole apparatus pivots like a hand. I am trying to convert into a robotic hand

I am trying to add a servo motor at the joint such that the whole apparatus can adjust its height accordingly. My question is, how can I replace the screw area with the screws with a motor.
I have MG995 Towerpro servo motor but I am not sure, how to connect the two things together. Please help!

答:
You are best off using the servo's horn/hub (the plastic or metal disk or arm that you attach to the servo), and screwing the arm to the hub. You get buy some larger horns for fairly cheap, and that will make it easier.

The arm of that desk stand doesn't have any single screw as the center of rotation - each joint has a pair of metal arms on each side, and the center of rotation is at the midpoint of the pair. You could stick the servo into one of the screw holes and make it work, but the movement would be off-axis, awkward, and the connection would be fragile.

If you really want to try attaching the servo through an existing screw hole, the easiest way is to unscrew one of the screws, drill out the hole so it's large enough, stick the servo spindle into the hole, and add some solder to hold the spindle to the arm. You'll also need to screw the servo to the joint piece, otherwise the servo casing will spin rather than the arm. This is a rather permanent and destructive approach (and you really need to be careful with the solder), but honestly the time required to properly machine the arm and set it all up so you can remove the servo later is a lot more of a commitment than the $40 you'd spend on the arm and servo. The hard part of such a 'proper' approach is getting the servo spindle to fit the hole perfectly. That's why I recommend using a large hub instead - that already fits the spindle, and you can attach the hub to an arm spoke with only 1 new screw hole. You'll still need to screw the servo casing to the joint piece.

The only caveat is that most servo spindles have 25 splines or teeth, but some have 24 (usually represented as 24T and 25T) - you'll need to ensure that the hub has the same number as the servo. I think HiTec is the only major maker that does 24 teeth, but some of their servos have 25 because they realized they aren't following the defacto standard. HiTec's website is very good at saying how many teeth their servos have.

Additionally, look for servos with high torque. Many are made for speed rather than torque, because that's what RC cars needed, but for an early experiement like this the speed isn't really important - you just want to have enough torque to ensure that it can move the arm. You can find some no-brand servos on Amazon with around 20kg/cm torque (they claim, but I've never checked that aim for accuracy) for around $25. They're not super precise or quiet, but if you want both torque and accuracy you'd pay at least twice as much. For your first go at this, you don't need to move in increments of fractions of a degree; the less-accurate servo will work just fine.

Title: Replace screws with motors!


问:
RC Transmitter Quadcopter with Arduino
I have a WL v262 quadcopter and I want to control it using Arduino instead of the joysticks on the transmitter. I opened up the transmitter and saw that each joystick has 2 potentiometers on the PCB and that the voltage for each pot goes from 0-3.3V. I used arduino's PWM and a low pass filter and connected the output of the filtered output to the potentiometer's analog pin which is connected to the PCB (I cannot desolder and take out the pots from the PCB) but even with this $V_{out}$ going onto the analog pin, my transmitter's display gave ????

Now I am really confused and frustrated because I don't know how else to control this transmitter other than attaching stepper motors to the joysticks and manually controlling the transmitter but this is really my last resort. Can someone help me with this? I have spent hours and hours trial and error but I am getting nowhere.

Here is the PCB of the transmitter:

答:
The typical solution to this is not to try to inject commands into the existing remote control encoder, but rather to replace it.

Typically you start by connecting a simple USB-based logic analyzer to the signals feeding the RF submodule that is attached at the top of the board.  You can do some initial identification of the lines (almost always an SPI bus, possibly with an additional enable, but very rarely a custom baud rate UART) with the analzyer's GUI interface (or a scope if available).  Once you know the electrical format, you identify operations on various registers and figure out which RF chip is being used from comparison to data sheets of the likely suspects (nRF24/Beken, A7105, XN297, etc).  Then you write a custom streaming decoder for the packet registers for that to plug into logic analyzer software like sigrok, so that you can move the sticks and see which parts of the transmitted packet change.  And you figure out the channel hopping scheme from the writes to the channel registers.

With all of that, you have what you need to make an Arduino-like board run the RF module - or often an alternate sourced one.  People have also working out how to make the nRF24L01+ talk to some similar concept chips with notably different on-air format like the X297.

It's quite likely though that you will not have to do this entire task yourself.  Typically, the R/C hobby community quickly reverse engineers all of this for any interesting inexpensive toy aircraft, and creates code to the able to operate it from a hobby grade transmitter, either running the "Deviation" firmware or as a plug-in-module which takes legacy multi-channel PPM input and uses an Arduino-like MCU to encode any one of a number of toy protocols.  So first do some looking on places like rcgroups for existing work on this particular toy.

In fact, the Deviation project Wiki lists the WL-v262 as using an nRF24L01-compatible radio, with what has come to be called the "V202" protocol, so likely everything you need is already available between that and the more Arduino-ish PPM translator implementation at https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.

Title: RC Transmitter Quadcopter with Arduino


问:
Converting product of exponentials from base frame to end-effector frame
This is a homework question from edx course Robot Mechanics and Control, Part II

Given the following

and expressing its forward kinematics as $T = e^{[S_1]\theta_1} ... e^{[S_6]\theta_6}M$

It is can be found (and also shown in the answer) that

$$ [S_2] =
        \begin{bmatrix}
        0 & 0 & 0 & 0 \\
        0 & 0 & -1 & -2L \\
        0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$$ and
$$ M =
        \begin{bmatrix}
        0 & 1 & 0 & 0 \\
        1 & 0 & 0 & 3L \\
        0 & 0 & -1 & -2L \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$$

Part 4b) requires expressing the forward kinematics in the form of $T = Me^{[B_1]\theta_1} ... e^{[B_n]\theta_n}$ and finding $[B_2]$

I wanted to try deriving the answer using the following property (as found in the lecture notes page 20 and in the lecture around 3:00, basically using property $Pe^A = e^{PAP^{-1}}P$ for any invertible $P$):

$$e^{[S_1]\theta_1} ... e^{[S_n]\theta_n}M = Me^{[B_1]\theta_1} ... e^{[B_n]\theta_n}$$ where $$[B_i] = M^{-1}[S_i]M$$

I get
$$ M^{-1} =
        \begin{bmatrix}
        0 & 1 & 0 & -3L \\
        1 & 0 & 0 & 0 \\
        0 & 0 & -1 & -2L \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$$

Using the property $$[B_i] = M^{-1} [S_i] M$$ to calculate $B_2$ and I get
$$
[B_2] =
        \begin{bmatrix}
        0 & 0 & 1 & -3L \\
        0 & 0 & 0 & 0 \\
        -1 & 0 & 0 & -5L \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$$

which is obviously wrong.  What am I doing incorrectly?

Thanks in advance

The correct answer is

$$
[B_2] =
        \begin{bmatrix}
        0 & 0 & 1 & 0 \\
        0 & 0 & 0 & 0 \\
        -1 & 0 & 0 & -3L \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$$

Full question with answers below:

Body:
So I finally found my mistake...

The mistake was in the matrix form of the screw

$ [S_2] =
        \begin{bmatrix}
        0 & 0 & 0 & 0 \\
        0 & 0 & -1 & -2L \\
        0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$
should be
$ [S_2] =
        \begin{bmatrix}
        0 & 0 & 0 & 0 \\
        0 & 0 & -1 & -2L \\
        0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 0 \\
        \end{bmatrix}
$

and I misinterpreted the answer...

$
[B_2] =
        \begin{bmatrix}
        0 & 0 & 1 & 0 \\
        0 & 0 & 0 & 0 \\
        -1 & 0 & 0 & -3L \\
        0 & 0 & 0 & 1 \\
        \end{bmatrix}
$
should be
$
[B_2] =
        \begin{bmatrix}
        0 & 0 & 1 & 0 \\
        0 & 0 & 0 & 0 \\
        -1 & 0 & 0 & -3L \\
        0 & 0 & 0 & 0 \\
        \end{bmatrix}
$

What a fool...


问:
Is it good idea to build robots with Android OS?
I know Android uses Linux kernel. And nowadays processors going to be more powerful and robots going to be more interactive with graphical user interface and Android is good in this field.
So, is it a good idea to investing time on Android and leaving Linuxes like Ubuntu?

Can we do some classifying and say for which robots it's better to use Android and for which Linux is better choice? I ask this because I think Linux is faster than Android, am I thinking true?

答:
(This questions asks for an opinion which, in most stackexchange.com forums, is discouraged.  I'll answer, but would appreciate knowing what is allowed in the robotics.stackexchange.com forum.)

The major difference between most Linux distributions and Android is that features normally relegated to different users are relegated to different applications on an Android device.  That is to say, all the Linux security efforts for isolating one user from another built up over the past several decades has been re-purposes to isolate one application from another.  In this way, an Android device can safely run multiple applications fairly independent of one another.  For example, your web browser should not be able to affect nor read the application you use for banking.

Is this good for controlling robots?

If you plan on controlling your robot from 1 application I would say it does not make any difference.  But, if you plan on controlling your robot from multiple applications, using an Android OS would make it more difficult.  Why?  If you use an application for computer vision and another for mapping and yet another for motor control - how will they freely talk with one another?  Likely it is not impossible.  But such communication between programs is common place in most Linux distributions.


问:
Mounting on servo horn
I'm trying to mount a rod on a micro servo's horn. The horn has several 1mm wide through holes. Does anyone know what sort of (tapping?) screws should be used for tapping 1mm plastic holes? Are M1.2 too small since the threads will be just 0.1mm deep?

Are there canonical approaches to choosing the appropriate self-tapping screw size given hole diameter?

答:
While all sorts of things get used in experiments, screws really intended to tap into plastic have larger more aggressive threads than those intended to go into a pre-tapped hole in a harder material like metal.

Generally speaking, you want the screw's minor diameter (which is to say that of the body between the threads) to fit through the hole, with only the threads cutting into the walls.  If the body itself has to be forced, breaking the plastic horn is more common.

It is also quite commonplance to drill out servo horn holes to a slightly larger size when needed - typically you would do this by rotating the drill bit by hand in a pin vise, not with a an electric drill.  Of course enlarging the hole weakens the servo horn.

Another option is to buy a miniature machine screw and matching nylon insert nut to install on the reverse side.  You may find it easier to install if you remove the servo horn from the servo.

Traditionally hobby shops had lots of small generic fasteners; that seems to be less true today with the prevalence of ready-to-go models vs kits assembled with components purchased individually.  However sometimes you can buy a full set of replacement screws for an RC car or helicopter, which will give you a variety of sizes to choose from.

Title: Mounting on servo horn


问:
How to detect books in a bookshelf?
I need help converting this project to reality for my office that I currently work in. I basically want to have sensors(idk which or what kind) behind a bookshelf in individual racks and have those sensors communicate with an app to tell if that rack is full or not. I have no background in programming or robotics but I am willing to learn and read as much as possible if someone can guide me in the right direction it would be really helpful. I also wan it to be as cheap as possible.

I have attached an image of how I want the setup to be. Thanks in advance

答:
I would suggest to start with something simple and later on work out the small details.

For a fast Proof of Concept you can use an Arduino Yun which comes with built-in WiFi connectivity.

The Arduino will be connected to an array of proximity sensors, either ultrasonic or IR, and will return the racks with books, simply check if the distance retrieved by the sensor is less than x cm, where x is the length of the single rack. Obviously you should take an average of several measurements with a small delay (say 10 uS) because these sensors are subject to heavy fluctuations and may cause false positives/negatives.

Then the Arduino will connect to a backend and stream all the data using one of the several available protocols. You can use an online ready to use backend such as Temboo to visualise data and later on develop a smartphone app.

Further improvements can be on the uC and code side, maybe using a raw ESP8266 to be put in sleep mode and enabled once a while to poll sensors and trasmit data to go back in low power mode.

Title: How to detect books in a bookshelf?


问:
Using 20 Servos at once, with raspberry pi
I have recently been asked to review a raspberry pi hat (from a programming view) that will allow PWM control of upto 16 servos, however I am hoping to use this time to work on a hexapod idea I have been thinking about for a while, which requires a minimum of 18 servo's, and preferably 20 (camera/sensor pan and tilt).

My question is:

What is a relatively cheap and uncomplicated way of extending my control over those extra 4 servo's?

It would appear most servo controller hat/shiels for arduino and raspi are upto 16 servos, and can be extended by buying another shield, are there any other options?

Any advice in this subject would be greatly appreciated, preferably dumbed down a bit, and I don't know a great deal about micro controller hardware (more of a software guy)

答: I would go with the PCA9685 16-channel PWM controller (12-bit and I2C) that will set you back about €2.10 when ordered on ebay. It uses i2c and you can chain up to 64 of these controllers. So you will need only two of them probably. You just need a few pins to connect them to either a raspberry or an arduino. The module itself has a small form-factor. Software support is also great: https://github.com/adafruit/Adafruit_Python_PCA9685. I did learn also about the adafruit solution, but I'm glad the price has made me look a bit further.</p>


问:
How to tell when an ArduPilot has finished initialising its gyros (without referencing telemetry)?
Using ArduPilot software (fixed wing, ArduPlane), I know that after I boot up I need to keep the system sit still while the gyros initialise.

When I have ground station in the field it's easy to know when it's safe to launch because the telemetry message tells me. But I don't always fly with a ground station. In these situations I currently just sit and wait for a while before arming, then again before launching.

Is there some reliable rule of thumb? information in the blinking of the arming switch or buzzing that I haven't worked out yet? This UAV has PX4 autopilot hardware (with both Px4FMU and PX4IOBoard), including with buzzer and illuminated arming switch. The LEDs on the board are obscured (but I could make light channels from them if required).

(Note: I'm asking this question here to test the theory that robotics stack exchange night be an appropriate forum for these sorts of questions, which has been suggested a couple of times in response to the Area51 drones proposal.)

答:
This depends on a few things. First of all, are you using ArduPlane or ArduCopter, and what mode are you in? For ArduPlane, your answers are here, and for arducopter, here.

In both cases, the software has safeguards that will not let you arm or start the motor while it is initializing. In both cases, the LEDs indicate when it is ready to arm or fly. Of course, these behaviours are mostly configurable. For example, you can set the MANUAL_LEVEL parameter in ArduPlane to 1 if you want to skip the accelerometer calibration on each boot.


问:
Confusion in fixing DH frames
I am analyzing a concept of a surgical robot with 4 revolute joints and one sliding joint. I am not able to fix the coordinate frame for last prismatic joint.
Following are the schematics of robot and DH frames I have fixed

As X4 axis and X5 axis are intersecting each other, I am not able to capture joint distance variable(di) for the slider. How can I fix this?

Following are the parameters for rest of the frames

Updated Frames:

答:
The updated image solves the problem. You did not consider the end-effector coordinate frame earlier.
Also, the crosses (going into) in the diagrams should be replaced by dots(coming out), because the crosses don't hold the right hand rule in case you are using a right hand coordinate system.</p>

Title: Confusion in fixing DH frames


问:
Waterproofing LiDAR?
I am interested in using a cheap LiDAR module for an outdoor robot I am building. The LiDAR modules that I am looking at are not waterproof and I was wondering how hard it would be to build a waterproof case and how much that would impact performance. If anyone has experience related to this and can give some advise that would be greatly appreciated.</p>

答:
So I just found this in the Sweep LiDAR datasheet(https://s3.amazonaws.com/scanse/Sweep_user_manual.pdf).

Sweep uses 905nm laser light, which passes through several kinds of clear glass and plastic very well. Based on our testing, clear Polycarbonate plastic is one of the best choices, as it can be molded to fit the profile of the application’s enclosure, is very inexpensive, and in most cases,is more than 95% translucent to Sweep’s light
  beam.

Factors that can affect the performance of a window are:

Thickness of the window. Thicker windows will block more light, as well as bend the light more if the beam is
  not hitting the window normal to the surface.

Scratches and dust. The presence of scratches and dust on the window will scatter the laser light, and may reflect some of the light back into the sensor’s detector, causing measurement errors.

Surface coatings. There are a variety of coatings that can help with the performance of windows. One is an anti-reflective (AR) coating, which can help reduce the amount of laser light that is reflected as it passes through the window’s surface.

Title: Waterproofing LiDAR?


问:
How to open a coffin for halloween decoration?
Let me start by saying that I know nothing about robotics.

My wife goes a little crazy with Halloween decorations. She judges success by how many children she can make cry.  Last year I built her a coffin with a hinged lid that we prop a skeleton in.  I'd like to punch it up this year and have the lid open with some actuators.

I have no idea what parts I would need to make this work.  I'm thinking I need something weather resistant and powerful enough to lift a wooden lid.  I'll probably attach a skeleton prop to the underside of the lid so it looks like he's sitting up when the lid opens.  For controls I'd like just a switch that we can turn on/off or maybe get fancy and add a motion sensor.

Any help you can give is appreciated.  Thanks in advance.

答: I think the easiest way would be to attach a rope that pulls up the lid. You then just need a motor to wind up the rope. If you have no idea of hardware, this can also be done manually if your development fails and you need to have something working at Halloween. </p>


问:
Programmable Microcontroller for Drones
Are there any programmable microcontrollers or add-on boards that contain an IMU, or ESCs? I've looked at the arducopter but this board's code is not open source, and I need something that can be programmed.</p>

答:
For drones you may check out the PixHawk, whose schematics and software (ArduPilot) are open-source and expandable. If you prefer you can also connect a companion computer via MAVlink and perform heavy-duty tasks on it, such as computer vision or obstacle avoidance.
Apart from that, there are countless IMU boards which can be easily interfaced with popular uC like Arduino simply using I²C or SPI, from Chinese low-cost modules to thousand dollars ones used for advanced INS and dead reckoning.</p>

Title: Programmable Microcontroller for Drones


答:
You can use a heavy-duty linear actuator paired with a simple motor controller board (such as the Polou one) and a vibration motor to make the skeleton move.
A PIR, passive infra-red, sensor and an Arduino can do the job, so that whenever someone drops by, the coffin will be lifted and the skeleton tremble and shake.

Some nice additions could be RGB leds and sound effects, the latter easily integrated using a sound board (like this one).

As a reference, this is a linear actuator.

Title: How to open a coffin for halloween decoration?

Body:
Let me start by saying that I know nothing about robotics.

My wife goes a little crazy with Halloween decorations. She judges success by how many children she can make cry.  Last year I built her a coffin with a hinged lid that we prop a skeleton in.  I'd like to punch it up this year and have the lid open with some actuators.

I have no idea what parts I would need to make this work.  I'm thinking I need something weather resistant and powerful enough to lift a wooden lid.  I'll probably attach a skeleton prop to the underside of the lid so it looks like he's sitting up when the lid opens.  For controls I'd like just a switch that we can turn on/off or maybe get fancy and add a motion sensor.

Any help you can give is appreciated.  Thanks in advance.


答:
The LEDs on the board indicate the status of the Ardupilot. See the LEDs on the boards on the Arducopter wiki for more detail. Of interest to you are likely the A (red), B (yellow), and C (blue) LEDs. LED A is solid when the motors are armed and blinks otherwise. LED B flashes while the Ardupilot calibrates. Finally LED C indicates the status of the GPS module if there is one.

Edit: I just noticed you are using Arduplane in which case you want to reference the LEDs and their meanings page on the Arduplane wiki. The meanings are basically the same though it appears you do not have the option arm/disarm the motors.

Title: How to tell when an ArduPilot has finished initialising its gyros (without referencing telemetry)?

Body:
Using ArduPilot software (fixed wing, ArduPlane), I know that after I boot up I need to keep the system sit still while the gyros initialise.

When I have ground station in the field it's easy to know when it's safe to launch because the telemetry message tells me. But I don't always fly with a ground station. In these situations I currently just sit and wait for a while before arming, then again before launching.

Is there some reliable rule of thumb? information in the blinking of the arming switch or buzzing that I haven't worked out yet? This UAV has PX4 autopilot hardware (with both Px4FMU and PX4IOBoard), including with buzzer and illuminated arming switch. The LEDs on the board are obscured (but I could make light channels from them if required).

(Note: I'm asking this question here to test the theory that robotics stack exchange night be an appropriate forum for these sorts of questions, which has been suggested a couple of times in response to the Area51 drones proposal.)


问:
Yaw from accelerometer? No! So what do these equations actually mean?
note: I'm just a day or so into the use of inertial measurements and trying to learn everything at once, this may be a noob question (it's my first here).

I have seen this image of "Figure 8" in several sites geekmomprojects, makerworkshop, husstechlabs, aros.se, but I don't understand it or how the equations are derived.

If I set an accelerometer on a table so that $a_x$ and $a_y$ are nulled and rotate it around the $\hat{z}$ axis, I'm changing the yaw of the accelerometer but of course there is no change in the value of $\theta$ away from zero as given by the last equation.

So how is this a measurement of yaw? Or am I missing something obvious? What do these three expression actually mean? I'm beginning to think that the first two expressions are simply the "tilt angles" and the third is some geometrical angle that is not actually independent of the other two.

答:
Not sure if I understand your question exactly, but the scenario you point out is the blind spot of imus: they can't tell you the rotation about the gravity vector. It's nothing specific to yaw per se; if you put the imu on edge then you couldn't get rotation about the x or y axis, depending on which was aligned with the gravity vector.

Basically, when the imu is sitting still is tells you which direction gravity points, but this is only 1 axis of a coordinate system so doesn't fully define your orientation. This is why systems will frequently add another measurement such as a magnometer which can generally be used to know which direction is north. With these two directions you can fully define the orientation.


问:
Robot Position Control on Treadmill
Previous Question

Hello, In continuation of my question above, I have another question. I have managed to control the speed of the treadmill using a PID and StevO mentioned to me how the scaling from process variable(speed) to control signal (pwm) is done.

Now, I want to control the position of the robot at a fixed position on the treadmill. I want to use the first approach shown in picture below. Note that the labeling is for a quadcopter. I want to use the same approach but the labeling is different in my case. For me the input to Stabilize PID is desired robot positon on treadmill and actual robot position on treadmill.

The Rate PID is up and working. I want to use the Stabilize PID to make the robot hold a fixed position on the treadmill. I can measure the position of the robot using a distance sensor and find the error = desired distance - actual distance.

My problem is that the error is in terms of distance(meters) but the control signal needs to be speed that would be fed to the speed control. The speed controller would do its job.

To sum up, my question is that for the Stabilitze PID block, by using a process variable which is position (meters), how can I get a control signal that would be speed?, what kind of scaling should be done here?

Thank you.

答:
Consider using calculus or rather derivatives.

You have stumbled upon the relationship between velocity and position.  This can be extended to include acceleration.  Simply put, velocity is the derivative of position.  And taking the derivative of position gives acceleration. Instead of writing an equation and actually taking the derivative, computers simply takes samples and divide the samples by time.  A good example might be an electronic bicycle speedometer.

For your project, you can get velocity by dividing the change in the distance sensors position value by an arbitrary but consistent time interval.  Then correcting the robot's velocity relative to the treadmill.

Title: Robot Position Control on Treadmill


问:
Validation of dh parameters
I am working on a concept of robotic arm for which I have fixed DH frames and parameters. Is there any way to validate the correctness of DH parameters and frames ?

答:
The easiest way to validate a set of DH parameters is to plug them directly into a simulator which can build a robot model from a DH table. Once you've got the DH-generated robot model, you can verify that the robotic structure that is generated is what you would expect based on your DH table.

The most common DH-table based robot simulation package that I've worked with is the Robotics Toolbox for MATLAB written by Peter Corke: http://petercorke.com/wordpress/toolboxes/robotics-toolbox.

Title: Validation of dh parameters


问:
How to get longest flight time on octocopter that has decent payload already on it?
I want to design an octocopter that will respond to incidences of crime and terrorist attacks. Survey and gather intel and come back to HQ. I have used a 16000mAh 6S lipo battery with no lead, but only can  flight 20mins.
I want this Octocopter to carry radioactive/chemical testing equipment and have a flight time of 45 mins
How likely am i to achieve 45min flight times?
There must be a way of optimizing flight time. I know i can double the amount of batteries but this may make the craft unstable I may need to scale up on motor size to make payload less of an issue..
The larger the craft the more dangerous and costly the craft. So i'm really interested in optimizing it the best i can.
I know there are hydrogen fuel cells, maybe some other sort of alternative battery.
Please help thanks</p>

答:
Since you want to keep the mass of the vehicle constant, I suggest you focus on the efficiency of the propellers.

Area 1 to look at is optimizing the propeller shape for the exact speed and thrust you need for your vehicle. (The motors you are using will have an optimal operating point that defines the ideal speed). There are electric helicopter enthusiasts that compete for long duration flights (Which can last more than 60 min for some configurations if I remember correctly); so that is probably a good place to start looking for information.

Area 2: Each propeller you remove from the system will reduce the overhead in mass and system losses. A helicopter is more efficient than a quad or octo copter. Quadcopters are popular because of their mechanical simplicity but you pay for this in efficiency (flight time).


问:
Rotary Serial Elastic Actuator
I'm building a 7oF arm with series elastic compliant joints. I need series elasticity because I'm training the robot to do autonomous manipulation using machine learning, and I want force control (and prevent the arm from killing itself if it hits something). I want the final joint to be something like this.

I'm having real trouble finding plans online for any kind of rotary series elastic joint. I wonder why this is, given how easy it is to find arm plans.

I'm going to add it to this robot. An example of the kind of motor I'll be sticking it on is 5:1 planetary gear stepper motor.

My plan right now is to buy a rotary magnetic absolute encoder and a torsional spring. I don't really know if there's a standard way to mount these things.

So if anyone could point me in the right direction, that would be great :)

答:
There was a paper describing a rotary series elastic actuator for human-assistive systems in IEEE/ASME Transactions on Mechatronics, Vol. 17, No. 2 (April 2012).

The paper included diagrams of the mechanism and a description of the controller design.

Is that the sort of thing you were looking for?

Title: Rotary Serial Elastic Actuator


问:
What is the cheapest / easiest way of detecting a person?
I'd like to know if anyone has had success detecting a warm-bodied mammal (ie. Human) using standard off the shelf, inexpensive sensors?

Ideally, I'd like to use an inexpensive sensor or combination of sensors to detect a person within a room and localize that person. I would like the robot to enter a room, detect if a human(s) is/are present and then move to the detected human. The accuracy does not need to be 100%, as cost is more of a factor. I'd like the computational requirements of such a sensor to be such that it can run on an Arduino, although if it's impossible, I'd be willing to utilize something with more horespower, such as a Raspberry Pi or a BeagleBone Black. I have a few thoughts; however, none of them are ideal:

PIR Sensor - Can detect movement within a large field of vision (ie. usually 120 degrees or more).  Might be the closest thing to a "human" detector that I'm aware of; however, it requires movement and localizing/triangulating where a person is would be very difficult (impossible?) with such a large field of vision.

Ultrasound - Can detect objects with good precision.  Has a much narrower field of view; however, is unable to differentiate between a static non-living object and a human.

IR detectors - (ie. Sharp range sensors) Can again detect objects with great precision, very narrow field of view; however, it is again unable to differentiate objects.

Webcam + OpenCV - Possibly use face detection to detect human(s) in a room.  This may be the best option; however, OpenCV is computationally expensive and would require much more than an arduino to run.  Even on a Raspberry Pi, it can be slow.

Kinect - Using the feature detection capabilities of Kinect, it would be relatively easy to identify humans in an area; however, the Kinect is too expensive and I would not consider it a "cheap" solution.

Perhaps someone is aware of a inexpensive "heat-detector" tuned to body heat and/or has had success with some combination of (#1-4) above and would like to share their results?

答: a capacitive sensor could work, it's really cheap to make, just aluminum foil and a few resistors, it can detect flesh but i'm not sure if iy doesn't detect anything but flesh, you can use 3 to triangulate</p>


问:
Determining time difference of image capturing in multi camera setup
it is widely discussed in this forum, how to sync multiple cameras (e.g. best done via hardware trigger).
Now I'd like to know how to actually determine the time delay between two image streams and the overall offset between a real event, and the moment when the captured frame is available in the PCs buffer.

So I have a picture P which captured an event at time T, so the captured image will be available at P(T+dT).
How to determine dT?

I have two cameras capturing picture P1 and P2.
But due to two unsynchronized shutter, P_1 will be captured at T_1 and P_2 will be captured at T_2.
How to determine dt=T2-T1?

PS.: I really don't want to synchronize the cameras, just determining these delays.
I searched intuitivley for publications on multi camera/Kinect tracking or Event Related Synchronisation but weren't lucky at all.
Does someone has some suggestions?

答:
Consider using infrared transmitters to flood the area of interest with short bursts of infrared light while using video cameras sensitive to infrared light or both infrared and visible light.

By flooding the area of interest with detectable pulses, the video from each camera can be analyzed such that any time discrepancies due to unexpected latencies can be mitigated.

The location of objects in three dimensional space can be improved as video from various angles can be combined without concern regarding when in time a particular image from a particular camera was taken.


问:
How do robotics companies track faults in production systems?
Are there any specific tools or practices which robotics companies use in order to keep track of errors in:

Sensors/Actuators malfunctioning or returning unexpected results

Programming errors or exception states

The aim of tracking this diagnostics information would be to:

Remote diagnosis of errors

Root cause analysis

Understanding of errors which 'cascade' from devices/robots to platforms and cloud services

I'm interested specifically in the parallels between normal software tools, e.g. Sentry or Rollbar for exception tracking, APM systems such as Dynatrace and the distributed and long lived state of the autonomous systems world. These systems seem to be better suited to errors in a request/response format, where the history of a device does not have as much affect on it's future as in the autonomous systems world.

So far the only tool I've seen is the diagnosis tools built into the ROS messaging bus, however it does not seem well suited to production.

How are teams currently doing this in production?

答:
Company size and market expectations shape the specific tools used. Almost always kept confidential to some degree.

Issue tracking, remote diagnosis (and device security), and stochastic monitoring of hardware and software are common practice.

Failure prediction modeling is common where the economics make failure costly.

There are no specific tools and best practice is sector specific.

You might gain some insight looking at the practices of academic projects that require a large number of robots to be created and shared with other universities (iCub for instance); or by looking at robotics companies that have a strong open source commitment. But projects like these are biased by what tools the project leaders are willing to pay for.

If you are part of a team in a new company with no experience in this you are probably better off hiring an expert or two in your sector than reinventing 100 wheels.

EDIT Note that robotics hardware products can take 5 to 10 years to develop into a mature product, be deployed for another decade or two, and best practices will be from the era of development.


答:
For an arm with series elastic actuators I'm not aware of an open source design. There are many mechanisms you can find in research papers if you search for them.

For force control you have a few other options.

You can use an efficient backdrivable transmission (direct drive or spur or planetary or capstan all work) and control the current in a permanent magnet motor which will have a linear relationship between current and torque/force.

If you only interact with the world (payload) at the end-effector, you can put a force-torque sensor there.

For safety you can use clutches instead of compliance in many cases.

In all cases you will need to invest some time and learning. Maybe buddy up with a mechanical engineer.

As a side note, there are cheaper ways to measure the deflection (the original used a potentiometer) and finding the correct geometry and size of spring to match the operating conditions is a challenge in itself. These guys used compression spring for a rotary actuator and you could probably find enough public information plus some simple equations to use that approach in your own design.

A final comment is that since you tagged visual servoing in your other question and your are talking about machine learning, you might consider keeping things more simple. Don't worry about force control, add whatever compliance you need for safety in any form (a rubber section in the link perhaps) and let the learning algorithm handle the control details...

Title: Rotary Serial Elastic Actuator

Body:
I'm building a 7oF arm with series elastic compliant joints. I need series elasticity because I'm training the robot to do autonomous manipulation using machine learning, and I want force control (and prevent the arm from killing itself if it hits something). I want the final joint to be something like this.

I'm having real trouble finding plans online for any kind of rotary series elastic joint. I wonder why this is, given how easy it is to find arm plans.

I'm going to add it to this robot. An example of the kind of motor I'll be sticking it on is 5:1 planetary gear stepper motor.

My plan right now is to buy a rotary magnetic absolute encoder and a torsional spring. I don't really know if there's a standard way to mount these things.

So if anyone could point me in the right direction, that would be great :)


答:
Actually the constraints you set of using an Octorotor is already impeding the autonomy of the system. Indeed multi-rotor platforms are a trade-off between on one hand the ability to over and a simple dynamics of the system and on the other hand the flight efficiency and thus higher payload.
My answer to your question

How likely am i to achieve 45min flight times?

is that I think it is very unlikely if you platform weights around 1.5kg and you want to carry around 1kg of payload.

To your question

How to get longest flight time on octocopter ?

lest first review your strategies:

I can double the amount of batteries but this may make the craft unstable

Double the battery is just embedding more energy on board (i.e. reducing the payload) but should not bring you platform to instability as long as your flight controller knows the mass and center of mass of the platform. Note that the more you increase the payload the closer you get to the actuation limits of you motor+propeller, what can happen is then that you use almost all your control authority for weight compensation and that nothing is left to allow attitude control, resulting in unstable behavior.

2.

I may need to scale up on motor size to make payload less of an issue

Scaling up the motor alone is a partial solution. As the thrust is produced by the combination motor+propeller, you can increase the thrust by tunning your motor+propeller combination. As noted by @hauptmech, propeller shape can be optimized to improvement the performances, but this is not trivial due to the aerodynamic at play and the interferences between the different propeller, the relative wind and so on. Note that increasing motor "size" will most likely lead in an increase in current consumption and so you might need to change your ESCs, also it will drain more power so you will need more battery and we are back to the same issue as described above.

3.

I know there are hydrogen fuel cells, maybe some other sort of alternative battery

Hydrogen fuel cells is very new for multi-rotor and seems to not be super mature technologies, so it comes with potentially high development costs.
The idea fuel cells is that the power density of battery is rather low, another approach in the same direction is to have a gasoline motor and an alternator, but then even if you store more energy in the tank the weight of the full machinery doesn't scale for typical multi-rotor size.

Lastly my solution, from a system engineering point of view I would recommend you to start the design from the problem; monitoring which kind of area, is stationary flight required, typical payload weight, typical payload power consumption, desired autonomy, and so on and so fourth. And based on those info choose the more adapted hardware for both your payload and your flying platform.

Title: How to get longest flight time on octocopter that has decent payload already on it?

Body:
I want to design an octocopter that will respond to incidences of crime and terrorist attacks. Survey and gather intel and come back to HQ. I have used a 16000mAh 6S lipo battery with no lead, but only can  flight 20mins.
I want this Octocopter to carry radioactive/chemical testing equipment and have a flight time of 45 mins
How likely am i to achieve 45min flight times?
There must be a way of optimizing flight time. I know i can double the amount of batteries but this may make the craft unstable I may need to scale up on motor size to make payload less of an issue..
The larger the craft the more dangerous and costly the craft. So i'm really interested in optimizing it the best i can.
I know there are hydrogen fuel cells, maybe some other sort of alternative battery.
Please help thanks</p>


问:
Is it possible to achieve control of 4 DOF in quadcopter?
I have been looking into non-linear control algorithms for controlling a quadcopter. I know that we have total 6 DOF for a quad (3 translation and 3 rotation) and our input belongs to $\mathbb{R}^4$, i.e. the 4 motor inputs. So if I look at a quad following a specified trajectory $x(t)$, where $x\in \mathbb{R}^3 $. Then I am actually controlling only the desired position coordinates. Angles and angular velocity vary such that position is attained, but we don't actually command the angles.

So, my doubt is we have 4-degree input but only 3-degree controlled output. Is it possible to have position tracking along with a particular angle, such as yaw tracking? Controlling 4 states using 4 commands? Am I fundamentally wrong in my reasoning?

Alternatively, in terms of movements being directly actuated, we do have 3-moment torques and a thrust as an input. Would we consider this as 4 DOF command instead?

Any reference or paper would be welcome too.

答:
You are fundamentally right in your description of the quadrotor system.

One thing that you oversaw a bit is how your four inputs are mapping to the system dynamics, indeed here 4 motors leads to 4 controllable quantities but it's not always the case. Think for example of an octorotor, with quadrotor configuration, ie, 2 motors per corner of the frame.

Is it possible to have position tracking along with a particular angle, such as yaw tracking?

This is typically what is done in linear control of quadrotor, by relying on the near-hovering approximation. An outer control loop generates the orientation, and its derivative, to be tracked to follow a position trajectory, when an inner loop tracks the orientation and its derivative, the yaw can be chosen arbitrarily at this stage (or set to follow a trajectory). Note that from the quadrotor design this is only possible for yaw, as yaw orientation doesn't influence the total thrust orientation.
A complete introduction paper on quadrotor is DOI: 10.1109/MRA.2012.2206474

As for more complex control in SE(3) you can look for  DOI: 0.1109/CDC.2010.5717652


答:
I can't say whether this is easiest, but conceivably you could use the Eulerian Video Magnification library to detect the pulse of a person.

In that case, you would be looking for a fluctuation in the video that matched the expected range of human pulses.  You would also need a clear image of a body part that exhibited the visible pulse.

There has also been some work (example 1, example 2) exploring hardware-based face detection.  Digital cameras from a few years ago had this capability, which was essentially a highly optimized neural network designed to say "does this square contain a face or not"... then you just iterate over a set of predefined squares in the captured image.

Title: What is the cheapest / easiest way of detecting a person?

Body:
I'd like to know if anyone has had success detecting a warm-bodied mammal (ie. Human) using standard off the shelf, inexpensive sensors?

Ideally, I'd like to use an inexpensive sensor or combination of sensors to detect a person within a room and localize that person. I would like the robot to enter a room, detect if a human(s) is/are present and then move to the detected human. The accuracy does not need to be 100%, as cost is more of a factor. I'd like the computational requirements of such a sensor to be such that it can run on an Arduino, although if it's impossible, I'd be willing to utilize something with more horespower, such as a Raspberry Pi or a BeagleBone Black. I have a few thoughts; however, none of them are ideal:

PIR Sensor - Can detect movement within a large field of vision (ie. usually 120 degrees or more).  Might be the closest thing to a "human" detector that I'm aware of; however, it requires movement and localizing/triangulating where a person is would be very difficult (impossible?) with such a large field of vision.

Ultrasound - Can detect objects with good precision.  Has a much narrower field of view; however, is unable to differentiate between a static non-living object and a human.

IR detectors - (ie. Sharp range sensors) Can again detect objects with great precision, very narrow field of view; however, it is again unable to differentiate objects.

Webcam + OpenCV - Possibly use face detection to detect human(s) in a room.  This may be the best option; however, OpenCV is computationally expensive and would require much more than an arduino to run.  Even on a Raspberry Pi, it can be slow.

Kinect - Using the feature detection capabilities of Kinect, it would be relatively easy to identify humans in an area; however, the Kinect is too expensive and I would not consider it a "cheap" solution.

Perhaps someone is aware of a inexpensive "heat-detector" tuned to body heat and/or has had success with some combination of (#1-4) above and would like to share their results?


问:
State vector for a Quad-copter?
Whatever literature I've read on quad-copter dynamics, the state of a quad copter is define as a 12x1 vector, containing the coordinate positions (x,y,z) and velocity (xdot, ydot, zdot) in Earth frame, euler angles (theta, phi, psi) and euler angle derivatives (thetadot, phidot, psidot). However, this code that I am reading seems to have modeled the state vector as a 13x1 vector. It's modeled as : [x,y,z,xdot,ydot,zdot,qw,qx,qy,qz,p,q,r]. I am lost at these last 7 variables. In the initialization module, (qw,qx,qy,qz) are initialized as Quat(1),Quat(2),Quat(3),Quat(4) respectively, and (p,q,r) are all zero. I'm guessing the (p,q,r) are derivatives hence are set to zero during initialization. The Quat() is supposed to be the vector of quaternions, which is again something I haven't found in most literature on modeling of quad-copter dynamics. What is this and why is it needed?
I have no prior background in robotics or control systems! </p>

答:
Quaternion are used to avoid gimbal Lock. As Euler-angle suffer from singularity configuration and the gimbal lock needs to be treated explicitly in your algorithm. Quaternion only suffer from a slight singularity in the sense that you express the rotation by a vector (3d) and a rotation around this vector (1d), so one rotation can also be represented by the opposite vector and the opposite angle (ie kind of multiplying the quaternion by -1) . The best is to use rotation matrices to be on the clean side, but it's usually heavier to implement. Using rotation matrices a nice paper is DOI: 0.1109/CDC.2010.5717652

Another point in favor of rotation matrices or quaternion is that the number of convention is sensibly lower from more than 12 for Euler-angles, to 2 for quaternions and 1 for matrices. This is especially good when you work with other people/other software to be sure to be easily interfaced. See more on rotation in general https://www.astro.rug.nl/software/kapteyn/_downloads/attitude.pdf

A last remark, in general  for quadrotors the translational dynamics is expressed in world frame and the rotational dynamic is expressed in body frame, which simplifies expression of the control  matrix.  So naturally [p,q,r] are the angular velocities along the main axis of the body frame.

Title: State vector for a Quad-copter?


问:
Generation of a trajectory (position,velocity,acceleration) from velocity
I would like to generate a trajectory for a quadrotor UAV and I am using an architecture which allows to do so only by specifying position, velocity and acceleration.

I only know that I want to do a circle in 2D (fixed z for example) and therefore I should give a sine wave on the x and a cosine on the y.

So far everything is ok. I am working in MATLAB/Simulink and therefore to generate the position I simply use an integrator block and I get it.

What about the Acceleration? If I do just a derivative of the velocity my trajectory is not working, I don't know why. Is there a better way to do that? A friend suggested me a second order filter to generate the trajectory but I don't know what he really means.

Could you please help me?

Thanks.

答:
With the method you describe you are bound to have non zero velocity or non acceleration (based on if you consider a + pi/2 offset or not).

Despite @combo answer I would suggest you a second order filter or heaven higher to generate a smooth trajectory up to the n-th order. Typically in my lab we try to impose up to smooth jerk or snap, for high agility maneuvers.
I want to comment on the lag induced by such a filter, first of all it is small but most importantly it is irrelevant because it is in the planning side !
Let me elaborate, if you filter any signal in your control loop loop you induce delay, if this delay is not taken into account by advanced control scheme this results in instability, which is bad.
However, what you try to do is to generate a feasible trajectory, so by using such a filter what happens is that your position input is such that you reach half the circle at a given time, then the filter output is going to be  bit delayed this delay is constant an related to the time constant of your filter. If you have time constraints in your trajectory you can take it into account but by experience in the majority of application it is not necessary.
So using a n-th order filter you just produce a smooth trajectory. Be careful to use as desired position the one given out of the filter so that it matches the velocity and acceleration.


问:
how to get h*w point cloud from laser scan not just planer
I am trying to convert a laser scan into point cloud so i can use its cartesian cordintes for computer vision purpose. But when i do it it seems like the width of point cloud converted is only 1. Before this i was using kinect sensor where both height and width were not 1. i'm getting confused to use the hokuyo sensor/multisense sensor. I am using gazbo for getting the lidar scan data. To convert lidar scan into pointcloud2 data i'm using this

```<code>program:
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <laser_geometry/laser_geometry.h>

class My_Filter {
     public:
        My_Filter();
        void scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan);
     private:
        ros::NodeHandle node_;
        laser_geometry::LaserProjection projector_;
        tf::TransformListener tfListener_;

        ros::Publisher point_cloud_publisher_;
        ros::Subscriber scan_sub_;
};

    My_Filter::My_Filter(){
            scan_sub_ = node_.subscribe<sensor_msgs::LaserScan> ("/multisense/lidar_scan", 100,

&My_Filter::scanCallback, this);
            point_cloud_publisher_ = node_.advertise<sensor_msgs::PointCloud2> ("/my_cloud", 100, false);
                tfListener_.setExtrapolationLimit(ros::Duration(0.1));
        }

    void My_Filter::scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan){
        sensor_msgs::PointCloud2 cloud;
        projector_.transformLaserScanToPointCloud("/head", *scan, cloud, tfListener_);
        point_cloud_publisher_.publish(cloud);
    }

int main(int argc, char** argv)
{
    ros::init(argc, argv, "my_filter");

    My_Filter filter;

    ros::spin();

    return 0;
}
</code>```

Here when i run this node, the height of point cloud is fine but width is only 1. and when i visualize the laser scan or pointcloud or pointcloud2 in rviz even when the lidar is rotating i can only see 2-d points as shown in below screenshot. Why is this happening. what should i do to convert it into 3d point cloud? Here all the point lies in single plane.

答:
I think, that the following two video tutorials can help you with your problem. The first one shows how to convert a laser scan into a pointcloud, and the second shows how to mix several laser scans into a single pointcoud.

1- How to convert a laser scan into a pointcloud

2- How to assemble several laser scans into a single PointCloud


问:
Thrust and Torque on Quad Rotor
I am a beginner on Drones. I would like to understand the how each motor contribute to thrust on the whole drone. And what is the direction of torque created on each propeller.

Everywhere I find a tutorials with complex formulas. It would be great to have a simple answer about how the thrust system works on Quad rotor and the torque mechanism of it.

It would be great to know how lowering the speed of one propeller causes the movement in certain direction, and also the relation of propeller motion with pitch, yaw and roll.

答:
As you pointed out there are a lot of tutorial online see DOI: 10.1109/MRA.2012.2206474 for example.

I think that the section https://en.wikipedia.org/wiki/Quadcopter#Flight_dynamics from wikipedia is quite simple, and neglects cumbersome aerodynamic effects that can arise for fast maneuvers. I will take a picture from there as it's open source.

Let's consider the quadrotor

The propellers are numbered from 1 to 4, and assume that the center of mass of the quadrotor is at the origin of the frame. The propellers are each exerting force along the z-axis in body frame (pointing toward you) and the sum of the 4 thrusts gives the total thrust. Also assume that the relation between thrust and drag is directly proportional to spinning velocity, ie 10% more spinning velocity results in 10% more drag and thrust. From start consider that all 4 propellers spin at the same velocity, so that the total thrust produced balances the quadrotor weight.  This is called hovering, the sum of the propeller forces and torque is a force compensating for weight and no torque.

First notice that 2 are rotating clockwise and 2 counter clockwise, in order to balance the drag torque that they generate along th z-axis. So if you want to exert torque around the z axis you need to have the even propellers spinning more (less) than the uneven one. If you spin the even ones by 10% more and the uneven one by 10% less, the weight is still balance but a torque around z-axis is exerted. This would describe the yaw motion.

For the roll and pitch the reasoning is equivalent, so I will only present one. Consider that the pitch corresponds to the rotation around the y-axis [a]. The propeller 1 and 3 being located on that axis have obviously no role in the toque generation. Then the drag torque generated by the propeller is around z-axis so it's also not affecting the  pitch motion.
The torque generated along y for one propeller (2,4), is depending of two quantities the distance between the propeller center (where the force is exerted) and the thrust produced by the propeller. In general of their vector product but for the co-planar case one can just consider the thrust magnitude and the distance in the plan. So from the hovering condition if you spin 2 faster (an reduce all other 3 accordingly) you will get a negative pitch, quadrotor flying toward x negative. Conversely spinning less will generate positive pitch quadrotor flying toward x positive. The fact that the position change is due to the dynamical coupling and underactuation of quadrotors. But in general due to the high symmetry of the platform one augment the velocity of 2 and diminish the one of 4  (or the converse) at the same time to exert higher torque but most importantly to make the total thrust balance simpler.

Note that some people consider other frame conventions, like NED or with the frame not aligned with the propellers but the points between to propellers. The discussion remains the same, it's all about balancing force with the total thrust and playing on differential to exerted desired torque.

I hope this is as complete as possible without being cryptic, feel free to interact with me to refine my answer.

[a] note for aeronautics enthusiasts, as the frame is not following North East Down convention positive pitch do not match to "rise" of the flying vehicle as it would be the case for a plane

Title: Thrust and Torque on Quad Rotor


问:
2D quadcopter simulation position controller and PD controller
I'm a beginner in controls system, so if there is a nice tutorial on this, please let me know.

I have a Simulink model like the following:

It takes roll and pitch commands and output velocities and positions. I want to create a PD controller so that the quadcopter in the simulation can move in a 10x10 meter shaped square(starting from bottom left corner) in a clock-wise direction.

I'm not sure how to go about this so I've been watching Vijay Kumar's Ariel Robotics lectures on Coursera and it seems like I need to create desired position, velocity, and acceleration at every time step which I think I can do (make a trapezoidal velocity profile and compute the rest).

Then Kumar talks about a nested control structure where there are two controllers: a position controller that takes in the desired position, velocity, and acceleration; and there is attitude controller which I believe is the one I have.

My question is how do I create a position controller? And is the position controller the one that converts my desired position,velocity, and acceleration into a roll/pitch command?

答:
As you pointed out the typical control loop for a quadrotor is a nested one, with a position controller and a orientation controller (I prefer to use orientation instead of attitude to avoid confusion with altitude which happens more often than not). If you want to find some literature the set up you describe is often referred as P-VTOL , for Planar Vertical Take-Off and Landing.

In this case

is the position controller the one that converts my desired position,velocity, and acceleration into a roll/pitch command?

the answer is yes, the position controller generate the thrust magnitude and orientation to achieve good position tracking and the orientation controller is then responsible of tracking the orientation coming from the position controller.

That being said in the model you posted (first figure) you have as input pitch and roll commands, which is not possible in the planar case as in the plan there is only one angle. Usually for PVTOL system input are chosen as the total thrust ($F$) and the torque $\tau$  (as in your second figure) or as the two thrust $f_1,f_2$ produced by each propeller.
The relation between the two is simple and linear

$$ \begin{bmatrix} F \\ \tau \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ d & -d\end{bmatrix} \begin{bmatrix}f_1 \\ f_2 \end{bmatrix}$$
Where $d$ is the distance between the propeller and the center of mass, and is assumed the same for all propellers.

Also note that from your second pictures it seems that you want to control at the same time 2 positions (y,z) and the orientation. This is impossible as the PVTOL is underactuated and only has 2 control inputs, you can either control the 2 positions but not the orientation or 1 poisiton and 1 orientation (usually z and $\phi$). The typical approach for near-hovering flight and non aggressive maneuvers is to give desired trajectory for the 2 position.

how do I create a position controller?

To create a controller you need to consider your system model, ie the mapping between your control input and your state. The trick for quadrotor is that the  total  thrust is exerted along a fixed direction in the body frame, so to change the orientation of the thrust you need to change the orientation.

Here I will sketch the basic rationals behind the position controller.
Consider that you have an error in position along both axes $e_z$ and $e_y$ to make it disappear you need to move your platform in the direction defined by the vector $\begin{bmatrix} e_y \\ e_z \end{bmatrix}$, this gives you the desired orientation of your total thrust vector, ie z-axis of the PVTOL, that needs to be fed to the orientation controller which will compute $\tau$. The magnitude of the total thrust is usually regulated via PD on the errors, this directly defines $F$.


问:
Confusion in fixing DH frames
I am analyzing a concept of a surgical robot with 4 revolute joints and one sliding joint. I am not able to fix the coordinate frame for last prismatic joint.
Following are the schematics of robot and DH frames I have fixed

As X4 axis and X5 axis are intersecting each other, I am not able to capture joint distance variable(di) for the slider. How can I fix this?

Following are the parameters for rest of the frames

Updated Frames:

答:
In the first drawing the resulting D-H would results in the last line of you r D-H table to contain both $\theta_4$ and $d_1$ as parameters, provided you choose the frame in a proper way.

The second drawing solves your issue, at the coast of adding and extra frame, but makes it clearer from a parameters points of view. Although as noted @aniket-sharma the frame you draw are not direct which can lead to confusion/errors.

In general  the D-H parametrization of an manipulator is not unique ! Because textbooks are listing to sets of rules, omitting to present the others.
In general an open question while doing a D-H parametrization is the choice of orientation and location of both the first (base) and last (end-effector) frame.

For clarity they can be chose in a  way that is not minimizing the total number of frames. Think for example as a manipulator mounted on a mobile base, for clarity some people consider as base frame a frame aligned with the one of the mobile center of mass, and then fix the first frame based on D-H convention.
As for the location of the frame, for a rotational joint the origin should be located on the axis of rotation and for a prismatic joint on the direction of translation. For design where those two lines do not intersect in the 3D space or when they coinciding the location of the origin is a matter of convenience (and can be optimized for readability/simplicity or for computational efficiency).

The latter being the one at hand here, where you can have a compact form as first proposed or an easier to understand as the second proposed.

Title: Confusion in fixing DH frames


问:
Human arm inverse kinematics
Hi I want to implement an human arm robot and a task such as moving a glass between two points  using Robotic Toolbox for Matlab  by Peter Coorke. I'm a student and I'm a newbie in this kind of things so I would find a good reference for solving the inverse kinematics of the human arm and  an algorithm that implements some kind of obstacle avoidance exploiting the redundancy of the manipulator (7dof) using null space motion.  Anyone can suggest me a good reference to follow in this implementation with the toolbox? Thanks</p>

答:
You are tackling two non trivial problem at the same  time
1. Inverse kinematics of an overactuated manipulator
2. Obstacle avoidance using the null space

By definition of the null-space projection the solution you want will only be able to avoid obstacles which are not on the desired Cartesian trajectory to be followed during the task. Think about sliding an object on a table, and the only thing you can do is moving your elbow from up to down, this is the null space motion. If you break the contact with the table it means that you motion went outside of the null space.
You will realize that you can not avoid much obstacles because our shoulder and wrist rotation limits are quite constrained, typical anthropomorphic arms are a bit better in this respect. But overall  they can not avoid much that way, it is usually preferred to project in the null space additional task like manipulability optimization or joint limit avoidance, look at DeLuca from Roma.
If you want to avoid any obstacle while manipulating, this is a path-planning question where many approach exists, both online and offline based on their computational costs and their local or global range, you can look at Haddadin collision avoidance works.

That being said if you are a total newbie I encourage you to start by a 2D example, like a 4 revolute joints planar manipulators. This will get you familiar with the concepts at hand but for a simpler problem.

Title: Human arm inverse kinematics


问:
forward and inverse kinematics of arm
I'm trying to figure out to a problem with a planar manipulator.
The manipulator has a base effector and L1 and L2 with 3 joints.

Question: INVERSE KINEMATICS

Given the posit_ion(x, y, z) of the tool I calculate the values of the joint variables ($\theta_1$, $\theta_2$, $\theta_3$ and $\gamma$) as follow:

From the position(x, y, z) I calculate:

$\gamma= atan2(z, x)$

$x'= \cos(\gamma)*x + \sin(\gamma)*z$

$y'= y$

I used $x'$ and $y'$ to calculate (through) the angles of joints like this:

is it correct?

Question FORWARD KINEMATICS:

Given the joints variables ($\theta_1$, $\theta_2$, $\theta_3$ and $\gamma$) I need to calculate the position(x, y, z) of the tool.
In this case I don't know how to continue.

Anyone can help me?

答:
From now, I will solely answer your second question about forward kinematics, which is usually easier to solve than inverse kinematics.

First you should sketch your robot in a plan using textbook representations for revolute and prismatic joints, this will make it clearer for you and the others. I needed to look at the picture to see that the 4 rotations are not along parallel axis.

There are two approaches based on your degree of confidence;

you consider yourself at ease and you derive it from the position of the base by propagating in plans, this easily doable here are 3 joints remain in the same plan thus you only need to compute position in the plan, plus you don't have spherical joint or other complex mechanism

you fell less at ease and you use  a systematic way, for example one of Denawit-Hartemberg parametrization. This option is well documented in any textbook or in DeLuca's slides, freely available online. This way is systematic, and less error-prone.

Both methods boil down to the use of transformation matrices so are pretty efficient to implement nowadays.

An hint about your inverse kinematics you have 4 degrees of freedom and want to find the inverse kinematic of a 3D position, there is potentially an infinite number of solution for such a problem.

Title: forward and inverse kinematics of arm


问:
Suggestions for a rotational actuator
I am looking for a rotational actuator with high torque and one whose rotation angle can be controlled using the arduino control signals
The project is an e-brake for an e-bike.

Working mechanism
The control input from sensor is fed to arduino and from arduino to an actuator .
The actuator(to which the brake wire is connected)should rotate a predefined angle so that the brakes are engaged

Any suggestions on implementing this?
Or any other alternative mechanisms for suggestion?

答:
Typically arduino can not directly be plugged to an actuator without a motor control board in between. A motor control board is just a power stage allowing higher voltage and current than the ouptut one provided by the arduino. Typically those board are controlled with PWM signals that can be easily generated from arduino.

In order to get a better answer as for the actuator you should provide a estimated of the torque needed, the desired reaction time which can of breaking system you plan to use and where you plan to break (on the wheel outside? at the crank set?)

Title: Suggestions for a rotational actuator