答:
A real time system is not really required for many (most?) robotic control systems. As long as you have a control loop that runs fast enough, with low enough jitter, and doesn't miss too many cycles, then this is quite adequate for robotic control and servoing.

As evidence of this, let me present the PR2 and the Shadow  Robot Hand:

This robot has about 20 degrees of freedom, all of which are servoed through ROS's main loop. Or how about the Shadow Robot Hand, which also has 20 DOFs, plus an array of tactile and other sensors, and is also servoed through ROS's main loop.

The ROS main loop suffers from a little jitter, sometimes as much as 100us, and even sometimes misses cycles altogether. But it doesn't matter if 99.9% of cycles are executed successfully.

The use of many cores within the host PCs means that one whole core is dedicated to running the main loop, and so it is very rarely delayed by other tasks.

The main reason for using a really real-time OS for a robotic system is for safety. If the robot is working in a safety critical situation, then it is your responsibility to guarantee 100% control up-time, and part of this is guaranteeing the real time nature of it.

Whether you use a real-time OS or not, your servos should do something safe in the event that the control loop dies entirely. This safety system would also be helpful on the rare occasion your non-real-time OS skips more than a cycle. For example, on the Shadow Hand, the motors are halted if the control loop misses more than 20 cycles (20ms). I have never seen this happen though.

Added

Another way to think about it is this: What update rate does your servo system actually need? If it's a largish arm, and doesn't need super high performance, high speed positioning, then 500Hz might be sufficient. For driving around, 200Hz is probably sufficient. In both of these cases, if your loop is actually running at 1000Hz, then a late or missing cycle really is no problem at all, as long as your control algorithm takes into account the actual elapsed time between loops.

Title: How mature is real-time programming in robotics?

Body:
Edit: I don't know why, but this question seems to be confusing many people. I am aware of when/where/why/how to use real-time. I am interested in knowing whether people who have a real-time task would actually care enough to implement it in real-time or not.

There's no need to mention why real-time operations are important for a robot. My question is however, how much is it actually used in robotics?

Take this question for example. Only one answer mentions any platform with real-time capabilities, and it is far from the top too. ROS apparently, being a very popular platform which is not real-time.

In the real-time world however, RTAI1 seems to be the only workable free real-time platform of use. It is however, limited to Linux (no problem), badly documented and slowly developed.

So, how much is real-time behavior sought after among robotics developers? The question is, how much are developers inclined to write real-time applications when real-time behavior is actually needed? If not much, why?

For example, reflexive behavior based on tactile data, cannot go through ROS because it would lose its real-time property. But do people really come up with a real-time solution or use ROS anyway, ignoring the real-time property?

1 or similarly Xenomai


问:
Rotation ratio between left rocker and right rocker in rocker-bogie system
Following, the previous question, I am trying to calculate how much one rocker would rotate when the other is being rotated. I attached my calculation here.

I am trying calculate the rotation of gear B that connects to right rocket. Given gear A rotates at 0.05 rad, what is the rotation of gear B in rad? Gear ratio A:D is 4:1, and D:B is 1:4.

At the end, I ended up with rotational gear A = gear B. This somewhat puzzles me. Is my calculation correct?

答:
Your calculation is correct in magnitude but incorrect in sign, because gear B rotates oppositely to A (when the axis of D is fixed and D is not locked).

If D is locked (ie, the gear is not free to rotate in its plane) then A and B are locked together and rotate identically.

If the body V to which the axis of D is fixed rotates during rotation of A, then the rotation rate of B will differ from that of A.  Example: Let rotation directions for A, B, and V be stated relative to a view from the left, and for D  relative to a view from above.  With V fixed, suppose A rotates CW at 40 rpm.  Then D rotates CCW at 10 rpm, driving B CCW at 40 rpm.  If V now begins to rotate CW  at 20 rpm, D's rotation rate drops to 5 rpm, so that B begins to rotate at -20 rpm relative to A, 0 rpm relative to V, and 20 rpm to the frame of reference.

ContentLicense: CC BY-SA 3.0


问:
What are the signs that a servo might be broken?
I just got a kit and im not sure if its me or not but it appears one of the continuous servos might be broken. What happened first when I plugged it into the microcontroller, it made a humming sound when I sent it commands. The second continuous servo didnt work at all

I played around with different ports on the aurdino based board, and to no avail, just a hum.
Then I removed the humming servo altogether and just placed the second servo alone. the second continuous servo started to move in whatever direction I asked it to.

I plugged the first one in, only the second moved.

then I tried spinning them by hand, the second has much resistance, while the first one has dramatically less resistance, maybe 60% easier to spin by hand.

Is this something I can fix? Has anyone experienced these problems before?

Thanks in advance, you guys are great!

答:
How Servos Work

Based on these details of your question:

I just got a kit [...] continuous servos [...] plugged it into the
  microcontroller

Combined with your "Arduino" tag, I'm betting that you are working with hobby (RC) servos modified for continuous rotation. Standard servos work by receiving a pulsed signal with a 20ms period (50Hz). Regular hobby servos will rotate to a specific angle based on the duty cycle (ON time) of the pulsed control signal. This on time can range from 500us to 2500us, but usually only a range of 1000us to 2000us is used so as to not damage the servo. The "neutral pulse" of 1500us will put the servo in the center position.

This Wikipedia article about servo control has a great picture regarding the pulsed control:

There are a few different ways that the servo works, but the most common type I've seen in use by hobbyists is an analog servo. As the motor turns, an internal potentiometer is adjusted creating a feedback path for the internal circuitry. The servo will continue to rotate until the potentiometer is at the expected position for the given pulse width.

There are numerous different ways of modifying a standard hobby servo for continuous rotation, so I won't go into that, but essentially, this feedback path is tampered with such the servo never thinks it is in the correct position when it gets a non "neutral" pulse. A mechanical stop on the internal gears is also removed. Once this is done, sending a non neutral pulse will cause the servo to rotate completely, with the speed of rotation dependent upon the pulse width.

Your Issue

When a non-modified servo is given a pulse, it will quickly rotate to the desired position and hold it as long as a pulse is being sent. It should be very difficult to manually turn the servo at this time, and doing so will cause the internal motor to hum as it draws excessive current trying to correct itself during this overload situation. If the servo is disabled (receiving no pulse) it can be manually manipulated with ease.

A modified servo will exhibit similar behavior when under too much of a load - it will hum loudly and draw excessive current. While your servo may not be overloaded, it is obviously exhibiting similar symptoms and is most likely defective. When being driven, manually turning the actuator or stopping it from turning in its desired direction/speed is not a good idea, so keep that in mind for your other servos.

When the defective servo tries to rotate, it is drawing so much current that the second servo cannot operate. That is why it worked fine once the defective servo was removed.


问:
Why are the IRB 1410's servos running even when the joints are not moving?
I was jogging the ABB IRB1410 and I noticed that the servo motors are humming even when the joints are not moving. The motor cuts off only when the guard switch in the flex pendant is released.

What kind of mechanism which require the drive motors to keep running even when the joints are not moving ? I went through the manual but no luck. I suppose the holding torque is provided by some braking mechanism so I think I can rule it out.

答:
The motors in ABB robots have integrated brakes that are engaged when not energized. They hold the position of the joint and prevent the arm from falling if power is lost. The flex pendant enable switch actually drives a relay in the controller that removes or applies all power to the motors. This is done for safety reasons, so that in the event of a mishap (i.e, you drop the pendant), the robot becomes completely de-engerized.

When you enable the robot for jogging, it disengages the brake, applies power to the servo, and uses the static torque to hold the joint position instead of the brake. When you release the switch or cut the power in some other way, the brakes engage again.

Search Google for "Product manual Motor Unit MU10/20/30" for more details.


问:
Non-Vision Based Target Tracking
I am building 4-wheeled, knee-high robot with music and speakers on top that will follow a target person as the target moves around. I would like some help with the setup for tracking the target. The most obvious solutions are Ultrasound or Infrared sensors or some kind of vision tracking, but for this application, I don't want to use them.

Imagine that the robot is placed into a crowded area and asked to move towards a particular person in the area (for the sake of simplicity, assume the person is less than 5 meters away, but could be obscured by an object). Ideally, if someone walked between the target and the robot, the robot would not lose it's path (as would happen with vision-based sensing).

Thanks!

答:
There are a few ways you might handle this.  Although my knee-jerk response is to say "transmit a radio signal from the target and triangulate it with 3 antennas on the robot", apparently the implementation of that is really difficult (1 2 3).

Although it sounds heavy-handed, the best way to do what you're describing is to put a GPS on both the robot and the target, and have the target communicate its location back to the robot.  Assuming that you don't lose wireless connectivity -- 5 meters is within the range of bluetooth, zigbee, wifi, and 3G -- obstacles will not hamper the ability of the robot to find its target; you just use the haversine formula to draw a path between those two points.

Of course, if you're going to let a knee-high robot loose in a crowded area, it would be common courtesy for it to have adequate ultrasonic/vision sensors to be able to avoid bumping into passerby.

Title: Non-Vision Based Target Tracking


问:
Visualizing and debugging an EKF
I am currently debugging and tuning an EKF (Extended Kalman Filter). The task is classical mobile robot pose tracking where landmarks are AR markers.

Sometimes I am surprised how some measurement affects the estimate. When I look at and calculate the numbers and matrices involved, I can work out how the update step got executed, what and why exactly happened, but this is very tedious.

So I wonder if anyone is using some technique, trick or clever visualization to get a better feel of what is happening in the EKF update step?

UPDATE #1 (will be more specific and show first approximation of what I have in mind)

What I am looking for, is some way to visualize one update step in a way that gives me a feel of how each component of the measurement affects each component of the state.

My very first idea is to plot the measurement and it's prediction together with some vectors taken from the K matrix. The vectors from K represent how the innovation vector (measurement - measurement prediction, not plotted) will affect each component of the state.

Currently I am working with an EKF where the state is 2D pose (x,y,angle) and the measurements are also 2D poses.

In the attached image(open it in new page/tab to see in full resolution), the (scaled) vector K(1,1:2) (MATLAB syntax to take a submatrix from 3x3 matrix) should give an idea how the first component of the EKF state will change with the current innovation vector, K(2,1:2) how the second component of EKF will change, etc. In this example, the innovation vector has a relatively large x component and it is aligned with vector K(2,1:2) - the second component of the state (y coordinate) will change the most.

One problem in this plot is that it does not give a feel of how the third component(angle) of the innovation vector affects the state. The first component of the state increases a bit, contrary to what K(1:1:2) indicates - the third component of the innovation causes this, but currently I can not visualize this.

First improvement would be to visualize how the third component of the innovation affects the state. Then it would be nice to add covariance data to get a feel how the K matrix is created.

UPDATE #2 Now the plot has vectors in state-space that show how each component of measurement changes the position. From this plot, I can see that the third component of the measurement changes the state most.

答:
Something that is often done is to plot the state variables over time as well as their 3-sigma intervals. Points where this interval shrinks are the updates, where you could possibly annotate the source of the measurements involved.

Besides errors in implementation which should be checked (not only wrong equations, but numerically unstable equations as well), the effect of updates is only directly affected by the difference between what is "expected" and "measured" and their respective uncertainties. So you might be interested in figuring out a way to visualize this balance in terms of the time progression in the first plot.

Title: Visualizing and debugging an EKF


问:
Robotics Location Following and Tracking?
I am building a robot that will follow a target as the target moves around. I would like some help with the setup for tracking the target. The most obvious solutions are Ultrasound or Infrared sensors, but for this application, they won't work. Imagine that the robot is placed into a crowded area and asked to move towards a particular person in the area (for the sake of simplicity, assume the person is less than 5 meters away). Is there some kind of radar or radio solution to this, or anything?</p>

答:
In a broad sense, there are a couple of ways to do this, but they basically boil down to the problem of how do you know what person you're going towards?

If it's feasible to give the person a flashlight or some light source (IR or visible), you could use light sensitive elements to determine where to go.

Magnetic fields could also be used, by giving the person in question a strong enough magnet.  (But it would have to be pretty strong, so I don't think this is as feasible...)

A final resort would be to attempt some form of a vision system.  For instance, if you gave the person a lime-green ball, a vision system could pick up on that, and treat it as a target.

OwnerDisplayName: RJackson

OwnerDisplayName: anorton


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

答:
What to cut out is not always a simple matter

One complication arises when the actuators actually need power in order to remain safe. For example: a back-drivable or compliant robot arm had picked up a heavy object, and is using motor power to hold the object in the air. If you kill the power, the weight of the object will bring the arms crashing down, and either breaking the object, the robot, or a person.

One way to implement cut out

In the above case, rather than cutting actuator power, it might be wise to send a message to all actuators to go into a safe mode. Exactly what that means depends on the nature of the robot and the particular actuator. They might stop, or simply go into a lower power mode where they fall down slowly.

Another way to implement cut out

In the Shadow Robot Hand, the sensing system, bus and actuators are all powered from the same 48v supply line. The sensors and actuators each have their own regulators, each with their own Unver-Voltage Lockout setting. The actuators cut out at 25v, while the sensors cut out at 9v. When an emergency stop happens, the power supply line is taken down to 18v, which causes the actuators' power supply to cut out, while maintaining the power to the sensors and communication bus.

Title: How should emergency stops be wired?


问:
Source to learn Kalman Fusion, explanatory code snippets
Currently I am reading a book of Mr. Thrun: Probabilistic Robotics. I find it really helpfull to understand concept of filters, however I would like to see some code in eg. Matlab. Is the book "Kalman Filter for Beginners: with MATLAB Examples" worth buying, or would you suggest some other source to learn the code snippets from?</p>

答:
Once you have a real intuition for the Kalman equations you will easily be able to translate the equations / models into code.  I highly recommend working (by hand) the examples in the Lecture Subject MI63: Kalman Filter Tank Filling - Kalman Filter Applications.

The examples highlight how the system model can greatly affect the output of the Kalman filter and provide concrete examples of tracking random variables.

More information on the derivation of the models used in the examples is given in UNC-Chapel Hill, COMP 145 - Team 18: The Kalman Filter Learning Tool - Dynamic and Measurement Models.

You can implement the examples in something as simple as Excel or Matlab.  However, if you plan on implementing the Kalman equations in C++, I recommend use the Eigen software package like Josh previously mentioned.


答:
The tricky part with what you want to do is that matching a person to some electronic representation of their "signature" is a very difficult task to do. Outside of some advanced facial recognition software, or tweaked vision software that could recognize a lime green shirt for example, there isn't much you can do.

I thought of something I haven't seen suggested elsewhere so I don't know if something like this exists or not but it seems like it could work for you with development. Perhaps using an thermal infrared camera to calibrate a thermal image of you putting in your height dimensions would work. Ultimately you are still getting into a vision based solution but a thermal camera would auto-greenscreen your whole body so to speak so you wouldn't have to worry about wearing the right color clothes or vibrantly colored clothes. It also wouldn't matter which direction you were facing. One caveat would be if you sat down or bent over, you wouldn't be properly height matched so something would have to account for that.

Anyways, just thought I'd throw that idea out there. It wouldn't work in a crowded area as well as you being the only one wearing vibrant green and color matching with a vision solution. Perhaps a combination of the two? Two cameras are better than one.

The issue with any kind of field based approach is that the robot wouldn't know in which direction it was coming from without enough resolution which might force one to get expensive high resolution equipment. Also, the smaller the robot, the more expensive and higher res equipment one would need to triangulate a point of origin.

Alternatively, sound signatures could work. Sound waves are slower than electromagnetic waves and so would be easier to triangulate. You could also use a frequency that humans/animals cannot hear. You wouldn't need very high end equipment I don't think if you orient mics at appropriately far angles apart. Imagine a "follow my voice" kind of scenario.

Perhaps RF would work here too as mentioned but it does depend on the size/equipment.

Title: Robotics Location Following and Tracking?

Body: I am building a robot that will follow a target as the target moves around. I would like some help with the setup for tracking the target. The most obvious solutions are Ultrasound or Infrared sensors, but for this application, they won't work. Imagine that the robot is placed into a crowded area and asked to move towards a particular person in the area (for the sake of simplicity, assume the person is less than 5 meters away). Is there some kind of radar or radio solution to this, or anything?</p>


答:
The issue with any kind of field based approach is that the robot wouldn't know in which direction it was coming from without enough resolution which might force one to get expensive high resolution equipment. Also, the smaller the robot, the more expensive and higher res equipment one would need to triangulate a point of origin.

Alternatively, sound signatures could work. Sound waves are slower than electromagnetic waves and so would be easier to triangulate. You could also use a frequency that humans/animals cannot hear. You wouldn't need very high end equipment I don't think if you orient mics at appropriately far angles apart. Imagine a "follow my voice" kind of scenario.

Perhaps RF would work here too as mentioned but it does depend on the size/equipment/software.

Title: Non-Vision Based Target Tracking

Body:
I am building 4-wheeled, knee-high robot with music and speakers on top that will follow a target person as the target moves around. I would like some help with the setup for tracking the target. The most obvious solutions are Ultrasound or Infrared sensors or some kind of vision tracking, but for this application, I don't want to use them.

Imagine that the robot is placed into a crowded area and asked to move towards a particular person in the area (for the sake of simplicity, assume the person is less than 5 meters away, but could be obscured by an object). Ideally, if someone walked between the target and the robot, the robot would not lose it's path (as would happen with vision-based sensing).

Thanks!


问:
Problem uploading to Roboduino AtMega328
I bought a new Roboduino atmega 328 board. Basically Roboduino is a modded version of Arduino UNO made by robokits.co.in. The problem is

On Windows Plaform:
When I tried to upload a simple Blink program that's listed in the examples of Arduino IDE 1.0.4, I got error that
avrdude: stk500_getsync(): not in sync: resp=0x00

I chose the correct COM port after verifying it with the Device manager. I installed the Prolific Drivers for the board. I selected the board as Arduino UNO in Arduino IDE.

The complete verbose for the upload is as follow:

```<code>D:\Softwares\Installed Files\arduino-1.0.4\hardware/tools/avr/bin/avrdude -CD:\Softwares\Installed Files\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM10 -b115200 -D -Uflash:w:C:\Users\ANKITS~1\AppData\Local\Temp\build5865304215250534760.tmp\Blink.cpp.hex:i
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch
         System wide configuration file is "D:\Softwares\Installed Files\arduino-1.0.4\hardware/tools/avr/etc/avrdude.conf"
Using Port                    : \\.\COM10
Using Programmer              : arduino
Overriding Baud Rate          : 115200

avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.
</code>```

When I plug in the board the power LED is on. The 13 pin LED blinks once. When the IDE shows uploading the 13 pin LED blinks 3-4 times and then the error appears on the screen. In between also sometimes it blinks randomly for 5-6 times. I also tried other example programs but the same follows.
I'm using 32 bit Windows 7 Ultimate and the baud rate is set to 9600.

On Ubuntu 13.04:
I downloaded the IDE from Software Center. I was added to the dialouts group on  the first run. After connecting the board to my pc I ran two commands lsusb which returned following output:

```<code>Bus 004 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
</code>```

and then dmesg. After this when I tried to upload the same program of blink, it gave me following error:avrdude: stk500_recv(): programmer is not responding. I'm using 64 bit ubuntu 13.04 and selected Arduino UNO as the board.

Thank you for reading this long. Please provide me suggestions for the problem.

答:
I finally got the problem solved. The problem was that I had selected Arduino UNO. After checking out the datasheets for my board I found that it had the same specs as Arduino Duemilanove AtMega328. After selecting it I got the things right.
So the general solution is check out the data sheets if you are using any such modded boards and then select the appropriate board which matches the specs.
Now my board is working successfully on both windows and linux.</p>


问:
Additional Power to DC Motor via Second Power Source
How can I provide more power to a DC motor that is in series behind a receiver circuit hacked out of a cheap RC car without burning up the receiver board? The board runs off two AAs at about 3V. I'm replacing the stock motor with a slightly larger one (12V, taken from a printer) and remounting it on a chassis for a homebrew robotics project... just messing around to learn more. I imagine I could go safely to 4.5V or even 6V with the receiver but I don't want to go much higher since half the stuff is epoxied and I can't really tell what's in there.

What I'd like to be able to do is add an additional two AA batteries behind the receiver to run the receiver system at 6V but add another two 3V 123A batteries to have the motor at 12V with the ability to run with the higher current draw due to the heavier load the motor will handle on its fancy new chassis... but without pulling that current through the receiver circuit.

My first thought is to simply connect my 123As negative to the motor and positive to a common ground... but I'm really not sure and I want to be careful to not damage the circuit or batteries. My next thought is to simply build a single power supply out of my 123As and use a current divider but I've only read about them and never actually tried so.

I've been doing some of those kiddie "electronic playgrounds," a few books and probably cost Google an extra few bucks in energy costs and I'm still kinda at a loss.

答:
It is safest to isolate the power supply for the motors from the electronics.

Normally, there is a single top-level power supply, eg. at 12V. This can supply the motors and other actuators directly. Because electronics normally run at 5V or 3V, a voltage regulator is often used to decrease the voltage (it taps into the 12V supply, and outputs a regulated 5V for the electronics). This is good, because the current motors draw can change quickly and may sometimes affect the power supply. In this case, if the voltage regulator is insufficient, capacitors may be added across the 12V supply, but this is not often required.

In your case, supposing you don't want to use a voltage regulator, you should have separate battery cells supply your electronics (at 3V), and another stack of cells at 12V to run your motors. You can then connect the ground of each circuit to each other to provide a common reference for your motor control signals. This setup again prevents the motors from affecting the voltage supplied to your electronics (assuming they draw a relatively constant, low current, won't require voltage regulation, although you might add a few capacitors to help with this - especially when you have op-amps or other switching electronics). Also, each cell in each battery stack will have the same current drawn from it. This avoids the some batteries in a stack having more charge than others, or having more current drawn.


问:
Connecting two microcontrollers using I2C
I Have an ATmega16 mc which is master on the i2c and a ATMega8 mc which is slave on the i2c.

I have connected the two mcs' sda and scl ports to each other alongside a pullup resistor.

Now I want to read a register from the ATMega8 using the ATMega16.

The problem is that I don't want to assign all the variables manually. Is there any libs or headers that will do this thing for me?

答:
I've not used the ATMega family, but have lots of experience of configuring many other devices - setting up the control registers for I2C is usually pretty straight forward, with appropriate reference to the datasheet/user-manual and will help you understand what's going on.

For such tasks, a library is (a) inefficient (b) overkill and (c) doesn't help you learn.

I don't know if there is one, but wouldn't recommend you use it, if there was...


问:
Battery pack discharged
I used a Turnigy 2200mAh 3S 25C Lipo battery pack with Turnigy balancer & Charger 2S-3S for about a month. Yesterday I left the battery plugged into four ESCs of my quadrocopter. Today I've found the battery totally discharged. When I tried to charge it, the charger showed it as faulty. After replugging it to the charger it showed it as fully charged.

How can I charge it now?

P.S. I've got a multimeter, but I do not know what and how to measure... The battery pack has two plugs: one is connected to the charger and the other to the ESCs...

答:
You have to be very careful with those packs as they don't usually have under-voltage protection for themselves. You're pack is likely fine but the charger isn't seeing the minimum voltage required to begin charging and so it won't.

I found myself in nearly the same situation not too long ago and managed to bring the battery back to a visible voltage by charging it with a Pb charge algorithm of similar voltage for a few minutes.

The multiple plugs are because there are multiple cells in the pack and each one requires individual charging (in parallel - not in series). They all have a common ground so you put the black end of the multimeter in the 4 pin black hole and put the red end in each of the 3 other colored wires. You will get 3 different, but probably close voltages.

I have this exact charger which is what I used to revive a similar pack: https://www.sparkfun.com/products/10473

Edit:
If you wanted to get a littler risky with the battery, a NiMH charger could be used for a short period as you mentioned. It charges at an acceptably low rate but the cells differ a lot more than they do between Pb and Li. A multi-cell NiMH for instance can have all of it's cells charged at once while this is generally not possible for Pb/Li. This means that a 12v NiMH charger is not going to work for a 12v Li battery since each Li cell needs to be charged individually.

If you happen to have an NiMH AA charger, you would retrofit that to be a 3v Li cell booster provided it slow-charges by putting two 1.5v terminals in series with the Li cell.

I would highly suggest getting an inexpensive smart charger as it's uses are nearly endless and it could save you many headaches that dumb chargers often create.

Additionally, you may want to build in a low-voltage cutoff circuit into your design to prevent this issue in the future.

Title: Battery pack discharged


问:
How do I interpret these specs for a motor and motor driver?
I ran into confusion while reading about motors.

Consider a motor with these specs:

Maximum motor voltage - 6VDC

No load current - 250mA max.

Stall current - around 1A

I am considering using the Texas Instruments L293D, with these specs:

Output Current - 600 mA Per Channel

Peak Output Current - 1.2 A Per Channel

If I use the L293D to run 1 motor (back and forth), is this safe?  What would happen if my motor requires more than 600mA?  Does this simply mean I need different driver IC?

Also, the specs say that if I want to drive 2 motors then i'll need to compensate for the current. Is it current from my power supply or from the motor driver?

答:
For the motor, a stall current of 1A means that at stall, supplying 6V will cause the motor to draw 1A. The no-load current of 250mA means that supplying 6V will cause the motor to draw 250mA.

The half-bridge IC you have given has no current overload protection. Its peak current of 1.2A is high enough, but the 600mA continuous current is not. This can normally cause it to overheat, and possibly break. Under the absolute maximum ratings, it has a peak current of 1.2A for <100us. Normally, it may be possible to heat an IC a little more than recommended if a good heatsink is used. However, the <100us implies that this is not possible, because the heat would not be able to transmit through the package fast enough.

These are your options:

You can supply your own current foldback protection. By using a current sensor of some sort, you can detect when there is too much current flow, you can then scale down the voltage, possibly down to $6\times0.6\div1 = 3.6V$. Assuming a fast control circuit, this is probably fine (due to the peak current allowed).

You can run the motor at only 3.6V. This limits the stall current, torque and maximum no-load speed, but means that you do not have to do any current foldback.

If you can measure the speed of the motor, and assuming you know the back EMF constant of your motor, you can convert speed to back EMF voltage. This is the additional voltage that you can supply to your motor (in addition to the 3.6V which gives 0.6A of current). This is because the amount of the back EMF voltage represents the voltage which will cause zero current to flow.

Note that when you run the motor at 3.6V, this is just the average voltage. Assuming you use pulse width modulation, this is equivalent to a power supply of 6V, with a duty cycle of 60%. Of course, the actual supply voltage must be within the operating condition of the device (36V).

You might be tempted to use two sets of half-bridges for each direction of the same motor. However, if you do this, you should be aware that it is quite difficult to control how much of the current comes from each parallel supply. Therefore, due to slight differences in transistor characteristics, one will supply more current than the other.

The specifications do not appear to mention anything about compensating current with two motors.

Why don't you just use the L293 quad half-bridge drivers (which allow 1A continuous)?


问:
Multicopter odd or even
I would like to ask which is better to design the multicopter with odd or even number of propellers? and why?</p>

答:
Simply put, it is a trade off between control complexity vs. power requirements. You should probably go with an even number, 4 or greater. Nice explanation of all the technicalities:

Why do quadcopters have four propellers?

How to choose the right propeller/motor combination for a quadcopter?

Title: Multicopter odd or even


问:
Arduino Controlled RC Car. What now?
I bought an RC car about a year ago. A few days later I integrated an arduino nano into the vehicle. The only thing the arduino does is to receive the RC signal and pass it on to the esc/servo. So, basically it just does a big amount of NOTHING :)

Right now the wiring looks like this:

[Remote] -> [rc receiver] -> [arduino] -> [servo/esc/lights]

I added lights and I did some experiments with distance sensors and I will try to integrate car control via xbee + processing. This works via serial already.

What else could be possible with a setup like that? Here are some of my ideas:

perhaps some sort of autonomic driving? The car is built for offroad and the suspension is not too bad but it is pretty fast (40 km/h) so a crash would be fatal.

FPV (first person view) driving? I could add another servo to move a small camera.

"swarm intelligence"? I have built two of those vehicles. Both feature the arduino nano, a zigbee and LED front lights.

steering correction? I could integrate a gyro sensor to check if the car is not driving straight when it should.

telemetry to another arduino? I could build some sort of arduino-zigbee-handheld that shows me some information for both cars like motor temperature, current speed, uptime, battery voltage, sensor values etc.

Any ideas, anyone? Right now it is just driving like it normally would. I integrated an arduino into an RC toy that does an awesome amount of NOTHING. Makes me feel pretty stupid.

答:
Consider integrating an Android smartphone with the Arduino board, as then you get cameras, gps, accelorometers and even voice command.

If you have 2 units and you want to build in a camera on one, why not have it automatically follow the other one. This should not be too hard if you put a marker / beacon on the one without the camera, or even a couple of different coloured markers so you can differentiate which side you are looking at. You could then have a 'robot cop' chase the user controlled car.

Title: Arduino Controlled RC Car. What now?


答:
Eventually if it's under too much of a load, such as if it's holding a position and you force it in a different direction, or if its trying to adjust to a position and something is blocking it, it will burn out. As in a little puff of smoke will come out. This also happens with servos which eventually reach their end of life. You can generally smell the servo to know if it's dead. </p>

<p>In you're case, it hasn't died, but may be malfunctioning. You generally can't repair servos. If you had new electronics, you could, but unless its a $100+ motor, its generally not worth it. </p>

Title: What are the signs that a servo might be broken?

Body:
I just got a kit and im not sure if its me or not but it appears one of the continuous servos might be broken. What happened first when I plugged it into the microcontroller, it made a humming sound when I sent it commands. The second continuous servo didnt work at all

I played around with different ports on the aurdino based board, and to no avail, just a hum.
Then I removed the humming servo altogether and just placed the second servo alone. the second continuous servo started to move in whatever direction I asked it to.

I plugged the first one in, only the second moved.

then I tried spinning them by hand, the second has much resistance, while the first one has dramatically less resistance, maybe 60% easier to spin by hand.

Is this something I can fix? Has anyone experienced these problems before?

Thanks in advance, you guys are great!

Body:
Eventually if it's under too much of a load, such as if it's holding a position and you force it in a different direction, or if its trying to adjust to a position and something is blocking it, it will burn out. As in a little puff of smoke will come out. This also happens with servos which eventually reach their end of life. You can generally smell the servo to know if it's dead.

In you're case, it hasn't died, but may be malfunctioning. You generally can't repair servos. If you had new electronics, you could, but unless its a $100+ motor, its generally not worth it.


问:
What is a suitable model for two-wheeled robots?
What is a suitable model for two-wheeled robots? That is, what equations of motion describe the dynamics of a two-wheeled robot.

Model of varying fidelity are welcome. This includes non-linear models, as well as linearized models.

答:
There isn't a lot of information here. Let's fix the wheels as separated by distance $b$, and each wheel has orientation $\theta_i$ with respect to the line joining them.  Then assume each wheel can be independently driven with an angular velocity $v_i$.

If the wheels are independently driven, but fixed in direction, $\theta_1=\theta_2=90^\circ$, you have something like a differential drive (tank treads).
It's worth noting that, assuming the wheels do not slip perpandicular to their orientation, you can solve for the motion of the robot base in closed form given velocity commands which are fixed over a small time duration (as is usually the case with robots under software control). The iCreate is such a platform, as are the smaller pioneers, and the Husky by Clearpath.
Then the change in orientation of the base, labelled $\theta$ below, can be found in closed form.

The usual model for these things, where $v_b$ is the base velocity and $\omega_b$ is the angular velocity of the base, is:

$$v_b = \frac{1}{2}\cdot(v_1+v_2)$$
$$\omega_b=\frac{1}{b}(v_2-v_1)$$

For a fixed time increment, $\delta t$, you can find the change in orientation, and linear distance traveled using these. Note that the robot travels along a circle in this time window. The distance along the circle is exactly $\delta t\cdot v_b$, and the radius of the circle is  $R=\frac{b}{2}\cdot\frac{v_1+v_2}{v_2-v_1}$.  That's enough to plug into these equations: circular segments -- particularly the chord length equation, which describes the distance the robot displaces from its original location. We know $R$ and $\theta$, solve for $a$.

So assuming the robot starts with orientation $0$, and position $(0,0)$, and moves along time window $\delta t$ with velocities $v_1$ (left wheel) and $v_2$ (right wheel), it's orientation will be: $$\theta_1=\frac{\delta t}{b}(v_2-v_1)$$ with position:
$$p_x=\cos\left(\frac{\theta_1}{2}\right)\cdot\left(2 R \sin\left(\frac{\theta_1}{2}\right)\right)$$
$$p_y=\sin\left(\frac{\theta_1}{2}\right)\cdot\left(2 R \sin\left(\frac{\theta_1}{2}\right)\right)$$

Note that as $v_1\to v_2=v$ the limit is
$$p_x=\delta t \cdot v$$
$$p_y=0$$

as expected.

Update why?.

Rearrange $p_x$ so that:

$$ p_x = cos \left( \frac{v_2-v_1}{2b} \right)
* 2 * \left( b\frac{v_1+v_2}{2(v_2-v1)} \right)
* sin\left( \frac{v_2-v_1}{2b} \right)
$$

$$ p_x = cos \left( \frac{v_2-v_1}{2b} \right)
* \frac{(v_2+v_1)}{2}* \frac{sin\left( \frac{v_2-v_1}{2b} \right)}
{\frac{v_2-v_1}{2b}}
$$

Now note that we have three limits as $v_2 \rightarrow v_1$.

$$cos \left( \frac{v_2-v_1}{2b} \right)\rightarrow 1$$

$$ \frac{(v_2+v_1)}{2} \rightarrow v_1 == v_2$$

$$ \frac{sin\left( \frac{v_2-v_1}{2b}\right)}{\frac{v_2-v_1}{2b}}
 \rightarrow 1 \text{  (see sinc function)}$$

This is covered all over the internet, but you might start here: http://rossum.sourceforge.net/papers/DiffSteer/ or here: https://web.cecs.pdx.edu/~mperkows/CLASS_479/S2006/kinematics-mobot.pdf

If the wheels are not fixed in direction, as in you can vary the speed and orientation, it gets more complicated. In that sense, a robot can become essentially holonomic (it can move in arbitrary directions and orientations on the plane). However, I bet for fixed orientation, you end up with the same model.

There are other models for two wheels, such as a bicycle model, which is easy to imagine as setting the velocities, and only varying one orientation.

That's the best I can do for now.


问:
Permission to fly UAVs
Okay, this might sound like a stupid question but, is there some sort of a permission in the US I might require to fly a quadcopter or a UAV for that matter? I couldn't find much help anywhere else.  </p>

答:
It is best to check with your local council - they will be able to inform you on general laws as well as local by-laws. Another good source would be your local model plane club.

As far as I know: UAV typically requires permission, depending on capabilities (they don't want unlicensed Predator drones flying around). Quadcopters typically don't, except at public events (like those camera quadcopters they use at some sport events).

Disclaimer : based on my personal understanding never having been to the states (they are pretty much standard the world over). I accept absolutely no reponsibility for any claims arising from usage of this info i.e. use at your own risk.

Title: Permission to fly UAVs


答:
I've been collecting books on Kalman filtering and target tracking for some years now.

Most approachable book I've found: Gelb's Applied Optimal Estimation.  It is widely considered a classic in the field.  It is also relatively inexpensive.

Second place goes to Brookner's Tracking and Kalman Filtering Made Easy.  It is aimed primarily at radar processing.  He goes to a good bit of trouble to explain simpler tracking filters first, then shows that the Kalman filter is nothing magic, just a more flexible way of coming up with the coefficients for the filter.

Neither of them tackle the association problem for multiple target tracking.  Blackman's Multiple Target Tracking with Radar Applications is a good start.  New, it is expensive, like all Artech House books.  Amazon says there are some inexpensive used copies available.

Unfortunately, I have yet to find anything that even remotely resembles an approachable explanation for Reid's Multiple Hypothesis Tracker, which you need if you are trying to do multiple-target tracking.  This is a robust approach to the problem of associating sensor reports with existing tracks and/or initiating new tracks if something new pops up.  You NEED to solve the association problem to do multiple target tracking.  Unfortunately, Reid's paper is almost incomprehensible, at least to me.  (Yes, there are simpler methods, but they are not nearly as robust.)

Title: Source to learn Kalman Fusion, explanatory code snippets

Body: Currently I am reading a book of Mr. Thrun: Probabilistic Robotics. I find it really helpfull to understand concept of filters, however I would like to see some code in eg. Matlab. Is the book "Kalman Filter for Beginners: with MATLAB Examples" worth buying, or would you suggest some other source to learn the code snippets from?</p>


问:
Open source "sci-fi"-like robot projects IRL
I'm looking for a robot that is capable of moving around and has arms that can get objects in one place and drop in another. Something akin to what we see in most sci-fi movies, though much simpler. It may run on legs, wheels or tracks; it may have claws or hands. I'm looking for open-sourced design, schematics, specifications of the parts, coding - the whole package. It may be specific cases or projects/initiatives with a growing collection of robots.

As long as it can take out the trash, it's perfect. ;D

答: Regarding Open Source software for robots, check about the ROS (robotics operating system) from willow garage.</p>


问:
Aluminum vs Carbon Fiber
So building a quadrocopter from scratch HAS a lot of decision making, and I need some input on the material choice.

I have short listed Aluminum and Carbon Fiber for the Arms and support of the Quadrocopter.
I am a little short on cash to experiment with both of them.

So considering that I have enough money to buy either of those, and assuming that I have access to general tools like a Table Saw, Horizontal Band Saw, CNC Router and a Water jet.

What would be a better material to work with

EDIT:

I will be deciding the specs around the frame so as to allow me some design liberty. So right now, my goal is to assemble a very durable, as-light-as possible frame, which can withstand a lot of experimentation on the electrical side.

答:
Have you considered balsa or similar woods from the model airplane world?

There are a LOT of balsa model airplanes flying.  Some of them are pretty big, and very strong.  (There's a picture of a 1/4 scale Piper J-3 Cub skeleton, pre-covering, with an elementary school kid sitting on the wing box, straddling the forward fuselage.  The airplane survived this particular elephant test just fine.)

Title: Aluminum vs Carbon Fiber


答:
Based on the experience others have had, it would appear that carbon fibre is a much better choice, because it is much lighter.

Because you need motors which can hold up the quadrocopter, weight is a primary consideration. By lightening it, you do not need as powerful motors, and you can carry less batteries - which of course, helps to lighten it further.

The main part of the frame, are the arms holding the rotors, so using carbon fibre for those would help significantly. I believe there are carbon fibre rods and tubes which can be purchased. The hollow tubes allow wiring through the centre.

However, using carbon fibre may change the way things are mounted. In particular, drilling holes for mounting may be problematic - potentially causing cracking in the material. A good solution is to rely on clamping parts to the structure instead.

Title: Aluminum vs Carbon Fiber

Body:
So building a quadrocopter from scratch HAS a lot of decision making, and I need some input on the material choice.

I have short listed Aluminum and Carbon Fiber for the Arms and support of the Quadrocopter.
I am a little short on cash to experiment with both of them.

So considering that I have enough money to buy either of those, and assuming that I have access to general tools like a Table Saw, Horizontal Band Saw, CNC Router and a Water jet.

What would be a better material to work with

EDIT:

I will be deciding the specs around the frame so as to allow me some design liberty. So right now, my goal is to assemble a very durable, as-light-as possible frame, which can withstand a lot of experimentation on the electrical side.


问:
How mature is real-time programming in robotics?
Edit: I don't know why, but this question seems to be confusing many people. I am aware of when/where/why/how to use real-time. I am interested in knowing whether people who have a real-time task would actually care enough to implement it in real-time or not.

There's no need to mention why real-time operations are important for a robot. My question is however, how much is it actually used in robotics?

Take this question for example. Only one answer mentions any platform with real-time capabilities, and it is far from the top too. ROS apparently, being a very popular platform which is not real-time.

In the real-time world however, RTAI1 seems to be the only workable free real-time platform of use. It is however, limited to Linux (no problem), badly documented and slowly developed.

So, how much is real-time behavior sought after among robotics developers? The question is, how much are developers inclined to write real-time applications when real-time behavior is actually needed? If not much, why?

For example, reflexive behavior based on tactile data, cannot go through ROS because it would lose its real-time property. But do people really come up with a real-time solution or use ROS anyway, ignoring the real-time property?

1 or similarly Xenomai

答: Our company builds robots using FreeRTOS running on PIC microcontrollers.  For us, the main reasons to use FreeRTOS is the ease of rearranging priorities on tasks, handling multiple communication lines simultaneously, and easy communication between interrupt handlers and main tasks.  Microcontrollers are far cheaper than putting a full linux machine into each robot we produce as well.</p>


问:
Single camera vision and mapping system
Some time ago I saw a demo of a small 'toy tank' with a single camera mounted on it. This tank was able to drive around the floor and detect objects and then move/steer to avoid them.
The interesting part was that it used a single camera vision system and as far as I remember was taking advantage of the floor being flat. and then using the rate a feature was moving in the scene relative to the motors and directions of travel to evaluate and hence map the scene.

Can anyone send me pointers what to search for to get some more information on this, or some pointers to codebases that can do this.

The reason I ask is that this was a single camera system from a number of years ago (5+) and therefore (from what I remember) was a relatively low compute load.
I was intending to try this out on a Raspberry PI to build a car/tank that maps a room or set of rooms.

答:
It's hard to say exactly what they were doing, but the terms you may want here are "optical flow" and "egomotion". Sounds like there may have been some feature detection and matching (something like SURF or SIFT) or foreground/background segmentation thrown in as well.

OpenCV is probably the most widely used codebase for computer vision, they have a lot of functionality for motion analysis. OpenCV should run on the Raspberry Pi, although your algorithms may be limited by computing power.

Title: Single camera vision and mapping system


答: Building on WildCrustcean's response another possiblity would be stereo vision. While we often think of stereo vision as using two cameras the techniques really only need images displaced in space and a model of the displacement. In other words I can take an image, move, then take another image. So long as I know the transformation between these two images I can then use stereo vision techniques to calculate the distance to a point in the image.</p>

Title: Single camera vision and mapping system

Body:
Some time ago I saw a demo of a small 'toy tank' with a single camera mounted on it. This tank was able to drive around the floor and detect objects and then move/steer to avoid them.
The interesting part was that it used a single camera vision system and as far as I remember was taking advantage of the floor being flat. and then using the rate a feature was moving in the scene relative to the motors and directions of travel to evaluate and hence map the scene.

Can anyone send me pointers what to search for to get some more information on this, or some pointers to codebases that can do this.

The reason I ask is that this was a single camera system from a number of years ago (5+) and therefore (from what I remember) was a relatively low compute load.
I was intending to try this out on a Raspberry PI to build a car/tank that maps a room or set of rooms.


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

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

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

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

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

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

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

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

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

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

答:
If you want to detect missed steps, you want an encoder. Luckily, both magnetic and optical encoders exist that easily give you 4096 steps per revolution, so even a micro-stepping stepper motor will be measured with at least one step per step.

Note that some CNC mills may not necessarily detect missed steps; it's up to the operator to not program a tool path that's too hard for the spindle and tool, and to hear the problem when it happens. Instead, those CNCs just use end limit switches to find the absolute home, and then work entirely by assuming steps are taken.

Encoders may allow you to experiment with other features, too, like using an assist DC motor for non-engaged moves for really fast rapids :-)


问:
How can I convert RGB colors to CMYK for my airbrush robot?
I am developing a robot which paints using an airbrush (3D painting). I intend to use several colors as a CMYK printer, but I do not know how to do the conversion of RGB colors in the computer to the dosage of colors in CMYK.</p>

答:
Professional CMYK conversions use algorithms that use blend matrices and even non-linear warping to fit the RGB color space (which color space? sRGB?) onto available printing inks. The best way to do that might be to find a library that does this, and find the specific parameters for the inks you want to use.

You need to design a system that can deliver an increment in coverage based on an input.

For example, in offset printing and laser printing, the picture is broken up in very small dots (a halftone screen,) and a percentage of dots is covered to achieve a certain degree of saturation. The different colors in 4-color printing are printed using halftone screens at different angles to minimize the case where one colored dot will keep falling right on top of another colored dot and thus "punch out" the covered color.

For an airbrushing robot, perhaps you can measure degree of paint feed (pressure on the lever) and dwell time, and convert that to a measurement of degree of paint coverage. The air brush works a bit like a stochastic paint particle emitter, removing N % of uncovered area within its zone of effect for every millisecond it is "on." The covered area is also a 2D function that's strongest in the center, and fades out towards the edges.

In my opinion, the most interesting programming challenge in this design is figuring out the optimal path to "sweep" the airbrush to get the right amount of coverage of each kind of paint on each area, while not over/under-covering certain areas and making a mess. Holding the airbrush very close, and painting one "pixel" at a time, would work, but wouldn't be very "artistic."


问:
Can I use Ziegler-Nichols's rules to find PID parameters for a non linear system
I'm trying to use a PID to stabilize a system described from the following difference equation:

$$y_{k+1} = a y_k \sqrt{(1-y_k)}~~~ + b y_{k-1} ~+ c u_k$$

Can I use Ziegler-Nichols's rules to find PID parameters in this situation?

To be more precise. My system is an Apache Http Server, in particular I'm trying to model how the CPU load can change in function of KeepAlive parameter. When KeepAlive grows the cpu load should decrease.

So:

$$cpu_{k+1} = a \cdot cpu_k \sqrt{(1-cpu_k)}~~~ + b \cdot cpu_{k-1} ~+ c \cdot keepAlive_k$$

Obviously the Cpu load is a scalar $\in [0,1]$ , $keepAlive$ is just a time and the $a,b,c$ parameters are known to me through experimental data and multiple regression on them.

答:
First, you haven't provided enough information.  Your equation is nonlinear, which means that the behavior of the system as described depends not just on the coefficients of the difference equation, but on the range of values that $y$ can take on.  From the looks of things, the closer that $y$ is restricted to 0, the more you can treat the whole thing like a linear system and just apply PID control to it.

Second, Ziegler-Nichols just isn't indicated here.  Z-N was invented as an ad-hoc tuning method for industrial plants with unknown characteristics.  It guarantees neither stability nor performance of the result -- and assuming that you know the values of $a$, $b$, and $c$, you have a plant with known characteristics!!!

Even if the plant characteristics are known, Z-N is really only a good way to arrive at a starting point for tuning.  Z-N tends to result in an underdamped system, and as I mentioned, it guarantees neither stability nor performance.

In systems that are amenable, I vastly prefer to do swept-sine measurements (Measuring Frequency Response).  If you don't like the buzzing and shrieking noises, and the uninitiated diving for cover behind lab equipment, you can use some sort of a system identification based on a step response instead -- but in my experience with servo systems, a frequency response-based design is superior when you need to go from measured values.

Whatever you do, you want to account for the effect that the variation in the value of $y$ is going to have on your system.  If the derivative
$$\frac{d}{dy}y\,\sqrt{1-y}$$ varies by more than a few percent, then you need to do your design to accommodate the differing systems characteristics.  If that derivative varies by a factor of two or more, then you need to consider the possibility of some sort of a nonlinear controller, however difficult and perverted your design may end up being, or you need to just pull in your horns and accept that you're going to have a severely detuned system for most ranges of $y$.

See Applied Control Theory for Embedded Systems for more information.


问:
What is the actual physical actuated quantity when controlling the position of a servo?
I'm trying to learn about servo control. I have seen that the most generic position control method for servos is PID, where the control input is position error. However, I am not sure about what is the actuated quantity. I am guessing that it is one of:

Voltage applied to the motor

Current applied to the motor

I am then guessing that the actuated quantity gets turned into one of:

Torque that the motor exerts

Angular velocity that the motor runs at

I haven't been able to get my hands on and explicitly control a physical servo so I cannot confirm that the actuated quantity is any of these. I know very little of the electronics that controls the motor. It might well be that the controlled quantities are different for different series servos.

My bet is on torque control. However, assume that the servo is holding a weight at a distance (so it is acting against gravity), which means an approximately constant torque load. In this case, if the position error is zero and the servo is at rest, then each of P, I and D components are zero, which means the exerted torque is zero. This would cause the weight to sink, which is countered by the error in its position causing P,I components to increase. Wouldn't this situation cause the lifted weight to oscillate and balance at a constant position which is significantly different from the goal position? This isn't the case with the videos of servos I have seen lifting weights. Or is this the case and friction is smoothing everything out? Please help me understand.

答:
If you are speaking about RC style servos, then the actual drive to the motor is in the form of a pulse width modulated voltage: the servo amplifier just turns the motor on fully in one direction or the other, for a length of time determined by the difference between the measured position and the target position as determined by the width of the incoming pulse.

Life is complicated by the newer "digital" servos -- I can't swear to the internal workings of these, but the drive to the motor is almost certainly PWM of some sort, just at a faster rate than the old-style analog servo amplifiers.  There's no reason that it couldn't be as described below, except that there is precious little room inside of an RC servo, so there's a good chance that no current measurement is done, and hence that the parameter that the microprocessor controls is the PWM duty cycle.

How servo mechanisms in industry are controlled is a much wider answer: basically, it can happen any way that the designer thought was appropriate.  Motor drive can be via a linear amplifier that is configured to drive a current or a voltage, or it can be via a switching amplifier (i.e. PWM).  In the case of a switching amplifier, the amplifier itself can be either analog or digital and (through feedback) configured for either constant-current, constant-voltage, or constant duty cycle.

Usually in a "pro" servo mechanism with a brushed or brushless motor there will be an inner loop that servos the motor current (and therefor torque).  This is not so much to provide any big advantage in control as it is because it vastly simplifies current limiting to the motor, which is necessary if you want to keep all that expensive smoke inside the motor where it belongs.  That inner current (and hence torque) loop will often be wrapped by a speed loop that either senses the speed of the motor shaft or that deduces it from the motor's back-EMF (and which provides a convenient means of speed limiting the motor, if that is necessary).  Finally, that speed loop is wrapped by a position loop.

ContentLicense: CC BY-SA 4.0


问:
How is PIV control performed?
I'm considering experimenting with PIV control instead of PID control. Contrary to PID, PIV control has very little explanation on the internet and literature. There is almost a single source of information explaining the method, which is a technical paper by Parker Motion.

What I understand from the control method diagram (which is in Laplace domain) is that the control output boils down to the sum of:

Kpp*(integral of position error)

-Kiv*(integral of measured velocity)

-Kpv*(measured velocity)

Am I correct? Thank you.

答:
A PID loop and a so-called PIV loop with equal gains should have the same response to a disturbance, so I'm not sure why the claim that the disturbance response is better or worse.

As mentioned, the derivative "kick" will be less, which can be a good thing if you give the thing sharp inputs.

In addition, there can be some benefits as the thing comes out of integrator saturation, depending on how you implement your anti-windup.

Mostly, the so-called PIV loop is just a way of affecting the zeros of the closed-loop transfer function.  It's a special case of a more general scheme where your controller output is (in Laplace notation)
$$Y(s)=\frac{k_{fi}U(s) - k_{bi}X(s)}{s} + \left(k_{fp}U(s) - k_{bp}X(s)\right) + \left(k_{fd}U(s) - k_{bd}X(s)\right)s$$
where $Y$ is the controller output, $U$ is the system command and $X$ is the controlled variable, while the various $k_{xx}$ are forward and backward integral, derivative, and proportional gains.  In this scheme you tune the various feedback gains ($k_{bx}$) to get the loop (and hence disturbance) response that you want, and you tune the forward gains ($k_{fx}$) to improve the response to a command change, by whatever criteria you have for "better".

Setting all the forward and reverse gains equal gets you a plain ol' PID, while setting $k_{bp}=0$ and  $k_{bd}=0$ gets you the so-called "PIV" controller.

Title: How is PIV control performed?


答:
Disclaimer: IANAL.

For the US law, small UAVs are analogous to RC models and the regulation depends on the use intent.

For non-commercial, recreational use, the law is relatively permissive and mostly relies on the rules of the Academy of Model Aeronautics. You can find their rules here: http://www.modelaircraft.org/documents.aspx

For commercial use, the UAV currently must be certified like a manned aircraft, which is impossible in practice for small UAVs. Until recently, this has rendered the commercial exploitation of UAVs impossible in US. The parliament has been tasked to design laws to permit commercial exploitation of UAVs by 2015 at the latest. At the moment, it's possible for government agencies and university to obtain special permits through Certificates of Authorization. Other ways of demoing/using UAS are also being put in place (testing fields, lightweight certification process, etc.), but it will be difficult to have a clear picture for the next year or two. To complicate the picture, several states are in the process of passing restrictive laws related, e.g., to privacy, so the situation may end up being state dependent.

Title: Permission to fly UAVs

Body: Okay, this might sound like a stupid question but, is there some sort of a permission in the US I might require to fly a quadcopter or a UAV for that matter? I couldn't find much help anywhere else.  </p>


问:
What are the signs that a servo might be broken?
I just got a kit and im not sure if its me or not but it appears one of the continuous servos might be broken. What happened first when I plugged it into the microcontroller, it made a humming sound when I sent it commands. The second continuous servo didnt work at all

I played around with different ports on the aurdino based board, and to no avail, just a hum.
Then I removed the humming servo altogether and just placed the second servo alone. the second continuous servo started to move in whatever direction I asked it to.

I plugged the first one in, only the second moved.

then I tried spinning them by hand, the second has much resistance, while the first one has dramatically less resistance, maybe 60% easier to spin by hand.

Is this something I can fix? Has anyone experienced these problems before?

Thanks in advance, you guys are great!

答:
There is at least two modalities along which servos (continuous or otherwise) usually fail: gear problems and motor breakdown.

When the gear fails (broken tooth, hard point, etc.), the servo may get stuck, free moving or any combination. When the motor breaks (usually the brushes inside the DC motor are the culprit), the servo stops working altogether (as if it was unplugged) or overheats and burns. In your case, since it's humming and behaves differently when actuated by hand, I'd think your servo has gear problem. Its relatively easy to take a look at the gear box as it is the first apparent area when opening the servo and it can easily be re-assembled afterward (on the contrary, checking the motor's brushes usually means breaking the motor open), so I'd have a look to confirm the diagnostic.


答:
My choice is Carbon Fiber for sure. It has some advantages and some disadvantages.
OT: Using carbon fiber your robot will look much more professional and you will feel good looking at it.

Advantages:

Much Lighter.

Much Stronger

Disadvantages:

More expensive

Slightly harder to work with (cutting, ...)

Title: Aluminum vs Carbon Fiber


问:
Upgrading the motors on a SeaPerch ROV - more torque, or more RPMs?
I am looking to upgrade the motors for SeaPerch underwater ROVs so we can carry heavier payloads and more equipment.

My question is, should I look for motors which have a higher RPM and lower torque, or with lower RPM but higher torque to gain a substantial power increase? If the latter, what threshold of RPMs should I stay above to maintain speed?

We are currently running Jameco PN 232022 motors with ~1 1/2" props (same setup as here). They are mainly run at max power as our ESC currently consists of a fuse and a toggle switch.

答:
Keep in mind that "heavier" is not quite the term you're looking for.  You should be trimming your SeaPerch to be neutrally buoyant, so unless the new payload creates significantly more drag than your old one, your existing motors should work fine (just with decreased acceleration in response to the increased mass).

The answer to the question of torque vs RPM really depends on the propeller you use -- they should be evenly matched.  There is a fair amount of theory on this (for example, Mark Drela's lecture notes from MIT), but you can also just approach it in a practical way.

The basic idea is to work with the power curves of the propeller and motor (both of which are measurable):

 (more here)

Based on this, you should be able to work iteratively with a few propeller designs after you pick your motor.  There are also a lot of guides for this (like this one, providing the image below) that explain how to choose the propeller based on the power of the motor that you've already selected.  You might not be measuring your engine power in units as large as BHP, but the technique is the same.

As always, you'll have to run your own thrust-vs-rpm tests on a variety of propellers to verify your calculations.


答:
If your goal is to experiment, then use the cheapest option possible -- it will give you the freedom to make more mistakes.  Carbon fiber would be great if your design is in a fairly final state, but are you 100% assured that you correctly determined all the thicknesses, mounting holes, wiring guides, etc?  Are you good enough working with carbon fiber to successfully build what you designed?  These are serious things to consider if you are on a budget.

Balsa wood is a fairly cheap way to get started, and there are plenty of others (for example, if it's light enough then you may be able to use a sheet of foam).

Will it look pretty?  No.  But that's a prototype for you; if you're too heavily invested in the appearance/workmanship of the first draft, you'll fail to make newer & better drafts.

Title: Aluminum vs Carbon Fiber


问:
Prop Orientation on a Multirotor
While looking up information for the right propellers for my quadcopter, I realized that they had different orientations i.e. Clockwise and Counterclockwise. On further research I found that all multi-rotors have different combinations of these orientations. So my question is WHY? How does it matter if the propeller is turning clockwise or anti-clockwise?   </p>

答: This has to do with the torque, or moment, the rotors induce on the body of the quadcopter/multirotor. If all of the rotors were to spin the same direction they would all induce a torque in the same direction causing the craft to yaw. Of course this is undesirable for many reasons. By spinning half of the rotors the opposite direction the torques are theoretically canceled preventing the craft from yawing.</p>

Title: Prop Orientation on a Multirotor


问:
F/OSS Optical Object Avoidance
I am beginning work on a larger scale, 250-350 lbs wheeled robot and looking to use both optical and other means of object avoidance. I am concerned with a robot this large causing issues with running into things, including people as it has a top speed of 15mph and that would cause issues with safety. I am starting out with a remote control but am looking to have the robot become self contained. I have been loosely following the DARPA driver-less car project but will not have anywhere near the fiscal or power budget that they do for sensors and computers. Am I thinking to far afield with my idea of having a self-contained robot in the 250-300 lbs range that does not break the bank on optical object avoidance? Any comments or experiences will be greatly appreciated.</p>

答:
Yes, you are thinking too far afield. This is an open research problem (especially where people are concerned). Don't even think about the DARPA grand challenge, that's way out of a single person's league. However, there are some good starting points I can recommend.

A labmate has had good success tracking people using a Kinect with OpenNI. The kinect has range information, which makes it better than pure vision or binocular vision. Typically a vision-based solution uses Structure From Motion. Because this can be terribly sensitive to moving scenes, vision is probably NOT the way to go for this task. A more reliable method is laser scanner for close-in obstacle avoidance. However, Vision-based SLAM is possible, and can be implemented using the Robot Operating System.  The task becomes significantly easier if you have detailed maps before you deploy.

Start with ROS, aka the Robot Operating System, it will be much more helpful than implementing these things yourself. I can assure you from personal experience.

Title: F/OSS Optical Object Avoidance


问:
What reward function results in optimal learning?
Let's think of the following situations:

You are teaching a robot to play ping pong

You are teaching a program to calculate square root

You are teaching math to a kid in school

These situations (i.e. supervised learning), and many others have one thing (among others) in common: the learner gets a reward based on its performance.

My question is, what should the reward function look like? Is there a "best" answer, or does it depend on the situation? If it depends on the situation, how does one determine which reward function to pick?

For example, take the following three reward functions:

Function A says:

below a certain point, bad or worse are the same: you get nothing

there is a clear difference between almost good and perfect

Function B says:

you get reward linearly proportional to your performance

Function C says:

if your performance is bad, it's ok, you did your best: you still get some reward

there is not much difference between perfect and almost good

Intuitively, I'd think A would make the robot very focused and learn the exact pattern, but become stupid when dealing with similar patterns, while C would make it more adaptable to change at the cost of losing perfection.

One might also think of more complex functions, just to show but few:

So, how does one know which function to pick? Is it known which behavior would emerge from (at least) the basic A, B and C functions?

A side question is would this be fundamentally different for robots and human kids?

答:
Short answer: the strongest reinforcement effect comes from delivering a valuable reward on an intermittent (random) schedule.

Longer version: One aspect of your question is about operant conditioning, at least as it applies to teaching maths to a complex organism. Applying this to machine learning is known as reinforcement learning.

Economics (as per jwpat7's answer) only addresses one part the story of reinforcement. Utility function tells you what reward has the strongest reinforcement effect (biggest impact on behaviour) in a given context. Is it praise? chocolate? cocaine? direct electrical stimulation to certain areas of the brain? Mostly my answer is about effect of context, assuming a given reward utility.

For complex organisms/behaviours, reward scheduling is at least as important as reward utility:

A "fixed-interval reward schedule" is the least effective way to modify behaviour with a given quantity of reward (I'll give you \$10 per week if you keep your bedroom tidy). Think dole bludger.

Fixed ratio reward schedules (I'll give you \$10 every seven days you have a tidy bedroom) are more effective than fixed intervals, but they have a kind of effectiveness ceiling (subject will tidy their room seven times when they are hungry for \$10, but not otherwise). Think mercenary.

The most influential way to deliver a given reward with a "variable interval reinforcement schedule" (e.g. every day you tidy your bedroom you have a 1/7 chance of getting $10). Think poker machine.

If you are a learning supervisor with a fixed reward budget, for a given learning situation, there will be an optimum balance of reward size (utility) and frequency. It's probably not a very small slice of reward at a very high frequency, nor a very large chunk of reward delivered very rarely. It might even be a random size reward at a random schedule - the optimum is usually determined experimentally for a particular situation.

Finally, the "optimum" schedule (random frequency, random quantity {p(reward),p(value)}) will probably vary at different stages in the learning process. For example, a new pupil might be subject to "primacy" effect (welcome! have a jelly bean) that quickly becomes fixed-interval reward if you repeat it. There might be a "recency" effect that gets more reinforcement value from a reward delivered on the very last trial ("finishing on a high note"). In between, there may be an accumulative "faith effect" where as a learner becomes more experienced, the optimum might shift toward lower probability, higher utility over time. Again, more stuff to determine empirically in your situation.


答:
The optimal reward function depends on the learning objective, i.e. what is to be learned. For simple problems it may be possible to find a closed form representation for the optimal reward function. In fact for really simple problems I'm confident it is possible though I know of no formal methods for doing so (I suspect utility theory would address this question). For more complex problems I would argue that it is not possible to find a closed form solution.

Instead of seeking the optimal function we could look to an expert for a good reward function. One approach to doing so is a technique called Inverse Reinforcement Learning (IRL). It formulates a learning problem as a reinforcement learning problem where the reward function is unknown and the objective of the learning process. The paper Apprenticeship Learning via Inverse Reinforcement Learning by Pieter Abbeel and Andrew Ng is a good place to start learning about IRL.

Title: What reward function results in optimal learning?

Body:
Let's think of the following situations:

You are teaching a robot to play ping pong

You are teaching a program to calculate square root

You are teaching math to a kid in school

These situations (i.e. supervised learning), and many others have one thing (among others) in common: the learner gets a reward based on its performance.

My question is, what should the reward function look like? Is there a "best" answer, or does it depend on the situation? If it depends on the situation, how does one determine which reward function to pick?

For example, take the following three reward functions:

Function A says:

below a certain point, bad or worse are the same: you get nothing

there is a clear difference between almost good and perfect

Function B says:

you get reward linearly proportional to your performance

Function C says:

if your performance is bad, it's ok, you did your best: you still get some reward

there is not much difference between perfect and almost good

Intuitively, I'd think A would make the robot very focused and learn the exact pattern, but become stupid when dealing with similar patterns, while C would make it more adaptable to change at the cost of losing perfection.

One might also think of more complex functions, just to show but few:

So, how does one know which function to pick? Is it known which behavior would emerge from (at least) the basic A, B and C functions?

A side question is would this be fundamentally different for robots and human kids?


问:
Prop orientation for tricopters
This question stems from previous question, where I asked why does the prop orientation matter so much for a multirotor. But on further research† I found that these reasons need not apply to a tri copter. and then again. Why?

Are these reasons general for all multi rotors with odd number of motors? or even rotors?

† This forum talks a lot about tricopters and prop orientations but nothing really answers the question.

答:
For a basic multicopter, in the absence of any other way to control yaw, orientation does matter. A quadrotor needs a balanced set of rotation directions so that it can easily control yaw direction, and at equilibrium, all propellers can rotate at the same speed. This is primarily because all rotors in a quadrotor are fixed (usually). The quadrotor can also control yaw by varying the speed of propellers that rotate in one direction versus another.

Propeller orientation does not matter so much when it has some other method to control yaw. For example, helicopters have a tail rotor, which corrects for any yaw moment caused by the main propeller. Thus, if it was to set to rotate in the opposite direction, the tail rotor can just rotate in the opposite direction to counter this.

The standard tricopter has two front rotors, and a third rear rotor. However, the rear rotor can change its axis. It tilts left or right. When it tilts left or right, a portion of its thrust acts in the yaw direction. Therefore, where front rotors rotate in the same direction, the rear rotor must tilt more the counter the moment from the front rotors. Where the front rotors rotate in opposite directions, the rear rotor tilts less. This is explained in the video in message #4 of the link you posted.

The reason why the controllers does not even need to know the direction of rotation in the tri-copter is because it is a feedback controller. Thus, when it senses undesired yaw, it simply tilts the rear rotor in the opposite direction to correct the yaw direction.

Note that the rear rotor, when tilted in one direction, also causes a lateral force. This is counter-balanced by having the whole tricopter tilt in the opposite direction. Hence, the front rotors are tilted (to a lesser degree), and part of their force is oriented laterally.

Therefore, tricopters are more stable and performs better when the front rotors are counter-rotating, because the rear rotor can tilt less (as well as the whole tricopter tilting less).

In summary, the general rule is that propeller orientation is a consideration unless it has some other mechanism to correct for yaw. With more than 4 rotors (which are unable to tilt), it is not necessary to have rotors in one direction be exactly equal to the number in the other direction, because it can change the speed of the rotors independently to exactly cancel out the moments. However, this may cause uneven utilisation of the rotors - we tend to like symmetry.

Title: Prop orientation for tricopters


问:
Instantaneous Center of Rotation for a differential Drive Robot
I want to find the instantaneous center of rotation of a differential drive robot.

Assuming I know that the robot will travel with a particular linear and angular velocity $(v,w)$ I can use the equations (given at A Path Following a Circular Arc To a Point at a Specified Range and Bearing) which come out to be:

$$x_c = x_0 - |\frac{v}{w}| \cdot sin(\theta_0)$$
$$y_c = y_0 - |\frac{v}{w}| \cdot cos(\theta_0) $$

I'm using the webots simulator and I dumped gps points for the robot moving in a circle (constant v,w (1,1)) and instead of a single $x_c$ and $y_c$ I get a center point for every point. If I plot it out in matlab it does not look nice:

The red points in the image are the perceived centers, they just seem to trace the curve itself.

Is there some detail I am missing? I'm really really confused as to what's happening.

I'm trying to figure out the center so I can check whether an obstacle is on this circle or not and whether collision will occur.

答:
It looks like there is some noise in the sensor readings. Make sure your simulator is reporting ground truth, or you have some tolerance to noise.

See here: http://www.cyberbotics.com/dvd/common/doc/webots/guide/section9.2.html

In particular

In Supervisor code:

To get the 3D position of any Transform (or derived) node in the
  Supervisor code: you can use the wb_supervisor_node_get_position()
  function. Please check this function's description in the Reference
  Manual.

To get the 3D position of any Transform (or derived) node placed at
  the root of the Scene Tree (the nodes visible when the Scene Tree is
  completely collapsed), you can use the
  wb_supervisor_field_get_sf_vec3f() function. Here is an example.

A simulation example that shows both the GPS and the Supervisor
  techniques is included in the Webots installation, you just need to
  open this world: $WEBOTS_HOME/projects/samples/devices/worlds/gps.wbt.

IF in fact noise in the state estimate is the problem (bit IF), then
the way to compensate for such errors is to use an estimate of your state and error models. It's beyond the scope of the question, unfortunately. If you want to do obstacle avoidance AND you are certain that sensor error is the issue, I suggest you:

Check for obstacles in a wide band (a fat circle) which could represent your trajectory with a bit of error

Run a filter to get an estimate of robot position, then find the "likely" collisions

Only look for obstacles over a small window into the future.  In the short term, your state estimate should be fine.

However, these are heavy handed fixes for what is likely a small problem.


问:
Source to learn Kalman Fusion, explanatory code snippets
Currently I am reading a book of Mr. Thrun: Probabilistic Robotics. I find it really helpfull to understand concept of filters, however I would like to see some code in eg. Matlab. Is the book "Kalman Filter for Beginners: with MATLAB Examples" worth buying, or would you suggest some other source to learn the code snippets from?</p>

答:
The two links that I found most useful were Kalman Filter for Undergrads1
and Kalman Filter for Dummies. They're not high on the theory though. and Student Dave's Kalman Filter Tutorial. The last one has matlab code that you can play with and is easy to follow. </p>


答:
It's hard to see what's going on exactly, especially without seeing the code or knowing more about the sensor model. That's said, your trajectory is mostly straight and $w$ is thus mostly close to zero. This means that:

your center of rotation is far away during most of your experiment -- likely beyond the bounds of your graph;

you may have numerical stability issues due to a division by a very small number.

Title: Instantaneous Center of Rotation for a differential Drive Robot

Body:
I want to find the instantaneous center of rotation of a differential drive robot.

Assuming I know that the robot will travel with a particular linear and angular velocity $(v,w)$ I can use the equations (given at A Path Following a Circular Arc To a Point at a Specified Range and Bearing) which come out to be:

$$x_c = x_0 - |\frac{v}{w}| \cdot sin(\theta_0)$$
$$y_c = y_0 - |\frac{v}{w}| \cdot cos(\theta_0) $$

I'm using the webots simulator and I dumped gps points for the robot moving in a circle (constant v,w (1,1)) and instead of a single $x_c$ and $y_c$ I get a center point for every point. If I plot it out in matlab it does not look nice:

The red points in the image are the perceived centers, they just seem to trace the curve itself.

Is there some detail I am missing? I'm really really confused as to what's happening.

I'm trying to figure out the center so I can check whether an obstacle is on this circle or not and whether collision will occur.


问:
Working of Autonomous Lawn mower(ALM) in an unbounded area without a perimeter wire
I have an Autonomous Lawn mower(ALM) which can mow a certain lawn area when that area is bounded by a perimeter wire. Even when that perimeter wire is removed, it has to mow the above mentioned area accurately without slipping into a neighboring area.

Constraints and problems:

The ALM is an open loop system.

Differential GPS was tried, but it did not yield proper results.

Any iterative pattern of area coverage can be used provided the error in each iteration is not added cumulatively which can result in unpredictable error in the end.

I do not expect full fledged solution. But I need a starting point to understand motion planning particularly for unbounded robotics to solve this problem.

I searched on internet to know about the knowledge sources about motion planning but could not get good results. Can anyone guide me to know about such sources preferably books and articles on internet which can help me to solve this problem?

EDIT:
Addition of information:

The above picture shows the irregular lawn area which does not have any enclosures and perimeter
wire
1.The red mark shows the center point of lawn .

2.The grey area is the initial scaled down area which resembles in shape to the larger area .I could not draw the grey area which exactly resembles the larger green area .

3.The grey lines are the contours which from the tracks to be followed by the lawn mower

Idea description:

1.Using planimeter app for onetime , the shape and dimension of the lawn area (green area) can be known
Link:https://play.google.com/store/apps/details?id=com.vistechprojects.planimeter&hl=en

2.Center of polygon can be found by using the method in the following link
http://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon

3.Calculation of area of grey shape in the above figure .

4 . Grey shape is the least possible area which can be grazed by the ALM . Grey shape is similar to the green area shape and it is formed when Green area is scaled down

To determine the scale down factor which is a numerical value ‘ n’ (n<1)
Where Grey area = n * Green area

Once the Grey area is known , the number of contours or tracks to be grazed by ALM have to be determined manually .

The width of contour is equal to the distance between the blades on the either end i.e. the width which can be grazed by ALM in a single stroke .

Green area = Grey area + area of track 1 + area of track 2 + area of track3 + . . . . . . + area of track n

5.Once the lawn mower is switched on ,it should reach the center of the lawn (red mark showed in the above figure)

6.Then, ALM should graze the least possible area or grey area .

7.After that ALM should Switch to contour circumscribing the grey area . It should continue circumscribing in each track till all the tracks are completed( decision has to be made by validating against the calculated and preset value ' No.of tracks' in ALM)

In this way entire lawn can be mowed without the need of perimeter wire and also ALM would not mow the neighbor’s lawn

Challenges :

a. Enable ALM to reach the center point of the lawn

a. To make ALM mow the grey area accurately

b. To make the ALM switch from one track to track .

c. To bypass the obstacle in track and return to the same track .

When i mentioned this idea to my colleague ,he mentioned the about possible cumulative addition of error in each iteration resulting in an unpredictable error in the end .

I intend to minimize the error and fix the boundary as correct as possible.
In fact this deviation should be predictable before it can be corrected .

答:
So you want your robot to stay in a fixed area, without giving any sensor feedback? Don't move the robot...

More seriously, I don't see how you could get away with having no sensor feedback. You tagged your question as motion planning. Yes, you could find a coverage pattern which minimizes your dead reckoning error, e.g. by looking for the least amount of turns or shortest path. But if you want to use the system in the real world I don't see how this would ever result in the robot not going over your boundary.

Ah.. wait. Lets say you know your boundary and your starting position, the best I could think of here would be to go straight to your bounds and then move along the bounds at a distance of lets say three sigma of your position uncertainty. You would try to cover your area from the outside to the inside, and always keep a three sigma distance of your position uncertainty to the borders. At some point your uncertainty ellipse will not fit into the area anymore and you will have to stop. With a bit of luck, large parts of your area may have been covered. Not sure if its practical, since I would not expect lawn movers to have very good odometry.


问:
Is it possible to run a neural network on a microcontroller
Could you implement a simple neural network on a microprocessor such as the Arduino Uno to be used in machine learning?</p>

答:
Yes. If you only run it in feed-forward mode and do your training off-line somewhere else:

I programmed a 3-layer (5-5-2) feedforward ANN on an Arduino UNO.  It ran on a mobile robot.  Whenever the robot would hit something, it would re-train the network.  The feedforward portion of the net ran in real-time; while the back-propagation training took on the order of ~5 to 20 seconds.  I suppose you could trim the size of the network as well as the play with the parameters to make it run a bit faster, but if you plan on doing backpropagation on an Arduino, I think it would be too slow.

Some thoughts to speed things up include:

Use fixed vs floating point (for MCU's w/o an FPU)

Use an MCU that has a FPU

Use a simpler activation function (ie. $\tanh$) instead of Sigmoid

Have the training phase occur offline on a PC

Here's a quick write-up I did of the network.


答: Yes indeed, it's possible to embed neural network in microcontrollers. There are many such examples of this in the scientific literature but I can cite a striking example of what can be done with a very simple MCU if you're smart enough. In Evolutionary Bits'n'Spikes, the authors describe the implementation of a real time spiking neural network AND a genetic algorithm to train it, in order to control a differential wheel robot. The whole code runs in a tiny PIC16F628 4MHz MCU embedded on the 1-cubic-inch Alice robot.</p>

Title: Is it possible to run a neural network on a microcontroller

Body: Could you implement a simple neural network on a microprocessor such as the Arduino Uno to be used in machine learning?</p>