问:
Effectiveness of a Mobile Robot In Relation To Mass
Do mobile and/or autonomous robots become more or less effective the bigger they get? For example, a bigger robot has bigger batteries, and thus bigger motors, whereas a smaller robot has the exact opposite, making it need less energy, but also have smaller motors. Is there any known theorem that models this?</p>

答:
Practical point of view: Traction of wheel

Traction of the wheel (friction between wheel and surface) is proportional to the mass of the robot. Small mobile robots with low mass can have low wheel traction, and can easily slip on the surface, friction co-efficient of the wheel and surface area of contact between wheel and surface. Even if the wheel slippage is not too much, even small slippage can make big difference in accumulating odometer error.

Summarizing, higher the mass of the robot, better is the traction of wheel with surface.

The type of wheel/tire will be one of the important design consideration as the mass of robot varies.

I wasted lots of time trying to make a mobile robot (differential drive with 2 driven wheels + caster wheel, size around 10x15cm, mass < 1 kg) follow specified trajectory, and get proper odometer data. It had hard plastic wheel with rubber band tire. In normal operation slippage was barely noticeable and used slip at every small variation on floor. It also used to get stuck easily at small obstacles. Even though the motor had lots of torque, wheels used to just spin in place, due to lack of sufficient traction. At one point I added lots of deadweight to improve the traction.


问:
Velocity Control via Vibration
I am working on a robot that has an accelerometer. This accelerometer measures the vibration of the robot. When the robot hits a certain vibration, I would like it to slow down in order to reduce the vibration. I thought about a PID controller, but I don't think it would work. Does anybody have some input on different types of controllers I can use?

Mechaman

答:
Since you are attempting to slow down a car when the road gets too bumpy, a PID controller is not what you want.  Or rather, the bumpiness of the road will determine the desired speed that goes into the PID, instead of being part of the PID's sensor feedback loop.

You may want to look at additive increase, multiplicative decrease as a function to control your desired speed.  The basic idea would be:

```<code>good = 1
bad = 1
while (true):
    if (bumpy_level_detected() > bumpy_level_allowed):
        bad = bad + 1
    else:
        good = good + 1

    desired_speed = (good_speed_constant * good) / (bad_speed_constant ** bad)
</code>```

In more mathematical notation:
$$speed_{desired} = \frac{k_{good} * g}{({k_{bad}})^b} $$
Where $g$ represents the number of iterations where the bump sensor was within limits, $b$ represents the number of iterations where the bump sensor was over the limit, $k_{good}$ controls how quickly the car ramps up its speed when the road is smooth, and $k_{bad}$ controls how quickly the car slows down when the road is bumpy.

(The above is just for explanatory purposes; in practice, rather than keeping $g$ and $b$ in memory and causing an overflow as they increase, you'd just apply the $k_{good}$ > 0 and $k_{bad} > 1$ constants to the running total as appropriate.)

ContentLicense: CC BY-SA 3.0

Title: Velocity Control via Vibration

Body:
Since you are attempting to slow down a car when the road gets too bumpy, a PID controller is not what you want.  Or rather, the bumpiness of the road will determine the desired speed that goes into the PID, instead of being part of the PID's sensor feedback loop.

You may want to look at additive increase, multiplicative decrease as a function to control your desired speed.  The basic idea would be:

good = 1
bad = 1
while (true):
    if (bumpy_level_detected() > bumpy_level_allowed):
        bad = bad + 1
    else:
        good = good + 1

    desired_speed = (good_speed_constant * good) / (bad_speed_constant ** bad)

In more mathematical notation:
$$speed_{desired} = \frac{k_{good} * g}{({k_{bad}})^b} $$
Where $g$ represents the number of iterations where the bump sensor was within limits, $b$ represents the number of iterations where the bump sensor was over the limit, $k_{good}$ controls how quickly the car ramps up its speed when the road is smooth, and $k_{bad}$ controls how quickly the car slows down when the road is bumpy.

(The above is just for explanatory purposes; in practice, rather than keeping $g$ and $b$ in memory and causing an overflow as they increase, you'd just apply the $k_{good}$ > 0 and $k_{bad} > 1$ constants to the running total as appropriate.)


问:
Raspberry Pi for two wheel robot?
I want to create a two wheel remote controlled robot. I have worked out a lot of the logic with regards to balancing. I have started to read up on motor control and arduino vs beagleboard black vs raspberry pi.

Is the multitasking nature of a full linux OS a problem I need to be concerned with for this application?

I expect that I have to adjust the motors at least 20 times per second, but I don't think a slight variation in the update loop interval to be a problem. Possibly, I will face problems if I need to do PWM myself?

Basically, the way I plan to make the robot work is by using an accelerometer to have a reference to where down is. The robot will autonomously work to keep the direction of the accelerometer down. The remote control will simply adjust the readings from the accelerometer, and the balancing loop will then react as if the robot is falling and accelerate the wheels.

答:
A Raspberry Pi should be sufficient for the control you intend to do with it.

In designing a controller under a full multitasking operating system, like the Linux operating systems that are available for the Raspberry Pi, you have to be careful about the real-time requirements, and if the time share chunk of processor made available to your software will be enough to keep up with the rt nature of cyber-physical interactions.

In small words: if you don't run much beyond the controller code in the RPi, it should suffice, but if you want to have other pieces of code running, like some higher level supervisory control or even a Java virtual machine for some reason, you will have to assess the response time, and even take the risk of some runaway thread end up blocking your controller for some time.

The solution for that, and if you take it you will most likely have no headaches in the process, is to have non-preemptive multi-tasking OS, or, even better, a Real Time OS running on the Raspberry Pi.

And you can have both (not at the same time, of course!). Raspberry Pi has support for the RISC OS Operating System, which employs cooperative multitasking, where you can give absolute priority for the control loop, and only run other pieces of code once the control loop is done for the cycle.

And, my personal best, you have Xenomai running on it. Xenomai is a hard real-time supervisor that has Linux running under it, so you can have a full deploy of a Linux machine, with all the benefits of having all the pre-packaged software and other amenities, and you also have a Real Time layer where you can run your control loop without any risks of getting interrupted out of time. You can find instructions on how to have Xenomai installed on the RPi here. There used to be a ready SD image of it available, but it seems to have gone offline at this time.

EDIT: A ready to install SD image of Xenomai for the Raspberry Pi can be downloaded from this link.

Title: Raspberry Pi for two wheel robot?


问:
Manipulator link applied torque
I want to implement a manipulator link using a physic library. I can only apply some torque to the centre of mass, but the torque should be applied at the beginning of the link.

Shifting a reference frame from the centre of mass and recalculating inertia tensor in the new frame is not a problem, neither is recalculating a new torque, based on the change of distance, but I think it is not the correct solution.

In short, how can I scale a torque of a control signal applied at the beginning of the link to a torque of a physic simulation applied to the centre of mass. Thanks.

答: A moment applied to a rigid body does not matter where it is placed.  (This simple fact is taught in the "Statics" class for freshmen mechanical engineers).  Bullet does support joint constraints.  So you only need apply the torque on one link relative to the previous link.  Do not scale or transform the torque.</p>

Title: Manipulator link applied torque


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

答:
If you are not near the robot but require an e-stop, you'll want to consider a watchdog circuit watching a remote signal. The circuit keeps an eye out for a pulsing signal and, if the signal stops pulsing, activates the e-stop circuitry. You want to have this as close to a physical circuit as you can, which means the pulse can't be interpreted by a computer nor a microcontroller, because either of those are likely to have failure states that will prevent them from adequately actuating the e-stop.

As many of the other answers are stating, the ideal e-stop is one in which any failure mode will cause an emergency stop, which means that the laws of physics are doing most of the work of the e-stopping, rather than something resembling software. Of course, trying to interpret that stop correctly depends greatly on what the robot is meant to do and the consequences of it stopping that action, but failure of an e-stop system should not ensure that your robot keeps running.

Title: How should emergency stops be wired?


问:
Electronic Speed Control Concepts
I am a programmer who has never worked with electronics before. I am learning the concepts and hoping to build a quadcopter, with the control software entirely written by me. Motor control seems to be the most important part.

Is it true that the typical brushless DC motor and ESC (Electronic Speed Control) can only approximately control the speed?  That's because the ESC seems to have only a very approximate idea how fast the motor is revolving. This still works for a PID (Proportional Integral Derivative) controller because it gets indirect feedback from say a gyroscope whether the motor is going fast enough and so it can tell the ESC to make it revolve "even faster" or "even slower", and that's good enough.

Is my understanding in the above paragraph correct?

If so, I wonder whether a servo motor that can inform about its current rate of rotation could help do away with the ESC entirely? I feel that if the microcontroller can receive an input about motor speeds and send an output requesting a certain speed, it would not need the ESC. But I am not sure how servo motors work -- what happens immediately after you request 100rpm when say they were at 80rpm?

Since they cannot adjust the immediately, should the microcontroller immediately adjust other motors to account for the fact that not all motors are at 100rpm yet?  Does that imply that the microcontroller should only request very small deltas from the currently measured speed, so that the period of deviation from desired state is negligible?

In the latter model, of requesting only very small deltas from currently measured speed, the algorithm seems like it would not really be PID since there is no way to control the acceleration? But may be requesting the servo to go from 80rpm to 100rpm causes it to reach 81rpm much faster than requesting it to go from 80rpm to 81rpm?

I feel I know so little I cannot put my finger on it more precisely, but I hope this gives an idea of the concepts I am struggling to absorb.

To summarize, the questions are:

can a servo (brushless dc) motor allow doing away with ESC?

does a servo motor accept control inputs such as "revolve at 100rpm"?

does a servo motor offer an output saying "i am at 80rpm now"?

does a servo motor at 80rpm go to 81rpm faster if it is requested to revolve at 100rpm versus at 81rpm?

the less precise questions implicit in the text above.

(crossposted from electronics.stackexchange)

答:
First a little warning: This answer is one big AFAIK. I have some limited experience with RC electronics and don't know anything about industrial servos, and other simillar stuff :-)

BLDC motors (just motors) don't have any kind of RPM feedback, they are just three sets of coils and a bunch of magnets. The electronics that drives them can do some magic, though.

The speed controllers that I have played with are the RC hobby ones, simillar to this one. This kind of ESC have very simple interface, only receiving PWM encoded value that they somehow turn to motor speed / torque / who knows what. The general idea is that if you put more PWM, you get more speed, but no exact relation is given. They are meant to be manually controlled to drive RC cars (or planes), so they don't provide any feedback at all.

The next step are sensored ESCs. These need special sensored BLDC. The sensor in this case are three Hall effect sensors inside the motor, and its output is used to help the ESC drive the motor more precisely (or something like that), giving you more torque (especially when starting the motor from 0rpm), but the interface from the outside world is still just one PWM value going in and no feedback. I was thinking of tapping into the signal from these sensors with my microcontroller, but never tried it.

Then there are some smarter(?) ESCs like the OpenBLDC, that receive commands over I2C or some simillar bus. I have no experience with these at all, but in principle I think it should be able to report some data about how the motor is spining (rotation counts, maybe?).

RC servos (like this one have the same PWM input as the ESC, but here the value corresponds to position and the servo will control itself to keep the position even when externally disturbed.

For my robot I'm using a sensorless BLDC with the ESC I linked + a microcontroller with an optical sensor to measure the real motor rotation. Then I use PID to get the PWM input for the ESC. It receives commands like "I want to go at 1500rpm" and returns reports like "the motor rotated 135 degrees since the last report". I'm not saying this is ideal, but it kind of works.

Also careful about the start up (and low RPM operation) of the sensorless BLDCs, it can be really jumpy and unreliable.

Title: Electronic Speed Control Concepts


问:
Filling 30mL bottles with food-grade liquid
A project has been given to me at work, with no schematics or idea of where it was going.  I need to fill 5 30ml bottles at a time with a food-grade liquid.

Based on the parts I have, I think the design was going to use a air agitated pressure pot tank which is used for spraying paint, which would work if we weren't using food grade liquid, so right off the bat I cant use that.

The main parts that I can use are an Allen Bradley micrologix plc, 2 pneumatic cylinders, a couple solenoids, start and stop buttons.

My question is: to fill a 30ml bottle with this liquid, would a positive displacement pump with a vfd be the best way of slowing the pdp down enough to fill the 5 30ml bottle at a time?

I do have a little experience with this particular plc so the ladder logic is not the issue, its the figuring out the specs for the pump and the motor.  Any input would be very helpful also any links would be great. At this point im trying to determine if this is a huge waste of time and money or should I just go buy a filling machine for $3-5000.

答:
A specific type of equipment is named 'metering pump' (chemical dosing pump) which can be controlled by PLC, computer, serial link or on-off switch, etc.   These are standard equipment as used in lab., hospital for patient, chemical process control for PCB factory and food-processing factories.

'Metered' refers to precise control of either or both (one-shot) volume and (continuous) flow-rate, depending on specific mechanical configuration and working principle.

search google will give hundreds of units, from many brands, functions, size, and price. Try look for lab type unit for your 30ml requirement (there are big unit for hundred of litres as in food industry). There are specific types for food, 'harsh chemical (PCB etch)' and even living human/animal blood/fluids.

https://www.google.com/?gws_rd=ssl#q=metered+pump&safe=off

As original poster questioned price, one may google and get prices listed on some seller's site at much lower cost than original poster's mentioning.

Hope it helps


答:
From this page on Bullet's constraints (http://bulletphysics.org/mediawiki-1.5.8/index.php/Constraints), you can clearly create a hinge constraint that is not at the COM of the links it is attached to.  </p>

```<code>btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB,
                  const btVector3& pivotInA,
                  const btVector3& pivotInB,
                  btVector3& axisInA,
                  btVector3& axisInB,
                  bool useReferenceFrameA = false);
</code>```

<p>Once you set up a constraint like this, the bodies will pivot about this point (relative to each other).  applying a torque to any location on one of the links will have the same affect.  </p>

Title: Manipulator link applied torque

Body:
I want to implement a manipulator link using a physic library. I can only apply some torque to the centre of mass, but the torque should be applied at the beginning of the link.

Shifting a reference frame from the centre of mass and recalculating inertia tensor in the new frame is not a problem, neither is recalculating a new torque, based on the change of distance, but I think it is not the correct solution.

In short, how can I scale a torque of a control signal applied at the beginning of the link to a torque of a physic simulation applied to the centre of mass. Thanks.

Body:
From this page on Bullet's constraints (http://bulletphysics.org/mediawiki-1.5.8/index.php/Constraints), you can clearly create a hinge constraint that is not at the COM of the links it is attached to.

btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB,
                  const btVector3& pivotInA,
                  const btVector3& pivotInB,
                  btVector3& axisInA,
                  btVector3& axisInB,
                  bool useReferenceFrameA = false);

Once you set up a constraint like this, the bodies will pivot about this point (relative to each other).  applying a torque to any location on one of the links will have the same affect.


问:
Why production lines are so huge and power hungry?
I'm thinking of starting my adventure in area of professional manufacturing. When I started to look onto machines I figured out that they are build somehow like in the 70s: huge footprint, big 3kW electric motors etc.

Is there any explanation why they are build in that way?

The only one I can think of is: they were developed long time ago and if it worked, it stays as it is.

BTW: If you know other place where to ask this question please let me know!

答:
Older manufacturing robots where definitely larger than those available today. One of the biggest things you'll notice when you compare robots from today and years ago is the size of the control box! Just like computers have shrank over the years, robot controller have shrank drastically, even to the point that some manufacturing robots don't have a seperate control box, all the electronics are built into the body of the robot.

Just imagine all the power that was required to run a desktop in the 70's and compare that to the little battery in your cell phone...and the cell phone is orders of magnitudes better at crunching numbers!

That being said, the heavier an object that needs to be picked up is, the larger motors will be required. Electric motor designs have only made small incremental improvements over the years and not much has changed in terms of power density. At the end of the day, torque is proportional to current. There is some promising technology coming from humaniod robots that involves liquid cooling DC motors, that help reduce motor size, but I think power consumption is the same.


答:
I know how set up the constraint. I have it set up, have the control signal and it just do not behave as expected (though it also can be because of some mistake in my calculations). Constraining two bodies like this is just removing some dof to keep them at distance pivotInA, pivotInB and allow only for rotation about set axis. It does not dismiss the fact, that the inertia tensors is calculated for COM, not for the beginning of link. If you look at the methode applyForce (const btVector3 &force, const btVector3 &rel_pos) you can see that it is separated into

```<code>  applyCentralForce(force);
</code>```

and

      applyTorque(rel_pos.cross(force*m_linearFactor));

the offset is taken relative to the COM, you can not just apply a force relative to any other points but to the COM. So, the inertia tensor is wrong, force would be applied with a wrong shoulder, i doubt it is gonna produce the correct result.

Title: Manipulator link applied torque

Body:
I know how set up the constraint. I have it set up, have the control signal and it just do not behave as expected (though it also can be because of some mistake in my calculations). Constraining two bodies like this is just removing some dof to keep them at distance pivotInA, pivotInB and allow only for rotation about set axis. It does not dismiss the fact, that the inertia tensors is calculated for COM, not for the beginning of link. If you look at the methode applyForce (const btVector3 &force, const btVector3 &rel_pos) you can see that it is separated into

  applyCentralForce(force);

and

      applyTorque(rel_pos.cross(force*m_linearFactor));

the offset is taken relative to the COM, you can not just apply a force relative to any other points but to the COM. So, the inertia tensor is wrong, force would be applied with a wrong shoulder, i doubt it is gonna produce the correct result.


问:
Current-limiting stepper motors for RepRap
I have been working on a robot project for a while. Now I am tired of finding parts that just does the job, so it is time to do create parts.

A 3D printer will do the trick for many parts, but 3D printers share a lot with a CNC mill in terms of control and parts. So my question is this:

I am building a Reprap style printer, but I will use more heavy duty parts and motors, hoping to make a aluminum capable 3 axis mill later. I found some bipolar NEMA 23 stepper motors at 1.9 Nm and 3 Amps per coil. According to the reprap.org website, they recommend NEMA 17 and low voltage. Seems to me that they use voltage to limit the current.

Can I build a reprap, and use current limiting stepper drivers with an Arduino and some software I find online, and get away with these large stepper motors? Or am I in for a lot of trouble?

答:
I'm using a NEMA23 on my Y axis on my greatly frankensteined MendelMax. The bed was elongated to 350mm along with other upgrades, so I needed the bigger motor. It's running nice and cool at 26 volts on standard Pololu DRV8825 stepper motor controllers.

Note however that CNC platforms and 3D printer platforms have only three things in common: X, Y, and Z axes.

Otherwise, 3D printers tend to want to be very fast (150+ mm/s), very light, low torque, with modest precision (0.1mm is ok).

CNC mills tend to have a lot more torque, can be much slower (5mm sec would be ok), and would want higher precision (0.01mm).

While many reprap based 3D printer designs use belts for the X+Y axes for their speed (and screws for the Z axis for holding power); most CNC designs tend to use leadscrews on all three (or four) axes.

If you want a machine that can do both, it's best to start out with a CNC design and use leadscrews. Then you can make a very slow but very precise 3D printer.

That's much better than a wimpy belt-based CNC machine that won't have enough torque to even mill out plastic.


问:
How can the inverse kinematics problem be solved?
The forward kinematics of a robot arm can be solved easily. We can represent each joint using Denavit–Hartenberg transformation matrices.

For example, if the $i^{th}$ joint is a linear actuator, it may have the transformation matrix:

$T_i = \left[\begin{matrix}
1&0&0&0\\
0&1&0&0\\
0&0&1&d_i\\
0&0&0&1
\end{matrix} \right]$
where the extension length is defined by $d_i$

whereas, a rotating link may be:

$T_i = \left[\begin{matrix}
1&0&0&L\\
0&\cos\alpha_i&-\sin\alpha_i&0\\
0&\sin\alpha_i&\cos\alpha_i&0\\
0&0&0&1
\end{matrix} \right]$ where $\alpha$ is the angle, and $L$ is the length of the link.

We can then find the position and orientation of the end effector by multiplying all the transformation matrices: $\prod{T_i}$.

The question is, how do we solve the inverse problem?

Mathematically, for a desired end effector position $M$, find the parameters $d_i$, $\alpha_i$ such that $\prod{T_i} = M$. What methods exist to solve this equation?

答:
There a number of solutions to this problem that center around the Jacobian Matrix. This slideshow covers the Jacobian methods and also mentions a Cyclic Coordinate Descent method, which I am unfamiliar with.

There are a plethora of resources on the subject - if you ask google for "inverse kinematics Jacobian".

Also, check out Chapter 5.3 of the lecture notes from MIT's Open Course on Introductory Robotics.


答:
For practice, model quadcopter typically uses sensorless BLDC motor with ESC which are mass produced, low cost and specifically designed for the job (high power, light weight).

Speed control via PWM (pulse width modulation) signal applied to ESC input pin. PWM frequency is fixed. Pulse width vary from a minimum to maximum value which ESC control motor varying from min to max speed.

This type of ESC creates a rotating magnetic field which the rotor magnet simply follows, ESC knows the precise speed that you can control via the PWM signal.

Sensored ESC provides better performance at low speed (precise speed control down to zero RPM) that may be useful for vehicle but not required for quadcoptor. Sensorless system has non-zero minimum speed.

For theory, a nice free-of-charge MOCC course is
https://courses.edx.org/courses/TUMx/AUTONAVx/2T2014/info

There are many web and open source projects. Try wiki and follow the external link at bottom.
http://en.wikipedia.org/wiki/Ardupilot

Hope this helps.

Title: Electronic Speed Control Concepts

Body:
I am a programmer who has never worked with electronics before. I am learning the concepts and hoping to build a quadcopter, with the control software entirely written by me. Motor control seems to be the most important part.

Is it true that the typical brushless DC motor and ESC (Electronic Speed Control) can only approximately control the speed?  That's because the ESC seems to have only a very approximate idea how fast the motor is revolving. This still works for a PID (Proportional Integral Derivative) controller because it gets indirect feedback from say a gyroscope whether the motor is going fast enough and so it can tell the ESC to make it revolve "even faster" or "even slower", and that's good enough.

Is my understanding in the above paragraph correct?

If so, I wonder whether a servo motor that can inform about its current rate of rotation could help do away with the ESC entirely? I feel that if the microcontroller can receive an input about motor speeds and send an output requesting a certain speed, it would not need the ESC. But I am not sure how servo motors work -- what happens immediately after you request 100rpm when say they were at 80rpm?

Since they cannot adjust the immediately, should the microcontroller immediately adjust other motors to account for the fact that not all motors are at 100rpm yet?  Does that imply that the microcontroller should only request very small deltas from the currently measured speed, so that the period of deviation from desired state is negligible?

In the latter model, of requesting only very small deltas from currently measured speed, the algorithm seems like it would not really be PID since there is no way to control the acceleration? But may be requesting the servo to go from 80rpm to 100rpm causes it to reach 81rpm much faster than requesting it to go from 80rpm to 81rpm?

I feel I know so little I cannot put my finger on it more precisely, but I hope this gives an idea of the concepts I am struggling to absorb.

To summarize, the questions are:

can a servo (brushless dc) motor allow doing away with ESC?

does a servo motor accept control inputs such as "revolve at 100rpm"?

does a servo motor offer an output saying "i am at 80rpm now"?

does a servo motor at 80rpm go to 81rpm faster if it is requested to revolve at 100rpm versus at 81rpm?

the less precise questions implicit in the text above.

(crossposted from electronics.stackexchange)


问:
Is this gear design feasible?
I came up with an idea and am working with a mechanical engineer to design and prototype the idea but I keep sketching out my own ideas in the process and I just came up with this.. I'm quite sure this is not an idea he'll go with but I'm just kinda curious whether or not this would actually be feasible.  Or for all I know it's already common place, or totally stupid...  I dunno.

What do you think?

答: Hmm, thats definitely a unique idea. I think the shape of the top gear would have to be rounded off like half of a torus so it maintains a good interlocking through the motion from parallel to 90 degrees. Also, the motion that the top shaft/gear go through during that transition might not be a simple rotation...it might be a rotation + translation. I'm just speculating, but if that is the case, it would be cumbersome to design the supporting structure for this setup. If it were me, I'd model it up in solidworks and inspect it throughly. I'd be interested in knowing what you find out. </p>

Title: Is this gear design feasible?


问:
Android Vibrating based on Arduino devices
I want to make a simple device that causes my cellphone to vibrate for 30 seconds when my phone is 10 feet away from it. How would I go about doing that. How small could I make the device?</p>

答:
Program a Bluetooth 4 BLE transmitter to send a burst of short data every n seconds. Choose n to balance cell life and response time. Small n, less cell life. The data is dummy data as we need the signal strength only. Use shortest data length to save cell life.

Older transmitter is MCU and BLE chip. Seem newer chip is one chip doing both.

Program a cell phone app to read RSSI signal strength to estimate distance with reasonable accuracy.

With mass production factory grade tools, facility and know how, size can be 1.2 diameter of coin cell and 3 times height of coin cell, being 1 time for cell, 1 time for electronic and PCB and 1 time for plastic and misc.

Google "child monitor bracelet" to see examples of real commercial products

Hope this helps


问:
Best microphone for speech recognition tasks
I made several tests with different setups in order to achieve an acceptable speech recognition quality. It works well when I push a button to activate it but now I want it to be automatically activated when a user speaks. This is a big problem, especially when I only use the energy of the audio signal to guess when the user is speaking. That is why I thought about using a headset and not a distant microphone. In a headset the microphone is very close to the users mouth and it is easier to make correct guesses about when the user is speaking. Now my question is if bluetooth sets used with mobile phones also have such a property. They are not long enough and their microphone is not positioned exactly in front of the mouth. Is there a possibility that such devices can also capture some speech/noise from a distant user? Is there a significant difference in the signal energy coming from the user's speech and a 1 meter distant person's speech?</p>

答:
You might want to examine different microphone pickup patterns and determine which is best for your application:

Most headset microphones are designed using a cardioid or hypercardioid pattern for their noise-cancelling properties. They probably won't be as good for recording sound at a distance of 1 meter, but you can still get cardioid microphones that are useful at such a distance.

To understand better some of the design concepts of directional microphones, I recommend checking out EEVBlog video #605, which discusses it.

As to whether you should use a condenser, dynamic, ribbon, etc. microphone, that depends on the electrical characteristics of your device.


问:
What UAV kit(s) would be suitable for a beginner roboticist with programming experience?
I'm really new to robotics, however I am a programmer familiar with several different languages. I don't have a ton of money to spend and I was wondering what is a really good starter kit.

My criteria is for the kit to be inexpensive and powerful, in that its functionality is extensible -- something that would allow the builder to be creative and possibly invent new ways to use it, not just a glorified model kit.

Being extendable to smartphones is a plus.

I'm not looking for something easy or introductory, just something powerful, flexible, and cost effective.

答: Parralax offers a number of kits that are relatively cheap and extensible.</p>


问:
Absolute positioning without GPS
Using an IMU a robot can estimate its current position relative to its starting position, but this incurs error over time. GPS is especially useful for providing position information not biased by local error accumulation. But GPS cannot be used indoors, and even outdoors it can be spotty.

So what are some methods or sensors that a robot can use to localize (relative to some frame of reference) without using GPS?

答: http://www.locatacorp.com/ might be the solution you are looking for. They offer technology  to create a local constellation indoor. It emulates the satellites for indoor GPS applications. I believe it can use GPS receivers indoor without the need for additional hardware on the robots.</p>

Title: Absolute positioning without GPS


问:
IPC-Bridge problem
Is anyone able to help me out getting IPC-bridge working on my ubuntu lucid installation (with matlab 2012a)? I'm not being able to finish the last step on here (Compiling the messages folders): https://alliance.seas.upenn.edu/~meam620/wiki/index.php?n=Roslab.IpcBridge#Installation

I'm able to rosmake the ipc_bridge_ros, however when i enter this "roscd ipc_roslib && make", it seems meX does not recognize the commands. Here is what i get (screen shot): http://img13.imageshack.us/img13/6031/screenshot20121108at191.png

NOTE: i'm going to use IPC-bridge so that i can control a pioneer 3DX and implement a Fast-slam algorithm in matlab.

答:
That script is calling "mex" but it's getting pdfTex "mex" tool instead of the Matlab compiler.

Before running that script you need to adjust your PATH environment variable to put the Matlab binaries before your system ones.  Assuming your Matlab binaries are located in /opt/matlab/bin that would look something like this:

```<code>export PATH=/opt/matlab/bin:$PATH
roscd ipc_roslib && make
</code>```

Title: IPC-Bridge problem

Body:
That script is calling "mex" but it's getting pdfTex "mex" tool instead of the Matlab compiler.

Before running that script you need to adjust your PATH environment variable to put the Matlab binaries before your system ones.  Assuming your Matlab binaries are located in /opt/matlab/bin that would look something like this:

export PATH=/opt/matlab/bin:$PATH
roscd ipc_roslib && make


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

I'm using an Arduino Uno for the microcontroller.

答:
Here's a paper that seems relevant: Policy Gradient Reinforcement Learning for Fast Quadrupedal Locomotion.

Abstract:

This paper presents a machine learning approach to optimizing a quadrupedal trot gait for forward speed. Given a parameterized walk designed for a specific robot, we propose using a form of policy gradient reinforcement learning to automatically search the set of possible parameters with the goal of finding the fastest possible walk. We implement and test our approach on a commercially available quadrupedal robot platform, namely the Sony Aibo robot. After about three hours of learning, all on the physical robots and with no human intervention other than to change the batteries, the robots achieved the fastest walk known for the Aibo, significantly outperforming a variety of existing hand-coded and learned solutions.


问:
Can ROS run on a Raspberry Pi?
Can ROS run on a Raspberry Pi?

ROS is resigned to run on a network of machines, with different machines, even different cores on the same machine doing different jobs. Can one of those machines be a Raspberry Pi?

I am considering using an R-Pi as the EtherCAT master on a mobile robot, communicating with the main PC over WiFi, using a dongle.

Can an R-Pi even run ROS at all?

Would an R-Pi have enough processing power to do some 1kHz servoing?

Would it be possible to run some servoing on the host through the WiFi connecion?

答: Yes it does, but installing ROS on Debian is do-able, yet not trivial.</p>

Title: Can ROS run on a Raspberry Pi?


问:
I'd like to use gesture based input for my robot. What are the pros and cons between the Xtion Live and the Kinect?
As in the title, I'd like to implement gesture recognition on my robot and I'm looking for the pros and cons between the Kinect and the Xtion - and also if there are any other sensible options available.

I'm thinking of the following, but open to other suggestions:

Accuracy

Price

Driver quality

Power draw

答:
There may be software differences, depending on how you connect to the device.

On Linux, freenect seems to work better with Kinect than Xtion, while openni tries to support both, but seems rather buggy, lately.


问:
Robot Serial Communication Error
We are using a Koro robot for our PC based automation solution. But sometimes the robot is getting the command but refuses to respond. Then I get a serial communication timeout error. The error is happening for a random type of commands and it is also not happening all the time making the troubleshooting difficult.

I doubt the driver problem. How do you approach this problem.?

Thanks

答:
Welcome to Robotics... Hopefully, this will give you some pointers, although your situation is not easy to debug remotely :)

Things to consider (and I appreciate its a non-repeatable problem):

Does it only happen when battery levels are low, or also with full charge (voltage low)

Does it only happen when the robot is active, or also from stationary (processor overload)

What else is the control PC doing? (PC overload)

Have you checked that the comms link is correct (voltage levels, numbers of bits, protocol etc) - Check with an oscilloscope.

Noise interference (EMC) if the motors are active

Can you log what is received at the robot?

Is the receive buffer on the robot big enough for the biggest command sequence? (buffer overflow)

Have you checked the cable, both for continuity and that it isn't loose.

As things stand, it is difficult to be able to determine...

Title: Robot Serial Communication Error


答:
There are a number of things to consider for your project. Since you are asking for the learning algorithms, I asume your hardware is or will be up and running. When getting your robot to learn, you should differentiate between on-line and off-line learning. Further, there is on-system and off-sytem learning, which can be combined with the previous category. Since your system only has a micro-controller attached to it, your method of choice would be off-system. You learn (be it on-line or off-line) on your connected PC, but not on the system. The system will just execute your current learned policy.

All gait movements have some sort of cyclic nature, and can generally be described as functions that provide an angular value over time for each of the joints. The trick is to parametrize these functions that you come out with as little parameters as possible. Then you perform optimization on these functions. In order to do that you need to know what to optimize for.

Most learning approaches will require some sort of reward function, so effectively some feedback to the algorithm to tell it how well it does perform (e.g. maximise distance travelled/energy required). The algorithm will then want to see the reward for a given set of parameters (single episode). Depending on the complexity of your problem, the number of episodes might be quite large. This is where the destinction between on-line and off-line learning comes in. In off-line learning you use a simulation to perform the learning and then later move it to the system. In on-line learning you learn directly on the system. This is generally more difficult, since you will have to spend a lot of time performing evaluations for the learning algorithm.

Title: Learning Algorithms for Walking Quadruped

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

I'm using an Arduino Uno for the microcontroller.


问:
Low-cost servo with digital control interfaces?
Some years ago, there where some projects that provided hardware and software to perform modifications on standard hobby servos to convert them to digital servos, with all the advantages that come with it.

OpenServo is a little outdated, and does not seem to be worked on anymore, and there is no hardware to buy.

Sparkfun has its own version of the OpenServo, which at least is available for buying.

Do you know if there are other mods, or even complete low cost digital servos? I am mostly interested in position feedback, and servo chaining.

答:
With a bit of additional research I have found one other project very similar to the OpenServo project. They are called supermodified servos. Some of the web sources are not available anymore, but there is the source for the project, which is quite advanced on google code and on github:

zosupermodified - source code for the controller

Supermodified-Servo - eagle files


答:
You might also consider the Leap Motion:

It's got amazing resolution, and the ability to pick out individual fingers at an amazing update rate.

And is even fine enough to allow you to write in the air with a pencil:

You can't buy one yet, but they'll be available soon.

Title: I'd like to use gesture based input for my robot. What are the pros and cons between the Xtion Live and the Kinect?

Body:
As in the title, I'd like to implement gesture recognition on my robot and I'm looking for the pros and cons between the Kinect and the Xtion - and also if there are any other sensible options available.

I'm thinking of the following, but open to other suggestions:

Accuracy

Price

Driver quality

Power draw


问:
Correct way to use Subsumption Architecture with Robot C
I've been doing a lot of reading lately about Subsumption Architecture and there are a few different ways people seem to advocate.

For instance some people use a global "flag" variable to have a task take control. Others use the endTimeSlice() and allow the arbiter to really choose. And I think this is correct.

I have this small section of RobotC code that I'm working on for a line following robot but am not sure I am doing it right as currently the track method will always take over the find method. The correct flow should be that find should guide the robot to the line using a spiral path to find the line. Once the line is found track should take over.

```<code>task evade(){
    if(SensorValue(forwardSonarSensor) > threshold){
            //box the obstruction
    }
}

task find(){
    if(SensorValue(lightSensor) > threshold){
            //spiral the robot
    }
}

task track(){

    if(SensorValue(lightSensor) < threshold){
            //go straight
    }else{
                //execute turns to follow the line
    }
}

task main(){
    while(true){
        StartTask(evade,9);
        StartTask(track,8);
        StartTask(find,7);
        wait1Msec(250);
    }
}
</code>```

I've just used some comments here rather than the actual code to keep it brief. Are my if statements not good enough as conditions because when the robot is off the line, track() takes over. Is this due to the else statement within track? If so, how to have track() perform turns when it looses the line without taking over from forage at the start of the program?

答:
With Subsumption Architecture, you should carefully design your behaviors in such a way that if you assign task T priority n, then T should be what the robot should do if all tasks with higher priority than n are ignored.

Let's order your example tasks, then figure out a way to implement it. Your tasks are evade, find and track.

In general you would want the robot to track a line. However, if it couldn't detect the line, then it should try to find it. Above all, it should evade obstacles. This gives us the following ordering:

Highest priority: evade

Then: find

Then: track

The reason find has higher priority than track is that, as I mentioned above, you would track only if evade and find are unnecessary. If you put find below track, that means you start tracking if there is no obstacle, even if you are not on the line.

Now let's look at your implementation:

```<code>task find(){
    if(SensorValue(lightSensor) > threshold){
            //spiral the robot
    }
}

task track(){

    if(SensorValue(lightSensor) < threshold){
            //go straight
    }else{
                //execute turns to follow the line
    }
}
</code>```

Remember that we gave find a higher priority. Therefore, if the robot cannot sense the lightSensor, it will go in spiral trying to find the line. Once it does, track kicks in. As you can see, the else condition of track never happens.

While this works, the robot would move very awkwardly. There is not much you can do about it in fact, given the current build of your robot.

Although I already answered your question, but here is a simple improvement to your line tracking:

Instead of one light sensor, use two; ls_left and ls_right. Using (at least) two sensors, you can understand whether you are totally out of the track, or about to go out of the track. In the second case, you can easily turn to the proper direction and get back on track.

Your find task is similar:

```<code>task find(){
    if (SensorValue(ls_left) > threshold
        && Sensorvalue(ls_right) > threshold){
            //spiral the robot
    }
}
</code>```

That is, you go in spiral only if you don't sense anything at all

Your track task now becomes more efficient:

```<code>task track(){

    if (SensorValue(ls_left) < threshold
        && SensorValue(ls_right) < threshold){
            //go straight
    } else if (SensorValue(ls_left) < threshold
        && SensorValue(ls_right) > threshold){
            //turn left
    } else if (SensorValue(ls_left) > threshold
        && SensorValue(ls_right) < threshold){
            //turn right
    } else {
            // shouldn't happen, but go on spiral anyway
    }
}
</code>```

Obviously, with a matrix of light sensors, you can better judge how badly you are going out of track (i.e. with what angle) and better decide how to get back on track (i.e. with what angular speed).

Body:
With Subsumption Architecture, you should carefully design your behaviors in such a way that if you assign task T priority n, then T should be what the robot should do if all tasks with higher priority than n are ignored.

Let's order your example tasks, then figure out a way to implement it. Your tasks are evade, find and track.

In general you would want the robot to track a line. However, if it couldn't detect the line, then it should try to find it. Above all, it should evade obstacles. This gives us the following ordering:

Highest priority: evade

Then: find

Then: track

The reason find has higher priority than track is that, as I mentioned above, you would track only if evade and find are unnecessary. If you put find below track, that means you start tracking if there is no obstacle, even if you are not on the line.

Now let's look at your implementation:

task find(){
    if(SensorValue(lightSensor) > threshold){
            //spiral the robot
    }
}

task track(){

    if(SensorValue(lightSensor) < threshold){
            //go straight
    }else{
                //execute turns to follow the line
    }
}

Remember that we gave find a higher priority. Therefore, if the robot cannot sense the lightSensor, it will go in spiral trying to find the line. Once it does, track kicks in. As you can see, the else condition of track never happens.

While this works, the robot would move very awkwardly. There is not much you can do about it in fact, given the current build of your robot.

Although I already answered your question, but here is a simple improvement to your line tracking:

Instead of one light sensor, use two; ls_left and ls_right. Using (at least) two sensors, you can understand whether you are totally out of the track, or about to go out of the track. In the second case, you can easily turn to the proper direction and get back on track.

Your find task is similar:

task find(){
    if (SensorValue(ls_left) > threshold
        && Sensorvalue(ls_right) > threshold){
            //spiral the robot
    }
}

That is, you go in spiral only if you don't sense anything at all

Your track task now becomes more efficient:

task track(){

    if (SensorValue(ls_left) < threshold
        && SensorValue(ls_right) < threshold){
            //go straight
    } else if (SensorValue(ls_left) < threshold
        && SensorValue(ls_right) > threshold){
            //turn left
    } else if (SensorValue(ls_left) > threshold
        && SensorValue(ls_right) < threshold){
            //turn right
    } else {
            // shouldn't happen, but go on spiral anyway
    }
}

Obviously, with a matrix of light sensors, you can better judge how badly you are going out of track (i.e. with what angle) and better decide how to get back on track (i.e. with what angular speed).


问:
Choosing the right dimensions for an underwater glider
I'm looking to potentially build an underwater glider, a type of submarine that's slow but can operate on extremely low power draw. However, in order for it to work effectively I've found several sources hinting that the dimensions of the components, especially the wings, are critical to its success.

However, I've found very sparse information about what these dimensions should be! I'm happy to do a bit of trial and error if it comes down to it, but to save some work does anyone have any information on what the critical dimensions should be?

答:
There is no right answer.

However, I think I can clarify what you've read so far.  You need a buoyancy engine to supply the thrust, wings to direct that thrust, and some ability to change your pitch angle when you change the buoyancy.  So, you'll need to balance the strength of your engine with the drag created by your wings.  At the same time, your wings need to be big enough to convert vertical forces of buoyancy into horizontal motion.  (Generally, the shallower depths you work with, the less power your buoyancy engine will require.)

Existing Gliders

This is a complex problem, and the existing solutions to it vary wildly.

Seaglider

The Seaglider AUV (built at the University of Washington, now owned by iRobot) is shaped to achieve laminar flow.  The antenna attaches at the back, allowing the vehicle to communicate while pointing nose-down at the surface.  It has no external moving parts; all control is done by shifting weight internally.

(source: washington.edu)

Spray

The Spray Glider (built at Scripps Institute of Oceanography, now owned by Bluefin) is a more cylindrical shape.  The antenna is located in one of the wings, and the vehicle lays on its side on the surface to communicate.

(source: auvac.org)

Slocum Gliders

Slocum gliders go for a cylindrical shape that's more suited to the pressure housing.  They have an electric powered version, but the real magic is in their more modern "thermal glider" -- they take advantage of the fact that pressure increases with depth but temperature decreases with depth to make an engine that requires no (or very little) electrical input.  Like Seaglider, the antenna is in the tail.

(source: rutgers.edu)

Liberdade XRAY

The Liberdade XRAY is shaped like a flying wing and (to my knowledge) is actually the fastest autonomous underwater glider ever made.  It's more for naval use than scientific use -- it tracks submarines.

Approaching the problem (from scratch)

If you can't find a hydrodynamics expert to help (which would be the best option), I would suggest starting with your buoyancy engine and working outward.

Figure out how much buoyancy your engine can create

Figure out how much power your engine requires

Decide how large of a battery you'll need -- this will be a significant proportion of total weight

Explore your ability to trim your vehicle (likely by moving the battery fore and aft) and calculate the pitch angles you'll be able to produce

Repeat steps 1-4 as necessary

Make a prototype shape, make its buoyancy half of what the engine can produce (minus a little for safety).  Then drag it to the bottom of a pool and see what happens.

Repeat steps 1-6 as necessary

ContentLicense: CC BY-SA 4.0


问:
What are good strategies for tuning PID loops?
Tuning controller gains can be difficult, what general strategies work well to get a stable system that converges to the right solution?

答:
A similar experimental method to hauptmech's answer that I was taught in college:

Set all gains to 0.

Increase Kd until the system oscillates.

Reduce Kd by a factor of 2-4.

Set Kp to about 1% of Kd.

Increase Kp until oscillations start.

Decrease Kp by a factor of 2-4.

Set Ki to about 1% of Kp.

Increase Ki until oscillations start.

Decrease Ki by a factor of 2-4.

The Ziegler-Nichols method is more precise if you can get an accurate number for the oscillation period. It does generally cause oscillations using the "classic PID" numbers given, so it's not always optimal.

For general rules on the effect of each term on rise time, overshoot, settling time, steady-state error, and stability, see Table 1 of "PID Control System Analysis and Design", by Li, Ang, and Chong in IEEE Control Systems Magazine.


问:
Starting out advice on making robots and tinkering with microcontrollers
I'd like to start making robots and tinkering with microcontrollers. Where do I start, and what do I need?

I'd like to make my own robots. I'm comfortable with programming (assembly and C) so I've got that part covered, but my electronics/circuits knowledge is a little weak. I have no idea what material to start with and which tools I need, nor how to put stuff together.

For the microcontroller, I'm thinking about going with the Pololu Orangutan LV-168 or the Arduino Duemilanove, although I'm leaning more towards the Orangutan because of the built-in LCD and pushbuttons (which I would expect to use, especially for debugging and user interaction). Am I on the right track? It seems to me like the number of I/O ports is small, but is that the case in practice?

答:
The answers so far have covered the more general electronics stuff pretty well, so I'm going to focus on your mention of the Kinect.

Something Arduino-based is a good starting point for embedded electronics even though you already know C/assembly. What Arduino offers for you is a higher level API -- you COULD muck around with bitwise operations to modify peripheral configuration registers all day, but you have robots to make!

However, it has nowhere near the horsepower needed to make use of a Kinect on its own. It needs quite a bit of USB bandwidth just to process all of the raw output data, let alone do anything useful with it. I've heard of proof-of-concept robots connecting one to a netbook and I think once even a PandaBoard (which has smartphone-level performance using an OMAP chip), but nothing smaller than that.

Start reading up on ROS and the Kinect openni_camera and openni_tracker drivers. Use a laptop/netbook (the Raspberry Pi is apparently too slow to give more than 2-3 FPS) for the Kinect and have that talk over USB to the Arduino, which will control all of your other electronics directly.


问:
With a 6-axis robot, given end-effector position and range of orientations, how to find optimal joint values
Given a six-axis articulated robot arm holding a tool at its end-effector,  if I have a desired tool position and tool orientation,  there will be exactly 1 solution to the inverse kinematics equation for the robot to reach that position.

(or rather up to 16 different solutions, depending on range of the joints)

But if the robot is holding something like a pen, and I want the robot to mark a specific point with that pen on the target, then I do not care how the pen is oriented, as long as it is perpendicular to the marked surface.

So the inverse-kinematics equation will have infinitely many solutions.

How can I pick among these solutions the joint configuration that is closest to the current configuration: the one that will require the least amount of movement to reach?

(or the joint configuration that is optimal according to some other similar criterion, such as that all joint angles are furthest from their maximum and minimum?)

答:
First, we need to define optimal. Since you do not say what you consider optimal, most people choose a quadratic expression. For example, suppose your current joint angles are given by the vector $\vec{\alpha}$. We can consider minimizing the movement required - with an error $\vec{x} = \vec{\alpha} - \vec{\alpha}_{start}$, you can define a cost function $J=\vec{x}^TQ\vec{x}$ for some matrix $Q$. We normally use a diagonal matrix, but any positive-definite matrix will do.

In a simplified example with two joint angles, if joint $a$ had a cheaper motor (perhaps closer to end-effector), we might have a cost function of

$J=\left[\begin{matrix}x_a\\x_b\end{matrix} \right]\left[\begin{matrix}1&0\\0&2\\\end{matrix} \right]\left[\begin{matrix}x_a&x_b\end{matrix} \right]$, ie. movement of joint $b$ is twice as costly as joint $a$.

Now, the kinematic equation is a matrix formula, and in Denavit-Hartenberg notation might be:

$\prod{T_i}=\left[\begin{matrix}1&0&0&x\\0&1&0&y\\0&0&1&z\\0&0&0&1\end{matrix} \right]$, where the right hand side represents the position $(x,y,z)$ and orientation (currently set as zero rotation), given the joint angles.

Since we do not care about the orientation, and only the position, we can truncate the first 3 columns of the last transformation matrix, and the last row of the first transformation matrix. We can equivalently express this formula as:

$\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\end{matrix}\right]\prod{T_i}\left[\begin{matrix}0\\0\\0\\1\end{matrix}\right]=\left[\begin{matrix}x\\y\\z\end{matrix} \right]$

Multiplying out the left hand side, we get three equations. If the parameters were linear, it would be simple to solve. This is the case if all the actuators are linear actuators. In this case, the problem is actually a quadratic program. We can re-arrange the left hand side to get the equation:

$K\vec{x}=\left[\begin{matrix}x\\y\\z\end{matrix}\right]$, for some matrix $K$.

A quadratic program is a problem which can be expressed in the form:

Minimize $J=\frac{1}{2}\vec{x}^TQ\vec{x}+\vec{c}^T\vec{x}$

Subject to $A\vec{x}\leq\vec{b}$, $E\vec{x}=\vec{d}$

To solve this, there are a number of algorithms you can use, for example, interior point, active set, ... . Just find a suitable library, and it will solve it for you.

A non-linear system of equations is more difficult to solve. This is called non-linear programming, but it is what you have if you have rotating joints.

Essentially, in place of matrix equations, you have nonlinear functions.

Minimize $f(x)$ subject to $\vec{h}(x) = 0$, $\vec{g}(x) \leq 0$ (re-arrange if necessary to make the RHS of the constraints zero)

The algorithms used to solve this are even more complex, but includes Interior-point, Sequential quadratic programming (SQP), Active-set, Trust-region reflective algorithms. Obviously, the explanation of how these algorithms work is very lengthy, and I will leave it out of the scope of this answer. Suffice it to say, the amount of content on the algorithms used for just quadratic programming could be a whole course by itself.

You should just find a library to solve the problem, it would take a long time to code up an efficient implementation, and efficient implementations can handle 100 (or more) variables at a time. For example, if you use MATLAB, then there is documentation on how to use the function fmincon from the Optimization Toolbox.

To solve it online, you might want C++ or other native implementation, for example, NLopt. Do note that this may not be something a microcontroller can solve quickly, and many libraries may have other dependencies which are not easy to use on a microcontroller (since they are intended for a computer).

If you are not worried about efficiency, and just want something you can code yourself, then assuming there is a function you can call to solve the inverse kinematic problem, you can simply do a gradient descent method. For example, arbitrarily choosing a random starting orientation, solve the inverse problem, then check the cost function. Then you can use perturbation analysis to check how you should vary the orientation. For example, if you check similar orientations around your current orientation (ie. 8 points in a cubic grid), you can get a second order approximation of how the cost function varies in each direction.

Using the second order approximation (known as a Hessian matrix since it is multivariate - 3-dimensional for orientation), you can find the zero-crossing of the gradient of the cost function (ie. the predicted local minima).

With the new predicted orientation, just put it through the inverse solver again, and repeat until the accuracy is sufficient.

Do note that this will probably not be as efficient, because the inverse kinematic problem itself must be iteratively solved (so you are repeatedly using a function which itself takes a while to solve). Also, the code involved may be less than a fully-fledged optimization algorithm, but it is still quite substantial, and not an insignificant investment of time.

Using either method (formally solving as a nonlinear program or using the iteratively using a function to solve the inverse problem), the solution may not be optimal if there are multiple local minima. In this case, you can try to find the global minima by using various approaches. Even with a non-linear programming solver, you will be expected to seed it with initial values (eg. joint angles). You can repeatedly run either method with the seed generated in various ways:

random restart (it is generated randomly)

grid-based

or other custom methods.

However do note that if there are many minima, there is no good way to guarantee that you will find the global minima. You can only improve your chances.


答:
short answer; no you really need to do things quite a bit differently.

long incomplete answer;
Let me give you some psuedo code appropriate for robotC, that puts you on a better path. First, do not use tasks - this is NOT what robotC tasks are for. They could be made to work, maybe, maybe not (and you need quite a few changes to even try).

```<code>// global variables
int distance;
int light;

main() {
   while (true) {
   distance = read_distance;
   light = read_light;
   if (task1_wantsToRun())
     task1_run();
   if (task2_wantsToRun())
     task2_run();
   }
}
</code>```

there is a couple of things here; priority becomes irrelevant. As nice as it seems to have tasks in robotC with priorities, they are not a good choice for subsumption implementation in my experience. For reasons like, priorities are not always honored, tasks can not be interrupted (sometimes) so when a higher priority event occurs, it is not going to react like you expect, robotC only recently became re-entrant, so things like accessing a sensor from more than 1 task may be risky (I2C timing issues), and in some cases it is not (automatically polled sensors).

You can add your own priority implementation to the above loop as you get things working, but it really is not needed for starts.

Your comment "//box the obstruction"  describes a ballistic behavior. Those are a bit tricky to implement using multi-tasking. The simple loop I used makes it a lot easier, and better for starters/learning.

The other thing I will leave you with, is that subsumption while being neat and appropriate for a lot of things, is not a good way to implement what is better done traditionally. Indeed the 'evade' portion may be a good candidate for subsumption, but honestly your other task should be called 'GoOnAboutYourBusiness'. I say this because you probably do not want to change from searching to following with subsumption. Handle those with traditional programming loops. With a single sensor, - is the light sensed darker or lighter than it was last loop?  if it got darker (assuming black line) keep turning the same direction, if it got lighter turn the other way, if it stayed the same, go straight. You probably need to add some PID and use a steering curve instead of just turning left and right to be smoother.

And yes, multiple sensors help. http://www.mindsensors.com/  - yeah, that's me in the movie currently (11/10/2012)

Update: actual code

I will try this out in a little while, but it compiles and illustrates what I wrote above:

```<code>#pragma config(Sensor, S1,     S_LIGHT,        sensorLightActive)
#pragma config(Sensor, S2,     S_DISTANCE,     sensorSONAR)
#pragma config(Motor,  motorB,          LEFT,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorC,          RIGHT,         tmotorNXT, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

int distance_value, light_value;

bool evade_wantsToRun()
{
    return distance_value < 30;
}

void evade_task()
{
    // full stop
    motor[LEFT] = 0;
    // evade the object ballistically (ie in full control)
    // turn left, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = -20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn right, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn right, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn left, resume
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    motor[LEFT] = 0;
}

///////////////////////////////

void TurnBySteer(int d)
{
    // normalize -100 100 to 0 200
    nSyncedTurnRatio = d + 100;
}
///////////////////////////////

typedef enum programPhase { starting, searching, following, finished };
programPhase phase = starting;

// these 'tasks' are called from a loop, thus do not need to loop themselves

void initialize()
{
    nSyncedTurnRatio = 50;
    nSyncedMotors = synchBC;
    motor[LEFT] = 30;       // start a spiral drive
    phase = searching;
}

void search()
{
    if (light_value < 24)
    {
        nSyncedTurnRatio = 100;
        phase = following;
    }
}

int lastLight = -1;
int currentSteer = 0;
void follow()
{
    // if it is solid white we have lost the line and must stop
    // if lightSensors detects dark, we are on line
    // if it got lighter, we are going more off line
    // if it got darker we are headed in a good direction, slow down turn in anticipation
    // +++PID will be even smoother
    if (light_value > 64)
    {
        motor[LEFT] = 0;
        phase = finished;
        return;
    }
    if (light_value < 24)
        currentSteer = 0;
    else if (light_value > lastLight)
        currentSteer += sgn(currentSteer) * 1;
    else    // implied (light_value < lastLight)
        currentSteer -= sgn(currentSteer) * 1;

    TurnBySteer(currentSteer);
}

bool regularProcessing_wantsToRun()
{
    return phase != finished;
}

void regularProcessing_task()
{
    switch (phase)
    {
    case starting:
        initialize();
        break;
    case searching:
        search();
        break;
    case following:
        follow();
    }
}

task main()
{
    // subsumption tasks in priority oder
    while (true)
    {
        // read sensors once per loop
        distance_value = SensorValue[S_DISTANCE];
        light_value = SensorValue[S_LIGHT];
        if (evade_wantsToRun())
            evade_task();
        if (regularProcessing_wantsToRun())
            regularProcessing_task();
        else
            StopAllTasks();
        EndTimeSlice();     // give others a chance, but make it as short as possible
    }
}
</code>```

Title: Correct way to use Subsumption Architecture with Robot C

Body:
I've been doing a lot of reading lately about Subsumption Architecture and there are a few different ways people seem to advocate.

For instance some people use a global "flag" variable to have a task take control. Others use the endTimeSlice() and allow the arbiter to really choose. And I think this is correct.

I have this small section of RobotC code that I'm working on for a line following robot but am not sure I am doing it right as currently the track method will always take over the find method. The correct flow should be that find should guide the robot to the line using a spiral path to find the line. Once the line is found track should take over.

```<code>task evade(){
    if(SensorValue(forwardSonarSensor) > threshold){
            //box the obstruction
    }
}

task find(){
    if(SensorValue(lightSensor) > threshold){
            //spiral the robot
    }
}

task track(){

    if(SensorValue(lightSensor) < threshold){
            //go straight
    }else{
                //execute turns to follow the line
    }
}

task main(){
    while(true){
        StartTask(evade,9);
        StartTask(track,8);
        StartTask(find,7);
        wait1Msec(250);
    }
}
</code>```

I've just used some comments here rather than the actual code to keep it brief. Are my if statements not good enough as conditions because when the robot is off the line, track() takes over. Is this due to the else statement within track? If so, how to have track() perform turns when it looses the line without taking over from forage at the start of the program?

Body:
short answer; no you really need to do things quite a bit differently.

long incomplete answer;
Let me give you some psuedo code appropriate for robotC, that puts you on a better path. First, do not use tasks - this is NOT what robotC tasks are for. They could be made to work, maybe, maybe not (and you need quite a few changes to even try).

// global variables
int distance;
int light;

main() {
   while (true) {
   distance = read_distance;
   light = read_light;
   if (task1_wantsToRun())
     task1_run();
   if (task2_wantsToRun())
     task2_run();
   }
}

there is a couple of things here; priority becomes irrelevant. As nice as it seems to have tasks in robotC with priorities, they are not a good choice for subsumption implementation in my experience. For reasons like, priorities are not always honored, tasks can not be interrupted (sometimes) so when a higher priority event occurs, it is not going to react like you expect, robotC only recently became re-entrant, so things like accessing a sensor from more than 1 task may be risky (I2C timing issues), and in some cases it is not (automatically polled sensors).

You can add your own priority implementation to the above loop as you get things working, but it really is not needed for starts.

Your comment "//box the obstruction"  describes a ballistic behavior. Those are a bit tricky to implement using multi-tasking. The simple loop I used makes it a lot easier, and better for starters/learning.

The other thing I will leave you with, is that subsumption while being neat and appropriate for a lot of things, is not a good way to implement what is better done traditionally. Indeed the 'evade' portion may be a good candidate for subsumption, but honestly your other task should be called 'GoOnAboutYourBusiness'. I say this because you probably do not want to change from searching to following with subsumption. Handle those with traditional programming loops. With a single sensor, - is the light sensed darker or lighter than it was last loop?  if it got darker (assuming black line) keep turning the same direction, if it got lighter turn the other way, if it stayed the same, go straight. You probably need to add some PID and use a steering curve instead of just turning left and right to be smoother.

And yes, multiple sensors help. http://www.mindsensors.com/  - yeah, that's me in the movie currently (11/10/2012)

Update: actual code

I will try this out in a little while, but it compiles and illustrates what I wrote above:

#pragma config(Sensor, S1,     S_LIGHT,        sensorLightActive)
#pragma config(Sensor, S2,     S_DISTANCE,     sensorSONAR)
#pragma config(Motor,  motorB,          LEFT,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorC,          RIGHT,         tmotorNXT, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

int distance_value, light_value;

bool evade_wantsToRun()
{
    return distance_value < 30;
}

void evade_task()
{
    // full stop
    motor[LEFT] = 0;
    // evade the object ballistically (ie in full control)
    // turn left, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = -20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn right, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn right, drive
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    nSyncedTurnRatio = 100;
    Sleep(1000);
    // turn left, resume
    nSyncedTurnRatio = 0;
    motor[LEFT] = 20;
    Sleep(500);
    motor[LEFT] = 0;
}

///////////////////////////////

void TurnBySteer(int d)
{
    // normalize -100 100 to 0 200
    nSyncedTurnRatio = d + 100;
}
///////////////////////////////

typedef enum programPhase { starting, searching, following, finished };
programPhase phase = starting;

// these 'tasks' are called from a loop, thus do not need to loop themselves

void initialize()
{
    nSyncedTurnRatio = 50;
    nSyncedMotors = synchBC;
    motor[LEFT] = 30;       // start a spiral drive
    phase = searching;
}

void search()
{
    if (light_value < 24)
    {
        nSyncedTurnRatio = 100;
        phase = following;
    }
}

int lastLight = -1;
int currentSteer = 0;
void follow()
{
    // if it is solid white we have lost the line and must stop
    // if lightSensors detects dark, we are on line
    // if it got lighter, we are going more off line
    // if it got darker we are headed in a good direction, slow down turn in anticipation
    // +++PID will be even smoother
    if (light_value > 64)
    {
        motor[LEFT] = 0;
        phase = finished;
        return;
    }
    if (light_value < 24)
        currentSteer = 0;
    else if (light_value > lastLight)
        currentSteer += sgn(currentSteer) * 1;
    else    // implied (light_value < lastLight)
        currentSteer -= sgn(currentSteer) * 1;

    TurnBySteer(currentSteer);
}

bool regularProcessing_wantsToRun()
{
    return phase != finished;
}

void regularProcessing_task()
{
    switch (phase)
    {
    case starting:
        initialize();
        break;
    case searching:
        search();
        break;
    case following:
        follow();
    }
}

task main()
{
    // subsumption tasks in priority oder
    while (true)
    {
        // read sensors once per loop
        distance_value = SensorValue[S_DISTANCE];
        light_value = SensorValue[S_LIGHT];
        if (evade_wantsToRun())
            evade_task();
        if (regularProcessing_wantsToRun())
            regularProcessing_task();
        else
            StopAllTasks();
        EndTimeSlice();     // give others a chance, but make it as short as possible
    }
}


答:
Arduino is a great fit for your problem. It is not only used by hobbyists and beginners but it is frequently used by top Universities for both teaching and in research. Arduino also has a large active community which makes helps when you have a problem.

There are a couple of caveats to the Arduino solution however. 1) They have very limited computational power and no floating point unit which can further slow down calcuation. 2) Working with Arduino does require one to have a rudimentary understanding of electronics. Of course there are myriad tutorials that can help you get up and running in a matter of minutes. However when I first delved into robotics I wanted to avoid the electronics aspect so as to focus on the programming.

Phidgets is a good alternative. Many Phidgets components are abstracted to the point that you only need to connect them to a computer via USB and processing is done on a desktop, laptop, or single board computer (SBC) which have more processing power. Furthermore Phidgets works with multiple operating systems and they offer a lot of well documented code to simplify interfacing with their parts. It is worth noting that Phidgets solutions tend to cost a bit more than Arduino solutions but they're still reasonably priced.

I would suggest against Parallax. They are interesting but they don't offer anything over Arduino, they are more expensive (than Arduino), and they are considerably less flexible from a programming perspective in my experience.

Also Phidgets do not work well in UAV applications. For that I would advise looking at the ArduPilot. It is an Arduino based solution to UAV and UGV robots and includes a number of built-in sensors for state estimation. Furthermore ArduPilo has its own a large active community.

Title: What UAV kit(s) would be suitable for a beginner roboticist with programming experience?

Body:
I'm really new to robotics, however I am a programmer familiar with several different languages. I don't have a ton of money to spend and I was wondering what is a really good starter kit.

My criteria is for the kit to be inexpensive and powerful, in that its functionality is extensible -- something that would allow the builder to be creative and possibly invent new ways to use it, not just a glorified model kit.

Being extendable to smartphones is a plus.

I'm not looking for something easy or introductory, just something powerful, flexible, and cost effective.


答:
Get a LEGO NXT kit, it costs around $280, and will give you a lot of fun.

You can control it from your computer using any programming language - just send Bluetooth commands to the LEGO NXT brick. It is very simple!

If you want to learn more - here is a simple KB article about that: http://www.robotappstore.com/Knowledge-Base/Introduction-To-Lego-NXT-Programming/32.html


问:
What are some common mistakes that robots make?
Is there a taxonomy of errors that are common in robotics? Things that come to mind but I don't have names for are:

Getting stuck in a stable infinite loop

Going into an unstable feedback loop (A balancing robot overcompensating more with each correction)

An inability to generalize between tasks (Pick up a bowl vs pick up a glass)

An inability to generalize between 'similar' sensory inputs.

Causing damage to itself or its environment.

These would be things that make a robot look 'stupid' to a non-roboticist. If you're curious I want to have this list so I can then prepare a clear answer ready for people who don't know why these various things are hard.

答:
To a roboticist it might look like a stupid question, however, I think your question is valid, and even important!

Setting expectations is very important when introducing robots to the general public, this will help bridging between Hollywood-robots and real-life robots.

I think the most important difference is understanding the context. Robots (or computer) are very good with computing an answer to a mathematical question, however they are clueless about the context of the question.

for example - ask a humanoid robot to reach his right hand to touch his left ear. In most of the cases I saw - the robot tried to get to the left ear through the head... the context has to be hard coded into everything...


问:
Programming Robots with JavaScript
As somebody who is spending the majority of his time programming in JavaScript, what's the best route to get into small-robotics without needing to deviate too much from my current language focus?

Are there any project kits or tools that make use of the JavaScript language that might make the field more approachable for developers like myself? I would even be interested in virtual environments where all code is executed in a simulation.

答:
Robot Operating System (ROS) offers the ability to use Javascript to control your robots. Specifically you will want to look at rosbridge. You will then need to use rosserial to interface with the microcontroller controlling your robot.

While I am a big fan of ROS this is an overly complicated way to begin exploring the field of robotics IMHO. You would be better served to pick up an Arduino and learning a little bit of C. Arduino does a great job of making the process simple and C is not a large deviation from JS from a syntax perspective.

Title: Programming Robots with JavaScript


问:
Which spline function would be best suited for the trajectory of a differential drive
What's the best kind of spline that can be used for generating trajectory that can be adapted during execution time?

The use case is having a differential drive which has to move towards a point (x,y,theta) without stopping during the movement (e.g. no, turn toward the goal, straight move to the goal position, turn to the goal orientation). The robot is provided with a laser scanner for detecting dynamic obstacles which have to be avoided.

What's the best kind of controller in this case?

答:
I have not done it myself yet, but, I have always planned on finding algorithm(s) here;

http://opensteer.sourceforge.net/

The controller they include is called 'unaligned collision avoidance'.


答: A friend of mine actually has a pretty powerful tank robot that's controlled with NodeJS over wifi. The robot itself isn't exactly "small-robotics" at 150 pounds, but you could probably learn quite a bit from the source code. It has a netbook onboard running a webserver and talking to an Arduino. You can find the source code on his Github project page. The real-time control from a web browser on another computer is surprisingly responsive.</p>

Title: Programming Robots with JavaScript

Body:
As somebody who is spending the majority of his time programming in JavaScript, what's the best route to get into small-robotics without needing to deviate too much from my current language focus?

Are there any project kits or tools that make use of the JavaScript language that might make the field more approachable for developers like myself? I would even be interested in virtual environments where all code is executed in a simulation.


答:
Generally there are many ways to use node.js with a platform, like this one for the RPi. There are a lot more similar ones if you just search for them.

Another interesting one is ArduGate, which lets web pages communicate with the arduino via JS (though probably not exactly what you wanted since it doesn't compile and load to  the arduino)

Though I really don't see what's wrong with using a different language. I myself write primarily in JS, but I find myself perfectly comfortable programming an Arduino in C++ (it also allows C and Java, and if you put in a bit of work, quite a few more languages ). Remember, we're not needing anything fancy for programming a robot--just normal ifs,fors,whiles,switches, and the occasional class. Learn the syntax, and you're good to go :) The only thing is that C/C++/Java are strongly typed (though if you're using the RPi, python is weakly typed but picky in a million more ways), so you may get a bit of frustration in the beginning when you have to specify types for everything. One advantage of using the native languages is that it's much easier to find APIs and example code on the net. For example, aside from ArduGate(which has it built in and is probably not what you wanted), I can't find any way to access the EEPROM--a common task. So, unless you want to stick to simple programs, it's just better to use the native languages.

Title: Programming Robots with JavaScript


问:
What good robotics software platforms / operating systems are available?
My company will soon be starting a brand new robotics project, and we are still trying to decide whether we should design and code a robotics software platform from scratch, or if there are any good existing ones.

It would be very useful if there was a software platform which was commonly used among both academics and industry so that our robotic system was generally compatible with others, and so that people were already familiar with it.

We would like the software platform to be able to:

Integrate new robotic hardware components easily.

Already contain a wide array of useful data processing and visualisation tools

Make efficient use of computing hardware

答: MOOS is Oxford's ROS analog. http://www.robots.ox.ac.uk/~mobile/MOOS/wiki/pmwiki.php It's used for a number of naval applications, from harbor-sweeping to low-power, UUVs that surface to report in intervals counted in months.</p>


问:
restricting range of motion with complex constraints
I am looking for a way to restrict a robot's range of motion, using complex constraints such as not tearing of a cable attached to the robot.

Take an articulated 6-axis robot arm as shown below, with attached cable (red), fixed at points X (before axis A4) and Y (after axis A6).

The cable will limit the range of movement for the robot. It can stretch and bend only to some extend, but something like a full 360° turn of axis A4, with all other axes remaining as they are in the picture, will tie the cable around the arm and rip it off.

If joint A5 is at 0°, then A4 and A6 can still move the full 360°, but they cannot diverge too much from each other, as that would twist the cable. If A5 is tilted, the relationship becomes even more complicated.

How can you express such a constraint?

It is not a simple joint constraint, where you can independently limit the range of the joints, and it is also not a positional constraint, where you can define a region the robot must not enter. Checking a start and a goal posture is not sufficient, since along the path from start to goal posture there may still be a posture that puts too much strain on the cable.

Without limiting the robot to a small set of pre-tested paths, how can you limit the robot to movements that will not rip off the cable?

What are the standard techniques used for this sort of problem?

答:
The cable has a certain amount of slack, and each joint it goes over takes up some of that slack as a function of the joint angle. The cable will break if the total amount of slack taken up by all joints exceeds the available slack.

Firstly, it would help if you could thread the cable along the robot in such a way that that each joint has a calculable effect on the slack, and each joint affects the cable independently. This will really help the calculations. Let's define the amount of slack taken up by joint 1 at an angle th1 by:

```<code>f1(th1)
</code>```

Now, your robot arm can move anywhere such that

```<code>f1(th1) + f2(th2) + ... + f6(th6) <= total_slack
</code>```

This assumes that the cable is fixed in such a way that it can slide up and down the robot arm, distributing the slack where it's needed. Generally, this isn't the case in most robots, and isn't easy to do.

A more reliable way to solve this problem is to rigidly fix the cable before and after each joint, and make sure there's enough slack for every joint.

Body:
The cable has a certain amount of slack, and each joint it goes over takes up some of that slack as a function of the joint angle. The cable will break if the total amount of slack taken up by all joints exceeds the available slack.

Firstly, it would help if you could thread the cable along the robot in such a way that that each joint has a calculable effect on the slack, and each joint affects the cable independently. This will really help the calculations. Let's define the amount of slack taken up by joint 1 at an angle th1 by:

f1(th1)

Now, your robot arm can move anywhere such that

f1(th1) + f2(th2) + ... + f6(th6) <= total_slack

This assumes that the cable is fixed in such a way that it can slide up and down the robot arm, distributing the slack where it's needed. Generally, this isn't the case in most robots, and isn't easy to do.

A more reliable way to solve this problem is to rigidly fix the cable before and after each joint, and make sure there's enough slack for every joint.


问:
What kind of performance can I expect when using an Extended Kalman Filter for calibration and localization?
Currently I have a tricycle style robot that uses an extended kalman filter in order to track 6 state variables. The inputs to the system are a steer encoder, a distance encoder, and a rotating laser that returns bearing only information to known landmarks. Currently both encoders are located on the main wheel (The one that steers, and is also powered).

The 6 variables tracked by the Kalman Filter are X, Y, Heading, Distance Scaling (calibration of the distance encoder), Steer Calibration (offset of the steer encoder), and finally a bearing calibration of a rotating laser.

With this kind of system we put together a vehicle give it a known good location with plenty of landmarks, drive it around a bit, and end up with a well calibrated vehicle that can drive extended distances reliably with few landmarks. Its simple and it works great. Over time if an encoder drifts it will automatically follow the drift and adjust.

We are now attempting to apply the same principles to a robot with multiple steer and drive wheels. In this case the vehicle will be able to move in any direction, spin in place, etc. . Each steer/drive wheel will have its own steer and distance encoder that each need to be calibrated.

Can I expect to get the same kind of reliability and performance out of the more complex system? Are there any common pitfalls to look out for when expanding a kalman filter to include more variables? Is there a risk of it settling on sub-optimal values?

答:
In my opinion (based on my limited experience using the EKF for navigation):

The performance of the EKF can be hugely improved by a good kinematic model. You did right by including bias in your steering and odometry models for the tricycle system. If you can derive and apply a detailed kinematics model for your more complicated system, then you should do quite well. If not, then the EKF must also account for your errors in modelling, in addition to your sensor errors and linearization errors. This is the danger: including a source of error that is not accounted for will make your filter inconsistent very quickly.

If things get out of hand (your filter isn't converging nicely), you can try multiple model methds (IMM).  So my advice is to model the system as well as possible. The EKF has a very good track record for these tasks. Good luck.


问:
Programming a line following robot with reinforcement learning
I am considering programming a line following robot using reinforcement learning algorithms. The question I am pondering over is how can I get the algorithm to learn navigating through any arbitrary path?

Having followed the Sutton & Barto Book for reinforcement learning, I did solve an exercise problem involving a racetrack where in the car agent learnt not to go off the track and regulate its speed. However, that exercise problem got the agent to learn how to navigate the track it trained on.

Is it in the scope of reinforcement learning to get a robot to navigate arbitrary paths? Does the agent absolutely have to have a map of the race circuit or path? What parameters could I possibly use for my state space?

答:
One of the key measures of any machine learning algorithm is it's ability to generalize (i.e. apply what it has learned to previously unsceen scenarios). Reinforcement learners (RL) can generalize well but this ability is in part a function of the state-space formulation in my experience. This means that if you can find the right setup then the RL learner will not need a map of of the race circuit.

This leaves the question of which parameters to use. Without knowing more about the sensors available on your robot I can only speculate. My first inclinition is to try to encoded the relative orientation of the line and robot (i.e. is the robot tending to the right, left, or simply moving parallel with the line). Doing so would result in a nice small state-space. Though not strictly necessary it would make for a quick and simple implementation. Furthermore, if the robot is not going to move at a constant rate then it may help to encode the robots velocity as the robot will need to react more quickly when moving at higher speeds.


答: This is not a clear question, is more of a fishing / discussion question. As much as I'd love to sit down and discuss this for a few hours, this is unfortunately not the type of things we can concisely and objectively answer. Expectations are better diffused by specific questions. Example: "Bipedal robots: Can they walk over a pile of skulls like in Terminator 2?" </p>

Title: What are some common mistakes that robots make?

Body:
Is there a taxonomy of errors that are common in robotics? Things that come to mind but I don't have names for are:

Getting stuck in a stable infinite loop

Going into an unstable feedback loop (A balancing robot overcompensating more with each correction)

An inability to generalize between tasks (Pick up a bowl vs pick up a glass)

An inability to generalize between 'similar' sensory inputs.

Causing damage to itself or its environment.

These would be things that make a robot look 'stupid' to a non-roboticist. If you're curious I want to have this list so I can then prepare a clear answer ready for people who don't know why these various things are hard.


答:
I'm not sure what the "standard techniques" are but here are a few a ideas.

You could combine a standard jacobian based forward kinematics as your base and then apply a gradient search algorithm where you bias against things such as running out of slack on your wires or other constraints.

Let me go into a bit more detail. Generally you would just give the robotic arm an end point or perhaps a series of way points you expect the end effector to follow. You can then use the forward kinematics to move the end effector between those waypoints. In order to avoid your difficult to describe constraint you can define a value function that increases as the arm moves and reduces the slack on the wire.

If you guess a path most likely your initial guess will result in the wire being snapped. You're value function will give you a score representing this fact. You can then take your in between waypoints and tweak them a bit which may result in the function represetnging your constraint to decrease. You then can tweak it a bit more reducing it further.

This is called optimization and it is a huge field but the most basic method is Gradient Descent. In theory if you use an optimization method to adjust your waypoints eventually you will find a set of waypoints that keeps the tension along the wire to a minimum. The main issue with optimization is that you can run into local minimums that don't adequately solve your problem, and methods that get around local minimums can be slow.

If you are looking to get academic about it you  may want to look into the algorithm presented here. Keep in mind there might not be a simple answer to your question or a simple algorithm to solve it.

Title: restricting range of motion with complex constraints

Body:
I am looking for a way to restrict a robot's range of motion, using complex constraints such as not tearing of a cable attached to the robot.

Take an articulated 6-axis robot arm as shown below, with attached cable (red), fixed at points X (before axis A4) and Y (after axis A6).

The cable will limit the range of movement for the robot. It can stretch and bend only to some extend, but something like a full 360° turn of axis A4, with all other axes remaining as they are in the picture, will tie the cable around the arm and rip it off.

If joint A5 is at 0°, then A4 and A6 can still move the full 360°, but they cannot diverge too much from each other, as that would twist the cable. If A5 is tilted, the relationship becomes even more complicated.

How can you express such a constraint?

It is not a simple joint constraint, where you can independently limit the range of the joints, and it is also not a positional constraint, where you can define a region the robot must not enter. Checking a start and a goal posture is not sufficient, since along the path from start to goal posture there may still be a posture that puts too much strain on the cable.

Without limiting the robot to a small set of pre-tested paths, how can you limit the robot to movements that will not rip off the cable?

What are the standard techniques used for this sort of problem?


问:
Is subsumption architecture still an active area of research?
I am interested in learning more about subsumption architecture. I have read a number of books that talk about the idea but none of them go into great detail. I have also read a fair number of Dr. Brooks papers on the topic however he hasn't published much on the topic in recent years.

Is this still an active area of research? Are there are any must read papers on the topic?

答:
As you probably guessed from the lack of answers, subsumption architecture is not an active area of research any more. Most papers on this have been published in the late 80's / early 90's.

This doesn't mean that subsumption architecture is dead; it has been very influential in robotics, and it's still used in education for example, but it is just not a hot topic in research any more.