问:
Learning Algorithms for Walking Quadruped
I'm building a 4 legged robot (quadruped) with 3 Degrees of freedom per leg.
The goal of my project is to make this robot able to learn how to walk.
What learning algorithms will I need to implement for it to work?

I'm using an Arduino Uno for the microcontroller.

答: I have built a lot of walking robots, in my experience if you can't get it to walk by programming a gait you are not going to get it to learn because you don't know what it is supposed to do and the search space is too large. Using an Arduino you may be able to get it to fine tune some movements iff you can define good movements.</p>


问:
building a quadcopter using STM32F3 Discovery board
how do you calculate the PID values and stabilise the quadcopter using the on board sensors The gyro accelerometer and magnetometer</p>

答:
welcome to the Robotics stack exchange! your question is very broad, so I will try to give you an overview of what you need to do:

First determine orientation based on information from both the gyroscope and accelerometer. The accelerometer is accurate in the long term while the gyroscope is accurate in the short term, so you will need some kind of sensor fusion algorithm to determine the"true" orientation of the quad. The most popular one is the Kalman Filter but many others are available to choose from.

The next thing you will want to do is build a simple rate controller where you try to match the rate of rotation on a certain axis to the rate commanded by the controller

after you have a rate controller you can build a simple stabilized controller, where instead of commanding the rate you command a certain angle. You take the desired angle and the current angle and based on those values calculate a desired rate to close that gap and then feed that into the rate controller.

You will probably need a RC controller and receiver set, you will need to read the PWM values from the receiver in order to take command input

Here is my favorite resource on the matter it helped me when I was making my first flight controller from scratch.

Good luck!

ContentLicense: CC BY-SA 3.0


问:
How to control Brushless Motor+ESC with BeagleBone?
I can't really find a real straightforward tutorial for that. There are a lot for Arduino but I only have an original beaglebone, an ESC, and brushless motor with me. Please help.</p>

答: You will need to output a servo PWM signal with a 20ms period and a pulse width generally between 1 and 2ms depending on your ESC, Here is some information about using the PWM output on a beaglebone, and here is an article describing controlling a servo with a beaglebone, it is the same as an ESC.</p>


问:
make hc-sr04 receive from another one
I have 3 ultrasonic Sensor (HC-SR04), i want to use one of them as transmitter, and the other as receiver, i want to let the first one send ultra Sonic waves and the other receive these waves from the same transmitter.

how can i do that ?

i tried to send trigger for each ultrasonic and connect them on different pins on PIC, but its now work.

its something like this project but using HC-SR04

答: According to the datasheet the sensors automatically sends and receives the pulses, you would need to independently control the speakers and microphones I am not aware of any ultrasonic sensors that give you that fine control, you would need to purchase separate ultrasonic transmitters and receivers, and construct the appropriate filtering and amplification circuitry for both. </p>

Title: make hc-sr04 receive from another one


问:
Jacobian for point on robotic arm
currently i am programming for a robotic simulation. I have a Endeffector which aproaches a target, on the way to the target is an Obstacle. Now i redirect my Endeffector, so that it does not hit the target.

When i want to do the same for the whole arm i want to push the arm away from the Obstacle as well. Now i have it working so far that i can redirect the arm. But my calculation for the Jacobian seems to be faulty.

For my setup, and what i need for that.

I have a robotic arm, 7DOF. Let $x_0$ be the closest point on the arm to the obstacle. And $J_0$ the corresponding Jacobian.
Also i have given the following term:
$\dot{x_0} = J_0 * \dot{\theta}$

$\theta$ are my joint angles. I can calculate the Jacobian for the EndEffector, but do not know on how to calculate it for a point ob the arm.

Does anybody have an Idea on how to calculate the corresponding Jacobian.

Cheers

答: If the point is on some intermediate link, you can recompute the Jacobian with only the joints leading up to that link.  See this post or your favorite robotics textbook for how to create the Jacobian.</p>

Title: Jacobian for point on robotic arm


问:
create2 angle (packet ID 20)
how to convert the value you get for the angle (packet ID 20) into degrees?
i am using the create2 robot and when I did not understand the data I am getting back. The documentation it says it's in degrees but what I get back is a huge number like 4864 when I turned the robot just 45 degrees.</p>

答:
Well, the Distance opcode (packet ID 19) has a known bug in it.  So I wouldn't be surprised if this also affects the Angle packet.  I would recommend using the Left Encoder Counts and Right Encoder Counts opcodes (packets 43 and 44) and compute the angle yourself.

The angle is pretty easy to calculate from the distances traveled by each wheel.  This document has a good introduction to mobile robot kinematics.  But simply:

$$
\theta = \frac{d_r - d_l}{l}
$$

Where $d_r$ and $d_l$ are the distances traveled by the right and left wheels respectively since the last time step.  And $l$ is the wheel base of the robot.  The wheel base, number of encoder ticks per revolution, and wheel diameter can be found in the OI Spec.

Regarding units, the units for $d_r$, $d_l$, and $l$ shouldn't matter as long as they are all the same.  $\theta$ is in radians.  Picking mm for the lengths is easy because that is what is specified in the spec.  The wheel base is 235.0 mm.  To determine mm traveled from encoder ticks, I find it easiest to think about as a unit conversion using the equation for circle circumference.  If you have $X$ ticks:

$$
d \text{ (mm)} = X \text{ (ticks)} \begin{bmatrix} \frac{1 \text{ (revolution)}}{508.8 \text{ (ticks)}} \end{bmatrix} \begin{bmatrix} \frac{\pi 72.0 \text{ (mm)}} {1 \text{ (revolution)}} \end{bmatrix}
$$

Title: create2 angle (packet ID 20)


问:
Programable Drone with robotic arm and hand?
I was just wondering if it was possible to buy or build a programmable drone with a robotic arm,hand, knife.

I want to program a drone to harvest crops.

-object recognition from live video stream to server

-identify and grab objects with arm, make cut if necessary

-transport produce to collection site

I know this would take much knowlege from many fields but do any you have any forsight into the limitations of doing this other than energy for power.

Estimates on cost of hardware?

答: There is no ready to fly model or kit. You should do it yourself arm/hand/knife. But if you use extra blade like propellers you can use it as a harvester. BLDC motors have enough power.</p>


问:
Arduino depth sensor
I'm looking for an arduino compatible depth sensor NOT for water. What I need is a sensor very similar to an Xbox kinect (but much smaller) that will tell me what is in front of the sensor and also the shape of the object. For example, if I place a cylindrical water bottle in front of the sensor I would like to be able to figure out how far away the bottle is and also the shape of the object (in 2d, I don't need to know whether it is actually a cylinder only the general shape). The sensor only needs to be accurate at most 1 meter away. Does this exist and if so where can I purchase one. If it does not exist wholly what pieces do I need to buy to put it together? Thanks.</p>

答:
If your trying to get the most for your money I would buy used 1st gen Kinect (you can get them really cheap) and take it apart from it's housing to reduce size and weight.

Another option is Asus Xtion which is similar to Kinect only smaller and does not require external power supply.

And you could always just use 2 identical cameras (maybe webcams) for stereo vision.

Title: Arduino depth sensor


问:
How to tune the two PIDs for quadrotor
I'm trying to implement two PIDs for stabilizing quadrotor for position tracking. The inputs are $x_{d}(t), y_{d}(t), z_{d}(t)$ and $\psi_{d}(t)$. For position tracking, usually the small angle assumption is assumed. This assumption allows for acquiring $\theta_{d}$ and $\phi_{d}$. These are the results

The x-axis position is driving me crazy. After alot of attempts for tuning the PIDs, I felt something wrong is going on. Is this a normal behavior for PID controller? Also, what I've noticed is that once $\psi$ reaches to zero, the platform starts oscillating (after 1.5 second in the figure).

For solving ODEs and computing the derivatives for the velocities, I use Euler methods.

It is simulation in Matlab.

答:
The controller has a definite performance problem after t=1.5sec. [This can be due to the system model or some other coding error.]

The system (model + controller) behaves smooth until t=1.5sec. It is best to magnify and debug the code at that region. The controller behaves as expected until then. Only the X has no error from T0, which makes assessing the X-axis controller impossible.

Another point also worth noting is that, the Y and Z errors should have caused some error in X, but we don't see this. So the simulation model could be simplified (like decoupled in X direction from others maybe?)

Euler angles sometimes cause computational errors in attitudes (for exact zero, or pi or pi/2's). That might be the reason.

For an understanding of the maths behind euler representation singularities, and their solutions, please refer to textbooks or articles, one example is:
http://lairs.eng.buffalo.edu/pdffiles/pconf/C10.pdf

Title: How to tune the two PIDs for quadrotor


问:
What is the technology used for no-resistance robot arms?
I saw a high end robot arm once that I could move and bend it to any form I wanted with no resistance, as if the robot arm didn't have any weight. I'd like to know more about them. What is this class of robot arm design called? Where can I get some more information about its design and applications?</p>

答:
It's called compliance. Gravity compensation by itself is not enough to achieve this, as well it is not mandatory. For example, if reducers with high reduction ratios are used, robot arm will be very stiff to move around.

One way to make robotic arm compliant is to have torque sensors that can measure the differences in expected load (i.e. weight of the arm) and actual load, when you try to move and arm. Then you simply amplify difference enough to help user to move an arm. This is called active compliance.

You can also compute expected load before hand using knowledge of the arm configuration and inertial parameters. If arm is not moving, this is called gravity compensation, thus when you try to move an arm you do not feel its weight, but only joint stiffness.

To get information of how to compute torques for gravity compensation and how to make robot compliant I recommend this course:
http://see.stanford.edu/see/courseInfo.aspx?coll=86cc8662-f6e4-43c3-a1be-b30d1d179743

Here is some more information about compliance:
http://www.eucognition.org/eucog-wiki/Compliant_robots


问:
Connecting USB Xbox Controller to National Instruments cRIO
I have a FIRST Robotics spec National Instruments cRIO.  I would like to connect a USB wireless Xbox controller to it in order to control it from a distance with minimal extra hardware (which is why I am not using the more traditional WiFi radio method).  To this point I have been able to find either

A. A sidecar for the cRIO which allows it to act as a USB host or

B. A method that does not use NI specific hardware to connect the two together

If someone who is knowledgeable on the subjects of industrial system and robot control could provide some assistance that would be greatly appreciated, thanks!

答: So you can line the Xbox controller to the FIRST dashboard software as a joystick, this would be the easiest solution, If you want to attach it directly you could use the serial port on the Crio with a USB host shield and an arduino (similar to this) and configure the arduino to translate the data to serial and then read it. the second option is to connect the SPI lines on the shield directly to the GPIO on the digital sidecar and use the included SPI interface in the WPI library. Additional modules for the Crio will not be supported in the FIRST configuration, requiring to write your own libraries and FPGA implementation from the ground up to support more than just the offical modules, along with the fact that they are very expensive.</p>


问:
Is it possible to both move and stabilize a two wheeled robot with no gyroscopes?
With two wheeled robot like this one, I have managed to stabilize it while keeping it stationary. This was done using a digital feedback control system by reading the position of the wheels to determine position, and the natural back electromotive force from the wheel motors was used in the feedback loop to determine velocity. It was kept stable with a PID controller, which was designed using a root locus algorithm to keep it stable and modulate the performance parameters (such as percent overshoot, settling time, etc.). I wanted to attempt to keep it stable while simultaneously propelling it forward, but I couldn't figure out how to go about designing a linear controller that could do that. Is it possible to both propel the robot forward and keep it stable using a feedback controller on the wheels, or is a gyroscope necessary?

答: You could use other ways of measuring orientation, such as an accelerometer, optical tracking of markers, or a depth sensor pointed at the floor.</p>


问:
Design and construction of universal robotic arm (5kg, 1m)
i am working on my master's thesis about design and construction of universal robotic arm.
Goal of my work is to design 5 DOF robotic arm. Something like on the picture:

I need it to be able to lift a weight about 5kg. It has to move in "action radius" 1m. Rotation speed should be about 1m/s. The conclusion of my work should be like: "You can buy ABB robotic arm or you can but this..it can lift that much, can turn that speed and weighs that much". Basic construction should be done too. Maybe with some simulation.

First of all - i picked really bad master's thesis for me, i know that know.
Second - i have like month to finish it.
I would like to ask someone how to proceed.
I know that first step is to pick servos/actuators/gearboxes, but which one?
What is realistic weight of the whole arm which should lift another 5 kg of weight? How strong motors should i pick or with what gearboxes?

Is anyone able to help me via maybe emails?

答:
To answer your questions about the motors/gearing:

To lift 5Kg at 1 metre distance - the "shoulder" torque needs to be 500 Kg.cm or about 5000 N.cm.

This is far above the torque of most model servos, so forget them; robots of this sort of performance generally use a specialist motor, much more than 12V and a purpose built gearing arrangement that probably more costly than the motor.  (Often harmonic drives, though a more conventional spur gearing arrangement will work for less performance and more backlash.)

Motor power to get a reasonable speed can be calculated from the torque and the rotational speed you're designing for - at least several hundred watts.  This would assumes the arm itself has zero mass by the way, so would be a wild underestimate.

Actual weight is impossible to estimate without first making an initial mechanical design; it depends where the other motors are located and how heavy they are, since the robot must lift its own weight.  Robots I've learned on in the past (very old PUMA robots, quite well known) are far heavier than the 5Kg payload you want to lift; maybe 30-50Kg or so for the whole arm and rotation axis?

(This is much more than a month of work, I'm sorry to say.)


问:
Locating Omni-Directional Robot
I have an omni-directional robot, such as a X-Drive or mecanum Drive that I need to track the position of. I can put encoders on the wheels, but that is all I can do in terms of the sensors. I have no external beacons that I can link to. The issue is that I needed to keep track of X-Y position, including strafing, and my heading. Does anyone have any resources that could help me with this.</p>

答:
First of all, assume that the sensors we have are ideal (e.g. no latency, perfect accuracy, infinite (continuous) data frequency).

Then we can know the rotation rate of each of the wheels. and how much they have been turning from T_zero (initial time) until time, T.

making a few more assumptions, we can arrive at a computed X-Y location:

wheel sizes do not change with time (because we are trusting the angular position of the wheels to determine the movement in that direction, and we have to assume a radius for the wheel)

no slip in the wheels' turning direction.

Given these assumptions, calculations would follow as simple mathematics.

Depending on the operational scenarios, the validity of the assumptions should be re-considered. This might require some other fixing of coordinates using a secondary sensor-type. For example, in case there is an unnoticed slip of the wheels, the error would simly build up with time, and after some time the solution would be out of tolerances.

I came across this wonderful introduction to Xdrive robots. Which gives kinematics for their motion schemes, and so on.

It gives another method for calculating the location, using external sensors. But, it is definitely a good article worth reading.

Title: Locating Omni-Directional Robot


问:
PID control of tank-like robot and IMU
Consider a tank like robot with a motor driver channel for each side of the robot (two motors on the left and two motors on the right) and an IMU.
I'm interested in driving the robot in a straight line using the yaw data from the gyro and magnetometer of the IMU, removing the noise caused by slightly different behaving motors, and the possibility to change the desired direction angle. For example some event comes and I want the car to switch the desired direction to +120 degrees and turn while driving.

I'm using Arduino Uno, MinIMU-9 v3 and two DRV8838 Single Brushed DC Motor Driver from Pololu.

Can you please give me some hints and a short pseudo-code example?
Thanks!

答:
Assume that your motors can drive both forward and back. (which is not a must, but if the vehicle moves only forward, maneuvering will require a lot of space compared to a two-directional drive)

Assume that you want to manually control speed, by commanding to all motors.

variables:
r  = gyro yaw rate (can be positive or negative, assume (+) for yaw to left; assume we are interested in +/-10deg per second magnitude)
H  = heading from magnetometer (0 to 360)
H_com = commanded (desired) heading
M_com = speed term (motor power, controlled by the user)

M_l = left motor power (can be positive or negative)
M_r = right motor power (can be positive or negative)

M_l = M_com + Kr * r + Kh * (H_com - H)
M_r = M_com - Kr * r - Kh * (H_com - H)

Kp and Kh are to be found by analysis or trial and error.
(H_com-H) is the error term that the controller tries to zeroize, by moving the vehicle(H) to H_com.

Notes:

you should add some modulus logic, as you wouldn't want to go 300 degrees when you could only go 60 degrees to the desired heading.

at max speeds (max forward, or max rearward), the yaw authority is limited (as motor speeds hit their max), so Kr and Kh may need to be altered to be functions of speed.

for controller tuning strategies, refer to this question.

Title: PID control of tank-like robot and IMU


问:
Easiest way to submit a longer non standard character string via MAVLink
I want to submit my gains for the PID regulator via MAVLink.
Unfortunately, I am not very used to MAVLink and there are several functions which may be used for that purpose (I think). My string is currently JSON formatted and I was directly sending it to the serial port before.

Is there a straight forward way to submit the data like it is (see below) with MAVLink, or is it better not to transfer a JSON string with MAVLink and submit each single value? If yes, what is the function of choice.

So far I noticed that for most of the sensors, there are already MAVLink function defined. For the PID gains I found not so much.

```<code>AP_HAL::UARTDriver *pOut = uartX == UART_C ? hal.uartC : hal.uartA;
pOut->printf( "{\"t\":\"pid_cnf\","
              "\"p_rkp\":%.2f,\"p_rki\":%.2f,\"p_rkd\":%.4f,\"p_rimax\":%.2f,"
              "\"r_rkp\":%.2f,\"r_rki\":%.2f,\"r_rkd\":%.4f,\"r_rimax\":%.2f,"
              "\"y_rkp\":%.2f,\"y_rki\":%.2f,\"y_rkd\":%.4f,\"y_rimax\":%.2f,"
              "\"p_skp\":%.2f,\"r_skp\":%.2f,\"y_skp\":%.4f}\n",
              static_cast<double>(pit_rkp), static_cast<double>(pit_rki), static_cast<double>(pit_rkd), static_cast<double>(pit_rimax),
              static_cast<double>(rol_rkp), static_cast<double>(rol_rki), static_cast<double>(rol_rkd), static_cast<double>(rol_rimax),
              static_cast<double>(yaw_rkp), static_cast<double>(yaw_rki), static_cast<double>(yaw_rkd), static_cast<double>(yaw_rimax),
              static_cast<double>(pit_skp), static_cast<double>(rol_skp), static_cast<double>(yaw_skp) );
</code>```

答:
You need to use the mavlink parameter protocol, which is a coordinated set of mavlink messages between the ground control station and the vehicle (a bit trickier than just sending strings over the serial port, unfortunately).  The protocol is documented here: http://qgroundcontrol.org/mavlink/parameter_protocol

The following diagrams shows the flow of messages (replace "QGroundControl" with your application and "MAV Component" with your vehicle):

(You might also want to double check the parameter names for the particular flight controller/vehicle you're using, e.g. here are the parameters for ArduCopter/APM:Copter: http://copter.ardupilot.com/wiki/configuration/arducopter-parameters/)


问:
How to request a specific Mavlink packet from Ardupilot?
I'm developing a program for communicating with Ardupilot using Mavlink. I've generated code based on the Mavlink definition for Ardupilot, and I have the basic communication working.

What I can't figure out, is how to request Ardupilot to send a specific Mavlink message. I'd like Ardupilot to send me Mavlink message Attitude (#30) every second. How can I do this?

答:
nikhil's answer is not correct: You definitely don't have to change the ArduCopter code just to get it to stream ATTITUDE messages (if that were true, how are all the ground control station apps showing the vehicle's changing attitude?)

In ArduCopter, the ATTITUDE message is streamed at a constant rate in Hz that is determined by the value of the SR0_EXTRA1 parameter.  I think the default rate is 10 Hz, but you should check the value of that parameter on your vehicle.  You may also want to check the values of SR0_EXTRA2 and SR0_EXTRA3.


问:
Is it possible to use ROS on RPI with controller like MultiWii or similar?
I have a quadcopter using a MultiWii(Arduino Mega) controller. I am curious if there is any way to connect it with ROS capable RPI. (That I could add to the quad itself).</p>

答:
Yes! There is something called the Navio+ it runs a Linux kernel on the raspberry pi with the real-time extension, and runs Adrucopter on top of that.

You can also just connect the serial pins directly to the MultiWii and let the rpi do high level control and let the MultiWii do low level control.

Edit: Here is the reference for the MultiWii serial protocol (MSP) it is very powerful allowing you to do everything from sending RC stick commands, to receiving and injecting GPS values.


问:
Beaglebone not accessible through LAN?
Since the day I bought it I always use ethernet over USB connection, now I need to use RJ45 LAN cable to connect Beaglebone from my laptop, but my laptop can't even detect LAN connection from it, what could go wrong? Do I need straight or crossover cable? Do I need to configure something first on my BeagleBone?

UPDATE: Managed to connect it through Crossover cable and assign it IP
  address by running DHCP server on my laptop.

As seen above my laptop assign IP 169.254.223.76, but when I tried to
  connect to that IP using puTTY it gives me connection refused.

Please help.

答: You can configure it with a static ip address, and assign your laptop a (different) static ip address. Here is a link to a guide to setting a static ip address.</p>

Title: Beaglebone not accessible through LAN?


问:
Depth image sensor for integration into robot
I know there are lots of consumer depth image sensors: kinect, primesense, structure.io, leap motion, ... But I'm looking for something that is more suitable for integration into robot, something without case or with proper mount, compact and available for at least next five years if robot is going to production. Something similar to the sensors used in this drone https://www.youtube.com/watch?v=Gj-5RNdUz3I</p>

答: What kind of processing power are you hoping to carry to do the depth sensing/processing? I would recommend the ZED camera when paired with an Nvidia K1 it works great for mobile vision processing, it is not environmentally sealed so it can only operate in good weather. It works from about 2-30m for most applications. if you are looking for bigger objects (like building sized) it can work a little further, around 50m. </p>


问:
What was the earliest concept of a robot?
I'm a highschool student studying electronics and for an assessment task on the history of electronics I have decided to focus on the history of robotics. I want to begin with the earliest possible concept of a robot and progress through major developments in robotics to the current day. Where should I begin my research?</p>

答:
I started where you are but found lots of misconceptions and omissions so I started a small page on History making robots at http://davidbuckley.net/DB/HistoryMakers.htm
Reuben Hogget contributed a lot of information and after our trip round Europe talking to researchers who had built robots in the 1950s he started http://cyberneticzoo.com - not everything about the history of robotics is there yet. Humans have talked about robots (by other names) for a long time.
In the Greek myths Hephaestus creates 'walking' tripods and golden ladies to help him. The Greeks built large animated sculptures such as a 12 foot high statue of Nysa mounted on a huge cart. Heron of Alexandria (~50AD) created animated figures for theatre shows and also described mechanically programmable devices. There was nothing particularly new about Leonardo's drawings of a mechanical statue of a knight, it is just that his drawings have survived. The first 'modern' 'robot' was probably Dederick's 1868 steam man (Boilerplate is fictional). From early in the last century there have been many drawings of electromechanical men and several working ones (albeit of limited funtionality and really precursors of Disney's animatronic figures). Capek's RUR really only went along with people's fascination with robots (the robots he describes though are biological). A major advance came in the 1940s with Grey Walter's tortoises Elmer and Elsie which had simple electronic brains. The mobile robot Shakey (1966) was another 'milestone'. After that you have the walking robots from Waseda University, the subsumption (a dead end) robots from the MIT Mobile Robot Lab, and then Honda's P2 humanoid which led to a veritable explosion of humanoid robots from Japan followed by Korea and others. Whatever you read, all the writers will have their own slant on things and it is a huge field. Reuben has well over 500 posts on robotics history and PlastiPals.com is the site to read for more modern robots. </p>


问:
Building industrial-like robotic arm
I would like to build a 70cm articulated robotic arm (not a scara one) that can lift between 10kg and 15kg (10kg would be awesome already, this payload includes the weight of the arm+gripper) and moves at 1 m/s (dreaming again :)). The goal is to make it similar to an human arm since I want to control it "remotely", so the joint should not be able to rotate more than my arm ^^

So I know that I cannot uses servos available (like the overpriced dynamixel ones..)  with that payload. I also already excluded common linear actuators and less common ones like the pneumatic actuators (because of latency).

From what I read arms like the baxter ones uses elastic series actuators, so I guess that I should go that way, but there aren't a lot of details on how that works (getting a lot of 100x100 photos where you see nothing) and I have a lot of questions.
The only thing I could understand is that it uses 2 motors and a spring.

Do they use brushed or brushless motors? DC motors or steppers ? I read that steppers aren't that good to handle collisions and have difficulties when used at their limits.

Also, how is the spring mounted on the motor ?

To sum up, I'm collecting any experience, diagrams, intel, or documents that you have on that topic :)

PS : my budget can't exceed +/- 1500$ for that arm.

答:
A series elastic actuator is really just a motor/gearbox with passive compliance built in (hence the spring).  A google search finds http://ihmc.us/groups/sea/ (with links to some specs and information) and an older thesis, http://groups.csail.mit.edu/lbr/hrg/1995/mattw_ms_thesis.pdf

So the motors & gearboxes you use will still have to be pretty high in performance, regardless of whether they have elastic elements.  (Sorry but I think your budget is far too low for this torque requirement.)

Title: Building industrial-like robotic arm


问:
DH Forward Kinematics for a Cartesian Robot (CNC Mill)
I am implementing a Denavit-Hartenberg forward transform for a 3-axes CNC mill. I know that the kinematic for such a machine is trivial and doesn't need DH, but I need to make appliable for other robots too. My implementation does the math correctly(I've verified that with another tool), but the transformation doesn't give me the results I would expect.

I assume that for 3-axes cartesian robot with orthogonal prismatic joints(=CNC mill) the resulting transformation matrix should give me the input parameters(d1-d3) back in its translation vector, but it somehow doesn't. Also, the resulting orientation matrix should have some "nice" values(90, 180, 270, etc.) and no odd ones(0.0528, 0.5987, etc,.).
Is my assumption wrong?

答: Okay, I feel really dumb now. Turns out my sine/cosine functions take radiant as input rather than degrees. As expected, the resulting transform matrix has "nice" values. Since my implementation and the other tool, which I checked the results with, both use rad as input. Consequentially I assumed the math was correct, which was false and resulted in odd numbers. </p>


答:
A machinedesign.com article,  “Exclusive interview: Gill Pratt on how compliant actuators revolutionized robotics”, includes a close-up picture of an SEA (series elastic actuator) mechanism developed by a robotics research group at Vrije in Brussels, and a picture of a Baxter arm, captioned “In the larger red circle is one of Baxter's many compliant actuators, which give the robot a yielding motion that in turn allows for force-feedback control.”  The article suggests using affordable gearmotors, plus SEAs for compliance and energy conservation.  It also mentions some alternatives to SEAs.

A spectrum.ieee.org article, “This Humanoid Robot Gets Pushed Around But Stays on Its Feet”, describes a robot with numerous SEAs and has close-up pictures of springs in the joints.

Comment 1. Industrial robots exist that can meet the requirements listed in the question, but they typically cost 10 to 100 times as much as the amount mentioned.  If you can build such an arm for $1500, you probably can make a lot of money selling them!

Comment 2. I presume you have a particular industrial application in mind for the specified robotic arm.  You may do better asking how to meet the needs of the application instead of asking how to make an arm.  For example, it may be that a light-weight articulated boom could be quickly moved to a target location, then have its joints locked (a locked joint typically can support a larger load than a movable joint) and an overhead support cable tensioned up.  Then the 10-15 kg load would be towed along a line to the end of the boom.

Title: Building industrial-like robotic arm

Body:
I would like to build a 70cm articulated robotic arm (not a scara one) that can lift between 10kg and 15kg (10kg would be awesome already, this payload includes the weight of the arm+gripper) and moves at 1 m/s (dreaming again :)). The goal is to make it similar to an human arm since I want to control it "remotely", so the joint should not be able to rotate more than my arm ^^

So I know that I cannot uses servos available (like the overpriced dynamixel ones..)  with that payload. I also already excluded common linear actuators and less common ones like the pneumatic actuators (because of latency).

From what I read arms like the baxter ones uses elastic series actuators, so I guess that I should go that way, but there aren't a lot of details on how that works (getting a lot of 100x100 photos where you see nothing) and I have a lot of questions.
The only thing I could understand is that it uses 2 motors and a spring.

Do they use brushed or brushless motors? DC motors or steppers ? I read that steppers aren't that good to handle collisions and have difficulties when used at their limits.

Also, how is the spring mounted on the motor ?

To sum up, I'm collecting any experience, diagrams, intel, or documents that you have on that topic :)

PS : my budget can't exceed +/- 1500$ for that arm.


问:
How frequently should a PID controller update?
I am developing a quadcopter platform on which will be extended over the next year. The project can be found on Github. Currently, we are using an Arduino Uno R3 as the flight management module.

At present, I am tuning the PID loops. The PID function is implemented as:

```<code>int16_t pid_roll(int16_t roll)
{
    static int16_t roll_old = 0;
    int16_t result =
    (KP_ROLL * roll) +
    (KI_ROLL * (roll_old + roll)) +
    (KD_ROLL * (roll - roll_old))
    ;
    roll_old += roll;
    result = constrain(result, PID_MIN_ROLL, PID_MAX_ROLL);
    return -result;
}
</code>```

I am having trouble interpreting the system response on varying the constants. I believe the problem is related to the questions below.

How frequently should a PID controller update the motor values? Currently, my update time is about 100-110 milliseconds.

What should be the maximum change that a PID update should make on the motor thrusts? Currently, my maximum limit is about +-15% of the thrust range.

At what thrust range or values, should the tuning be performed? Minimum, lift off, or mid-range or is it irrelevant?

答:
I have programmed a quad myself and learned to stay away from the PulseIn function. What it basically does is waiting and constantly reading the pin.
I believe Arduino UNO has 2 interrupt input pins, try using those.With some receivers it is possible to use OR ports if pulses are sent one after the other, and combine pulses into a CPPM signal. Interrupt handlers don't take too much time, all you need to do is to start and read a timer. Using this technique I got a rate of well over 200Hz</p>


答:
It is related with response time of electronic speed controller units and bldc motors. In discrete time only Ki and Kd have time variable. In a stable system If you change the sample rate you have to change Ki and Kd to companse it. So you can do it conversly. You can change just Ki and Kd constants instead of changing sample rate. both make same effect. </p>

<p>You can look this link for relation between PID and sample rate : http://support.motioneng.com/downloads-notes/tuning/scaling_pid_param.htm </p>

Title: How frequently should a PID controller update?

Body:
I am developing a quadcopter platform on which will be extended over the next year. The project can be found on Github. Currently, we are using an Arduino Uno R3 as the flight management module.

At present, I am tuning the PID loops. The PID function is implemented as:

```<code>int16_t pid_roll(int16_t roll)
{
    static int16_t roll_old = 0;
    int16_t result =
    (KP_ROLL * roll) +
    (KI_ROLL * (roll_old + roll)) +
    (KD_ROLL * (roll - roll_old))
    ;
    roll_old += roll;
    result = constrain(result, PID_MIN_ROLL, PID_MAX_ROLL);
    return -result;
}
</code>```

I am having trouble interpreting the system response on varying the constants. I believe the problem is related to the questions below.

How frequently should a PID controller update the motor values? Currently, my update time is about 100-110 milliseconds.

What should be the maximum change that a PID update should make on the motor thrusts? Currently, my maximum limit is about +-15% of the thrust range.

At what thrust range or values, should the tuning be performed? Minimum, lift off, or mid-range or is it irrelevant?

Body:
It is related with response time of electronic speed controller units and bldc motors. In discrete time only Ki and Kd have time variable. In a stable system If you change the sample rate you have to change Ki and Kd to companse it. So you can do it conversly. You can change just Ki and Kd constants instead of changing sample rate. both make same effect.

You can look this link for relation between PID and sample rate : http://support.motioneng.com/downloads-notes/tuning/scaling_pid_param.htm


问:
iRobot Create 2: Angle Measurement
I have been working on trying to get the angle of the Create 2. I am trying to use this angle as a heading, which I will eventually use to control the robot. I will explain my procedure to highlight my problem.

I have the Create tethered to my computer.

I reset the Create by sending Op code [7] using RealTerm.
The output is:

bl-start

  STR730

  bootloader id: #x47175347 4C636FFF

  bootloader info rev: #xF000

  bootloader rev: #x0001

  2007-05-14-1715-L

  Roomba by iRobot!

  str730

  2012-03-22-1549-L

  battery-current-zero 252

  (The firmware version is somewhere in here, but I have no clue what to look for--let me know if you see it!)

I mark the robot so that I will know what the true angle change has been.

I then send the following codes [128 131 145 0x00 0x0B 0xFF 0xF5 142 6]. This code starts the robot spinning slowly in a circle and request the sensor data from the sensors in the group with Packet ID 2. The output from the Create seen in RealTerm is 0x000000000000, which makes sense.

I wait until the robot has rotated a known 360 degrees, then I send [142 2] to request the angle difference. The output is now 0x00000000005B.

The OI specs say that the angle measurement is in degrees turned since the last time the angle was sent; converting 0x5B to decimal is 91, which is certainly not 360 as expected.

What am I doing wrong here? Is the iRobot Create 2 angle measurement that atrocious, or is there some scaling factor that I am unaware of? are there any better ways to get an angle measurement?

答: There is a known bug in the angle command.  We are still working on a workaround.  In the meantime, please extract the angle yourself by using the left and right encoder counts.  See this question for detailed equations.

Title: iRobot Create 2: Angle Measurement


问:
What is the RobotC type for motors?
I'm trying to create a function that allows me to more easily start a motor, but I'm running into a problem, I don't know the type to use for the motorName argument. I'm using a VEX 269 Motor. Here's the function.

```<code>void runMotor(MotorTypeHere motorName, int speed, int time)
{
  startMotor(motorName, speed);
  wait(time);
}
</code>```

I just don't know what type to put for the motorName argument. What type would it be?

答:
Looking at some of the docs I see that the startMotor function usually takes values like portN as in:

```<code>startMotor(port8,-32);
startMotor(port9,128);
</code>```

and I am also seeing that some code looks like this:

```<code>motor[port8] = -32;
motor[port9] = 128;
</code>```

so that tells me that since it is an index into an array it must be just simply an int.

Update:
I can see on this page that within VEX it is actually a variable of type tMotor. But it can't work as an index in C unless tMotor is an alias for some sort of int. Ultimately, the best choice would be to use tMotor in your code.

Title: What is the RobotC type for motors?

Body:
Looking at some of the docs I see that the startMotor function usually takes values like portN as in:

startMotor(port8,-32);
startMotor(port9,128);

and I am also seeing that some code looks like this:

motor[port8] = -32;
motor[port9] = 128;

so that tells me that since it is an index into an array it must be just simply an int.

Update:
I can see on this page that within VEX it is actually a variable of type tMotor. But it can't work as an index in C unless tMotor is an alias for some sort of int. Ultimately, the best choice would be to use tMotor in your code.


答:
If you want a low cost vision sensor that does all the work for you I sugest you look here -> Pixy Cam

From here you can work with two cameras and build your application using stereo vision to achieve 3D. You will have some work, because you have to use some kind of controller (arduino, netduino, whatever), build your own algorithm, build a case, etc... but it's cheap and it works fine.

Also, look here -> Question regarding 3d scanning and camera choice

Title: Depth image sensor for integration into robot

Body: I know there are lots of consumer depth image sensors: kinect, primesense, structure.io, leap motion, ... But I'm looking for something that is more suitable for integration into robot, something without case or with proper mount, compact and available for at least next five years if robot is going to production. Something similar to the sensors used in this drone https://www.youtube.com/watch?v=Gj-5RNdUz3I</p>


问:
Questions regarding 3D scanning and camera choice
A few days ago, I just shared my concerns about the price of computer vision hardware on this same exact forum (see What main factors/features explain the high price of most industrial computer vision hardware?) and I think a new but related post is needed. So here we go.

Here are some details to consider regarding the overall scanner I want to build:

Restricted space: my overall scanner can't be larger than 3 feet cube.

Small objects: the objects I will be scanning shouldn't be larger than 1 foot cube.

Close range: the camera would be positioned approximately 1 foot from the object.

Indoor: I could have a dedicated light source attached to the camera (which might be fixed in a dark box)

Here are the stereo cameras/sensors I was looking at (ordered by price):

Two Logitech webcams (no model in particular)

Cheap

Harder to setup and calibrate

Need to create your own API

Built for: what you want to achieve

Intel RealSense: http://click.intel.com/intel-realsense-developer-kit.html

$100

High resolution: 1080p (maybe not for depth sensing)

Workable minimum range: 0.2 m

Unspecified FOV

Built for: hands and fingers tracking

Kinect 2.0: https://www.microsoft.com/en-us/kinectforwindows/

$150

Low resolution (for depth sensing): 512 x 424

Unworkable minimum range: 0.5 m

Excellent FOV: 70° horizontal, 60° vertical

Built for: body tracking

Structure Sensor http://structure.io/developers

$380

Normal resolution with high FPS capability: 640 x 480 @ 60 FPS

Unspecified minimum range

Good FOV: 58° horizontal, 45° vertical

Built for: 3D scanning (tablets and mobile devices)

ZED Camera: https://www.stereolabs.com/zed/specs/

$450

Extreme resolution with high FPS capability: 2.2K @ 15 FPS (even for depth sensing) and 720p @ 60 fps

Unviable minimum range: 1.5 m

Outstanding FOV: 110°

Built for: human vision simulation

DUO Mini LX: https://duo3d.com/product/duo-minilx-lv1

$595

Normal resolution with high FPS capability: 640 x 480 @ 60 FPS

Workable minimum range: 0.25 m (see https://stackoverflow.com/questions/27581142/duo-3d-mini-sensor-by-code-laboratories)

Phenomenal FOV: 170° (with low distortion)

Built for: general engineering

Bumblebee2: http://www.ptgrey.com/bumblebee2-firewire-stereo-vision-camera-systems

Too much expensive (not even worth mentioning)

Note: All prices are in date of April 18th 2015 and might change overtime.

As you can see, some have really goods pros, but none seems to be perfect for the task. In fact, the ZED seems to have the best specifications overall, but lacks of minimum range (since it is a large baselined camera designed for long range applications). Also, the DUO Mini LX seems to be the best for my situation, but unlike the ZED which generates really accurate depth maps, this one seems to lack of precision (lower resolution). It might be good for proximity detection, but not for 3D scanning (in my opinion). I could also try to build my own experimental stereo camera with two simple webcams, but I don't know where to start and I don't think I will have enough time to deal with all the problems I would face doing so. I am now stuck in a great dilemma.

Here are my questions:

What good resources on the internet give you a good introduction on 3D scanning concepts (theoretically and programmatically)? I will be using C++ and OpenCV (I already worked with both a lot) and/or the API provided with the chosen camera (if applies).

Should you have a static camera capturing a moving object or a moving camera capturing a static object?

Should I use something in conjunction with stereo camera (like lasers)?

Is it profitable to use more than two cameras/sensors?

Are resolution, FPS and global shuttering really important in 3D scanning?

What camera should I get (it can also be something I didn't mention, in the range of $500 maximum if possible)? My main criteria is a camera that would be able to generate an accurate depth map from close range points.

Thanks for your help!

答:
PCL library has all the functionality you need for 3D scanning, as well as it have the complete GPU pipeline, take a look at kinfu. Here is some tutorial regarding 3D scanning. Take a look at MeshLab too see how to do it manually.

Any approach will work. With object rotating on the platform you potentially has more information of object position, thus making registration step more robust (see tutorial). But anyway all the scanning algorithm steps will be the same.

I don't recommend you to use stereo cameras or single moving camera (structure from motion approach) for 3D scanning. Structured light sensors and time-of-flight sensors will give you much better results.

It is possible. Results will probably be marginally better. More data => better results.

Resolution and FPS - yes. But you need beefier computer to process all the data. Depending on used scanning algorithm global shuttering as well as controlled illumination and exposure are important if you want to achieve submillimeter accuracy or reconstruct texture. But I would not bother about that in the beginning.

Here are some structure light or ToF depth imaging sensors you might consider, including the ones you mentioned. Choose one according to your min/max range requirements, budget, processing power, SDK availability. Currently the easiest to start working with are Primesense/ASUS cameras. ROS/OpenCV/PCL - all of the support these two cameras and Kinect with a little bit of hacking:

Kinect 1, 2

Primsense Carmine 1.082, 1.09 or Asus Xtion

Creative Senz3D (based on SoftKinectic module)

Structure.io

Intel RealSense

PMD Pico

ESPROS


问:
Why are Servo Motors so noisy?
I was working on a project to make a bedside night light out of a stuffed butterfly or bird. I was making a mechanism to make the wings flap with a servo motor and some small gears. The servo motor was very loud as it moved. And this was whether or not the servo was moving large amounts, small amounts, fast or slow.

I've worked with small servos before and realized they usually are pretty noisy machines, but I can't really explain why.

Why are small servo motors noisy when they move? Is it backlash in the internal gearing?

答:
They aren't.  The word servo refers solely to a device that uses negative feedback for control.

Gearboxes or cheap brushed motors can be noisy.  You can get very quiet systems if you are willing to pay for it.

Cheap hobby grade servos can sometimes chatter if they do not settle in a stable state.  This is normal and is caused by poor tuning, a lack of a deadband, and backlash between the motor and the encoder (potentiometer).

Gearbox noise is caused by the spur gear teeth hitting eachother.  You can use heavier grease or quieter gear geometries such as helical gears which mesh smoothly.

There are also piezoelectric or memory wire based servos which are completely silent.

Title: Why are Servo Motors so noisy?


问:
Measuring angular displacement using the TI-SensorTag
I've looked around but can't find the answer, to what I hope is a simple question. I'm working with a TI-SensorTag, and I want to be able measure the rotation around the unit's Z-axis. Basically I want to attach the tag to a clock pendulum, lie the clock on a table so the tag and clock face point up, and to measure the angular displacement of the pendulum as it swings back and forth. I'm hoping the mental image translated well!

My understanding is that I can solve for displacement by multiplying my gyroscope readings by my sampling period, but I'm not sure how to compensate for drift. So my questions are: is my approach sound, and is the answer to drift to use the changing x and y accelerations? Or would I need to somehow incorporate the magnetometer readings?

Thanks!

答:
For your application the magnetometer data are the best to use.

The accelerometer data are completely useless. The gyro data have the drift problem, but the magnetometer data are the best.

The earth's magnetic field can be seen like some kind of vector field. Any place on the earth is a specific field, which you can calculate on this webpage:
 http://www.ngdc.noaa.gov/geomag-web/#igrfwmm

So basically the vertical component is useless for you application. In addition, you see, that east component is way smaller than the north component. So you can neglect the east component.
The rest is applying a simple trigonometric operator on the measurement and you are done.


问:
Determining a robot's distance from a certain point when the robot's position is constantly changing
I was wondering how I could determine a robot's distance from a fixed point when the robot itself is constantly changing positions. I can keep encoders on the wheels and can also get data from a gyroscope and an accelerometer.</p>

答:
If you know the position of the point at the begin, an easy solution would be to implement Dead Reckoning using the encoder value. Knowing the position of the robot at time t, compare it to its initial position and you can easily find where the fixed point is, in the robot frame (and thus calculate the distance).

Then to compensate the drift create by the dead reckoning process, you can use the values given by your IMU (gyro and accelerometer).


答:
In addition to Malc's answer, a simple Dead Reckoning Algorythm might look like this:

$$
X_k = X_{k-1} + f(u)
$$

where:
$$
X=\left(\! \begin{array}{c}
      PosX \\
      PosY \\
Heading
    \end{array} \!\right) \phantom {AAAAA} u=\left(\! \begin{array}{c} EncLeft \\ EncRight \end{array} \!\right)
$$

$f(u)$ is the change of the state $X$ since the last measurement. To calculate this change you need the Measurement $u$, which is in the most simple version just your Encoder values. In this case the encoder values are already transformed to their respective distance, therefore the unit is in meters or something similar.

In addition you need your wheelbase $r$ and the SamplingTime $Ts$ of your algorythm.

The update of $PosX$ might be:

$$
PosX_{(k)} =PosX_{(k-1)} + \cos {(Heading_{(k)})} \cdot  \frac{EncLeft_{(k)} +EncRight_{(k-1)}} 2
$$

Similar for $PosY$:

$$
PosY_{(k)} =PosY_{(k-1)} + \sin {(Heading_{(k-1)})} \cdot  \frac{EncLeft_{(k)} +EncRight_{(k)}} 2
$$

The change in heading might be expressed with:

$$
Heading_{(k)}=Heading_{(k-1)}+ \arctan \left(\! \frac{EncLeft-EncRight} r \!\right)
$$

Some Points, like the calculation of the heading, are pretty simplified, but may work in "homemade" application

Further improvements might be done with feedback from the IMU sensor.

Title: Determining a robot's distance from a certain point when the robot's position is constantly changing

Body: I was wondering how I could determine a robot's distance from a fixed point when the robot itself is constantly changing positions. I can keep encoders on the wheels and can also get data from a gyroscope and an accelerometer.</p>


答:
This document has a good overview of mobile robot kinematics which is required to perform dead reckoning.

Adding the IMU provides more information and can correct for drift of the encoders.  But now you need to fuse the data, typically with a kalman or particle filter.  Traditionally, mobile robots will also have a planar laser range finder (LIDAR) sensor such as a Hokuyo.  By doing incremental scan matching you can further improve accuracy.  In addition to now being able to map and such.  This is approaching SLAM.

Additionally, determining "ground truth" location is achieved through the use of other sensor modalities.  For example a motion capture system like Optitrack, or a webcam pointed at the ceiling with April tags on it.


问:
Got Difficulty in reading Specification?
Guys I am making a home automation system very simple one with infrared remote ccontrol of tv remote Now the problem is I wanna buy a some relays to switch 230V AC using my arduino board but can't understand which one to buy I don't want to buy relay module but I wanna buy relay.</p>

答: For you, the safest option is probly be the Power Switch Tail It needs no transistors and is very simple, simply set the arduino pin high or low to turn on or off the connected device. Just be careful connecting it to Vacuums and other inductive loads (ie those with motors) as they draw a large current on startup. </p>


问:
read from Ultrasonic HC-SR04
i want to run two HC-SR04 on one PIC16F877A and send the value mesured by the two ultrasonic to serial port.

this is my code using PIC C Compiler :

```<code>#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#define e1 PIN_B6
#define t1 pin_B7
#define e2 pin_B4
#define t2 pin_B5
int a;
int distanse(int,int);

void main()
{

while(1){
int u1,u2;
u1=distanse(e1,t1);u2=distanse(e2,t2);
printf("%3u", u1);
printf("%3u", u2);
delay_ms(1000);

}
}

int distanse(int e,int t){
long long counter=0;
output_bit(t,1);delay_us(10);output_bit(t,0);
a=input(e);
while(a==0){a=input(e);}
while(a==1){counter=counter+1;a=input(e);}
return counter/3.333333;
}
</code>```

but the computer received random values !
what is the problem ?

答: Ultrasonic sensors work by emitting a set of pulses and reading the return signal (here is a better overview), this causes problems when you have more than one as they cannot distinguish between their own sensor and the other. I would suggest putting a 500ms delay after each reading to avoid as much interference as possible while you keep the same read rate.</p>

Title: read from Ultrasonic HC-SR04


问:
How can I improve the range of an XBee S6B?
Has anyone used the XBee WiFI modules? Done a range check on them?

With my laptop i get a range of around 400m on industrial level Accesspoints on a football field, well how good are these devices ? If i get a SMA Connector version and use a higher gain antenna am I looking at ranges from 250-500m ? (Talking 18-22dBi gains here).

答: Depends whether you're talking Point to point or just in a wifi field. According to the datasheet the transmit power is +16dBm or 40 mW and a maximum sensitivity of -93dBm. According to my favorite link budget calculator with 2 of these modules both with 22dBi gain antennas on them you will get around 6 miles (RF line of sight) out of them with a respectable 33dB fade margin. But I suspect you are asking about accessing a standard wifi router, and with a receiving antenna gain of 0dBi (perfictaly omnidirectional) and a sensitivity of -70dBm (crappy ap) you will have a fade margin of around 13dB which would work, and I suspect it would be higher. So, those modules should work for your application, but the best way to find out is to test them. </p>


问:
Quadruped Learning Simulator
I'm currently building a robot with four legs (quadruped), 3 DOF (Degrees of Freedom) and Its been suggested here that I use a simulator to do the learning on a computer and then upload the algorithms to the robot. I'm using an Arduino Uno for the robot and what software could I use to simulate the learning and then be able to upload to the Arduino board?</p>

答:
This wouldn't cover the robot simulation, but the OpenCV Machine Learning Library might be useful for evaluating learning algorithms and training parameters to download to the robot.

It includes a neural network implementation, which may be of particular interest for this problem.

OpenCv is a standard library too, and would likely integrate well with some other simulator for the robot itself.

Title: Quadruped Learning Simulator


问:
Determining transfer function of a PTU for visual tracking
I have a PTU system whose transfer function I need to determine. The unit receives a velocity and position, and move towards that position with the given velocity. What kind of test would one perform for determining the transfer function...

I know Matlab provides a method. The problem, though, is that I am bit confused on what kind of test I should perform, and how I should use Matlab to determine the transfer function.

The unit which is being used is a Flir PTU D48E

---> More about the system

The input to the system is pixel displacement of an object to the center of the frame. The controller I am using now converts pixel distances to angular distances multiplied by a gain $K_p$. This works fine. However, I can't seem to prove why that it works so well, I mean, I know servo motors cannot be modeled like that.

The controller is fed with angular displacement and its position now => added together give me angular position I have to go to.
The angular displacement is used as the speed it has to move with, since a huge displacement gives a huge velocity.

By updating both elements at different frequency I'm able to step down the velocity such that the overshoot gets minimized.

The problem here is: if I have to prove that the transfer function I found fits the system, I have to do tests somehow using the ident function in Matlab, and I'm quite unsure how to do that. I'm also a bit unsure whether the PTU already has a controller within it, since it moves so well, I mean, it's just simple math, so it makes no sense that I'll convert it like that.

答:
Imagine for a moment that you keep the input velocity fixed throughout the identification experiment, then you might inject into the system a sudden change in the final commanded position set-point while measuring as feedback the current position of your equipment (e.g. joint encoders). You will thus come up with a bunch of profiles of commanded vs. feedback positions for your identification goal. To this end you can profitably rely on the ident tool of the MATLAB System Identification Toolbox.

Explore the system response against different input position steps and remember to validate any result over profiles sets that you did not use during identification.

Finally, you could assume that varying the input velocity will have an impact on the internal controller responsivity, since of course what you're going to model is the whole apparatus made up of the internal actuators, controller, etc. In theory, you should repeat the identification experiment over a range of different input velocities.

I'll expand hereinafter a little bit further, given the fresh info you provided.

It's clear that there is an internal controller that converts your velocity input in a proper signal (usually voltage) actuating the motors. If you don't trust this internal loop, then you have to identify the plant and apply compensation as follows.

Setting: identification of a system controlled in velocity. Hence, input $=$ commanded velocity $v$; output $=$ encoder feedback $\theta$.

Procedure: you inject a chirp in velocity and you collect encoders. You can use ident to come up with a transfer function of your motor controlled in velocity at "high-level". This transfer function should resemble a pure integrator but it won't. What makes this difference needs to be compensated with the design of your velocity controller. This procedure has to be repeated for the two axes of the PTU. How to design a proper controller by putting its poles and zeros it's a matter of knowledge you should have; to do that of course you'll exploit the identified transfer function.

Note: you don't have vision in the loop yet, just position feedback from the encoders. This way you can refine the velocity control of your system, so that in the end, given a target angular position $\theta_d$ where you want to go, you know how to form the proper velocity commands $v$ to send to the device at run-time, while reading back the corresponding encoders $\theta$.

Then vision kicks in. The vision processing will tell you where the face centroid $p_d$ is with respect to the image center; this information is refreshed continuously at run-time. Then, using the intrinsic parameters of the pinhole model of your camera, you'll have an estimate of which angular positions this pixel corresponds to.

This is not that difficult to determine. Knowing the centroid coordinates $p_d$ and assuming that we know how far the face lies from the camera (let's say 1 m but we don't care about the real distance), that is we know its $z$ component in the camera reference frame, the pinhole model gives us a way to find out the face $x$ and $y$ components in the camera frame. Finally, trigonometry provides you with the delta angles to add up to the current camera encoders that will in turn let you compute the absolute target angular positions. These latter values will represent the angular set-point for the above velocity controller.

Here comes the math

Given $p_d=\left(u,v\right)$ the face centroid and $z$ the distance of the face from the camera, it holds:
$$
\left( \begin{array}{c} x \\ y \\ z \\ 1 \end{array} \right) = \Pi^\dagger \cdot \left( \begin{array}{c} z \cdot u \\ z \cdot v \\ z \end{array} \right),
$$

where $x,y,z$ are the Cartesian coordinates of the face in the camera frame and $\Pi^\dagger$ is the pseudoinverse of the matrix $\Pi \in \mathbb{R}^{3 \times 4}$ containing the intrinsic parameters of your camera (i.e. the focal length, the pixel ratio and the position of the principal point - browse internet for that - there are standard procedures to estimate this matrix). We are not interested in $z$, so that you can put in the above equation whatever value for $z$ you want (say 1 m), but remember to be consistent in the following. Given $u,v$ you get $x,y$ as output.

Once you have $x,y$ you can compute the angular variations $\Delta\phi_p$ and $\Delta\phi_t$ for the pan and the tilt, respectively:
$$
\Delta\phi_p=\arctan\frac{x}{z} \\
\Delta\phi_t=-\arctan\frac{y}{z}
$$

Finally, the absolute angular positions used as set-point will be:
$$
\phi_p:=\phi_p+\Delta\phi_p \\
\phi_t:=\phi_t+\Delta\phi_t
$$

Alternatively, we could also identify the whole system with the visual feedback in place of the motor encoders (visual servoing). Here, the transfer function will tell us the impact of a velocity command directly on the displacement a pixel undergoes. Intuitively, this identification will be more difficult because we put everything together and it's likely that we won't achieve the same performance of the first method.


问:
What is the difference between SAM and SLAM?
What is the difference between Smoothing and Mapping (SAM) and Simultaneous Localization and Mapping (SLAM)? These general approaches seem closely related. Can someone describe the differences?

答: SLAM is the process of locating oneself in a totally unknown environment where you are simultaneously mapping your environment and plotting your position in that environment. SAM is a technique used in SLAM to help keep the map constant by correlating current data with past data to normalize sensor error, It is simply one of many techniques for this purpose.  </p>


问:
Understanding the various attitude estimation methods
I am building a quadcopter using the Arduino Uno with a 6dof accelerometer and gyro. I will be adding a separate 3 axis magnetometer soon for heading. I have successfully implemented the code that reads the data coming in from these sensors and prints them out.

I have also checked for bias by averaging 100 measurements. My code calculates the pitch from the accel and pitch from the gyro respectively:

pitchAccel = atan2((accelResult[1] - biasAccelY) / 256, (accelResult[2] - biasAccelZ) / 256)*180.0 / (PI);

pitchGyro +=((gyroResult[0] - biasGyroX) / 14.375)*dt;

I am then using a complementary filter to fuse the two readings together like this:

pitchComp = (0.98*pitchGyro) + (pitchAccel*0.02);

I am stuck on how to proceed from here. I am using the same procedure for roll, so I now have readings for pitch and roll from their respective complementary filter outputs.

I have read a lot of articles on the DCM algorithm which relates the angles from the body reference frame to the earth reference frame. Should that be my next step here? Taking the pitch and roll readings in the body reference frame and transforming them to the earth reference frame? Repeat the entire procedure for yaw using the magnetometer? If yes, how should I go about doing the transformations?

I understand the math behind it, but I am having a hard time understanding the actual implementation of the DCM algorithm code-wise.

Any help is appreciated!

答:
I will shamelessly steal content from another anwser I gave:

First determine orientation based on information from both the gyroscope and accelerometer. The accelerometer is accurate in the long term while the gyroscope is accurate in the short term, so you will need some kind of sensor fusion algorithm to determine the"true" orientation of the quad. The most popular one is the Kalman Filter but many others are available to choose from.

You have already done this, I would suggest though looking into more sophisticated estimation techniques like the Kalman filter to improve performance

The next thing you will want to do is build a simple rate controller where you try to match the rate of rotation on a certain axis to the rate commanded by the controller

This should probably be your next step

after you have a rate controller you can build a simple stabilized controller, where instead of commanding the rate you command a certain angle. You take the desired angle and the current angle and based on those values calculate a desired rate to close that gap and then feed that into the rate controller.

You will probably need a RC controller and receiver set, you will need to read the PWM values from the receiver in order to take command input

Here is my favorite resource on the matter it helped me when I was making my first flight controller from scratch.

Good luck!

ContentLicense: CC BY-SA 4.0


问:
Estimating angular speed from position for control purpose
I am new to robotics, however I am designing a PID to control the angular velocity (azimuth, elevation) of a couple of Faulhaber motors.
The input to the PID control is the actual angular velocity, which is not observed though, since it is derived from the position of each motor at time $t$.

The PID sample period is aprox. 30 ms, whereas the input data rate from the joystick is aprox. 300 samples/s, corresponding to a sample period of 3.33 ms. The joystick input gets transformed into the desired angle speed, that the PID will control.

I was initially filtering position data using a normal 2D linear Kalman Filter, but the angular velocity is not linear (by formula), hence I switched to Extended Kalman filtering.

My questions are the following:

Is this latter approach that makes use of EKF correct?

Which are the parameters that I have to check in order to properly set the update rate of the PID loop?

Thx in advance!

答:
Why did you switch to EKF? KF is standard for estimating the angular rate of a electrical motor, whose transfer function is linear indeed. You might want to consider exploring also the Savitzky-Golay filter as a valid alternative, which is not model based.

Concerning the sample period of the controller, it is normally a good rule to take a frequency separation of one decade, at least, between the rate of the system and the bandwidth of the input signal. Therefore, the actual sample rate of the joystick input is an overkill.

A sample period for the PID of 5-10 ms is usually fine, given the low mechanical cut-off frequency of the motor (higher rates are better, but not required). Then, acquire the joystick at >50 ms.


问:
What was the earliest concept of a robot?
I'm a highschool student studying electronics and for an assessment task on the history of electronics I have decided to focus on the history of robotics. I want to begin with the earliest possible concept of a robot and progress through major developments in robotics to the current day. Where should I begin my research?</p>

答: I think it is better to start with explaining about an automation. And then go for robotics and their milestones. </p>


问:
Pins in OpenROV that control the motors?
I'm working on my own ROV project, but I find OpenROV have a ready to use image for my BB so want to use that instead of making my own program, and I already deployed the image, but I can't find which three pins find that send PWM signal for ESC's? Please help.</p>

答:
OpenROV Cape

If I understand things correctly,
the OpenROV motors are connected to ESCs that are connected to Arduino Digital pins 9, 10, and 11.
According to the "ATmega168/328-Arduino Pin Mapping", that corresponds to physical pins 15, 16, and 17 respectively on the 28-pin ATmega328 DIP.

A nice diagram on the OpenROV wiki showing a photo of the OpenROV Cape and where to connect the Port, Vertical, and Starboard ESCs to the cape
(diagram from https://forum.openrov.com/t/wiki-buildout/1585 ).

The Arduino IDE is used to program the ATmega328 in a 28-pin DIP package on the other side of the OpenROV Cape, shown here.
(photo from
"Bluebird Marine Systems: OpenROV underwater robots for educational exploration")

Why are there 2 not-quite-the-same Arduino firmware folders,
https://github.com/OpenROV/openrov-software/tree/v2.5.0/arduino/OpenROV
and https://github.com/OpenROV/openrov-software-arduino/tree/master/OpenROV ?
I'm guessing that the "openrov-software-arduino" version is the latest version.

The OpenROV Cape.h file defines those pins:

```<code>#define PORT_PIN 9
#define VERTICAL_PIN 10
#define STARBOARD_PIN 11
</code>```

Those definitions are used in the OpenROV Thrusters2X1.cpp file

```<code>Motor port_motor(PORT_PIN);
Motor vertical_motor(VERTICAL_PIN);
Motor starboard_motor(STARBOARD_PIN);
</code>```

The above lines pass the pin numbers to the Motor constructor declared in Motor.h.
Later the OpenROV Motor.cpp file stores those pin numbers and passes them to functions in the openrov_servo.cpp file to control the ESCs.

BeagleBone PWM

Some of the pins on the BeagleBone are internally connected to a hardware PWM driver.
Some people have several ESCs or other things controlled by a standard RC control signal, each one driven by one such pin on a BeagleBone.

(FIXME: this would be a good place for a link to the part of the OpenROV code that runs on the BeagleBone and sends a message to the Arduino with the desired PWM; can that bit of code can be tweaked to directly drive that desired PWM out the BeagleBone pins?)

Simon Monk. Adafruit. "Controlling a Servo with a BeagleBone Black"

Ben Martin. "How to Control a Servo Motor from a BeagleBone Black on Linux".

"BoneScript: analogWrite"

Meng Cao. "How to use all the GPIO on Beaglebone Black in Python"

Akkana. "GPIO tutorial for the BeagleBone Black"
implies that the BeagleBone Black hardware PWM can drive up to 8 pins (?).

Justin Cooper. Adafruit. "Setting up IO Python Library on BeagleBone Black: Using GPIO, PWM and more with Python"

Babak Parvizi. "BeagleBone Black ... Controlling a Servo Using HTML5, JavaScript, and Node.js."

"Working with PWM on a BeagleBone Black".

Saad Ahmad. "beaglebone-black-cpp-PWM".

eLinux. BeagleBoardPWM

Hipstercircuits. "Enable PWM on BeagleBone with Device Tree overlays".

"Using the BeagleBone: Using PWM outputs" describes how to drive 6 servos from a white BeagleBone.

Body:
OpenROV Cape

If I understand things correctly,
the OpenROV motors are connected to ESCs that are connected to Arduino Digital pins 9, 10, and 11.
According to the "ATmega168/328-Arduino Pin Mapping", that corresponds to physical pins 15, 16, and 17 respectively on the 28-pin ATmega328 DIP.

A nice diagram on the OpenROV wiki showing a photo of the OpenROV Cape and where to connect the Port, Vertical, and Starboard ESCs to the cape
(diagram from https://forum.openrov.com/t/wiki-buildout/1585 ).

The Arduino IDE is used to program the ATmega328 in a 28-pin DIP package on the other side of the OpenROV Cape, shown here.
(photo from
"Bluebird Marine Systems: OpenROV underwater robots for educational exploration")

Why are there 2 not-quite-the-same Arduino firmware folders,
https://github.com/OpenROV/openrov-software/tree/v2.5.0/arduino/OpenROV
and https://github.com/OpenROV/openrov-software-arduino/tree/master/OpenROV ?
I'm guessing that the "openrov-software-arduino" version is the latest version.

The OpenROV Cape.h file defines those pins:

#define PORT_PIN 9
#define VERTICAL_PIN 10
#define STARBOARD_PIN 11

Those definitions are used in the OpenROV Thrusters2X1.cpp file

Motor port_motor(PORT_PIN);
Motor vertical_motor(VERTICAL_PIN);
Motor starboard_motor(STARBOARD_PIN);

The above lines pass the pin numbers to the Motor constructor declared in Motor.h.
Later the OpenROV Motor.cpp file stores those pin numbers and passes them to functions in the openrov_servo.cpp file to control the ESCs.

BeagleBone PWM

Some of the pins on the BeagleBone are internally connected to a hardware PWM driver.
Some people have several ESCs or other things controlled by a standard RC control signal, each one driven by one such pin on a BeagleBone.

(FIXME: this would be a good place for a link to the part of the OpenROV code that runs on the BeagleBone and sends a message to the Arduino with the desired PWM; can that bit of code can be tweaked to directly drive that desired PWM out the BeagleBone pins?)

Simon Monk. Adafruit. "Controlling a Servo with a BeagleBone Black"

Ben Martin. "How to Control a Servo Motor from a BeagleBone Black on Linux".

"BoneScript: analogWrite"

Meng Cao. "How to use all the GPIO on Beaglebone Black in Python"

Akkana. "GPIO tutorial for the BeagleBone Black"
implies that the BeagleBone Black hardware PWM can drive up to 8 pins (?).

Justin Cooper. Adafruit. "Setting up IO Python Library on BeagleBone Black: Using GPIO, PWM and more with Python"

Babak Parvizi. "BeagleBone Black ... Controlling a Servo Using HTML5, JavaScript, and Node.js."

"Working with PWM on a BeagleBone Black".

Saad Ahmad. "beaglebone-black-cpp-PWM".

eLinux. BeagleBoardPWM

Hipstercircuits. "Enable PWM on BeagleBone with Device Tree overlays".

"Using the BeagleBone: Using PWM outputs" describes how to drive 6 servos from a white BeagleBone.


问:
An easy way to exert desired load on a motor shaft?
I am trying to exert a desired load of 0.07 N.m on a BLDC motor shaft whose length is 0.750in and diameter is 0.3125in (0.008m). I can go to a machine shop and get a small adjustable cylindrical coupling made for my shaft. But I need it to exert close to desired torque at a speed of 2100 rpm (220 rad/s). I tried doing some calculations, according to the formula

Torque = speed * mass * (radius)^2

If I solve this equation with T = 0.07 N.m, speed = 220 rad/sec, radius = 0.004 m, I get around 20 kg for mass, which is huge!!!. It is more than the mass of the motor. Can you please suggest a convenient way to load the motor. Thank you.

答:
There are a couple ways you could test this with a constant load:

do what you said by applying a load, you could use a spool 2cm in diameter with a string holding a 1kg mass down giving .09Nm of force (you could fine tune the mass or pulley diameter) this has the advantage of subtly changing components (mass of string/diameter of pulley) allowing you to more thoroughly test your PI controller, but the disadvantage of a limited time of function depending on the length of string and the desired rotation speed (the rotation rate has no effect on the torque unless it is changing and the pulley has a non neginlabal rotational inertia.

You could put vanes on the motor and put them them in a tub of water, which will produce torque but this will be dependent on the rotation speed of the vanes and will be hard to predict and will need to be measured and tested. However this has several advantages, practically unlimited run time and very constant torque at speeds slow enough that nothing weird happens to the water (excessive waves/cavitation ect...) but, this will require experimentation and a test stand setup.

Another option would be to spin a wheel with a brake pad attached with a known or measured coefficient of friction this will allow you to apply precise repeatable force on the wheel by easily adjusting the mass that of the object sitting on top of the wheel. You can calculate it using the following formula,
 where  is the torque desired,  is the mass,  is the acceleration of gravity  is the measured or calculated coefficient of kinetic friction and  is the radius of thew wheel. This all assumes the friction force is directed straight down (e.g. resting on top of the wheel). This is probably the best solution as you can easily vary the friction force and ius is very repeatable and accurate, additionally allowing unlimited run time limited only by the wear of the materials (which  could be non negligible depending on the speed and the materials used.


问:
How to find theta1 to theta5 after D-H parameter
```<code>Joint   θi    di    ai-1    αi-1
1     θ1-90  -d1     0      180
2      θ2     0      0      -90
3      θ3     0     a2       0
4     θ4-90   0     a3       0
5      θ5     0     0        90
</code>```

I am confused about the right way to look for my theta1-theta5.
Probably from the offset limit of the angles or calculation from x0 to x5 angle rotation or from atan2(x,y).

答:
In the Denavit-Hartenberg parametrization the theta parameters represent the degrees of freedom of your system. If you are using a robotic manipulator then the theta values correspond to your joint angles.

I would highly recommend that you look into the possibility of using the product-of-exponentials formulation instead. This is an alternative approach to using the Denavit-Hartenberg parametrization. This approach has a number of benefits such as the removal of singularities which are attributed only to your choice of parametrization.

I can imagine that some people would be put off from using it as you require a little more mathematical knowledge to fully understand how it works. However, as with many things you can still use it without knowing where it comes from.

If you do decide to continue with the D-H parametrization, remember that there are many possible values for your parameters which will result in equivalent models of your system.


问:
How to connect HC-sr04 ultrasonic sensor to APM 2.6?
I am working on my final project by autonomous Quadcopter. my tasks are to make a quadcopter  which should do object avoidance and it should auto land using ultrasonic sensors.
any possible ans to it, how should i connect HC-sr04 ultrasonic sensor to my APM 2.6 board?
Even APm 2.6 has a port I2C.</p>

答: HC04 not need a i2c connection just have vcc, gnd, trig and echo pins. vcc to 5v gnd to gnd trig and echo pins need digital input and output. </p>


答:
You may find the wikipedia Dynamometer article useful.  The “Types of Dynamometers” section lists eight kinds of dynamometers.  (Mark Omo's answer corresponds to two or three of the several types.)

If you have several sizes of power resistors available, you could connect a DC generator (or a DC motor used as a generator) to a resistor and use that system as a load on the motor under test.  Resistor substitutions or a  high-wattage rheostat can make the load variable.

Title: An easy way to exert desired load on a motor shaft?

Body:
I am trying to exert a desired load of 0.07 N.m on a BLDC motor shaft whose length is 0.750in and diameter is 0.3125in (0.008m). I can go to a machine shop and get a small adjustable cylindrical coupling made for my shaft. But I need it to exert close to desired torque at a speed of 2100 rpm (220 rad/s). I tried doing some calculations, according to the formula

Torque = speed * mass * (radius)^2

If I solve this equation with T = 0.07 N.m, speed = 220 rad/sec, radius = 0.004 m, I get around 20 kg for mass, which is huge!!!. It is more than the mass of the motor. Can you please suggest a convenient way to load the motor. Thank you.


问:
Do structured light camera sensors work outdoors?
Do structured light camera sensors like the structure.io, Intel RealSense or Microsoft Kinect work outdoors?

I read these sensors wont work outdoors because of ambient IR light. Can someone provide this with proper references/tests? I mean what degree of IR illumination is needed for the sensor to stop working etc.

There are videos on YouTube that show Microsoft Kinect working outdoors:

Prairie Dog II: UGV Kinect Sensor Outside - limited outdoors range

Outdoor Kinect Data Collection - heavy interference with direct sunlight

However, the (not yet released) new Intel RealSence R200 specification says "range up to 3-4 meters indoors, longer range outdoors" while the older F200 says "0.2 meters - 1.2 meters, indoors only". I am really interested in seeing if the R200 will really work outdoors.

答:
I only have experience with the kinect, but it will definitely not work outside no matter what (unless the sun is down) and I have had problems when giving demos near large windows with sun.

Tldr near windows or outside during the day is a nogo


问:
Using a Bitmap maze image to navigate the maze
I'm working on an robot that would be able to navigate through a maze, avoid obstacles and  identify some of the objects in it. I have a monochromatic bitmap of the maze, that is supposed to be used in the robot navigation.

I am just a first year electrical engineering student, and so need help on how I can use the bmp image. I will be making my robot using the Arduino mega microcontroller.

So how should I get started on it.

If you need me to elaborate on anything kindly say so.

Link: http://ceme.nust.edu.pk/nerc/files/theme_ind_2015.pdf

答:
User 9428

The task you define is quite easy to solve.
First see the sample file BMP as uploaded in FAQ Area in NUST NERC Edu Page.
Its a small file 56 bits by 96 bits of information in it.

The question most of students ask and face is how to read the BMP file?

BMP file or any other file what so ever is never so difficult to read or manage.

If you consider it as image you will think about it as image.

It is a text file - can any one read a text file simple with a room temperature or student marks obtained.

its some thing same like that.

upon investigating you will notice that the image it self is border white out side on all sides

then the line of black color starts the white path is all covered on all sides and fully with white elements. black color path is all round except two place which are gates to enter and exit ead them in Arduino and note them and mark as S and F - Start and Finish -

the white lines around are 4 bits by 56 on top
and 4 bits by 56 bits are lower most line
black lines are inside start from 5th bit and goes to 8th bit on left side
wall then on the right side 49th to 52nd bit is black on left side from top to bottom
ending is again 53rd bit to 56th bit white line.

Can you code them in Arduino ? quite simple and easy

This above tell opening and exit Marked as S Start and F Finish

Next like wise read the cells and code them by if and them loop to know they are black or white

Once you decode map to Array a 2D array can be manipulated and get all required results to find path and move for motors

some thing like below
001110
011110
011101
111111
111111
010011
010111

each element is coordinate form values

BMP is converted to Array and tell you in map form to deal as arithmetic problem

Arduino or any simple micro can do quite comfortably

the path found is decoded to move

you find two goals location from image also

but image is not telling color to pot in them
the color sensor is easy answer to do that

reach place and find which color to pot

when both balls are pot come out of arena or maze

Hope you win this

regards


问:
Cable routing in theta, x, y motion control system. Better inside or outside?
I'm building a motion control platform with 3 DoF: 1 axis of rotation (theta) and 2 cartesian (x,y). In most applications, like wrist actuation, you have an X-Y stage with a rotating servo as the stage's payload. This configuration works well since little of the power and data wiring needs to transit to the non-linear moving portion of the platform.

For my inverted application, the stackup is reversed. The rotating axis comes first (from the mounting plane) with the stage connected as the rotating platform's payload. Now nearly all of the wiring (power, command, sensor, and otherwise) must be routed to the non-linearly moving section.

I can see two broad approaches:

The inside track, I route the cabling through the center of rotation.

The outside track, I route the cabling around outside the outer diameter of the rotating platform.

Mathematically, I can see that (1) results in minimum cable length, but maximum torsional loading, while (2) results in maximum cable length, but minimum torsional loading on the wires.

Having limited experience with cable routing (and the associated carriers, strategies, and products) in non-linear applications, my question is...

...which approach is better in practice?

Cost isn't really the issue here. I'm more interested in reliability, ease of construction, availability of commercial components (says something about the popularity of the technique), etc...

e.g. the generic concepts behind why you pick one over the other.

...of course, if you have some part numbers for me I wouldn't be upset <-- I know I'm not supposed ask that here ;-)

答:
I've seen a number of systems in this configuration and most went for an outside track solution. Part of the reason for this is control of bend radius. With an outside track, the bend is obvious at all positions and it is clear when you run out of track.

If you are bothered about cabling complexity, you could put more of the electronics on the rotated stage, so instead of having motor, encoder and other cables all running down the energy chain, you would just have power and data lines, with everything else done by remote i/o.

Taking this to the extreme, I've worked at a place where this technique was used with slip rings for a continuously revolving robot. It had two scara arms and all of the control electronics for them mounted on a revolving platform. The data slip rings were horribly noisy, so the data connection had to have more ECC than normal, but it all worked well.


问:
Hand Eye Calibration
I'm trying to use a dual quaternion Hand Eye Calibration Algorithm Header and Implementation, and I'm getting values that are way off. I'm using a robot arm and an optical tracker, aka camera, plus a fiducial attached to the end effector. In my case the camera is not on the hand, but instead sitting off to the side looking at the arm.

The transforms I have are:

Robot Base -> End Effector

Optical Tracker Base -> Fiducial

The transform I need is:

Fiducial -> End Effector

I'm moving the arm to a series of 36 points on a path (blue line), and near each point I'm taking a position (xyz) and orientation (angle axis with theta magnitude) of Camera->Fiducial and Base->EndEffector, and putting them in the vectors required by the HandEyeCalibration Algorithm. I also make sure to vary the orientation by about +-30 degrees or so in roll pitch yaw.

I then run estimateHandEyeScrew, and I get the following results, and as you can see the position is off by an order of magnitude.

[-0.0583, 0.0387, -0.0373] Real
[-0.185, -0.404, -0.59] Estimated with HandEyeCalib

Here is the full transforms and debug output:

```<code># INFO: Before refinement: H_12 =
-0.443021 -0.223478  -0.86821  0.321341
 0.856051 -0.393099 -0.335633  0.470857
-0.266286 -0.891925   0.36546   2.07762
        0         0         0         1
Ceres Solver Report: Iterations: 140, Initial cost: 2.128370e+03, Final cost: 6.715033e+00, Termination: FUNCTION_TOLERANCE.
# INFO: After refinement: H_12 =
  0.896005   0.154992  -0.416117  -0.185496
 -0.436281    0.13281  -0.889955  -0.404254
-0.0826716   0.978948   0.186618  -0.590227
         0          0          0          1

expected RobotTipToFiducial (simulation only):   0.168   -0.861    0.481  -0.0583
expected RobotTipToFiducial (simulation only):   0.461   -0.362    -0.81   0.0387
expected RobotTipToFiducial (simulation only):   0.871    0.358    0.336  -0.0373
expected RobotTipToFiducial (simulation only):       0        0        0        1

estimated RobotTipToFiducial:   0.896    0.155   -0.416   -0.185
estimated RobotTipToFiducial:  -0.436    0.133    -0.89   -0.404
estimated RobotTipToFiducial: -0.0827    0.979    0.187    -0.59
estimated RobotTipToFiducial:       0        0        0        1
</code>```

Am I perhaps using it in the wrong way? Is there any advice you can give?

答: The library you are using (and papers it is based on) seem to be for a different use case than what you are doing.  They have a camera rig moving around a world with fiducials pulled out of a SLAM map, whereas you have a static camera and a moving arm holding fiducials.  Fundamentally, yes they are the same, but i wonder if you used a different library that is more suited to a robot arm, if you would have better results.  This is a paper you might consider: Calibrating a multi-arm multi-sensor robot: A Bundle Adjustment Approach.  I don't know if there is source code.  But it is ROS, so odds are good.</p>

Title: Hand Eye Calibration


问:
C++ and Create 2
I am trying to use C++ to talk to the Create 2 robot. Does anyone have basic code to write/read from the Create 2 using C++ or C?

I am having trouble with converting Create 2 commands (like 145) into one char.

答:
As ott mentioned, you can simply make the type an unsigned char which is an 8 bit data type.  Here is some code snipits that should work, but are untested.  This uses the "Drive" example from the OI Spec.

```<code>#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>

unsigned char buff[5] = {137, 255, 56, 1, 244};

fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY);

struct termios tio;
bzero(&tio, sizeof(tio));
tio.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
tio.c_iflag = IGNPAR;
tio.c_cc[VTIME]    = 1;
tio.c_cc[VMIN]     = 0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);

int res = write(fd, buff, 5);
if (res < 0)
{
    int err = errno;
    perror("write error: ");
    printf("\nWARNING: write returned %d, errno: %d\n", res, err);
}
</code>```

Title: C++ and Create 2

Body:
As ott mentioned, you can simply make the type an unsigned char which is an 8 bit data type.  Here is some code snipits that should work, but are untested.  This uses the "Drive" example from the OI Spec.

#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>

unsigned char buff[5] = {137, 255, 56, 1, 244};

fd = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY);

struct termios tio;
bzero(&tio, sizeof(tio));
tio.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
tio.c_iflag = IGNPAR;
tio.c_cc[VTIME]    = 1;
tio.c_cc[VMIN]     = 0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);

int res = write(fd, buff, 5);
if (res < 0)
{
    int err = errno;
    perror("write error: ");
    printf("\nWARNING: write returned %d, errno: %d\n", res, err);
}


问:
Is this rubber/PVC coupling a good enough for small torque (0.1 N.m)
I am working on a project that involves speed regulation of a BLDC motor under no-load and load conditions. I wish to use another machine operated as generator, acting as load on the motor, as shown in this video.

The coupling used in this motor/generator arrangement looks handmade out of a rubber tube or somethhing. I am considering using it as an alternative to a flexible coupling. Purchasing an actual flexible coupling is not an option for me. Moreover, I need the coupling on an urgent basis.

My question is, can this arrangement (or something similar) be used to couple a 15W motor to a similar rating machine, if the rated torque is not exceeding 0.1 N.m?

答:
Absolutely, I use this method all the time for small robots, and actuators. I can find no information on the formal torque ratings, but I did find in a document called "PVC Piping Systems: Helpful tips for Avoiding Problems"

The recommended best practice is to use a thread sealant (not a thread lubricant) and to assemble
  the joint to finger tight plus one and one-half turns, two turns at the most. Finger tight can be
  defined as: tightened using the fingers, no tools, to a torque of about 1.2 to 1.7 foot-pounds (1.7
  to 2.3Nm).

I am assuming the pipe can withstand the torque of tightening threads. I suspect that tie pipe can withstand much more torque than that though.


问:
Is it possible to have A/V feed and serial communication on an RF transceiver at the same time on an Arduino?
Is it possible to transmit live audio/video feed and at the same time, receive commands through UART using only 1 RF transceiver connected to the Arduino board?

I want to control the Arduino through serial communication (UART) which can be accomplished by using RF connection to control it from a remote. I also want to transmit live audio and video feed from the Arduino using the same RF transceiver. Is this possible?

I found AVCTP, but I'm not sure if it enables serial communication. Also, I don't like to use Bluetooth for some reasons.

Thanks in advance!

答: As I suspect you found out (based on your other question 7169), doing both over the same RF link will be more truble than it is worth, You could use ip as you sujested but this might turn out to be more truble than it is worth unless your main controller is a raspberry pi or BBB that already has native networking. I am assuming you are talking about a quadrocopter or RC car. For those platforms the standard thing to do is use a setup like this or make your own, consisting of a transmitter/recever pair, a camera and somhing to view it on. they sell plenty of battery powered monitors. as for telemetry the gold standard as far as I am concerned are the 3dr 900mhz serial modules, they work great up to about a mile with stock antennas beware you will need a pair to operate.</p>


问:
How can I use the Arduino PID library to drive a robot in a straight line?
I would like to create an Arduino based robot with 2 wheels, quadrature encoders on each wheel, a H-bridge driver chip (or motor controller) and a caster.  I want to use the PID library to ensure the speed is proportional to the distance to travel.  </p>

<p>At a conceptual level, (assuming the motors do not respond identically to PWM levels) how can I implement the PID control so that it travels in a straight line and at a speed proportional to the distance left to travel? </p>

答: This link gives a good example without two PID calculation. Also you can implement imu/compass to measure straight path</p>

OwnerDisplayName: Robert


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

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

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

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

Nothing can be added to the floor or ceiling.

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

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

I look forward to hearing some creative ideas.

答:
I'm working on this topic too. I'm trying to obtain sound
* ultrasonic: there is a lot of applications
* audible sound difference via multiple microphones like stereo vision or tdoa. also we need robot identification that may be frequency difference</p>

Title: Localising a robot swarm non-optically