问:
Simple yet effective angular position sensor to be used in robotic hand
What is the best yet simple to use angular position sensor? I am building a robotic hand and I want to implement this sensor at the joints of the fingers. I don't need a module, just an analogue output.
Thank you.</p>

答: Potentiometers are great for this kind of thing. Its what servos use to move to specific angles. They offer a linear resistance change that could be used to change an analog voltage that you measure, then angles map directly to that voltage.</p>


问:
Connecting an Arduino uno with a beaglebone black over USB
I have an arduino uno and a BeagleBone black and would like them to talk with eachother. Both the beagleBone and the arduino have their own 5V power supplies so no need for power to be transferred over usb. The used communication line we would like to use is the direct serial line. Preferably in such a way that the arduino can just call Serial.read() in order to get the bytes it needs (there won't be many). How do I get this to work on the BeagleBoneBlack? I suspect we can call the serial.write somewhere inside the BBB(we mainly program in C++). But how do we achieve this? </p>

答:
Beaglebone USB

When you plug a USB cable between the USB B plug of the Arduino Uno and the USB A plug of the Beaglebone Black, the Beaglebone should be able to talk and listen to it the same way any other Linux distribution talks and listens to any other CDC class USB peripheral.

On the Beaglebone, a CDC class USB peripheral can be read an written to through "/dev/ttyUSB0" or "/dev/ttyACM0" or something similar.

```<code># warning: untested code
import serial
serial_port = serial.Serial( port="/dev/ttyUSB0", baudrate=9600, timeout=1 )
while True:
    serial_port.write("Hey.")
    print hex(ord(serial_port.read()))
</code>```

"EZ430 Chronos and the BeagleBone"

"USB (serial) GPS Reader with pyserial, Redis, Ubuntu 12.10 on Beaglebone"

The Arduino uses Serial.read() and Serial.write().
Any of the Arduino serial demo scripts that read and write to the Arduino serial monitor when the USB cable is plugged into a "big" computer
should work just fine when that same cable is plugged into a Beaglebone instead.

Beaglebone UARTs

p.s.:
You may find it easier to wire one of the six BeagleBone UARTs directly to the Arduino UART ("Enable serial/UART/tty on BeagleBone Black"; "Python PySerial ... using Beaglebone Black"),
rather than trying to stick the more complicated USB in the middle somewhere.

"Serial Communication between an Arduino & a Beaglebone Black".

"Adafruit: setting up IO Python Library on BeagleBone Black: UART"

"Beaglebone Coding 101: Using the Serial and Analog Pins"

ContentLicense: CC BY-SA 3.0

Body:
Beaglebone USB

When you plug a USB cable between the USB B plug of the Arduino Uno and the USB A plug of the Beaglebone Black, the Beaglebone should be able to talk and listen to it the same way any other Linux distribution talks and listens to any other CDC class USB peripheral.

On the Beaglebone, a CDC class USB peripheral can be read an written to through "/dev/ttyUSB0" or "/dev/ttyACM0" or something similar.

# warning: untested code
import serial
serial_port = serial.Serial( port="/dev/ttyUSB0", baudrate=9600, timeout=1 )
while True:
    serial_port.write("Hey.")
    print hex(ord(serial_port.read()))

"EZ430 Chronos and the BeagleBone"

"USB (serial) GPS Reader with pyserial, Redis, Ubuntu 12.10 on Beaglebone"

The Arduino uses Serial.read() and Serial.write().
Any of the Arduino serial demo scripts that read and write to the Arduino serial monitor when the USB cable is plugged into a "big" computer
should work just fine when that same cable is plugged into a Beaglebone instead.

Beaglebone UARTs

p.s.:
You may find it easier to wire one of the six BeagleBone UARTs directly to the Arduino UART ("Enable serial/UART/tty on BeagleBone Black"; "Python PySerial ... using Beaglebone Black"),
rather than trying to stick the more complicated USB in the middle somewhere.

"Serial Communication between an Arduino & a Beaglebone Black".

"Adafruit: setting up IO Python Library on BeagleBone Black: UART"

"Beaglebone Coding 101: Using the Serial and Analog Pins"


问:
Finding the position of a servo
I am building a collision avoidance system for my robot. As a part of this system I am using a pan and tilt kit

(http://www.robotshop.com/en/lynxmotion-pan-and-tilt-kit-aluminium2.html)

My aim is to pan the sensor attached to this kit, and thus plan the route the robot should take.

In order to pan this sensor, I need to know the angle the kit has panned, and need to be able to call upon that angle at point in time.

Basically the sensor keeps panning, and at a point in time when certain conditions are met, it stops panning. When those conditions are met, I need to be able to extract the angle the sensor is panned at.

The servo being used on is: http://www.robotshop.com/en/hitec-hs422-servo-motor.html

If someone could help me find a way to extract this information that would be helpful. I did read somewhere that the servo could be hacked and changed into a closed loop system where the effective angle would be shown, but that option is not viable.

Thanks

答:
Servos are by definition, in the position you told them to go (or in a fault condition). This is the difference between a servo and a stepper. You tell a stepper to move 1 step at a time and do not know if it did or not. A servo on the other hand will continue trying to get to the position you asked.  For hobby Servos, you are setting a pulse width / duty cycle in some part of the code.  You can assume that IS the servo position for all intents and purposes. The standard servo's low value is 1000, high value 2000, and obviously 1500 in the center position.

Taken from Servo motors and controlling them with PWM

They have one really great feature: the interface to control them is super simple, just the pulse width of a digital pulse sent to the motor at a rate from 50-200Hz. The pulse rate is not that important. The important thing is the pulse width. The range of the pulse width is from 1-2ms. 1.5ms is the middle servo position and 1 or 2 ms are the end positions.

You cannot control the torque, rate, or anything else; as soon as the servo's electronics detects the pulse width (which can require several pulses) it tries to get the servo to the new position as quickly as possible. You also cannot sense the servo's position, current or anything else; control is open-loop as far as the servo is concerned; all control is handled inside the servo.

Just as a warning, most modern servos DO NOT use potentiometers. Today, most use optical encoders for positional sensing, so reading an analog signal is going to be difficult (impossible).

High end servos such as the HiTech do provide feedback (positional) information.

Title: Finding the position of a servo


问:
Looking for a cheap(ish) micromouse that I can program with C/C++
I'm looking to buy a micromouse (i.e. a small single-board unit with wheels and IR sensors that can move around freely). I've done a lot of searching but have only found resources relating to building one from components bought separately. However, I'm more of a programmer than an electrician so I fear I would struggle with this.

Anybody know where to buy one of these in the UK? (PICAXE does some suitable stuff but they're BASIC only unfortunately). My budget is about £60.

答:
Try a Pololu 3Pi. They were going for 50usd during black friday. Normally $99.  You can use arduino IDE to program it using Wiring, a C/C++ like language.

You would probably have to add IR sensors yourself, either via the expansion board, or re-wire the existing line detectors

At the moment, Hobby Robots are still only reachable by those with soldering skills. But that will be changing in the next few years.


问:
Why does the Pixhawk have 2 IMUs
I was looking at the Pixhawk specs and noticed that it has 2 different IMUs- Invensense and STM. Is it for redundancy or does it have any other higher purpose?</p>

答:
The particulars you are asking about are;

ST Micro L3GD20 3-axis 16-bit gyroscope
ST Micro LSM303D 3-axis 14-bit accelerometer / magnetometer

Invensense MPU 6000 3-axis accelerometer/gyroscope

The MPU 600 provides a stand alone I2C bus for attaching a remote magnetometer, to get it away from current and metal. But it also requires external clocking for accuracy.

Why someone would choose to use 2 different brands, I am not sure. It may be that one is used for INS and the other to transmit telemetry data at a different rate. The MPU 6000/6050 is known for its ease of use as it can do math processing on board, i.e. Output ready to use quaternions.

Title: Why does the Pixhawk have 2 IMUs


问:
I don't understand Integral part of PID controller
I dont understand integral part of PID controller. Let's assume this pseudocode from Wikipedia:

```<code>previous_error = 0
integral = 0
start:
  error = setpoint - measured_value
  integral = integral + error*dt
  derivative = (error - previous_error)/dt
  output = Kp*error + Ki*integral + Kd*derivative
  previous_error = error
  wait(dt)
  goto start
</code>```

Integral is set to zero in the beginning. And then in the loop it's integrating the error over the time. When I make a (positive) change in setpoint, the error will become positive and integral will "eat" the values over the time (from the beginning). But what I dont understand is, when error stabilizes back to zero, the integral part will still have some value (integrated errors over time) and will still contribute to the output value of controller, but it should not, because if error is zero, output of PID should be zero as well, right?

Can somebody explain me that please?

答:
Imagine that you set up a PID controller on your own arm, so that you could hold a cup of coffee straight out in front of you.

The proportional element would control your arm strength relative to your hand position being too high or too low.

The derivative element would adjust that strength based on how quickly you were already moving, so that you don't overshoot your target.

The integral element would compensate for the effects of gravity; without it, the cup would come to rest where the proportional force equaled the force of gravity.

It sounds like the part of the code you're stuck on is that the system must somehow measure the weight of the coffee, and one way to do that is to accumulate the position error over time.  Most PID controllers have an additional term to specify a reasonable limit on the size that the integral element can be.


问:
what is the easiest method to plot a temperature in my pc?
After a lot of learning, I'm launching a reballing business and I feel the need to have a realtime plot of the temperatures involved (ideally 3 or 4) and I have an arduino uno and a few K type thermocouples, I was researching the subject and saw a lot of different approachs, most of them use arduinos to send serial data to a pc port, then from there they process it with phyton, other guys matlab, some use ms excel plus a free add on in vb for apps. etcetera, and now after some reading I feel overwhelmed by all the different methods, so I wonder, perhaps I'm already losing perspective here? may be there is a simple method I can use and KISS way of get it done? thank you.</p>

答:
Looking for a open (free) source alternative is it normal to feel overwhelmed since the programs, that you can use, are really many.

Personally when I need to plot soma data coming from Arduino or Teensy on my PC I go through one of those ways:

If I want to use a programming tool Processing could be really easily implemented to show what you want. It has the same language as Arduino and the same environment. Take a look in the examples. There you can find a program that suits your needs. Since the language is the same as Arduino you have a very high portability and reconfigurability;

If I don't want to program anything, but just plot some values without loosing time, then I use Scilab. You don't need a license like Matlab, and fr plotting you have a lot of tools. This could be the way you want to go. In the Scilab package configuration there is package that listens to the serial port. You just need to write a small script to save in a array and then plot them. To open a serial port you need just three functions, really strightforward. I used it for controlling a robotic arm. I've formatted my PC due to a hardware failure, so I m sorry I cannot send you an already created script made by myself;

There are other options like gplot, octave or exceel. But if you don't want to spend more time and need a very fast solution I would go for the step #2;

Regards


问:
PID for Quadcopters
As already mentioned the PID output values that correspond to the error from the desirable error and current error has no units. Let's say we are using only the proportional part of the PID. Is it better to map the output of the PID values to the corresponding thrust values on each motor, or is it better to increase the Proportional coefficient Kp until the output values correspond to the proper thrust value to the motors?

For example if my desired angle is 0 and the angle that the sensor is reading is 40 degrees the difference is multiplied by Kp and the output is added or subtracted from the current thrust depending on the motor.

If I increase Kp too much, then the quadcopter is oscillating and not listening to the controller command that I am sending for the desired degrees from the joystick. If I map the values then it is listening to the joystick commands and not oscillating so much. Why is this happening? Isn't mapping the PID output values to bigger values the same as increasing Kp?

答:
I think you have inadvertently created a controller using a Ki only term.
It appears that your Kp term is used by summing it onto the current (last cycles) output. This is effectively creating an integral output.
You need to directly output the Kp term and sum it with a separate Ki term if needed.</p>

Title: PID for Quadcopters


答:
Do you need to use the Arduino?  Because if all I wanted to do was get temperature readings on the computer, I would use an off-the-shelf data acquisition device.  For example LabJack, Phidgets, something from National Instruments, or any number of others.  There also seems to be a large number of dedicated USB temperature sensors that are not too expensive.

These may be more expensive than something completely custom with an Arduino, but will be the simplest and most straight forward.   (Because you don't have to write code in 2 places.)  That is unless you are already very comfortable with the Arduino.

On the PC side, there are probably almost as many ways to accomplish this as there are languages.  It is hard to give advice without more background info on your requirements and personal capabilities.  (Windows or Linux, do you want a nice GUI or bare bones, do you want to store historical data, do you want it to be a desktop widget or regular application, what level of programmer are you, etc.)

You should use the tools you are most comfortable with.  For example i know people who would do this on Linux in a few lines of bash script with gnuplot.  And others who would use matlab on Windows.  Personally, I'd probably go with Python and matplotlib.

Title: what is the easiest method to plot a temperature in my pc?

Body: After a lot of learning, I'm launching a reballing business and I feel the need to have a realtime plot of the temperatures involved (ideally 3 or 4) and I have an arduino uno and a few K type thermocouples, I was researching the subject and saw a lot of different approachs, most of them use arduinos to send serial data to a pc port, then from there they process it with phyton, other guys matlab, some use ms excel plus a free add on in vb for apps. etcetera, and now after some reading I feel overwhelmed by all the different methods, so I wonder, perhaps I'm already losing perspective here? may be there is a simple method I can use and KISS way of get it done? thank you.</p>


问:
Sun tracking with +/- 0.1degree accuracy?
For a school project I am looking to track the sun with +/- 0.1 degree accuracy for use with a parabolic dish reflector. Say we need a final output torque of about 20Nm, what kind of gearing/motors and feedback would you guys use to accomplish this? The sun position will be found with a solar positioning algorithm.

I am pretty new to this all but from my research stepper motors seem the easiest but brushless DC motors, from what I have read, can yield better results with smoother tracking. I am confused how you even use regular brushless dc motors to achieve precision positioning. I am aware of encoders but I don't really understand why the BLDC are preferred for this particular application, and how one would implement them.. Any ideas that can help kick start my researching?

答:
If you look a stepper motors they have not an infinite resolution: They have a fixed stepwidth, which can be break down by modulating the input signals with sin waves, but you  loose torque.

So you say you need 20Nm torque. Which is a lot for a standalone stepper, therefor you need one with a gearbox. I suggest you buy a stepper with 0.5Nm, which is a pretty common value for a powerful stepper. Take a gearbox with 1:100. This means one revolution on your device's side mean 100 revolutions on your stepper's side. Therrefor you have a theoretical torque of 50Nm, which is a pretty good value for a 20Nm load.

I assume your stepper has the standard resolution of 200Steps/Revolution. Now with the gearbox you  have a resolution of 20kSteps/Revolution or 0.018° per step.

I won't suggest using microstepping for this setup, Because you already have enought resolution and you will only loose torque.

The huge Problem now is the method how you "control" the stepper. You basically have two posibilities: Open and Closed Loop. Most of the time you use a stepper in openloop, because he usually does one step if you tell him to do one step. BUT you can "loose" step, which is caused by a to high load-torque. So open loop is not the best but the simplest solution. In closed loop you simply use an encoder on the stepper motor and control it. In your setup you don't have any dynamically changing loads, but this is your decision.

For BLCD it is basically the same. You will need a gearbox, too. There are gearless BLDC with this high torque, but they are not reasonable for this project (~5k$). The BLDC has no restriction is resolution, but it needs an encoder and a control loop. Unfortunatly I cannot tell a lot about typical values for BLDC.


问:
Is there a place for posting "look at what I did" videos?
Robots are somewhat videogenic, and the old saying "show me, don't tell me" is especially applicable.

But of course, a video is not a question, so it doesn't fit the Stack Exchange format.  Maybe video links would be more suitable in a CodeProject post.  It just seems like this board hits the right cross-section of people, whose projects I would be interested in seeing.

答: While there are specific outlets, as the other answers show, you shouldn't underestimate plain old YouTube. Most research labs and companies simply host their videos there (e.g. MIT, BostonDynamics and the likes), as do individuals.</p>


问:
To control an omni wheel robot wirelessly using bluetooth and arduino
I am trying to control an omni wheel robot which has 4 motors using 2 joysticks, plus there are some actuation switches which I want to control too. I am using arduino mega and a pair of bluetooth wireless module(HC-05).

This bluetooth modules works on serial communication. How should I program arduino to send both the analog values provided by the joystick and the input from the switch continuously?

答:
The simplest solution is throwing all values into a comma seperated string:

use the the standard strcat():

```<code> char data[256];
 chat temp[16];
 data[0]=0;
 temp[0]=0;

 itoa(analogRead(A1),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A2),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A3),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A4),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(digitalRead(5),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(digitalRead(6),temp,10);
 strcat(data,temp);
</code>```

Body:
The simplest solution is throwing all values into a comma seperated string:

use the the standard strcat():

 char data[256];
 chat temp[16];
 data[0]=0;
 temp[0]=0;

 itoa(analogRead(A1),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A2),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A3),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(analogRead(A4),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(digitalRead(5),temp,10);
 strcat(data,temp);
 strcat(data,",");
 itoa(digitalRead(6),temp,10);
 strcat(data,temp);


问:
Can you identify the construction material/system used in the pic?
What's the name of the "big meccano" used in the photo below to construct all the cabinets and racks?

It appears to be an aluminium cut-to-length system of 4-way rails. I've seen it used many times and assume it has a well-known brand-name to those that know.

Photo taken from theverge.com and was a feature about how Audi are building a new car.

答:
The original T-slot frame system, was developed in the 80's by item GmbH and was quickly developed into the MB Building Kit System, hence I've always known it as item bar.

Since then though, there have been many other manufacturers producing similar systems. Examples include Bosch Rexroth (as mentioned by Guy Sirton), 80/20 (Andrew Capodieci's suggestion), FlexLink and many others, but item is still one of the most popular and well respected, especially in Europe.

Also, as David Cary says there are also people producing micro versions of T-slot systems, such as OpenRail/VSlot, MakerBeam and OpenBeam etc.


答:
Well, the sun moves pretty slowly across the sky.  So your best bet is to get a motor and gear it down heavily.  I'd say the type of motor doesn't matter as much as your sensing and control loop.

you definitely want to put an encoder directly on your dish.  This will eliminate errors from the gear train backlash.  i think you will want a 12 bit encoder or better.  this will give you slightly better than 0.1 degree accuracy.  (360 / 2^12 = 0.087 degrees per count).

Title: Sun tracking with +/- 0.1degree accuracy?

Body:
For a school project I am looking to track the sun with +/- 0.1 degree accuracy for use with a parabolic dish reflector. Say we need a final output torque of about 20Nm, what kind of gearing/motors and feedback would you guys use to accomplish this? The sun position will be found with a solar positioning algorithm.

I am pretty new to this all but from my research stepper motors seem the easiest but brushless DC motors, from what I have read, can yield better results with smoother tracking. I am confused how you even use regular brushless dc motors to achieve precision positioning. I am aware of encoders but I don't really understand why the BLDC are preferred for this particular application, and how one would implement them.. Any ideas that can help kick start my researching?


问:
Raspberry Pi vs BeagleBone Black Rev C on vending machine
I wish to start my vending business, but none of the existing vending machines fit my needs.
So, I need to choose the "brains" to my vending machine under current development.

The user experience of my vending machine will be:

User change their products on touchscreen display (firegox open rails application running in the "brains"), insert moneys, after that products will be returned to the user and notification (json query) will be send to it saas.

There are requirements:

Popular (I want to use a widely used computer for better support)

Debian-like or CentOs like system (easy to develop rails apps on them)

Big count of GPIOs

Working with touch-screen and large display (at least 15")

Working with mdb protocol (for currency detector needs)

So, I need your hints. It seems that BeagleBone is more powerful then Raspberry Pi, but there is one problem: It doesn't support many of the video outputs. Is there any solution to make good video output on BeagleBone? Do other such computers exist?

答:
Check out the new Raspberry Pi Compute module, it was created for things like this.

And you can begin development on a regular raspberry pi in the meantime.

I personally believe the Raspberry Pi is completely years ahead of everything else goes as far as maturity and suitability for use in production, as evidenced by this new compute card targeted at embedded system, above and beyond just prototyping.


问:
What is stall current and free current of motors?
What are the stall and free currents of an electric motor? For example, this Vex motor lists its stall and free currents at the bottom of the page.

I think I understand the general idea, but a detailed description would be helpful.

答:
All very good answers, but as a physics teacher I am concerned about some incorrect equivalences here that can only lead to confusion.

One form of [energy][1], eg [chemical potential energy][2], can be converted into other forms of energy (eg [electric potential energy][3], [kinetic energy][4], [sound energy][5], [thermal energy][6]). In the [SI system][7], which is by far the easiest to understand and most coherent, energy is a scalar physical quantity that is measured in [joules][8]. [Voltage][9] is not the same as energy. Voltage is measured in [volts][10]. One volt is defined as one joule per [coulomb][11]. Hence, energy (measured in joules) can never be converted into volts (measured in joules per coulomb).

The [Electromotive forces][12] (EMFs) in any electromechanical system (of which the electric motor is merely one example) are measured in volts. The [electric currents][13] are measured in [amperes][14]. [Electric charge][15] is measured in coulombs. One coulomb is one ampere second, ie the charge that flows past a point in a current of one ampere for one second.

What one needs to know for any electromechanical system is the [electrical impedance][16] of the electrical part of the system, and the [inertia][17] or [moment of inertia][18] of the mechanical part of the system. One also needs to know the net external [torque][19] driving the complete system at any moment. (When there is no torque per se (because there is no [moment][20]), then one needs to know only the net external [force][21] acting through the [centre of mass][22]).

At any moment, the electrical impedance, Z, of any electrical system is the square root of the square of the system's [electrical reactance][23], X, plus the square of the system's [electrical resistance][24], R. The system's electrical reactance is the difference between the [inductive reactance][25], X(L), and the [capacitive reactance][26], X(C), where X = X(L) - X(C)

(NB, initially, I tried to Wikilink each of the twenty-six key concepts in my answer, but the system has informed me that I am not allowed to include more than two links until I have at least ten points.)


问:
Where can I find a tutorial or sample code for the Juniper WiFi Arduino Shield?
I recently got an arduino wifi shield known as "juniper" (I believe it was by cutedigi). I've tried to find code examples, but when I saw code, it was un-commented and very little explained, I could really use a tutorial or some sample code with a good explanation, can anyone help me find a place to start? I found a piece of code here: http://arduino.cc/forum/index.php?action=printpage;topic=103582.0
and I just want to connect to a network, maybe send some get requests, or open a socket.

EDIT:
after poking around for a while, i found documentation, but I still can't get it to work.
my code:
http://pastie.org/5455603
I can't seem to get any input at all from the wifi shield.

答:
I think your best ally will be Google. A quick search for "arduino juniper cutedigi" led me to the manufacturer's website, which includes a good amount of documentation and sample code under the "Download:" heading at the end of the page. Here's an extra troubleshooting forum post that may be of use.

Even if you don't find the best documented code out there, finding several sample scripts that do similar things might help you understand the basics.


问:
Error as a State space
I am reading the following research paper regarding Trajectory tracking of mobile robots.

http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=5415188

There are two things at the start of the paper that i do not understand.

1) The author derives equation(14) as the state space model of the system in which he considers the error as the state. Can anyone please elaborate on why he is using the error as the state space model of the system and not the Vx, Vy, and w(Omega, angular speed) of the robot.

2) Why does the author linearize the system around the reference trajectory?

答:
FYI, most people (including myself) can't see that paper because we don't have IEEE memberships.

Based on your question, though, the error is often considered the state because that is what you really care about in control/estimation algorithms: you want to control the robot so the error is zero. This is true whether the reference trajectory is static or dynamic.

For 2), it's hard to say without looking at the paper, but the reference trajectory is a logical point of linearization because you assume that your controller is good and the robot is close the the reference trajectory. This way you can linearize and design controllers in advance, i.e. when you don't know the true state so the reference trajectory is the only information you can use.

Title: Error as a State space


问:
How would i go about learning to code a flight controller?
I'm interested in quadcopters/multi-rotors and want to eventually code my own flight controller ala an APM and/or Pixhawk. I've got a little experience in programming (i.e i know about if/else/else if conditionals), and have done a little programming with PHP, though it was procedural code.

I currently have a quadcopter that i built/assembled myself that is running on a f450 frame, using a APM 2.6 flight controller,so i have a reasonable grasp of how a quad works, and i would like to take it a step further and make my own adjustments to the code base, with the eventual aim of coding my own flight controller.

I've had a look at the code base, but am still unable to get a grasp of what the code is actually doing....yet. How would i go about learning how to code a flight controller?

I'm thinking that i would have to learn C++ & OOP first, but how familiar/proficient would i have to be with C++ before i can reasonably attempt to edit the code base?Also, what else would i need to learn apart from C++ & OOP?I am looking at setting a 6 month timeframe/deadline for me to do this, would it be possible?

答: Controlling a flying robot (or anything else) is a very complex subject (well, people are doing PhD on it..). I can recommend this free online course on the subject (I have taken it myself). It will give you a little taste of what it is.</p>


问:
the uncertainty of initializing new landmark in EKF-SLAM
In EKF-SLAM (based-feature map) once the robot senses a new landmark, it is augmented to state vector. As a result, the size of the state vector and the covariance matrix are expanded. My question is about the uncertainty of the new landmark and its correlation with other pairs of the covariance matrix. How should I assign them? When I assign them to be zero, the error of the estimation this landmark won't change as time goes. If I assign them with very large value, the estimation is getting better every time the robot reobserves this landmark however, the error approaches to fixed value not to zero. I assume the problem id with assigning the uncertainty. Any suggestions?</p>

答:
You can use the Jacobians of the inverse observation model to initialize the new row/column of the covariance matrix.

Suppose your observation model is $g(\mathbf{x})$, which maps your state $\mathbf{x}$ to a predicted observation $\hat{\mathbf{z}}$. The inverse observation model $g^{-1}(\mathbf{x}, \tilde{\mathbf{z}})$ maps an observation $\tilde{\mathbf{z}}$ to a new entry of your state. For example, if $\tilde{\mathbf{z}}$ is a range and bearing measurement, $g^{-1}$ might determine the global $(x,y)$ coordinates of a newly observed landmark given your current state estimate.

Let $\mathbf{P}$ be the covariance of your state and let $\mathbf{G}_x$ and $\mathbf{G}_z$ be the Jacobians of $g^{-1}$ with respect to $\mathbf{x}$ and $\tilde{\mathbf{z}}$. Then the updated state and covariance matrix after adding the new entry is

$\mathbf{x}\gets \begin{bmatrix} \mathbf{x} \\ g^{-1}(\mathbf{x}, \tilde{\mathbf{z}}) \end{bmatrix}, \qquad \mathbf{P}_{k+1} = \begin{bmatrix} \mathbf{P}_k & \mathbf{P}_k\mathbf{G}_x^\top \\ \mathbf{G}_x\mathbf{P}_k & \mathbf{G}_x\mathbf{P}_k\mathbf{G}_x^\top + \mathbf{G}_z\mathbf{R}_k\mathbf{G}_z^\top \end{bmatrix}$,

where $\mathbf{R}_k$ is the variance (1D) or covariance $\mathbf{z}$.


问:
Simple yet effective angular position sensor to be used in robotic hand
What is the best yet simple to use angular position sensor? I am building a robotic hand and I want to implement this sensor at the joints of the fingers. I don't need a module, just an analogue output.
Thank you.</p>

答:
A potentiometer linked to the output gear of your motor controlling the joint is the simplest position sensor. This is typically what is done inside cheap servomotors.

You will get an analog signal relative to the position of the output gear. Position can be found using the relation

$$\theta = \theta_0 + \frac{V_{out}}{V_{max}}$$

With $V_{max}$ the maximum voltage at the potentiometer end, $\theta_0$ the initial position. Precision depends on the quality of the potentiometer.

Magnetic encoder is a bit more complicated, but more precise. Magnetic encoder IC allow you to get position regarding the magnetic field induced by a magnet fixed to your joint. Precision usually is of 2000 tics per joint turn. Check out this project for example.


问:
Can triangulation by measuring angles to 3 beacons to find location work over a large outdoor area
To determine an outdoor location I think that I need to measure the angles between at least 3 beacons and take into account the order I sweep the beacons.  Is this a workable solution to get positional accuracy of about 30cm in a house block sized area?

Rewrite of question, note no distance measurement is suggested only angle measurements.
I am proposing that it might be possible to have a minimum of 3 local rf beacons and a robot device that sweeps an antenna through a circle identifying the angles between these beacons and to use this information and the order that the beacons are seen to find an absolute location.  I tried to prove this geometrically and it seems that with the 3 beacons there is 2 unique solutions without knowing the order and 1 solution if the order is known.  There would (I believe) be no need to try to find the distance to the beacons.  My question is, could this be implemented for a reasonable cost with some nRF24L01 based transcievers and some sort of rotating antenna?

答:
You haven't said whether you need 2D or 3D positioning, but if you have only 3 beacons you will need to stick to 2D.  Let's assume you know the XY position of the beacons and that the robot's sensor and the beacon emitters are at about the same height.

Geometrically, yes it can be done, with some limitations.  Take a pair of beacons B1 and B2; suppose your robot sees them as A12 degrees apart.  Now imagine that the beacons are pins stuck in a corkboard, and you have a cardboard triangle with one corner A12 degrees wide.  You can press the cardboard between the pins and rotate while keeping the triangle edges against the pins. - marking where the point lies.  Interestingly, this forms a circular arc between the pins (actually two arcs, forward and backward.

Now conceptually draw the equivalent with B2 and B3 and angle B23 - more circular arcs, which will intersect.  And for good measure use B3 and B1 and angle B31 - it doesn't really give you more information, but it acts as an error check.

You'll find a few places where these arcs intersect.  You can reduce the ambiguities using the order of the beacons as you scan (eg: clockwise sequence).

Besides the ambiguities, sometimes the arcs intersect close to right angles and give a sharp intersction point, but other times they are closer to tangent with each other which means that small errors in the angle result in large errors in position.

However, your proposed implementation is not going to work very well.  The antennas for a nRF24L01 are not going to give a very sharp directionality.  The patterns will almost certainly have multiple irregular but somewhat broad lobes that give you only a very loose sense of direction with additional ambiguities - and multipath reception will make that worse.  If there are any obstacles that absorb RF, that will make it worse.

If you have unobstructed line of sight, you could do better with optical sensors - that's the appoach I've played with, on paper.  Actually my original inspiration was how to tell where a photo was taken if it shows several towers on hillsides.  If you can determine the location of each tower, and you can calibrate the camera's pixels with angles, then this becomes the same problem as you raise - but with far better angular resolution.

For robotics in a smaller space, you could use visible or infrared emitters and a camera on the robot; there is some complication in spinning the camera and combining several less-than-360 degree views to get large angles, but the geometry issue is the same.

And if you have more than 3 beacons, you can improve your accuracy: they are less likely to all be obscured, some combinations will more likely have good intersection angles, you can remove many of the ambiguities, and you can average multiple solutions using different triplets to reduce the errors.

I recall working out the circular arcs traced by the tip of the triangle algebraically some while ago (I was expecting something more complex and loved that it came out so beautifully simple), but I don't have that proof handy and would have to recreate it.  However if you know that the location arc is circular, it's easy to compute the center and radius of the arcs from the location of two beacons and the angle between them.


答: The course suggested by @Eugene Sh is a good one to understand in depth the relevant details. If you have general idea about how an aircraft (fixed wing) operates it will be actually helpful to you. Refer Small Unmanned Aircraft:Theory and Practice by Randal Beard, one of the pioneers in aerial vehicle research and T.Mclain. This is about fixed wing aircraft, but the navigation and guidance principles are same for both fixed wind and quad/tri-copters. This book is written in a very simple language with minimal equations. Will be very good for testing out some of your guidance strategies</p>

Title: How would i go about learning to code a flight controller?

Body:
I'm interested in quadcopters/multi-rotors and want to eventually code my own flight controller ala an APM and/or Pixhawk. I've got a little experience in programming (i.e i know about if/else/else if conditionals), and have done a little programming with PHP, though it was procedural code.

I currently have a quadcopter that i built/assembled myself that is running on a f450 frame, using a APM 2.6 flight controller,so i have a reasonable grasp of how a quad works, and i would like to take it a step further and make my own adjustments to the code base, with the eventual aim of coding my own flight controller.

I've had a look at the code base, but am still unable to get a grasp of what the code is actually doing....yet. How would i go about learning how to code a flight controller?

I'm thinking that i would have to learn C++ & OOP first, but how familiar/proficient would i have to be with C++ before i can reasonably attempt to edit the code base?Also, what else would i need to learn apart from C++ & OOP?I am looking at setting a 6 month timeframe/deadline for me to do this, would it be possible?


答:
There's a lovely theorem in mathematics: given three points $A, B, C$ on a circle, the angle $BAC$ subtended at $A$ by the arc $BC$ is exactly half the angle subtended by the arc $BC$ from the circle's center (i.e., the "angle between $B$ and $C$, as seen from the circle center").

Thus as @Zeph observes, knowing the angle between any pair of towers places you on a circle of a particular radius that contains these towers at a certain angular distance from each other on the circle... but there are two such circles. If you know the signed angle (i.e., "As I sweep counterclockwise, I see $B$ and then $C$, with the angle between them less than 180"), then you actually know which of the two circles you're on.

If you look in Bowditch's American Practical Navigator, you'll find that this technique has been known for some time. (Closely related: "doubling the angle on the bow").

The sensitivity of the computed position to angular noise is not pretty. If your three towers are very far apart (hundreds of miles), but distributed at 120 degrees angles around the center of your region of interest, then the angles measured from any point in your region will be very close to 120...so determining the exact location will be tough. If, at the other extreme, your three beacons are very near the center of your region, then the three angles will again tend to be almost equal from all points of view, so the computed position will be very sensitive to angle again. In the ideal case -- which is probably to have the beacons placed on a circle that's perhaps twice the size of your region of interest -- you can probably do OK...but you'll do hugely better if you put 15 beacons out there, and use something like a Kalman filter to update your position estimate at each moment. Greg Welch at UNC did something like this for tracking in virtual reality systems, back in about 1991 or 1992, I believe, but I could be off by a year or two.

Title: Can triangulation by measuring angles to 3 beacons to find location work over a large outdoor area

Body:
To determine an outdoor location I think that I need to measure the angles between at least 3 beacons and take into account the order I sweep the beacons.  Is this a workable solution to get positional accuracy of about 30cm in a house block sized area?

Rewrite of question, note no distance measurement is suggested only angle measurements.
I am proposing that it might be possible to have a minimum of 3 local rf beacons and a robot device that sweeps an antenna through a circle identifying the angles between these beacons and to use this information and the order that the beacons are seen to find an absolute location.  I tried to prove this geometrically and it seems that with the 3 beacons there is 2 unique solutions without knowing the order and 1 solution if the order is known.  There would (I believe) be no need to try to find the distance to the beacons.  My question is, could this be implemented for a reasonable cost with some nRF24L01 based transcievers and some sort of rotating antenna?


问:
How can I start learning robotics?
For someone interested in robotics but do not know the ABC of robotics or mechanical/electronic engineering .What's a good roadmap for becoming an amateur roboticist . I'm studying theoretical physics so that I have no problems on the physics/math . If the question is too broad and doesn't meet the criteria of posting on this site . Please inform me of any helpful advice/study material etc. before the question get closed .
Thanks in advance.</p>

答:
This same question was just asked a few days ago.  Please look around before posting.

That being said, I would suggest taking a programming course for a start.  The Udacity CS373 class is the gentlest introduction to robotics I'm aware of.  I also recommend the textbook that the prof co-authored (but it's not used in the class).

Then you can use the time as you're working through the class to educate yourself more on hardware options.

Title: How can I start learning robotics?


问:
Step Motor and Bevel gear calibration
I am new to robotics. I want to understand how gears state is preserved as the gears turned to same positions repetitively.
I have a bevel gear and a step motor connected to one gear. This gear will turn 45*n = degrees. That is to say there are 8 states gears will stay in. The problem here is there will be force on the gear, which is not connected to motor, in any direction. That force must not change worm position even in micrometers. I think there should be a locking mechanism. Is there any applications of that you can give example of?</p>

答:
A complete answer isn't possible without details of your requirements for rotation rates, torque, tolerance, budget, mechanical layout, allowances for calibration or adjustment, and directions of motion.  That said, I will mention some relevant topics for gungor to study.

First, read about backlash.  Here's a brief overview from wikipedia:

In mechanical engineering, backlash, sometimes called lash or play, is clearance or lost motion in a mechanism caused by gaps between the parts. It can be defined as "the maximum distance or angle through which any part of a mechanical system may be moved in one direction without applying appreciable force or motion to the next part in mechanical sequence".

Next, read about anti-backlash mechanisms.  An article in machinedesign.com has an overview of some common methods, including use of precision gears; adjusting positions of gears (either manually or automatically) for minimum lash; and special designs.  With so little context given in the question, one can't say which technique would be best.

Also consider using limit switches or an encoder.  A set of eight or sixteen switches could be installed and calibrated so that different combinations of switch readings correspond to go and nogo rotations.

A rotary table or an indexing fixture would allow precise and solid positioning, but can be expensive, heavy, and in some forms difficult to use in automated systems.  However, if you use a machinist's indexing or dividing plate with a multiple of eight holes, repetitive rotary positioning accurate to a few arcseconds (comparable to a few microns at a radius of a few cm) is easy to achieve.

Title: Step Motor and Bevel gear calibration


问:
interfacing arduino uno with 9 dof razor imu
I have followed the tutorial for razor IMU and it worked perfectly when the IMU is directly connected to the PC. Currently, i am trying to interface the 9 dof razor imu with the arduino uno by simply connect the rx to tx and tx to rx. Sadly, it doesn't work! So, i am just wondering, has anyone done this before? or can anybody give me some hints? Much appreciated! </p>

答:
Yes, I've already experience.
Check please the baud rate of Arduino. it must match that of the board. Pay attention to the connection 5V and ground. I mean...check them with a Voltmeter !!!!

After that try to connect only the Arduino to your PC and be sure it echoes all ASCII Charachter you send to it (for this you find a ton of progrs in net). It everything goes wonderful and you are sure is everything ok, try just to forwarding the raw data from the board to the PC.

Only if those steps don't show any sign of life have you a broken board or something like that.

Let us know


问:
making a robot that knows your location
I've just made a radio frequency remote control using PIC microcontroller and I want to do something useful with it. I am thinking of a robot that gets things for you while you are at bed but here comes the question: How am I going to have the PIC determine the location of the remote control calling for it? It can't really be done using a GPS module because it will all be in the house.

What options do I have?

答:
For closed spaces (like a robot in a factory moving pieces from A to B) it is usually the best solution to put some beacons on walls, carpet, edge, doors, etc.. and doing a localisation based on fixed markers or beacons. Here get you an idea: https://parasol.tamu.edu/wafr06/papers/p45.pdf
but I strongly suggest you to read the following book
.
Forget Voronoi, potential fields and EKF or Markov probabilistic methods. The way you want to go is triangulation between fixed markers. Usually you need at least 3 of them, preferably 4. It is not really difficult as you can image. It is enough to mount a light emitter on your robot, put some reflecting strips on the wall and write a program to read the intensity of the light reflected from the marker and the angle. Some of them are in Infrared light spectrum, so you don't see anything. If I find the book, where I read about this, I ll tell you.

Or you can use a solenoid under the carpet..a line follower just to get the idea. The idea with the reflective strips is the most commons in industry where a robot must move in a given space but on medium-long distance.

A GPS does in reality the same...with 4 satellites

Regards

Title: making a robot that knows your location


问:
what is the easiest method to plot a temperature in my pc?
After a lot of learning, I'm launching a reballing business and I feel the need to have a realtime plot of the temperatures involved (ideally 3 or 4) and I have an arduino uno and a few K type thermocouples, I was researching the subject and saw a lot of different approachs, most of them use arduinos to send serial data to a pc port, then from there they process it with phyton, other guys matlab, some use ms excel plus a free add on in vb for apps. etcetera, and now after some reading I feel overwhelmed by all the different methods, so I wonder, perhaps I'm already losing perspective here? may be there is a simple method I can use and KISS way of get it done? thank you.</p>

答: Pyqtgraph for python is made with OpenGl and its blazing fast compare to Mathplotlib or other that are using processor to draw... I was really happy with Pyqtgraph, and it is made for ploting real time plots.</p>


问:
Robot docking for self-recharging
I want to build a simple obstacle avoider robot, but this time I want it to be self-recharging so I am building a dock for this purpose, so I want it to be able to locate the dock and go for it when battery voltage is lower than a fixed value.

I am having trouble to chose the right components for locating the dock, I think I am going to use an IR emitter on the dock so the robot can head toward it when battery is low (let's forget about the orientation problem for the moment, but if you have any thoughts about it that will be helpful) but I am not sure if the robot is able to detect the IR LED (or whatever) from a long distance (over 10 meter)

Is it possible to use this solution for this distance? If not, what do you suggest?

(If there is a simple ready solution to buy that's ok, let's say I have no budget limit)

答: There is a simple off-the-shelf solution.  The iRobot Create is a hackable Roomba and maintains all of its original code and behaviors.  One of which is "seek dock".  Although i think the max distance it can sense the dock is probably around 1 or 2 meters.</p>

Title: Robot docking for self-recharging


问:
Unable to hover my quadcopter
I'm currently flying a f450 Quadcopter using a APM 2.6 flight controller.While i am able to get the quad off the ground and relatively steady horizontally(via the use of trims).However, i am unable to get the quad to hover no matter what i do.I've tried using trims on throttle,but i am still unable to get it hover.On my transmitter (WFLY WFT06II), where the throttle has "ticks", i am currently stuck between too little lift and too much lift, where i push the throttle up by 1 "tick" and the quad goes from slowly decending to ascending, and vice versa.

Is there any way i can get my quad to hover ( with my hands off the throttle if possible), as currently, evern with me trying to fly it, i can never get it to hover vertically as it alternates between ascending and descending whenever i fiddle with the throttle.

答: Ian's comment is spot on. To maintain a constant altitude, you need to know what altitude you are at. For aircraft this is based on a pressure sensor. This is generalized at 14.696 psi for 0 ft altitude. For quad copters this is probably impractical. An ultra sonic sensor pointing at the ground or accelerometers tuned to minimize drift in altitude is more practical if you are relying on visual feedback for adjustment. </p>

Title: Unable to hover my quadcopter


问:
Is it better to have batteries distributed at the rotors or the center of the multicopter?
I've seen 3 approaches to mounting batteries on a multicopter:

All the batteries rigidly mounted near the center of the airframe

All the batteries in a bag hanging under the center of the airframe

Each rotor has its share of the batteries rigidly mounted near/under it. (For example, a quadcopter with 1/4 of all the batteries mounted underneath each motor).

Which design is the best, and why?
If there is no one best design, what are the advantages/tradeoffs between the designs?
Is there some other design I'm overlooking that is better in some way?

(This question focuses on multirotor flying machines.
For ground vehicles, see " Is it better to have weight distributed over the wheels or the center of the robot? ").

答:
Vince has it right, it is a designers choice. Depends on the application.

Moving the mass away from the center point of rotation will increases the moment of inertia. Which means it will resist influences from external forces more.

This includes both environmental disturbances and self generated motion command updates. One of these is not wanted, and the other is wanted. This leaves us with the trade off in design decision. What you choose will be application specific.

If you choose to have a responsive craft that is quick an aerobatic, it will come at the cost of the controller continuously fighting external disturbances. There will be a limit to how fast it can respond (bandwidth), and consequently will be more unstable given large, or rapidly varying disturbances.

Conversely, if you want inherent open loop stability, it will come at the cost your craft being slow to implement it's own desired motion updates.

I am doing my first build at the moment. I want to start with high controller bandwidth given the mountain environment I am in. My current conundrum is, do I put the battery on top or below. I really want it below.

Primarily because I am going to be changing things up down there when I start adding peripheral components to interact with the environment. It makes sense to wire up the computer with all fixed parts on top and then it's done, permanently.

But this does leave me with two issues. One doesn't want to get into the inconsistent delayed response that yoos brought up that will occur when something is dangling on a string. I can synch up the battery but it is quite a bit of effort each time for both axis'. Maybe I just need to invest in a better battery strap than my 1 dollar Chinese Velcro.

The real thing bothering me right now is risk, the idea of an unstable battery being exposed. I've got the heli-style Tarrot landing gear, and in a big fall I don't see it doing much to protect the battery.

So my question to expand this discussion here is: What are people doing in terms of top or bottom? I like the idea of it being up above, but that leads to numerous different awkward other placement problems down the road.


答:
DatPlot is an absolutely fantastic tool for plotting data and browsing through it, and I use it heavily when I want to quickly visualise and browse some data. I think it perfectly fills in a gap that exists between spreadsheets (such as excel) and general purpose computing packages (such as MATLAB, Scilab etc), in that it's great for exploring the data (zooming in and out, panning, selecting - which is something that spreadsheets utterly lack in my experience), and at the same time very simple and dedicated to one task (unlike MATLAB, scilab) and hence is quick to download install and use.

Obviously, you're still going to have to get the temperature data into your PC. If you have an off the shelf data logger, then great. Otherwise, in my opinion, an Arduino (or other microcontroller) would be a very simple solution - just get it to regularly sample your sensor and then send temperature (and optionally time) via the serial port. You can then use a program such as RealTerm (don't be overwhelmed by the UI) to automatically capture what's being sent via the serial port and save it to a file that you can then directly open in DatPlot. In RealTerm, the Capture tab allows you to just dump whatever is coming from the serial port directly to a file.


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

答:
I am not sure the Arduino has the "horse power" for this.  You might be better off going with a RaspberryPi, BeagleBone, or some other embedded board that can run a real operating system...

For 2D depth sensors, the main contenders are SICK and Hokuyo.  The interface for these is typically USB.  But i know older model SICKs used RS232 which might actually work with an 8 bit microcontroller.

Other types of depth sensors that typically play nicer with microcontrollers are ultrasonic rangers, and infrared proximity sensors.  However, these have a much wider beam, are much more noisy, and can adversely interact with each other if you try to make an array out of them.  (For example, an ultrasonic pinger will hear the response of the one next to it if they are turned on at the same time.)

Lastly, another option that is not Arduino compatible, but is cheap and might work with your system depending on what you want to do, is to use a camera and a laser line for structured light.  You can do some image processing and determine the depth to the line.  This paper: "High-Accuracy 3D Sensing for Mobile Manipulation: Improving Object Detection and Door Opening" has more info.

Title: Arduino depth sensor


问:
Alternatives to cameras for a dirt sensor for an autonomous vacuum robot?
When I use a standard manual vacuum, I often notice that I have to pass over a spot several times because a single pass does not necessarily catch all the dirt.  My eyes/brain can easily perceive this information visually, but I don't know how an autonomous robot vacuum can detect whether a pass over a patch of dirt was successful or not.  What kind of sensor/action can I use to determine if the robot vacuum successfully picked up the dirt from a particular patch?

I would prefer to avoid a visual camera if at all possible because it would necessarily have to be mounted above the robot and thereby limit the range of reachable locations.  Is there some other low-cost sensor that can accomplish the same task that can be placed low to the ground?

答:
If you want a robotic vacuum, and are not dead-set on building the base platform, you can always buy a Roomba and hack it.  The "Open Interface" of the Create works with any model Roomba.

And yes, the Roomba has piezoelectric-based dirt detection.


问:
Good Microcontrollers/SOCs for a Robotics Project
I am looking for a starting point for my project, preferably using popular systems (ones there is a lot of support for). I have an Arduino Uno, a Raspberry Pi, and a lot of willpower :) Anyone here built a project using the systems above?

Observation: I'd like to start with a simple line-following vehicle and build up afterwards.

答:
The Arduino is really an AVR Atmega328p. The Arduino is a fine off-the-shelf implementation of this microcontroller, but if you make many of them, you can buy the chip for less than $3 each in bulk, and it requires very little circuitry to run on its own -- a crystal and a couple of capacitors to run at 20 Mhz, or not even that if you can run at the built-in 8 MHz resonant oscillator frequency.

It's fine for generating control signals: Servo PWM, step/direction, control for H-bridges, etc.)

It's also OK for running sensors: Ultrasonic time measurement, IR voltage conversion measurement, on/off contactors, etc -- this includes whatever optical sensor you'd use for "line sensing."

There will be a little code space left over after doing these tasks, so the simple control loop of "is the line to the right, left, or center of me -> do the appropriate turn" can be built into that system. However, as soon as you want to do something bigger, like path planning, environmental awareness, memory, SLAM, etc, you will not be able to fit that into the Arduino.

Thus, the best system for your requirements probably includes tying all the physical hardware to the Arduino, and then talking to the Arduino from the Raspberry Pi. The RPi has a modicum of CPU power (700 MHz ARM) and RAM (256-512 MB RAM) and thus can run higher-level control algorithms like path planning, localization, SLAM, etc.

If you go with a bare AVR controller, there are UART outputs on the Raspberry Pi, but the problem is that the RPi is 3.3V and the Arduino Uno is 5V. Either go with a 3.3V Arduino version, or use a voltage divider to step down 5.0V output from the Arduino to the 3.3V input of the Raspberry Pi. I use a 2.2 kOhm high and 3.3 kOhm low resistor and it works fine. You can feed the 3V output from the Raspberry Pi directly into the RXD of the AVR, because it will treat anything at 1.2V or up as "high."


问:
Servos power supply in Quadruped Robot
I'm facing a problem while building my quadruped robot which is figuring out the efficient power supply needed for the 12 servos. I'm using 12 MG995 tower pro servos powered by 2 lithium batteries 2x3.7v (about 8 volts) with 2200 mA . I really don't know if that enough for the servos or something else is needed to be added(i hardly fitted the 2 batteries into the robot's body)
any suggestions please?</p>

答:
According to the specs, that is a 4.8V servo. Do NOT run it at 8 volts unless you are doing a smoking light show.

Get some sort of step down like this and set the voltage to 5V max.

Once you have the voltage correct the rule of thumb is max 1 amp per servo at heavy load. How many of your servos will be at heavy load? Your batteries will need to deliver that, and is specified as a 'C' rating.  A C rating of 1 means 1 times the mah, so 2 LiPos in series (for approx 7.4V even though it will be stepped down) is still 2200mah = 2.2 amps Most Batteries today have a minimum C of 15 or so. I would imagine 12 lightly loaded servos will not exceed 2.2 amps, but with a C rating of 15, you have up to 30 amps available, the step down is rated at 4amps, so you might need a beefier version of it (but I doubt it).

Title: Servos power supply in Quadruped Robot


问:
Simple vector problem, Weight vector components & sine and cosine of rotation?
I have the quadcopter in the photo below. It has rotate theta degrees about the -y axis. I want to get the x and z components in the local frame for the weight W which always points along the vertical downward.

We simply have:

```<code>Wx = W sin(theta); Wz = W cos(theta);
</code>```

Suppose that W = 4N and theta = 30 deg, then:

```<code>Wx = -4 * sin(-30) = 2N;   Wz = -4 * cos(-30) = -3.464N
</code>```

The negative sign in the angle was put because the rotation is about the -y axis (counterclockwise).

Wz seems correct as it is pointing towards the negative local z axis but Wx is 2 which seems wrong because according to the diagram it is supposed to be -2 indicating that it point towards the negative local x axis.

What's wrong with my simple calculation?

```<code>EDIT:
</code>```

Using rotation matrices, we have the following rotation matrix when pitching (rotating about y axis):

This matrix is used to transform vectors from inertial frame Xn,Yn,Zn to local frame Xb,Yb,Zb. To find the components of the weight W, we can multiply this matrix by W. Doing so, we get the same result:

```<code>Wx = W sin(theta); Wz = W cos(theta);
</code>```

答:
You've written your equations as if the weight vector you drew was positive, but then used a negative weight vector in your calculation. If you flipped $W$ around in your drawing you'd get
$$
\begin{align}
W_x &= -W \sin(\theta)
\\
W_z &= W \cos(\theta)
\end{align}
$$

** edit **

To expand, a more consistent approach is use to proper vector math. In this case you need apply a rotation to your weight vector (edited to correctly go from global to local frame)
$$
\begin{align}
W_L &= [0~0~-mg]^T
\\
R_{LG} &= \begin{bmatrix}
\cos(-\theta) & 0 & -\sin(\theta) \\
0 & 1 & 0 \\
\sin(-\theta) & 0 & \cos(\theta)
\end{bmatrix}
\\
W_L = R_{LG} W_G &= \begin{bmatrix}
mg\sin(\theta) \\
0 \\
mg \cos(\theta)
\end{bmatrix}
\end{align}
$$


问:
How would i go about learning to code a flight controller?
I'm interested in quadcopters/multi-rotors and want to eventually code my own flight controller ala an APM and/or Pixhawk. I've got a little experience in programming (i.e i know about if/else/else if conditionals), and have done a little programming with PHP, though it was procedural code.

I currently have a quadcopter that i built/assembled myself that is running on a f450 frame, using a APM 2.6 flight controller,so i have a reasonable grasp of how a quad works, and i would like to take it a step further and make my own adjustments to the code base, with the eventual aim of coding my own flight controller.

I've had a look at the code base, but am still unable to get a grasp of what the code is actually doing....yet. How would i go about learning how to code a flight controller?

I'm thinking that i would have to learn C++ & OOP first, but how familiar/proficient would i have to be with C++ before i can reasonably attempt to edit the code base?Also, what else would i need to learn apart from C++ & OOP?I am looking at setting a 6 month timeframe/deadline for me to do this, would it be possible?

答:
Seeking proficiency in C++ or in OOP in general would either have to be a result of obtaining the necessary knowledge in order to browse through the code-base of the flight controllers that you mentioned, or with the eventual goal that this is what you would use when implementing your own flight controller.

The first thing is familiarizing yourself with the syntax and semantics of the language(s) used in the implementation of the flight controllers that you're interested in adjusting.  The tricky part is actually determining what the code is doing.  It helps if the code base is well documented and that the code is developed in a concise manner.  For example, the functions and variables are named appropriately so that their purpose is clearly understood.  Otherwise be prepared to follow through the logic of the code.

Once you have that down, one of the efficient ways when trying to decipher what the code is doing is to start from the beginning.  Look for where the program starts when the flight controller is first turned on or is commanded to start executing whatever it needs to execute.  Also what sort of initialization is it doing.  Another thing is what sort of communication protocols that might be in play if the flight controller were to communicate with others.  And then just work from there.

Ignoring the details for now, the sole purpose of a flight controller is really to monitor and control the whole system and possibly relay any information to others perhaps a ground station of something.  This means having the knowledge of the sort of hardware/sensors/etc. that you need and need to be physically present in order to obtain the required data  and make sense of it.  Based on the data this will determine how the quadcopter should behave/maneuver.

As for wanting to implement your own flight controller it depends on what you are seeking.  Are you looking to take the existing flight controllers and replace the program installed in its entirety or are you looking to design and build your own flight controller platform and then create your own flight controller code.

For the first case, look at the related documentation/datasheets of the flight controller at interest.  In particular see if it's possible to make your own adjustments to the flight controller code.

For the second case, you might want to look into embedded systems development.


答: Probably a simple and cost-effective solution would be to use a flex sensor.  Essentially you can determine the amount of flex subjected on the sensor using resistance, much like a potentiometer. </p>

Title: Simple yet effective angular position sensor to be used in robotic hand

Body:
What is the best yet simple to use angular position sensor? I am building a robotic hand and I want to implement this sensor at the joints of the fingers. I don't need a module, just an analogue output.
Thank you.</p>


问:
Risk of overloading motor controller
I bought 2 brushed motor controllers from China for my hobby-weight battle robot (http://www.banggood.com/ESC-Brushed-Speed-Controller-For-RC-Car-Truck-Boat-320A-7_2V-16V-p-915276.html).

These are intended for use with my 2 cordless drill 14.4v motors which will be driving the left and right wheel respectively.

I will be using 4S LIPOs which (when fully charged) have a voltage of 16.8V. Can someone put my mind at rest that the .8 volt excess is unlikely to damage the controller (which is rated for 7.2v - 16v)?

Also is the fact that the motor controllers are rated for 320Amp likely to damage my motors?

I am to be honest not very clear on current and how this is drawn from a LIPO battery. For instance would connecting a LIPO directly to my motor result in a massive discharge or does the motor just "take what it needs" in terms of current? Can someone maybe kindly point me to an article which casts some light on the subject or even more kindly explain it to me here?

答:
Yes the motor just takes what it needs.
The 320 A rating means it will survive that current if the motor requires it.</p>

Title: Risk of overloading motor controller


问:
The algorithm for the following analog controller => digital controller?
I have found a continous control in the following form:

$$
u(s) = \left( K_{p} + \frac{K_{i}}{s} + K_{d} \frac{N}{1 + \frac{N}{s}} \right)e(s)
$$

but since I need it to "convert" in a digital control I need something like:

$$
y_{k} = y_{k-1} + q_{0}e_{k-1} + q_{2}e_{k-2}
$$

or everything that I can use in a digital way.
Is there any algorithm to achieve such transformation?
Actually the problem is the term $N$ in the equation. At first I thought that it was a simply PID controller but the N term is far from my understanding

Thank you very much and happy Christmas!!

答:
You should take a look at the Tustin transformation to get the bilinear mapping between s-domain and z-domain. You'll also find examples therein.

Once you're provided with the description of your transfer function in z-domain, it's straightforward to derive the formula in discrete time domain.

Given
$$
\frac{Y}{U}=\frac{b_0+\ldots+b_{m-1}z^{-(m-1)}+b_mz^{-m}}{a_0+\ldots+a_{n-1}z^{-(n-1)}+a_nz^{-n}},
$$

you'll obtain
$$
y_k=\frac{b_0u_k+\ldots+b_mu_{k-m} - a_1y_{k-1}-\ldots-a_ny_{k-n}}{a_0}.
$$


问:
How high of a gear ratio can a motor have?
I want to make a robot arm where a joint is powerful enough to lift 8 kg up at a distance of 1 meter.

This requires torque $tau = r*F = r*m*g$ = about 80 nm.

So now I am trying to find the requisite parts to put this together, i.e. motor + gears and then controller.

It seems that I will require a very high gear ratio to make this happen. For example this motor: http://www.robotshop.com/ca/en/banebots-rs-550-motor-12v-19300rpm.html has stats:

stall torque = 70.55 oz-in = 0.498 nm
no load roation speed = 19300 rpm

To get my required torque, I need a gear ratio of 80/0.498 = about 161:1 (and the max speed drops to about 120 rpm).

My questions:

1) Do my calculations so far seem correct? It seems a bit suspect to me that an $8 motor with some gears can cause a 17.5lbs dumbbell to rotate about a circle of radius 1m twice a second (I'm barely that strong). This type of torque would be awesome for my application, but perhaps I'm missing something in the calculations and being too optimistic (e.g. efficiency).

2) Is it safe to operate a motor at such a high gear ratio? Gears are small, and I'm worried they'll easily crack/break/wear down quickly over time. Does anyone know of example gears that I should consider for this?

Thank you very much for any help, cheers.

答:
One problem I can see is, that you are using stall torque (at 0 rpm) and no load rotation speed (at 0 Nm). If you want the motor to still turn, it will have lower torque than this, and lower RPM.

Also, running the motor at (or close to) stall for long time will probably overheat it (it's gonna draw 85A (that is about 1KW) and dissipate it all as heat).

I don't have much experience with this, but for a first version I would guess you can get 50% of the stall torque and 50% of the no load rpm continually (or maybe 40%?). Then you could test it and go for different motor in second iteration.


答:
It's quite possible for an $8 motor with enough gearing to move a mass as you describe. It's also possible to have gear ratios much more than a hundred. However:

Check that the gears you're using are rated for the torque you need.

What speed of rotation do you need? This defines the motor power you need (something people often forgot to think about). Power is usually the first thing you should consider when choosing a motor.

power(W) = force(N) x speed(m/s)

So, how quickly do you need the weight to travel?

The higher the gear ratio, the lower the efficiency of the gears. If the manufacturer doesn't specify the efficiency, then assume 50%, in which case, you'll need a motor of at least twice the power.

Title: How high of a gear ratio can a motor have?

Body:
I want to make a robot arm where a joint is powerful enough to lift 8 kg up at a distance of 1 meter.

This requires torque $tau = r*F = r*m*g$ = about 80 nm.

So now I am trying to find the requisite parts to put this together, i.e. motor + gears and then controller.

It seems that I will require a very high gear ratio to make this happen. For example this motor: http://www.robotshop.com/ca/en/banebots-rs-550-motor-12v-19300rpm.html has stats:

stall torque = 70.55 oz-in = 0.498 nm
no load roation speed = 19300 rpm

To get my required torque, I need a gear ratio of 80/0.498 = about 161:1 (and the max speed drops to about 120 rpm).

My questions:

1) Do my calculations so far seem correct? It seems a bit suspect to me that an $8 motor with some gears can cause a 17.5lbs dumbbell to rotate about a circle of radius 1m twice a second (I'm barely that strong). This type of torque would be awesome for my application, but perhaps I'm missing something in the calculations and being too optimistic (e.g. efficiency).

2) Is it safe to operate a motor at such a high gear ratio? Gears are small, and I'm worried they'll easily crack/break/wear down quickly over time. Does anyone know of example gears that I should consider for this?

Thank you very much for any help, cheers.


问:
Simple yet effective angular position sensor to be used in robotic hand
What is the best yet simple to use angular position sensor? I am building a robotic hand and I want to implement this sensor at the joints of the fingers. I don't need a module, just an analogue output.
Thank you.</p>

答:
Another popular rotary sensor is the ratiometric Hall effect sensor.

Use a device like the A1324. It's a 3-pin device which gives an analog voltage proportional to the magnetic field strength. For a magnet, you have two options:

A diametrically polarised ring magnet mounted on the steering column. The sensor should sit at the circumference of the magnet, facing the centre.

An axially polarised button magnet. Mount it on the steering column with its diameter colinear with the rotation axis.

As the magnet rotates, the output of the sensor changes sinusoidally. If you get the strength of the magnet just right, you can have very nearly a 5v output swing. However, since the output is sinusoidal, you won't be able to measure more than about 120º with good resolution.


答:
Your calculation of about 80 N⋅m torque for lifting 8 kg with a 1 m lever arm is ok; more precisely, the number is 8 kg ⋅ 9.81 m/s² ⋅ 1 m = 78.48 N⋅m.  As mentioned in other answers, you will need to scale up to account for gear inefficiency.

A simple calculation based on work shows that the Banebots RS-550 DC motor mentioned in the question is not powerful enough to spin the mass at 120 rpm in a vertical plane, geared down only 161:1.  From $W = f\cdot s$, with $f = 78.48 N⋅m$ and $s=2 m$, we require 156.96 joules to raise the mass 2 m.  Figures for most-efficient operation from the Banebots page show 120 watts (12 VDC ⋅ 10 A) power and 17250 rpm.  Supposing efficiency is 85 to 90%, the motor will take from $156.96/(120\cdot 0.90) = 1.45$ to  $156.96/(120\cdot 0.85) = 1.53$ seconds (ie, about 1.5 seconds) to deliver enough power to lift the mass 2 m, giving $60/(1.5⋅2) = 20$ rpm.

As noted in a previous answer, the RS-550's torque value of 0.498 N⋅m that is shown in the Banebots page is stall torque.  Following is a typical small-DC-motor diagram showing current (red), speed (blue), power (yellow), and efficiency (green) versus torque.

 From: JohnsonElectric.com PMDC Motors (permanent magnet DC brushed motors) webpage

You can see that speed is zero at highest torque, and since (as noted in wikipedia) mechanical power is given by $P = \tau\cdot\omega$, where $\tau$ is torque and $\omega$ is angular velocity in radians per second, ie $2\cdot\pi\cdot n$ at $n$ rpm, delivered power and efficiency also are zero at highest torque.

To compute actual values of torque, speed, current, power, and efficiency for this motor at various operating points, use the Basic DC motor equations given in wikipedia's Brushed DC electric motor article.  Most of the parameters needed for the calculations are given in the Banebots RS-550 motor page, which apply when the motor is powered by 12VDC.  Other required parameters can be calculated; for example, motor resistance is about $12V/85A = 0.14\Omega$, based on stall current.

If the 8 kg mass you mention always is attached to the arm, you probably should use a counterweight, a gas lift tube, or a spring to compensate for it, so that whatever motor you use will not have to do as much work.  Or, if the 8 kg mass is an item being placed into a workcell, operated on, and then removed, you might use two arms, linked such that weight of an item being placed is offset by that of an item being removed.


问:
I want to be a guy of robotics
I will be beginner need a help-I want to gain knowledge about robotics so it need a basic theoretical knowledge what is the best way to start?</p>

答:
Not too long ago I was a beginner myself so please let me give you my two cents worth of advice.

First of all, some background.

There are different types of robots you can build and the way they are controlled can be different too.

Essentially you have the robots that you build yourself out of bits and pieces and then you have kits you can buy and assemble. On top of that your robot can be radio controlled or it can have sensors and inbuilt programming that will make it react to its environment.

So you really need to better define what you mean when you say you need "knowledge about robotics".

If you decide to go the first route (build your own robot), it will be harder and will take longer but you are likely to learn far more in the process. It might also be cheaper especially if you use recycled parts, but I stand to be corrected on this.

Radio controlled robots bring their own challenges but are far easier to operate than autonomous ones (which use sensors and programming). Radio controlled robots are also easier to build, but they lack that certain something (call it sophistication?) and the challenge with these robots is definitely skewed towards the actual building of the robot hardware. If you go with an autonomous  kit robot, then you get to delve into the programming and sensors and it is more intellectually challenging.

Essentially if you want to make the robot autonomous then you need a microcontroller such as Arduino, which is essentially a microprocessor with input and output ports, so that you can read values from sensors and send out signals to operate servos, motors, lights and so on. This is how you would for instance get the robot to follow a line drawn on the ground. Many kit robots come with this microcontroller already installed so if you prefer to avoid the hassle of making your own robot this might be the best way to go. Plus of course you often get instruction manuals, user forums for that particular model and so on.

However if you do choose to make your own first robot then you should make sure it is a small one. In terms of cost, the microcontroller boards and the sensors you use with them are often very cheap (see also below), but expense grows with size, as in more material being required, larger motors/servos, larger batteries, and so on.

As an aside, in terms of materials, unless you are into wood work, I would recommend either aluminum or polycarbonate for the chassis parts. Polycarbonate in particular is extremely light and strong and can easily be cut into shape with hand tools. Its more expensive than aluminum so your best bet is to go for 3mm thick variety. Do not be scared at the bendability of the material - it won't break even if bent 180 degrees. NB. Make sure the shop does not give you Acrylic instead as this WILL BREAK! Another advantage of Polycarbonate is that it is transparent so it makes lining up holes and such like a breeze! Of course Aluminum is quite good too and you can buy it in various sizes and shapes (such as angle brackets) so it might be useful to explore that way forward also - 2.5mm to 3mm thick aluminum should be fine.

Anyhow, once you have decided what you want to do, then you can start to gather the resources and supporting knowledge you require. In other words you need to plan before you build anything.

First of all, there are lots of free resources online so please save your money to use on the actually hardware.

Download e-books - there are many of these easily available online. In some cases if a book is really good you might want to buy the paper version but don't get carried away.

For instance this site is quite good: http://it-ebooks.info.

Then there are many forums out there as well as you tube videos. Plenty of people willing to help too.

Another tip is to explore Chinese vendors because parts will often be far cheaper (although sometimes of lower quality).  But the cheapness means you can experiment without worrying about damaging anything. I buy a lot of my kit from www.banggood.com.

Some last points.

I have found that there are no clear boundaries in this hobby.

Whilst building my first robot, I got engaged with battery technology, Radio control channel mixing (followed a you tube video), motor controllers and motors. I converted cordless driller motors to use with my robot (followed a you tube video), scavenged printers to make the wheel shafts out of. I had to delve into (and buy) power supplies, watt meters, silicon-coated cables, different types of connectors, and umpteen other things I had never encountered before.

I visited metal working shops to get aluminum blocks cut and shaped. I also needed to go to  hardware stores to buy materials for my chassis, negotiated discounts for offcuts etc etc.

Which brings me to the most important thing of all - I talked to people everywhere and more importantly I listened!

That in fact is the number one thing you need to do. You will of course still make mistakes but at least in this way you will avoid making too many. Also note that some mistakes can be expensive and some mistakes can even be dangerous. LIPO batteries for instance need careful handling and require special chargers. So do not just barge ahead and think "these are toys and can't hurt me". Yes they can, especially if they involve large motors, high currents and moving parts.

So I suggest you start by collecting some ebooks using the site I listed. Then after reading bits and pieces here and there, decide on what you want to do exactly, then make a plan for your first robot and get going. And keep asking questions as you go.

And finally remember if it is not fun to do, then don't do it! Good luck.

Title: I want to be a guy of robotics


问:
Computing the Jacobian matrix for Inverse Kinematics
When computing the Jacobian matrix for solving an Inverse Kinematic analytically, I read from many places that I could use this formula to create each of the columns of a joint in the Jacobian matrix:

$$\mathbf{J}_{i}=\frac{\partial \mathbf{e}}{\partial \phi_{i}}=\left[\begin{array}{c}{\left[\mathbf{a}_{i}^{\prime} \times\left(\mathbf{e}_{p o s}-\mathbf{r}_{i}^{\prime}\right)\right]^{T}} \\ {\left[\mathbf{a}_{i}^{\prime}\right]^{T}}\end{array}\right]$$

Such that $a'$ is the rotation axis in world space, $r'$ is the pivot point in world space, and $e_{pos}$ is the position of the end effector in world space.

However, I don't understand how this can work when the joints have more than one DOFs. Take the following as an example:

The $\theta$ are the rotational DOF, the $e$ is the end effector, the $g$ is the goal of the end effector, the $P_1$, $P_2$ and $P_3$ are the joints.

First, if I were to compute the Jacobian matrix based on the formula above for the diagram, I will get something like this:

$$J=\begin{bmatrix}
((0,0,1)\times \vec { e } )_{ x } & ((0,0,1)\times (\vec { e } -\vec { P_{ 1 } } ))_{ x } & ((0,0,1)\times (\vec { e } -\vec { P_{ 2 } } ))_{ x } \\ ((0,0,1)\times \vec { e } )_{ y } & ((0,0,1)\times (\vec { e } -\vec { P_{ 1 } } ))_{ y } & ((0,0,1)\times (\vec { e } -\vec { P_{ 2 } } ))_{ y } \\ ((0,0,1)\times \vec { e } )_{ z } & ((0,0,1)\times (\vec { e } -\vec { P_{ 1 } } ))_{ z } & ((0,0,1)\times (\vec { e } -\vec { P_{ 2 } } ))_{ z } \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 1 & 1 & 1
\end{bmatrix} $$

This is assumed that all the rotation axes are $(0,0,1)$ and all of them only have one rotational DOF. So, I believe each column is for one DOF, in this case, the $\theta_\#$.

Now, here's the problem: What if all the joints have full 6 DOFs? Say now, for every joint, I have rotational DOFs in all axes, $\theta_x$, $\theta_y$ and $\theta_z$, and also translational DOFs in all axes, $t_x$, $t_y$ and $t_z$.

To make my question clearer, suppose if I were to "forcefully" apply the formula above to all the DOFs of all the joints, then I probably will get a Jacobian matrix like this:

(click for full size)

But this is incredibly weird because all the 6 columns of the DOF for every joint is repeating the same thing.

How can I use the same formula to build the Jacobian matrix with all the DOFs? How would the Jacobian matrix look like in this case?

答:
I have to admit that i haven't seen that specific formula very often, but my guess would be that in case of more than one DOF, you would evaluate it for every joint in every column and then (perhaps?) multiply those results in each column.

But let me suggest a simpler apporach to Jacobians in the context of arbitrary many DOFs: Basically, the Jacobian tells you, how far each joint moves, if you move the end effector frame in some arbitrarily chosen direction. Let $f(\theta)$ be the forward kinematics, where $\theta = [\theta_1, ... , \theta_n]$ are the joints, $f_{\text{pos}}$ is the positional part of the forward kinematics and $f_{\text{rot}}$ the rotational part. Then you can obtain the Jacobian by differentiating the forward kinematics with respect to the joint variables:
$$
J = \frac{\partial f}{\partial \theta} =
\begin{bmatrix}
  \frac{\partial f_{\text{pos}}}{\partial \theta_1}, & \frac{\partial f_{\text{pos}}}{\partial \theta_2} & ..., \frac{\partial f_{\text{pos}}}{\partial \theta_n} \\
  \frac{\partial f_{\text{rot}}}{\partial \theta_1}, & \frac{\partial f_{\text{rot}}}{\partial \theta_2} & ..., \frac{\partial f_{\text{rot}}}{\partial \theta_n}
\end{bmatrix}
$$
is your manipulator's Jacobian. Inverting it would give you the inverse kinematics with respcet to velocities. It can still be useful though, if you want to know how far each joint has to move if you want to move your end effector by some small amount $\Delta x$ in any direction (because on position level, this would effectively be a linearization):
$$
 \Delta \theta = J^{-1}\Delta x
$$

Hope that this helps.

ContentLicense: CC BY-SA 4.0


问:
Clicking NXT Brick
Help! I have recently installed leJOS NXJ on to my NXT brick, and soon after my batteries died. I inserted new ones, and now I cant start my brick up. When I press the startup button(orange) it makes a clicking sound and when I let go it stops. I have tried reflashing the brick with both leJOS NXJ and the NXT software and both programs say something along the lines of "unable to locate brick." Any suggetions?</p>

答:
The clicking indicates the brick is waiting for firmware download.

Double check device manager and it should also be listed there as waiting firmware.

Use either the LEGO software or another utility (eg RobotC, LeJOS) to download the firmware of your choice.

Big if ->  If the device does not show up as Nxt Waiting firmware in device manager, there may be some conflict with USB drivers often installed with Arduino.  It is a mess at the moment and there are no simple solutions. Keep Uninstalling (Arduino first), rebooting, re-installing (phantom drivers) until the NXT shows up as waiting firmware.

Title: Clicking NXT Brick


问:
Nano sized electric motors
What is a good website for buying 1.5V continuous motors? I'm looking to build a clockwork robot but I cannot find a motor small enough to fit inside my power box and I don't want to mount it outside of the box. I have a 1" by .75" space that the motor needs to fit into. I have found a few websites but they look sketchy and none of them have good reviews.</p>

答: Pager motors will most likely do the trick. You can find some on Robotshop for example, with correct specs. This one is manufactured by Solarbotics.

Title: Nano sized electric motors


问:
I need more robots
I know that this isn't a programming question, but it is robotics so I thought you could all be flexible since it's my first question?

Anyway. I love making robots using robot kits that come with instructions. It's always fun to use afterwards because of the controllers I build with it.

The problem is that I can't find anymore robots. They are all either too expensive, not what I'm looking for, or both.

Can anybody give me links to some good robot kits?

My price limit is £30 - £40.

Here are the three robot kits I have built. I need kits that are like these:

Robot Arm: http://www.amazon.co.uk/gp/aw/d/B002HXTONC/ref=mp_s_a_1_9?qid=1419721030&sr=8-9&pi=AC_SX110_SY165

Remote Control Robot Beetle: I can't post more than two links. Go to maplins and type in the name of the robot and you'll find it. It's a rover version of the robot arm.

3-in-1 All Terrain Robot Kit: http://www.maplin.co.uk/p/3-in-1-atr-all-terrain-robot-n12dp

I don't want to program this robot. I want it to be like it is in the examples above. Buy the kit, read the instructions, then build it.

Thank you all in advance!

PS. Any further information will be given if asked for.

答: The 3 "robots" above are not really robots. They are more like diy toys. A robot is fully autonomous. A robot that is controlled by someone is called a machine. I highly suggest you buy an arduino, some motors and sensors. Then you can truly make your own robot and there are plenty of instructions online for arduino robot and you can copy the code if you don't want to program.</p>

Title: I need more robots


问:
Robotics Trends
Robotics has always been one of those engineering fields which has promised so much, but is taking a long time to deliver all the things that people imagine.

When someone asks: "How long before we have [X] type of robots?" Are there any resources we can call upon to try to calculate a rough answer. These resources might include:

Rate of progress of computational power, and some estimate of how much will be needed for various types of AI.

Rate of progress of electrical energy storage density, and some estimate of how much will be needed for various types of robot.

Rate of progress of actuation systems, and some estimate of what would be needed for various types of robot.

Lists of milestones towards various types of robot, and which ones have been achieved and when.

Are these types of studies performed, and are the results published?

Added:

In response to Jakob's comment, I am not looking for opinions or discussions on this subject. What I am looking for are published studies which might shed light on this question.

答:
Rate of progress of computational power

Moore's law: over the history of computing hardware, the density of transistors on an integrated circuit doubles approximately every two years.

How long will that take until we have human-equivalent processing power (HEPP) ?
As Martin pointed out, Ray Kurzweil and those who listen to him say things like:
"By some estimates, we already have supercomputers that have the raw processing power
necessary to produce HEPP -- we just don't know how yet to program them to act intelligently."
"By 2030, the hardware for a HEPP will cost one dollar." (a b)

Nielsen's Law: network connection speeds double approximately every 21 months.

Rate of progress of electrical energy storage density

unnamed law: electric vehicle batteries double in miles/dollar every 10 years. (b)

The power consumed by a integrated circuit running at full speed remains roughly constant.

The power consumed by a integrated circuit to do any fixed amount of processing halves approximately every two years.

Other trends relevant to robotics

Hendy's Law: digital camera pixels per dollar doubles approximately every 18 months.

Haitz's law: the light output of an LED doubles approximately every 36 months.

Johnny Ryan is gathering data that may lead to a similar law for 3d printing.
(Robots are sometimes built using such 3D printed parts,
and 3D printers themselves are technically a kind of "robot" under most definitions).

[unnamed law]: the power-to-weight ratio of electric motors and their control electronics doubles every [FIXME] years.
(This trend is most obvious in electric aircraft). ( a b )

These trends in the low-level quantitative measures of what people build are surprisingly "linear" (in a log-linear graph) and therefore easy to predict.
However, historically people have made terrible predictions of exactly how much quantity of such low-level hardware was necessary to achieve some qualitative features in AI and other areas of robotics.
Usually people woefully underestimate what is needed to automate things we find "easy" like riding a bike or driving a car.
Occasionally people find it disturbing how easy it is to automate some things ( ELIZA effect ).

Title: Robotics Trends


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

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

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

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

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

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

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

Any help?

答: Eventually, @alecive came up with an elegant solution he published here: http://dx.doi.org/10.1109/ICRA.2014.6907178</p>

Title: How to invert D-H parameters


问:
What are the advantages of optimal control as opposed to control theory?
For a robot, say path planning in particular, what are the pros and cons of choosing classical control theory or optimal control (LQR for example) ?</p>

答:
Besides the clear answer that helps distinguish planning from control, I would stress the point that classical approaches based on pole placement (e.g. PID) and optimal control techniques (e.g. LQR) respond to different design requirements:

The former methods are more oriented to vary the transient dynamics of the closed-loop system (faster/slower response) so as they allow for a principled way to reject disturbances; hence, key features are: frequency analysis, transient response, steady-state errors, robustness margins, ease of gain tuning.

The latter methods focus much more on meeting some given integral goals, that is to comply for example with objectives such as maximum level of control effort or final displacement attained in the minimum time that are all computed over the whole trajectory; thus, key features are: bounds on control output, state feedback, performance on the whole.

However, pole placement techniques are preferable for the difficulties encountered in LQR design of setting up proper cost functions, as described in wikipedia.