答:
This is quite a broad question.

Everything depend on if you want to involve hardware design as Matthew Gordon said already. Lets say you don't want to touch hardware design.

I, as well, will suppose you don't want to do control (like PID control) but more AI, in team work, K-means algorithm and so.

First of all, I honestly think that, you'll always have to know at least a bit how the hardware is working for it is just really useful to know that in the control process. You don't have to be an expert about it but know the limit and the possibility of the robot helps design the machine learning process. So you know what's possible and what isn't.

Apart from that if you have no robot at disposition already you should look at simulation software. Some like Stage or Gazebo are really good simulators. Gazebo implied a bit more of preparation to be run though.

Then you can just take an existing robot to do your simulation. An existing robot like PR2 or TurtleBot depending on your project would do the trick.

Now those robots run with ROS which is, as the name say, a Robot Operating System. The goal is to provide abstraction so if you design an AI in C++ or python you could just directly run it on those robots because all the controls are already done. Meaning if your program uses the standard type of message for moving the robot you just have to ask for things as simples as "go there" in your AI program.

Ros is definitely a good start if you want to team up with other people as well as it will give you conventions, rules and a lot of libraries already provided for your robot.

Title: Project Idea for a AI related project

Body: I am a Computer Science final year undergraduate student.Until now,I used to shirk away from robotics as I believed that it is more related to electrical and mechanical aspects.But my interest in robotics grew by seeing some demos and I seriously want to make a robot which involves AI by teaming up with interbranch students of college.So what is the best project I can pick up as a beginner in robotics and AI and some experience in Computer Science so I can apply AI Machine learning concepts so that it learns something.How to start something?</p>


问:
Preventing leaks in motor shafts for underwater bots
Whenever building an aquatic bot, we always have to take care to prevent leakages, for obvious reasons. Now, holes for wires can be made watertight easily--but what about motors? We can easily seal the casing in place (and fill in any holes in the casing), but the part where the axle meets the casing is still left unprotected.

Water leaking into the motor is still quite bad. I doubt there's any way to seal up this area properly, since any solid seal will not let the axle move, and any liquid seal (or something like grease) will rub off eventually.

I was thinking of putting a second casing around the motor, maybe with a custom rubber orifice for the shaft. Something like (forgive the bad drawing, not used to GIMP):

This would probably stop leakage, but would reduce the torque/rpm significantly via friction.

So, how does one prevent water from leaking into a motor without significantly affecting the motor's performance?

(To clarify, I don't want to buy a special underwater motor, I'd prefer a way to make my own motors watertight)

答:
I understand exactly what you are talking about. I am developing my own ROV that will have a track system and crawl on the sea floor. If I may suggest placing your motor in a high point in your ROV with the gear drive close to the bottom, you can install a pressurized air system that will allow air into the chamber as the ROV goes deeper. Think of it like a toilet bowl except it allows air in as the water level rises. I have thought about this same issue and this is what I have come up with.
Using a CO2 cartridge from an airgun and a home-made pressurizing valve (idea from toilet bowl) the deeper it goes, the more air compresses allowing water to enter into the chamber. With the valve installed, it introduces more air, keeping the water away from the electric motor.</p>

ContentLicense: CC BY-SA 3.0


问:
How much can realistically be drawn from a 25C max 50C battery?
I am using 8 brushless motors for an octocopter. Each motor can be run at maximum 30A. I use 4 batteries in parallel. How high C number is needed?

$$\frac{30*8}{4*2} = 30C$$

When running the motors at 100% load, it will draw 30C from each battery. Can a 25C with max 50C be used, or will it run hot?

Additionaly, how many ampere hours can be drawn from a 5000mAh battery before it's empty? Many 12V car batteries can only be drawn for 60% of their stated capacity before they need to be charged.

答:
Total current that can be drawn from a battery depends on discharge capacity (C) and ampere-hour (Ah) rating of a battery. Maximum continuous current that can be drawn from batter can be given as follows

Maximum Current (A) = discharge capacity (C) x  ampere-hour(Ah)

For example, in your case if you are using 5000mAh, 25C battery, then you can draw maximum  125A continuously.

Generally discharge capacity of battery is mentioned as continuous discharge and burst discharge. Continuous discharge rating can be used to calculate maximum allowed continuous current. Burst discharge rating can be used to calculate maximum burst current that an be handled by battery. Usually burst current is can be drawn for few seconds (less than 10 seconds).
For example, in your case if you are using 5000mAh, 25C-50C battery, they you can draw 125A continuous and 250A burst current.

So for application purpose, one should always use continuous discharge rating for calculations and keep in mind burst rating only as fail-safe.

If you are using batteries in parallel then make sure all have same discharge rating. Discharge rating and voltage of resultant battery will be same as individual battery and only Ah rating will add up. So in your case, resultant battery should be 9600mAh, 25C then only it will be able to supply 240A(8x30A) continuously. In case you are using 4 batteries in parallel then each battery should be at least 2400mAh.


问:
What is meant by a speed profile?
When researching robots, micro mouses etc I've often come across people taking about generating "speed profiles" and how to calculate them. Also profiles for acceleration , deceleration , turning etc. Also trapezoidal profile?

But I can't seem to find exactly what is meant by this. The how or why also.

So what is a "profile" in this sense and why you would need one?

答:
Think of a motion profile as a graph of speed vs. time.

If you drive your car down the road:

Your initial speed is zero.

You start pressing the accelerator pedal.

The car starts moving slowly.

You keep pressing down on the accelerator.

The car accelerates faster.

As you approach your targer speed you let go of the accelerator.

The car settles on your target speed.

You approach a stop sign and start pressing on the brake pedal.

Your speed goes down and as you approach the stop sign you start letting go of the brake pedal.

You come to a smooth stop.

I just described roughly what people would refer to as an S-curve motion profile or a limited jerk profile.  To experience jerk in your car try this next time you stop, press the brake pedal but do not let it go at all until the car comes to an absolute stop.  This also illustrates the importance of controlling the motion profile for smooth motion.  When graphed this looks something like this:

You can see the S in there.  A trapezoidal profile has straight lines and three sections and as per our car experiment above will force you to reduce your acceleration to avoid "jerking" at the "corners" (discontinuities).

You should also think about this in terms of the equivalent position vs. time graph.  A motion profile executed in a robot, e.g. is typically moving from one position to the other.

Motion profiles are critical for achieving smooth and reliable high performance motion.  With more than one motion axis they are also important for synchronizing the motion.  Without them your motion might look like your car firing off a rocket to get started and locking the wheels to stop at the end of the street, not very pretty.

Additional reading:

https://www.pmdcorp.com/resources/get/mathematics-of-motion-control-profiles-article

Title: What is meant by a speed profile?


问:
What do the commutation waveforms look like for a brushless motor?
I have seen waveforms for driving a brushless motor.

I guess this is the waveform used for the simpler block commutation. But if I want to do sinusoidal waveforms, what does the PWM signal look like now? Is there a need to carefully synchronise the edges on the three phases?

答:
There is a fair deal of literature on the implementation of brushless motor control but here is an overview.

To understand the differences between commutation waveforms it is important to understand how brushless motors operate.

A three phase (two pole) motor will have three coils around a single magnet in the center.  The goal is to energize the coils in sequence so that the shaft of the motor (and its magnet) rotates.

There are two magnetic fields that are important here, the field of the rotor (rotating magnet) and the field of the stator (static coils):

We refer to the direction of the magnetic field as its "flux vector" because it sounds super cool.  The most important thing to learn from this image is that you want the two magnetic fields to be at right angles to each other.  This maximizes efficiency and torque.

The dumbest commutation scheme is trapezoidal.  Using either hall sensors or back EMF from the motor, it is possible to determine if the motor is in one of a discrete number of positions and perform on/off control on one or two coils to lead the magnetic field around the motor:

Because there might only be six separate orientations for the stator field, the flux vector of the motor could be anywhere from 60-120 degrees (instead of the desired 90) and therefore you get torque ripple and poor efficiency.

An obvious solution here is to switch to sinusoidal commutation and just smooth out the waveform:

If you know the exact orientation of the rotor you can just do some trig to calculate the exact PWM duty cycle to apply to each coil in order to keep the flux vector at 90 degrees and bam you have a beautiful 90 degree flux vector.  (The rotor orientation can be determined via encoder, interpolation or more advanced estimation such as a kalman filter).

So right now you might be wondering how you can do better than sinusoidal commutation.  The key flaw of sinusoidal commutation is that the outputs are sent straight to PWM.  Because of coil inductance, the current (and therefore flux vector) will lag behind the commanded values and as the motor approaches its top speed the flux vector will be at 80 or 70 degrees instead of 90.

This is why sinusoidal commutation has poor high speed performance.

This finally brings us to flux-vector control which is a name given to (often proprietary) control algorithms that attempt to ensure the magnetic flux stays at 90 degrees even at high speeds.  The simplest way to do this would be to lead the field by, for example, 90-120 degrees depending on how fast you are going, knowing that the actual magnetic flux will lag.

More robust solutions involve PID/feedforward to accurately control the current going through each phase.  Every servo manufacturer has their own in-house algorithm so I am sure there is some pretty complicated stuff at the bleeding edge.

To put it in simplest terms, flux vector control is sinusoidal control of the current going to each phase (instead of just the PWM duty cycle).

The line between sinusoidal/flux vector is pretty vague since some companies perform advanced control on their "sinusoidal" drives (which essentially makes them flux vector).  Also, since you can technically call almost anything flux vector control the quality of implementations can vary.


问:
DC motor with encoder
Can anyone help me out here with this DC motor, especially the encoder part? I tried searching around for its datasheet but its as short as 1 page and the only spec I get are:

Encoder:
1 pulse/revolution

It has 2 connection on the bottom, and I guess they are for driving the motor, but they say nothing about the 3 connections wires below.

答:
Yes, Crouzet's 82860502 documentation doesn't seem to be very helpful.

According to this post on their forum, the wiring is as follows:

Brown wire: + VDC encoder supply

Yellow wire: encoder output signal

Blue wire: encoder ground

Title: DC motor with encoder


问:
What is the response time of an Arduino Nano?
I want to make a circuit that powers a transistor when a sound above a set threshold is reached. (Trigger a flash for high speed photography.)

How long will the response time be?

答:
Why would you use an Arduino plus a circuit when you can just use the circuit by itself?  Here are some example circuits:

http://www.doc-diy.net/photo/sound_trigger/

http://hiviz.com/tools/triggers/triggers2.htm

http://forums.popphoto.com/showthread.php?346908-How-to-Build-a-simple-Sound-Trigger

http://www.instructables.com/id/Sound-Activated-Camera-Trigger-For-High-Speed-Phot/

http://www.diyphotography.net/universal_sound_and_optical_slave_flash_trigger/


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

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

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

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

答: With an Arduino, you are guaranteed to have dedicated processing power for your balancing application.  That said, the calculations for PID control are not terribly complicated and I would be very surprised to hear that a Raspberry Pi could not keep up with 20 calculations per second, even under load.  </p>

Title: Raspberry Pi for two wheel robot?


答:
If you're using a microcontroller (Arduino-type) with a loop, you can expect a response time of microseconds or less. If you're using a more advanced controller (Raspberry PI or BeagleBone Black), the latency will be less predictable, but very fast. The reason for less predictable latency is multitasking on the systems running Linux, while the Arduino isn't running anything that will interfere.

Given that you plan to use sound as a signal, there will be physical factors that create greater variation in reaction speed; wind direction comes to mind as a significant source of latency.

Of course, if you're trying to trigger it by the camera click sound, I guess you could do quite well with a simple arduino.

Title: What is the response time of an Arduino Nano?

Body:
I want to make a circuit that powers a transistor when a sound above a set threshold is reached. (Trigger a flash for high speed photography.)

How long will the response time be?


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

答:
This is a sweeping generalization that I'd be very cautious about. Engineering is about tradeoffs. But there are two things that I'd be comfortable generalizing, from my own personal biases.

I'm 99% serious when I say robots become more effective as the amount of money you are willing to invest becomes higher. This is because you can eventually custom-make all components and algorithms, and get the best possible solution for your job. But this significantly increases the engineering time ...

Second, I'd say increases in power storage translate directly to increasing capabilities for autonomous, mobile robots. The power is almost always the bottleneck for long-term autonomy. (notice: My lab works on long term-autonomy from a power-efficiency standpoint, so I'm biased).

That's about all. Other than that, the size of the robot is dependent on the task it is required to do. A larger robot is awful for invasive surgery, and a smaller robot is a terrible long-range terrestrial rover: It'd get stuck on the first tree root. Consider this: What's the best size for a flying robot?

Answer: The size that allows the perfect tradeoff of fuel capacity, lift capacity, processing power, speed, stability, and all other factors, subject to the task, cost, material, policy, and time constraints imposed.


问:
Robotics with Kinect
I want to learn robotics and really interested in making a robot based on Kinect sensor.

I see so many projects like this one, and just wondering how it works on top level. I downloaded Kinect SDK and did some basic tutorials, but I just don't think that Microsoft SDK is the library to use for real robotics projects. Any suggestions where to start and what library to use? Any good books in particular or online resources?

答:
Excellent answer by George. If I may, I'd like add more details and suggestions. (I would recommend googling terms that are new to you).

Your entire robot (input) configuration depends on what kind of data your code is going to process. If it's more vision oriented, the data can be depth maps, point clouds, rgb images  or a combination of the 3. This means you can use something like the Kinect (which would require a more powerful processor that the arduino), or simple rgb cameras (for which something like the arducam+arduino is sufficient). Arduino can run simple computer vision programs, but nothing too heavy and processor intensive. Also, if I'm not wrong, Arduino cannot process and use its GPIO pins at the same time. Which means during an intensive processing task, your robot motors are basically off.

In my experience, if you're planning to use point cloud stream, it would require a dedicated graphics hardware (like a GPU chip that's present on the Raspberry Pi or pcduino). (Hell, even my laptop cannot run the point cloud stream openni drivers without a dedicated graphics card)

Depth maps can be easily processed without a GPU, but it still requires high processing capabilities which would render the Arduino micro'controller' pretty useless. In this case you'd require a microprocessor board viz. Beagleboard, pcduino, gumstix, Raspi, Arduino TRE (not released yet), to name a few.

In terms of the output, the way to control your robot's mobility is to send power to the dc motors, servos, or stepper motors of your robot. This requires writing programs similar to what one would write on the microcontroller like an arduino.

If you require microprocessors, in my opinion (although I've never used it before), the pcduino V2 has it all: First of all, it's relatively cheap (~$70 + some cables etc). Raspi is cheaper, but not as powerful.
Pcduino has 1Ghz A10 processor, expandable upto 32GB SD slot, a GPU chip (OpenGL ES2.0) which means you can program CV applications and integrate webcams, or maybe even a Kinect. It also has wifi arduino headers, HDMI and usb outputs for easily connecting to monitors for programming etc.
But the thing I love about pcduino is that it has arduino headers. Which means you can attach something like the ADAfruit motor shield (normally used with arduino to effectively control a bunch of motors) on top of the pcduino board and send motor signals to control your robot.

Hope this helps

Title: Robotics with Kinect


问:
Can a rigid-prop quadcopter hover upside-down?
Most small quadcopters use rigid rotors with some fixed pitch.
In principle, I can imagine it might be possible for such a rigid-prop quadcopter to hover upside-down,
but that apparently requires reversing the direction of rotation of all 4 motors.

(This is very different from the way some "standard" single-rotor model helicopters can hover upside-down by continuing to spin that rotor in "the same direction", but moving the swash plate to give negative blade pitch).

Is it possible for a rigid-prop quadcopter to hover upside-down?

When I build a quadcopter so it can switch from flying upright to flying upside-down and back again in mid-flight, what do I do differently than a normal quadcopter designed to always fly right-side-up?

(Related: "Can you run a BLDC motor backwards without damage?" )

答: You can run a brushless DC motors backwards using a H-bridge. Basically you'll need to program your microcontroller/microprocessor onboard to flip the polarity of 2 of the wires of the bldc (a bldc has 3 wires, switching any 2 wires will reverse the spin)</p>


答:
Besides referring to the previously-mentioned 82860502 pdf file, see pages 30 and 31 of Steven Engineering's 44MICRO-MOTORS.pdf file, where the following diagram appears and shows the usage of the brown, yellow, and blue wires.

Attach a V+ voltage (for example, 5VDC) to the brown wire and connect the blue wire to ground.  As the motor rotates, the yellow wire will alternately be pulled up to V+ through a 10K resistor, and to ground via an NPN transistor.

Title: DC motor with encoder

Body:
Can anyone help me out here with this DC motor, especially the encoder part? I tried searching around for its datasheet but its as short as 1 page and the only spec I get are:

Encoder:
1 pulse/revolution

It has 2 connection on the bottom, and I guess they are for driving the motor, but they say nothing about the 3 connections wires below.


问:
A few questions about my first quadcopter build
I'm planning to order parts for my first quadcopter build and I had a few questions. Here is my parts list. I'm crossing my fingers that they are all compatible, and I'm pretty sure they are. I have two questions:

Do I need a Power Distribution Board and if so, what does it do?

Where on my flight controller do I attach my radio receiver?

答:
Since your frame is about (530g + other parts' weight), you need to make sure that your 4 motors give you a combined thrust of at least 100 g more than, just to get off the ground and maneuver. Anything greater than that is good. (Thrust Calculator).

You battery amps * burst C / constant C should be greater than the motor amp pull * 4.

Propellers look OK. Make sure their inner diameter matches motor shaft diameter, else buy adapters.

Motor controller board is also good.

Your radio receiver output should control the ALE, THR, ELE, RUD (Aileron, Thrust, Elevation, Rudder). Which means the radio receiver output (the CHx output pins) should be the input (the 4 above) of the controller board.


问:
Quadrocopter build - Do these parts look fine?
I am completely brand new to quadrocopter building. I am currently about to start building a Quad. I have done a little bit of research and was thinking of buying the following parts:

KK2.1 Hobbyking Flight Controller

Turnigy H.A.L Quadcopter Frame

4 x NTM Prop Drive    35-30 1100kv / 380w

Turnigy 9X 9CH

Turnigy Plush 40A ESC

Slow Fly Prop Left

Slow Fly Prop Right

Quad Power Dist Board

Turnigy 5Ah 3S25C LiPo

What do you think of these parts/Do you have any complete builds with instructions that you would recommend instead?

Thanks

答:
Since your frame is about (220g + other parts' weight), you need to make sure that your 4 motors give you a combined thrust of atleast 100 g more than, just to get off the ground and maneuver. Anything greater than that is good. (Thurst Calculator). Just looking at the numbers, I think it should work out fine.

You battery amps * burst C / constant C should be greater than the motor amp pull * 4 (using same units, mAh or Ah).

Your ESC amp rating should be higher than the Max current pull of a motor (which it looks to be).

Propellers look OK. Make sure their inner diameter matches motor shaft diameter, else buy adapters.

Rest all looks good to me.


问:
What is a suitable model for four-wheeled differential drive rigid-body robots?
I found a model for 2-wheeled robots here:

What is a suitable model for two-wheeled robots?

How should I adapt it to a 4-wheeled setting?

答:
The easiest way to built a 4 wheeled robot with motors to all 4 wheels is to buy a Rock crawler off of the internet, and to remove it's body and Radio receiver.

Then connect it's motors' and steering motor's wires to the output of a microcontroller and you have your 4WD robot, with the differential n steering system with suspensions n all.

If you are building a differential drive robot, best way is to give power to 2 diagonally opposite wheels and keep other 2 wheels freely rotating. This means your robot's platform should be circular


问:
Could piezoelectric sensors be crushed?
I have found some load sensors (piezoelectric) that measure relatively small weights (on the order of ~ grams). That's what I need!

However...
Around my robot, there will occasionally be bursts of extremely high pressure. These bursts do not need to be measured... they just wash over.
The pressure appears, to the sensor, to be a ~ 2,000+ kg

Question:
Are these sensors likely to break or fatigue? I realize piezos do not measure via deformation, but still... that's a big load!

Maybe I should just order a few and try...

答:
This really depends on the sensor. There are sensors which are protected for heigher loads. Usually around 300%-1500% of the rated load for sensors in gram range.

Most manufacturers say, connect the sensor when you are installing it so you can monitor it live so you won't break it.

I'd recommend to check the datasheet of your sensor. This should specify overload. I'd also think of something to prevent your sensor from such high loads.

Title: Could piezoelectric sensors be crushed?


答:
Aside from the square-cube law for measuring the strength of the bot mentioned by user65, you have a few more effects. I don't know of any theorem for this, though.

Firstly, note that "bigger batteries" doesn't mean "bigger motors". And "bigger motors" doesn't mean "stronger motors" or "more powerful motors". If we're talking about the same type of battery, then we can say that a bigger battery is generally more powerful{*}.

One thing the weight of the bot changes a lot is the friction. See, with a heavy bot, friction increases proportionately. This means we need proportionally stronger motor to be able to climb inclines (otherwise the bot just gets stuck, or starts rolling down). The friction doesn't really make a difference while moving on a flat surface, though. This is an easy principle to put down on paper--for a given weight increase, we need a proportional increase in torque. To obtain that, we may either use a motorwith a proportionately lower rpm (but that reduces the speed), or use a proportionately more powerful battery.  So in the end, this evens out nicely, since the power of a battery depends upon its size, keeping the type fixed. When the bot is moving on a flat surface, its inertia needs to be counteracted whenever one wants to turn. For this, we need high friction (which we already have), and a proportionately stronger motor. Again, this evens out nicely, So really, we should look at the power requirements of the other components and choose size/power, and the motors will take care of themselves (I don't mean you neglect the motors entirely, I'm just saying that the motor issue is easily straightened out after the bot size has been decided.

Another thing a larger size gives you is more capacity to store energy. You can always stuff some extra Li-Po's on a large (autonomous or RC) bot , and increase its lifetime.

Due to all this, it's really saner to just say that the size/weight of the bot has no direct relation to its effectiveness. It really depends on what the bot is supposed to do.  There are just too many other factors to decide--you need to know what strength you want, what power auxiliary mechanisms need, if the auxiliary mechanisms need couterbalancing, the maximum angle incline the bot is subject to, required stability, required response time, lifetime, etc. Choosing a size/weight requires one take all these factors into account while designing the bot. Some bots are better designed small, some bots are better designed large. No formula to it :)

*On the other hand, one can replace a Pb-acid battery with a bunch of Li-Po batteries of the same net weight and size, and get a much powerful "battery".

Title: Effectiveness of a Mobile Robot In Relation To Mass

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


问:
Kalman Filter when states are not observable at the same time?
I have a system that I can make a strong kinematic model for, but my sensors send readings at unpredictable times. When I say unpredictable, I am not just saying the order the readings will arrive, I also mean that sensors are able to sleep when they do not see a significant change. When an input arrives for any given sensor, that information can be used to infer the states of many other sensors based on my model.

At first, it seemed like a Kalman Filter was exactly what I needed because I could make a prediction of all of the states of the system and then update those states when one piece of information comes in and repeat this process until a good estimate of the system as a whole was determined. However, after reading over Kalman filters, it looks like they assume that every state will be updated on a regular basis. Is there a way the Kalman filter can be modified for when you are unsure about what input will come in next and you are also unsure how much time will elasped before the next input arrives? Please note that in my case, once the information arrives, I will know the source of the input as well as the time that has elapsed since the last update, I just won't be able to predict these two things beforehand.

答:
First, be careful when using the term "observable" with respect to Kalman filters. It has a precise mathematical meaning that basically determines whether or not the filter is even possible.

With respect to your question, you need to select a subset of the observation and measurement noise covariance matrices depending on which measurements are available. Assume you have the system
$$
\begin{align}
x_{t+1} &= A_t x_t + B_t u_t + G_t w_t
\\
y_t &= C_t x_t  + v_t
\end{align}
$$
where $w$ and $v$, with covariance $W$ and $V$, are the dynamic and measurement noises respectively.

Now partition your measurements as
$$
\begin{align}
y = \begin{bmatrix} y_1 \\ y_2\end{bmatrix},\quad
C = \begin{bmatrix} C_{11} & C_{12} \\ C_{21} & C_{22} \end{bmatrix},\quad
V = \begin{bmatrix} V_{11} & V_{12} \\ V_{21} & V_{22} \end{bmatrix}
\end{align}
$$

If you only have measurement 1 available, you would use the observation equation
$$
\begin{align}
y_1 &= C_{11} x + v_1
\end{align}
$$
and apply the Kalman filter measurement update accordingly.

The difference in time between measurements is not a problem since you can just keep running the time update equation ($x_{t+1} = \dots$) until you get a measurement. i.e. You might run the time update equation 5 times before running a single measurement update.


问:
Kinect point cloud + Pcduino. Will it work?
I'm a newbie to Mircroprocessors (PcDuino, for example) and I wanted to know if Kinect can be integrated with the pcduino, before I go and buy the board. I know in terms of connectors etc what might be required. My concern is regarding the hardware required to run the Kinect.

To elaborate more, I'll explain my current system: I have a system working on my laptop that uses a Kinect to extract unorganized point cloud data using "Processing" IDE which interacts with Kinect using openni drivers. My Matlab code then processes this information to detect obstacles and specific objects (can also be done using C++).

I want to build such a system for a robot, but using pcduino as the processing module. This means that the Kinect will connect to the pcduino using one of its usb ports. I'll power the Kinect using battery and a converted power adapter. Since pcduino can run Linux (Ubuntu) I (think I) can easily convert my laptop code into whatever the Ubuntu requires. The only concern I have is if there were any problems associated with using depth sensors with mini pc boards in terms of hardware capabilities of mini pc boards? I know that mini pc boards are not as fast as a PC, so the processing would be slower, but I'm not concerned with the speed, atleast for the time being.

One problem I encountered while using kinect, even on a PC is that the point cloud drivers in openni won't initiate the point cloud data stream, unless there was a GPU in the PC; the exact same code runs perfectly on a PC with a dedicated GPU. However, I do know that pcduino has a GPU chip (OpenGl ES2.0). Would the kinect work on this?

I searched online but the closest thing I could find is this which does not elaborate how the integration of Raspi and Asus Xtion works. I'm not too picky about the boards, anything that would work with a kinect is fine with me, although I like the pcduino since it has arduino headers and built in wi-fi etc.

Any additional pointers can also be helpful. Please let me know if I need to elaborate on anything more.

Thanks in advance

答:
I have used ROS and Ubuntu with a Kinect on many platforms and it has yet to let me down. I used it on a Pentium laptop without dedicated GPU as well as on powerfull desktops.

If the board has a USB port (which it does) and it can run Ubuntu, I don't see that there would be any problems with this setup.

I have also used MatLab on Windows and it is much easier to work with than ROS. Be prepared to do some debugging before it gets working correctly. If you don't have to, good for you!


问:
Wine yard robotics?
My friend has acquired a (small) wine yard to discover how much work it is tending and harvesting the grapes.

Now we are musing to enlist robotic help. The vine stocks are usually connected by a stiff wire, so some dangling machine might be feasible.

We are looking for references/inspirations for an agricultural robotic vine assistant. Any ideas?

答: You might want to check out this grape vine pruning robot: https://www.youtube.com/watch?v=9GaGO9LIDEA.</p>

Title: Wine yard robotics?


问:
Removing quadcopter drift to the side
I wrote my own quadcopter firmware which is based on some older code. This code shall stabilize the copter to be always in equilibrium. The model is behaving relatively nice. I can control it with my laptop.
However I noticed, that the copter is hovering to the side (if not manually controlled), likely because of wind, not well balanced or turbulence.

My idea was maybe to fuse GPS and accelerometer data to implement a function which shall help to hold the position. But this will likely only work if I have a hold altitude function, because changes in pitch or roll change the height, because the thrust is changed slightly. This is why I recently added a routine which shall allow to hold the altitude.

Is someone having experiences with this? I mean with avoiding side drifts of the model because of whatever by software? The problem is in my opinion, that I don't know whether the position change is wanted (by remote control) or not. Additionally it is hard to localize the correct position and calculate the distance caused by drift from it (just with GPS, but this is not precise).

```<code>void hold_altitude(int_fast16_t &iFL, int_fast16_t &iBL, int_fast16_t &iFR, int_fast16_t &iBR,
                   const int_fast32_t rcalt_m)
{
  // Enhance the performance:
  // This function is only needed for (semi-)autonomous flight mode like:
  // * Hold altitude
  // * GPS auto-navigation
  if(_RECVR.m_Waypoint.m_eMode == GPSPosition::NOTHING_F) {
    return;
  }

  // Return estimated altitude by GPS and barometer
  float fCurAlti_cm       = _HAL_BOARD.get_alti_m() * 100.f;
  // Estimate current climb rate
  float fBaroClimb_cms    = _HAL_BOARD.get_baro().climb_rate_ms * 100;
  float fAcclClimb_cms    = _HAL_BOARD.get_accel_ms().z * 100;
  // calculate the
  float fAltStabOut      = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid(fCurAlti_cm - (float)(rcalt_m*100), 1);
  float fBarAcclOut      = _HAL_BOARD.m_rgPIDS[PID_THR_ACCL].get_pid(fAltStabOut - fBaroClimb_cms, 1);
  float fAccAcclOut      = _HAL_BOARD.m_rgPIDS[PID_THR_ACCL].get_pid(fAltStabOut - fAcclClimb_cms, 1);
  int_fast16_t iAltOutput = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltStabOut - (fBarAcclOut + fAccAcclOut), 1);
  // Modify the speed of the motors
  iFL += iAltOutput;
  iBL += iAltOutput;
  iFR += iAltOutput;
  iBR += iAltOutput;
}
</code>```

Copter control:

```<code>// Stabilise PIDS
float pit_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_PIT_STAB].get_pid((float)rcpit - vAtti.x, 1), -250, 250);
float rol_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_ROL_STAB].get_pid((float)rcrol - vAtti.y, 1), -250, 250);
float yaw_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_YAW_STAB].get_pid(wrap180_f(targ_yaw - vAtti.z), 1), -360, 360);

// is pilot asking for yaw change - if so feed directly to rate pid (overwriting yaw stab output)
if(abs(rcyaw ) > 5.f) {
  yaw_stab_output = rcyaw;
  targ_yaw = vAtti.z; // remember this yaw for when pilot stops
}

// rate PIDS
int_fast16_t pit_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_PIT_RATE].get_pid(pit_stab_output - vGyro.x, 1), -500, 500);
int_fast16_t rol_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_ROL_RATE].get_pid(rol_stab_output - vGyro.y, 1), -500, 500);
int_fast16_t yaw_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_YAW_RATE].get_pid(yaw_stab_output - vGyro.z, 1), -500, 500);

int_fast16_t iFL = rcthr + rol_output + pit_output - yaw_output;
int_fast16_t iBL = rcthr + rol_output - pit_output + yaw_output;
int_fast16_t iFR = rcthr - rol_output + pit_output + yaw_output;
int_fast16_t iBR = rcthr - rol_output - pit_output - yaw_output;
// Hold the altitude
hold_altitude(iFL, iBL, iFR, iBR, rcalt);

hal.rcout->write(MOTOR_FL, iFL);
hal.rcout->write(MOTOR_BL, iBL);
hal.rcout->write(MOTOR_FR, iFR);
hal.rcout->write(MOTOR_BR, iBR);
</code>```

答: Do you have Gyros (roll pitch and yaw) installed? I would recommend those, since they give stability feedback to your code. If possible, you can even add a control board (from Hobbyking, kkV2). This board has 3 gyros, inputs to ale, rud, thr, ele. But the best thing is, it has gain adjusters for all 3 gyros, which means you can adjust them till your quad is stable (they adjust the power given to motors to keep the quad flat)</p>

Title: Removing quadcopter drift to the side


问:
MCBL Controller through RS232
I'm trying to use the MCBL Controller by Faulhaber to control my motor. I'm trying to program some sort of driver on linux using the serial connection and libserial. But it does not seem to be working for now.

I'm using the usb to RS232 converter like this one:

I'm wondering if it's well supported by libserial. I've read that yes but does anyone have any experience with it?

答:
Answering myself.

Yes it works flawlessly, you just need to take care of the different parameters for the connection. Especially the flow control one needed to be set at none.

Then just send the command using a std::string and the "<<" operator.

Title: MCBL Controller through RS232


答:
The drift is being caused either by your position data being consistently wrong, or by your roll/pitch PIDs not correcting the drift error with their integral term.

In any case, it is the integral term of a PID that (when working properly) prevents drift.

Title: Removing quadcopter drift to the side

Body:
I wrote my own quadcopter firmware which is based on some older code. This code shall stabilize the copter to be always in equilibrium. The model is behaving relatively nice. I can control it with my laptop.
However I noticed, that the copter is hovering to the side (if not manually controlled), likely because of wind, not well balanced or turbulence.

My idea was maybe to fuse GPS and accelerometer data to implement a function which shall help to hold the position. But this will likely only work if I have a hold altitude function, because changes in pitch or roll change the height, because the thrust is changed slightly. This is why I recently added a routine which shall allow to hold the altitude.

Is someone having experiences with this? I mean with avoiding side drifts of the model because of whatever by software? The problem is in my opinion, that I don't know whether the position change is wanted (by remote control) or not. Additionally it is hard to localize the correct position and calculate the distance caused by drift from it (just with GPS, but this is not precise).

```<code>void hold_altitude(int_fast16_t &iFL, int_fast16_t &iBL, int_fast16_t &iFR, int_fast16_t &iBR,
                   const int_fast32_t rcalt_m)
{
  // Enhance the performance:
  // This function is only needed for (semi-)autonomous flight mode like:
  // * Hold altitude
  // * GPS auto-navigation
  if(_RECVR.m_Waypoint.m_eMode == GPSPosition::NOTHING_F) {
    return;
  }

  // Return estimated altitude by GPS and barometer
  float fCurAlti_cm       = _HAL_BOARD.get_alti_m() * 100.f;
  // Estimate current climb rate
  float fBaroClimb_cms    = _HAL_BOARD.get_baro().climb_rate_ms * 100;
  float fAcclClimb_cms    = _HAL_BOARD.get_accel_ms().z * 100;
  // calculate the
  float fAltStabOut      = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid(fCurAlti_cm - (float)(rcalt_m*100), 1);
  float fBarAcclOut      = _HAL_BOARD.m_rgPIDS[PID_THR_ACCL].get_pid(fAltStabOut - fBaroClimb_cms, 1);
  float fAccAcclOut      = _HAL_BOARD.m_rgPIDS[PID_THR_ACCL].get_pid(fAltStabOut - fAcclClimb_cms, 1);
  int_fast16_t iAltOutput = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltStabOut - (fBarAcclOut + fAccAcclOut), 1);
  // Modify the speed of the motors
  iFL += iAltOutput;
  iBL += iAltOutput;
  iFR += iAltOutput;
  iBR += iAltOutput;
}
</code>```

Copter control:

```<code>// Stabilise PIDS
float pit_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_PIT_STAB].get_pid((float)rcpit - vAtti.x, 1), -250, 250);
float rol_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_ROL_STAB].get_pid((float)rcrol - vAtti.y, 1), -250, 250);
float yaw_stab_output = constrain_float(_HAL_BOARD.m_rgPIDS[PID_YAW_STAB].get_pid(wrap180_f(targ_yaw - vAtti.z), 1), -360, 360);

// is pilot asking for yaw change - if so feed directly to rate pid (overwriting yaw stab output)
if(abs(rcyaw ) > 5.f) {
  yaw_stab_output = rcyaw;
  targ_yaw = vAtti.z; // remember this yaw for when pilot stops
}

// rate PIDS
int_fast16_t pit_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_PIT_RATE].get_pid(pit_stab_output - vGyro.x, 1), -500, 500);
int_fast16_t rol_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_ROL_RATE].get_pid(rol_stab_output - vGyro.y, 1), -500, 500);
int_fast16_t yaw_output = (int_fast16_t)constrain_float(_HAL_BOARD.m_rgPIDS[PID_YAW_RATE].get_pid(yaw_stab_output - vGyro.z, 1), -500, 500);

int_fast16_t iFL = rcthr + rol_output + pit_output - yaw_output;
int_fast16_t iBL = rcthr + rol_output - pit_output + yaw_output;
int_fast16_t iFR = rcthr - rol_output + pit_output + yaw_output;
int_fast16_t iBR = rcthr - rol_output - pit_output - yaw_output;
// Hold the altitude
hold_altitude(iFL, iBL, iFR, iBR, rcalt);

hal.rcout->write(MOTOR_FL, iFL);
hal.rcout->write(MOTOR_BL, iBL);
hal.rcout->write(MOTOR_FR, iFR);
hal.rcout->write(MOTOR_BR, iBR);
</code>```


问:
What's the most effective type of rechargeable battery when taking into account size / weight / Ah?
I'm looking to build an underwater glider robot that will need to remain autonomous for long periods of time, perhaps even months. Power draw should be minimal, and I'm thinking of including some form of charging device (such as a solar charger) however I'd also like the battery capacity to be large enough so I don't hugely need to worry about this. Large current draw isn't really needed, but the battery does need to hold its charge effectively for long periods of time. Considering this is an underwater vehicle, weight and size are also a concern.

Cost isn't too much of an issue, as long as it's within reason of a hobbyist project.

I am looking to understand the pros and cons of each technology (Lead acid, LiPo, NiCad, fuel cell?), so I can decide what type of battery would be best suited to my purpose. As such, I'm looking at battery technology rather than looking for a specific shopping recommendation.

答:
When taking into account size / weight / Ah,
fuel cells and micro power turbines have an energy per kilogram and (with liquid fuels) an energy per liter that is an order of magnitude better than any battery.

In particular, I keep hearing that liquid methanol fuel cells are "relatively practical".
a b c d e.
And I've heard that Hyuk Kim and Seungdoo Park built a prototype diesel fuel cell.

Prototype microturbines also show promise.a b

Alas, fuel cells and micro power turbines (as well as some high-energy density batteries such as zinc-air) are not really designed for underwater vehicles -- they are designed to breathe air.


问:
Passive ego-motion estimation vs active
I am doing research of ego-motion estimation and positioning in 6DoF space. And I found that apparently all systems are based on active RGB-D sensors, like Kinect. I understand, that such sensors provide greater accuracy, and requires less computational resources.

But if such systems will be used, for example, for augmented reality or robot navigation, how they are going to solve the problem of the interference of signals from different systems, operating in the same space? If many people will wear AR glasses with active sensors - they will interfere with each other, aren't they?

Are there big commercial projects, that use passive visual odometry with multiple camera units and IMU sensors? I found some good papers on this topic, but I have not found commercial application of such technology. I am going to make research of passive odometry method for AR, but is it actually a problem with active depth sensors, that i described earlier?

UPD:
The main question:

Is passive odometry, based on video flow analysis and IMU, worth to make deep research in this topic, or active sensors - is our future, and the signal mix is not a big deal, and passive odometry is a dead end of such kind of technology? Because it will be not very useful to make research in useless technology...

答:
Odometry based only on passive sensors is a thoroughly researched topic.  You will find topics such as optic-flow, visual odometry, visual SLAM (VSLAM), structure from motion, stereo vision, etc.  This is certainly one path forward many people are going based on the cheap availability of cameras.

However, with the introduction of the Kinect and other cheap RGB-D sensors, many people are switching to this route.  Yes, they provide much more information and can simplify many problems.  I don't think i have heard of issues of interference between them.  However, it might be because they are mounted so that their field of views don't overlap.

Title: Passive ego-motion estimation vs active


问:
Where to ask NXP LPC1343 / ARM Cortex M3 related questions
I am a beginner to robotics and embedded systems. Consequently I have a lot of questions related to the toolchain and how things are going together like how to debug or how to connect a bluetooth module.

I already tried https://electronics.stackexchange.com/ and it did not work out for me.

Any ideas where I can get help with my LPC1343 related questions?

答:
I feel that people who say "this is off-topic" should tell you about some other place where that is on-topic.

I see that you and I are not the only people who think the electronics stackexchange is a good place to ask questions about the NXP LPC1343 and other ARM Cortex M3 processors.

The Arduino Due uses a ARM Cortex-M3 CPU -- perhaps the Arduino Forum or the Arduino Stackexchange or the Arduino Playground might be a good place to ask about setting up a toolchain and debugger for the M3 and other things that are not hyper-specific to the LPC1343.

the GCC ARM Improvement Project might be a good place to ask about setting up a toolchain and debugger that is not specificic to the M3.

The lpc13xx Microprocessor Forum may be a good place to ask about things that are specific to the LPC13xx series (including the LPC1343).

The LPCXpresso now uses the LPC1347 chip -- perhaps you might pick up some good tips at the LPCXpresso Forum

Perhaps you might pick up some good tips in the "Getting started with the LPC-P1343" document.

I hear the Dangerous Prototypes forum sometimes discusses the LPC1343.

Good luck.


问:
How to decide about the length of a robotic arm, the base of it and the torque?
I am designing  a remote controlled robot which will have a base with three wheels, two of them will be simple wheels at the back of the base and the third will be a ball wheel at the front. It will have a robotic arm which will have a gripper to hold objects up to 1kg. I have designed the arm like this

What I want to ask is how to calculate the length of the arm, the base of the  robot, the torque and also which motor to use. Please suggest to me if there is a better solution for designing the robot.I am a robot enthusiast and I am designing a robot for the first time.

答:
Every motor has a torque described in kgcm units. 1 kgcm means that the motor can lift 1kg weight on a distance of 1cm from the axis of rotation, or 0.5kg at the distance of 2cm and so on. Using that knowledge and the fact that you are lifting 1kg we can say that arm's length * 1kg must be less than the maximal torque of the motor. The stronger the motor - the longer the arm can be. How strong motor you'll use depends on how much money you'll spend and what length you need for your design.

As for the base of the robot, you need to measure where the center of the mass of the robot will be when the robot is holding the object and make sure that it is somewhere between the two red lines on the image (that is, between the wheels). If the center of mass goes outside of these boundaries, your robot will flip over. If your robot is accelerating, then not only the gravity can flip it but also the force due to acceleration (F=m*a). To check if your robot will flip, add the vectors of gravity force and force due to acceleration, position the beginning of the vector at the center of the mass and check if the vector passes between the wheels. If it doesn't, the robot will flip over.
You can make sure that doesn't happen by keeping your center of mass low (that is, keeping your base heavy), keeping the wheels as separated as possible and not having a too long arm.

I hope this helped you as your question is a bit vague.

Regards.


问:
Altitude hold for quadcopter with Accelerometer and Barometer
I wonder currently how to implement an altitude control for a quadcopter. I have atm just a barometer/GPS and an accelerometer.

Barometer and GPS are relatively straight forward implemented, but not very precise and slow. For the accelerometer readout, I remove the constant 9.81 m/s² acceleration by a low pass filter. Then I take this data and calculate out of it the climb-rate(in cm per s). I know the speed approximation by this way is not so great. However I don't know a better approach so far.

For the calculation of the motor speeds I use atm two PIDs (STAB and RATE).

I coded the example shown below, without much testing so far. I believe it will not work out in a smooth and nice way. E. g. instead of the speed calculated of the accelerometer I could use the climb-rate of the barometer. However for low altitudes and small changes I do need very likely the accelerometer.

ArduPilot seems to use somehow in a different way both with a third PID for the acceleration. I believe they calculate the height difference like me. Then they use maybe for STAB-Pid the barometer climb rate (not like me the accelerometer) and calculate with acceleration data another output. Unfortunately I don't know how exactly, or whether there are other methods.

Does someone know the exact layout to implement with a barometer and accelerometer an altitude hold function. I mean I am really not sure whether my ideas would be correct. Maybe I can post some options later.

My PIDs:

```<code>m_rgPIDS[PID_THR_STAB].kP(1.25);  // For altitude hold

m_rgPIDS[PID_THR_RATE].kP(0.35);  // For altitude hold
m_rgPIDS[PID_THR_RATE].kI(0.15);  // For altitude hold
m_rgPIDS[PID_THR_RATE].imax(100); // For altitude hold
</code>```

Code for altitude hold:

```<code>// Stabilizing code done before

float fCurAlti_cm       = _HAL_BOARD.get_alti_m() * 100.f;        // Barometer and GPS data
float fAcclClimb_cms    = _HAL_BOARD.get_accel_mg_ms().z * 100;   // Accelerometer output in cm per s (gravitational const. corrected)

// calculate the difference between current altitude and altitude wanted
float fAltStabOut       = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid(fCurAlti_cm - (float)(rcalt_m*100), 1);
// Rate it with climb rate (here with accelerometer)
int_fast16_t iAltOutput = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltStabOut - fAcclClimb_cms, 1);

// Modify the speed of the motors
iFL += iAltOutput;
iBL += iAltOutput;
iFR += iAltOutput;
iBR += iAltOutput;
</code>```

答:
Sorry, I'm not sure exactly what your code is doing but generally speaking ...

Instead of trying to control using the accelerometer directly, it is usually better to estimate velocity and control using that (as the D part of your PID controller).

If you're willing to dig into the math, the most common way to do this is to combine the barometer and accelerometer measurements using a Kalman filter. This will give you a smooth estimate of the altitude and velocity which can then be used as the P and D of the attitude controller.


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

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

Here is the PCB of the transmitter:

答: Search for a Digital Potentiometer. It's exactly what you're looking for. Just replace the manual pot's with them and you can use serial connections to control the voltage.</p>

Title: RC Transmitter Quadcopter with Arduino


问:
Why are capacitors added to motors (in parallel); what is their purpose?
I've seen many motors having capacitors attached in parallel in bots. Apparently, this is for the "safety" of the motor. As I understand it, all these will do is smoothen any fluctuations--and I doubt that fluctuations can have any adverse effects on a motor. Apparently these protect the motor if the shaft is being slowed/blocked, but I fail to see how.

What exactly is the function of such a capacitor? What does it prevent, and how?

答:
The capacitor seen on a lot of brushed motors is there to absorb RF noise due to the arcing as the brushes commutate. You often see these on the motors used in RC cars, where the motors are  fairly powerful and spinning fast.

The problem comes when you are using PWM to drive the motor. At the beginning of the duty cycle, when the current is switched on, you'll see a current spike as the current rushes into the capacitor from the H-Bridge. This inrush current can sometimes cause noticeable voltage ripple at the power supply, adding noise into any sensitive analogue sensors.

To prevent the inrush current, you can add a pair of inductors between the H-Bridge and the capacitor. This will hold the current fairly steady. Actually, you'll often see inductors on motor drive circuits anyway. Even though the motor itself is an inductor, it's often quite a low inductance, so extra inductance is added to help smooth out any current fluctuations when using PWM drive.

The capacitors have nothing to do with protecting the motor in the case of a stall. When the motor stalls, the current increases and you risk overheating the motor.


答:
I made a small routine for that, but not yet completely without errors. E.g.the acceleration term is still contradicting the differcence in height term, but working for it's own well.</p>

```<code>const float fBias_g   = 0.1f;
const float fScaleF_g = 100.0f;

int_fast16_t iAltZOutput = 0; // Barometer & Sonar
int_fast16_t iAccZOutput = 0; // Accelerometer

// Return estimated altitude by GPS and barometer
bool bOK_H, bOK_R, bOK_G;
int_fast32_t fCurAlti_cm = altitude_cm(&_HAL_BOARD, bOK_H);
float fClimbRate_cms = climbrate_cms(&_HAL_BOARD, bOK_R);
// Get the acceleration in g
Vector3f vAccel_g = accel_g(&_HAL_BOARD, bOK_G) * fScaleF_g;

// Calculate the motor speed changes by the error from the height estimate and the current climb rates
// If the quadro is going down, because of an device error, then this code is not used
if(_RECVR.m_Waypoint.mode != GPSPosition::CONTRLD_DOWN_F) {
  float fAltZStabOut = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid((float)(rcalt_cm - fCurAlti_cm), 1);
  iAltZOutput        = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltZStabOut - fClimbRate_cms, 1);
}

// Don't change the throttle if acceleration is below a certain bias
vAccel_g.z           = sign_f(vAccel_g.z) * (abs(vAccel_g.z) - fBias_g) * fScaleF_g;

// Calculate the throttle changes if copter changes altitude
float fAccZStabOut   = _HAL_BOARD.m_rgPIDS[PID_ACC_STAB].get_pid(vAccel_g.z, 1);
iAccZOutput          = _HAL_BOARD.m_rgPIDS[PID_ACC_RATE].get_pid(fAccZStabOut, 1);

// Modify the speed of the motors to hold the altitude
iFL += iAltZOutput + iAccZOutput;
iBL += iAltZOutput + iAccZOutput;
iFR += iAltZOutput + iAccZOutput;
iBR += iAltZOutput + iAccZOutput;
</code>```

Title: Altitude hold for quadcopter with Accelerometer and Barometer

Body:
I wonder currently how to implement an altitude control for a quadcopter. I have atm just a barometer/GPS and an accelerometer.

Barometer and GPS are relatively straight forward implemented, but not very precise and slow. For the accelerometer readout, I remove the constant 9.81 m/s² acceleration by a low pass filter. Then I take this data and calculate out of it the climb-rate(in cm per s). I know the speed approximation by this way is not so great. However I don't know a better approach so far.

For the calculation of the motor speeds I use atm two PIDs (STAB and RATE).

I coded the example shown below, without much testing so far. I believe it will not work out in a smooth and nice way. E. g. instead of the speed calculated of the accelerometer I could use the climb-rate of the barometer. However for low altitudes and small changes I do need very likely the accelerometer.

ArduPilot seems to use somehow in a different way both with a third PID for the acceleration. I believe they calculate the height difference like me. Then they use maybe for STAB-Pid the barometer climb rate (not like me the accelerometer) and calculate with acceleration data another output. Unfortunately I don't know how exactly, or whether there are other methods.

Does someone know the exact layout to implement with a barometer and accelerometer an altitude hold function. I mean I am really not sure whether my ideas would be correct. Maybe I can post some options later.

My PIDs:

```<code>m_rgPIDS[PID_THR_STAB].kP(1.25);  // For altitude hold

m_rgPIDS[PID_THR_RATE].kP(0.35);  // For altitude hold
m_rgPIDS[PID_THR_RATE].kI(0.15);  // For altitude hold
m_rgPIDS[PID_THR_RATE].imax(100); // For altitude hold
</code>```

Code for altitude hold:

```<code>// Stabilizing code done before

float fCurAlti_cm       = _HAL_BOARD.get_alti_m() * 100.f;        // Barometer and GPS data
float fAcclClimb_cms    = _HAL_BOARD.get_accel_mg_ms().z * 100;   // Accelerometer output in cm per s (gravitational const. corrected)

// calculate the difference between current altitude and altitude wanted
float fAltStabOut       = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid(fCurAlti_cm - (float)(rcalt_m*100), 1);
// Rate it with climb rate (here with accelerometer)
int_fast16_t iAltOutput = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltStabOut - fAcclClimb_cms, 1);

// Modify the speed of the motors
iFL += iAltOutput;
iBL += iAltOutput;
iFR += iAltOutput;
iBR += iAltOutput;
</code>```

Body:
I made a small routine for that, but not yet completely without errors. E.g.the acceleration term is still contradicting the differcence in height term, but working for it's own well.

const float fBias_g   = 0.1f;
const float fScaleF_g = 100.0f;

int_fast16_t iAltZOutput = 0; // Barometer & Sonar
int_fast16_t iAccZOutput = 0; // Accelerometer

// Return estimated altitude by GPS and barometer
bool bOK_H, bOK_R, bOK_G;
int_fast32_t fCurAlti_cm = altitude_cm(&_HAL_BOARD, bOK_H);
float fClimbRate_cms = climbrate_cms(&_HAL_BOARD, bOK_R);
// Get the acceleration in g
Vector3f vAccel_g = accel_g(&_HAL_BOARD, bOK_G) * fScaleF_g;

// Calculate the motor speed changes by the error from the height estimate and the current climb rates
// If the quadro is going down, because of an device error, then this code is not used
if(_RECVR.m_Waypoint.mode != GPSPosition::CONTRLD_DOWN_F) {
  float fAltZStabOut = _HAL_BOARD.m_rgPIDS[PID_THR_STAB].get_pid((float)(rcalt_cm - fCurAlti_cm), 1);
  iAltZOutput        = _HAL_BOARD.m_rgPIDS[PID_THR_RATE].get_pid(fAltZStabOut - fClimbRate_cms, 1);
}

// Don't change the throttle if acceleration is below a certain bias
vAccel_g.z           = sign_f(vAccel_g.z) * (abs(vAccel_g.z) - fBias_g) * fScaleF_g;

// Calculate the throttle changes if copter changes altitude
float fAccZStabOut   = _HAL_BOARD.m_rgPIDS[PID_ACC_STAB].get_pid(vAccel_g.z, 1);
iAccZOutput          = _HAL_BOARD.m_rgPIDS[PID_ACC_RATE].get_pid(fAccZStabOut, 1);

// Modify the speed of the motors to hold the altitude
iFL += iAltZOutput + iAccZOutput;
iBL += iAltZOutput + iAccZOutput;
iFR += iAltZOutput + iAccZOutput;
iBR += iAltZOutput + iAccZOutput;


问:
How Can I Measure the torque applied by a servo motor?
I believe that there must be a tool that can measure $oz-in$ of torque.  I do not trust what the servo manufacturers state on their site for torque values, so I want to test them for myself.

Can anyone suggest a tool which I can use to do this?  I have used fishing scales before, but I need something more sensitive than that and my units are pretty small, such as around $20\; oz-in$.

Thanks.

答:
One option for you if you are willing to spend ~ 100 dollars is a particle brake.  I just saw a 15 in-lb particle brake on ebay for 99 dollars.  If you search, you may be able to find a better deal.  You can couple a particle brake to your shaft and the torque that the brake applies is proportional to voltage.  Their torque is usually pretty linear with respect to voltage.

If you can't spend that much, then I don't have a lot of options for you.  But there are some checks you can do.  Start with checking winding resistance.  Measure the resistance between any 2 of the 3 motor leads and make sure it matches the manufacturer's spec.  Stall torque is proportional to resistance, so this is an important value.  I would suggest using a strobe or motor tachometer (~ 30 dollars).  Measure no-load speed and current.  Attach your motor to another motor and back drive the motor.  Take an oscilloscope and look at the waveform between any 2 of the 3 motor leads.  Measure the peak voltage and record the speed at the time of the measurement.  The speed (in RPM) divided the peak voltage should give you the motor's Kv value.  The peak voltage divided by the speed (in RPM) should give you the motor's back-emf constant.  Even more important is if you take the peak voltage divided by the speed (in rads/sec), then you get a back-emf constant in Volts/(rad/sec) which is equivalent to your torque constant in Nm/A.  From your no-load current and your torque constant, you should be able to estimate what your torque is based on the current draw of your motor.

ContentLicense: CC BY-SA 4.0


答:
There are lots of ways of measuring torque from first principles.  Obviously the first problem is that you need a sensor, you have lots of options:

You can use a torque sensor. ( e.g. imada.com/torque-testers/torque-gauge ) couple it directly to your shaft.  Drive your motor.  Read the sensor.  Your error would be the sensor's accuracy plus any errors introduced due to inaccurate coupling.

You can use some sort of force sensor.  Your scale is one example.  You mount an arm on the motor and you read the force at a given distance.  This gives you torque.  With a scale you want to: idle your motor, zero the scale with the weight of your arm on it, and then energize the motor (pushing on the scale) and read the scale.  Any zeroing error plus measurement error on the arm would eat into your accuracy.  Variations on this is putting a large weight on and driving up.  It's all the same principle.

You can use a position sensor.  Mount a large mass of known moment of inertia onto the motor and start driving it.  Take position measurements and differentiate them to find velocity and then acceleration.  From acceleration you can work back to torque given the moment of inertia inertia.  This has the advantage of being able to measure torque at speed. This is basically an inertia dynamometer.  You accuracy will depend on how accurately you know the moment of inertia of the system (including the shaft), you timing resolution, your position sensor resolution, friction potentially introduced by the sensor (e.g. an encoder) etc.

velocity sensor.  same princple as above.

Title: How Can I Measure the torque applied by a servo motor?

Body:
I believe that there must be a tool that can measure $oz-in$ of torque.  I do not trust what the servo manufacturers state on their site for torque values, so I want to test them for myself.

Can anyone suggest a tool which I can use to do this?  I have used fishing scales before, but I need something more sensitive than that and my units are pretty small, such as around $20\; oz-in$.

Thanks.


问:
What are the options for a thin light source (e.g. LED)?
I'm looking to make or buy something resembling an LED, that would be thin (about 0.5mm or less) and cheap (<0.1$ in mass production).

Any suggestions?

答:
What's wrong with an actual LED? Size 0402 is about your size spec.
This one is $0.06 at 10k quantity.</p>


问:
How can I modify a low cost hobby servo to run 'freely'?
I've got some hobby servos (Power HD 1501MGs) and I'd like to be able to control them (via an Arduino) so they will either go to the angle I set, or put them in a 'free running' mode, where the load will take them wherever it goes.

Is this even possible, or am I just going to end up stripping the gears?

My first thought is to simply kill the power to the servo, but the force required to move them in that state is more than I'd like.

If it is possible, am I looking at a hardware change, or could I do it in software?

答:
Usually, these types of hobby servos are not made for continuous rotation, and will often include a mechanical stop.  Beware, what I outline below is a surefire way to never get actual closed-loop operation, but will instead make the servo continuous-only.

Most of the time, you can do a quick search online for "Continuous modification for x servo", but I will outline the general process here.

Determine if the servo has a physical stop.  If it does, you will have to open the servo and remove it (I recommend the Dremel tool).

You then want to find the "center" of the feedback mechanism.

Connect the servo to your Arduino and send a "center" command (usually PWM 127).

Find the feedback mechanism (typically a potentiometer), and trim it until the servo does not move at all.

Either glue the potentiometer in place, or measure the resistance and replace the potentiometer with a set value resistor.

Reassemble the servo.

Now sending a "center" command to the servo should stop it from moving, while sending it a positive or negative command should cause it to rotate continuously in one direction or the other.  The rotation speed should be proportional to the "distance" from center of the command sent.

If you want to restore servo operation to your newly-modified servo, you can add some sort of encoder to re-close the loop.

Alternatively, you may want to look at the Dynamixel series servo, which allows for both continuous and servo'ed operation, and includes some Arduino support.


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

答: The square cube law mentioned by user65 is a good one. In fact, these kind of laws are fundamental when looking at machines of various sizes. For mobile robots, as Josh mentioned, power is a serious problem, and so I'd say that one of the most important laws regarding mobile robots is that the energy storage capacity goes up with the cube of the length of the robot (assuming roughly equal proportions). Thus larger robots benefit enormously from longer battery life.</p>


问:
2D Map representation of GPS coordinates in degrees
I want to implement my own GPS navigation for a quad-copter.
I can calculate and filter the GPS coordinates (latitude and longitude in degrees).

I believe the easiest approach for me would be, to calculate the change of the heading of the quad-copter from the current attitude to the destination point and let it fly straight on after turning.

However I am not sure about the 2D representation of the latitude/longitude-GPS coordinates (for a round earth to a 2D map system when calculating the heading change). How big is the expected error? Or is there none?

答: If the expected range of your quadcopter's journeys is under 10 miles, the error between spherical and flat geometry is less than the GPS's poistion error...assuming you are using normal GPS, not dGPS. As a rough rule of thumb, 2D mapping works to the horizon!</p>


问:
Quadcopter forward speed
I am trying to better understand the dynamics of forward flight in multirotors.

Assuming I have a quadcopter with 4 motor/propeller combinations capable (each) of a propeller pitch speed of, say, SpeedMax= 100 mph.

In forward horizontal flight, the quadcopter will pitch down at a certain angle, let's say AlphaP, from horizontal. If AlphaP is, say, 45 degrees, and drag is neglected, wouldn't the quadcopter be capable of a max theoretical speed of sin (45)* SpeedMax ~ 70Mph?

Also, seems to me AlphaP cannot go all the way to 90 degree (quadcopter flying like a plane), as at that point the propellers would not produce any  upward thrust to maintain the copter aloft given there is no wing loading as available in a plane.  If drag was to be neglected, what factors would the optimum AlphaP be depended on, and what would that angle be, for maximum speed?

答:
With my rudimentary knowledge of aerodynamics, your calculation of forward horizontal velocity sounds OK. I'm sure other people can shed more light on the practical constraints.

About the max alphaP angle, here's what I think:
Say your copter can produce F Newton upward thrust. And say your copter weighs x Kg. Then your max angle for alphaP will be governed by:

```<code> F*cos(maxAlphaP) = x*g     //cos or sine alphaP, depending upon how you measure the angle.
</code>```

Title: Quadcopter forward speed

Body:
With my rudimentary knowledge of aerodynamics, your calculation of forward horizontal velocity sounds OK. I'm sure other people can shed more light on the practical constraints.

About the max alphaP angle, here's what I think:
Say your copter can produce F Newton upward thrust. And say your copter weighs x Kg. Then your max angle for alphaP will be governed by:

 F*cos(maxAlphaP) = x*g     //cos or sine alphaP, depending upon how you measure the angle.


问:
How do I get started in Computer Vision?
I want to know how to write and run the correct code. I understand that I need to download OpenCV (which I have), but when I try to compile sample code - for example, Blob Detection - it doesn't compile. I am just very confused on the process of what you need to do to get something to show up on the screen.
I know my question is really vague, but I have such a bad understanding of Computer Vision that I don't really know how to describe my problem. Hopefully discussing more will be able to help me.

Please help me! I have been searching the Internet for 2 hours now and I am just lost in a sea of information...

答:
First try going through tutorials on the official OpenCV website: http://docs.opencv.org/doc/tutorials/tutorials.html
There they don't talk only about OpenCV functions but also explain some basic concepts of image processing along the way.

I also recommend this course, it can help you grasp some basic concepts related to geometry: https://class.coursera.org/vision

Finally, this is a great book but it is a bit depricated http://www.cse.iitk.ac.in/users/vision/dipakmj/papers/OReilly%20Learning%20OpenCV.pdf so use it with caution of that if you will.

Regards,
Damjan


问:
Battery system with and without mains voltage attached
I'm working on a project where mains voltage will sometimes be disconnected, and the system will have to run on battery for as long as possible before doing a (safe) shutdown.  The desired behavior is exactly like a laptop battery system:

When mains voltage is connected, charge the battery and power the system from mains

When mains voltage is disconnected, power the system from the battery

Prevent the battery system from supplying current when the batteries are discharged below a certain voltage (to prevent damage).

Is there a name for this type of system, or a name for the feature(s) that I should be looking for when I look at chargers?  (If it matters, this system will be 12V, so I'm looking at 14.8V Lithium battery options.)

答:
It appears to me that you are looking for some sort of UPS (uninterruptible power supply). You should look for "load sharing" controllers.

Maybe one of these will suit your needs?
http://www.mini-box.com/micro-UPS-load-sharing

Regards,
Damjan


问:
How does one calculate the angular motion of each node in a robotic arm
A robotic usually consists of joints with sections of possibly varying width connected together. Considering we know how much each is bent and the length of each section, and their location in 3D space (not local coordinates) at time zero; how do we determine how much each joint should rotate to goto position B from position A. Both A and B are defined in world cartesian coordinates.

Now each joint can move in terms or all at once, so should all joints move simultaneously or in turns?

答:
Inverse kinematics (a very hard field in its own right) is the correct answer, but it gets even more complicated than that. The path that your arm takes might really matter. Say that you need to get the end effector (gripper or hand) to a specific point, but there is a wall with a window in the way. The arm might need to snake around that hole so that it doesn't collide with the wall. This leads to the field of motion planning.

Motion Planning

One motion planning method that might help you work out the angles needed to get the hand to a specific position while taking the environment into account (the environment can also be free of clutter and all you want is the angles to get to a specific point) is to use a RRT.

RRT - Rapidly exploring Random Tree

This method would randomly close in on a solution in a "smart" way.


答:
You could go into a lot of detail on what the optimal design would be by taking into account the weights of the joints and where their centers of mass are, how fast the robot arm would be moving, what positions the arm will be in (which effects the center of mass of the entire arm), etc.

However, if you are just an enthusiast and want to make an arm that works, I would suggest just over designing the arm. Make your joints out of a light but strong material (PVC or some kind of plastic would probably work), get large enough servos that they will definitely be able to hold the weight of the arm and the object you are trying to pick up, and then make the base of the arm wide and heavy so that the arm is unlikely to fall over. You can probably work out some of these values by "going with your gut" and then adding a little more power, little less arm weight, and a little more base weight than what your gut tells you.

Title: How to decide about the length of a robotic arm, the base of it and the torque?

Body:
I am designing  a remote controlled robot which will have a base with three wheels, two of them will be simple wheels at the back of the base and the third will be a ball wheel at the front. It will have a robotic arm which will have a gripper to hold objects up to 1kg. I have designed the arm like this

What I want to ask is how to calculate the length of the arm, the base of the  robot, the torque and also which motor to use. Please suggest to me if there is a better solution for designing the robot.I am a robot enthusiast and I am designing a robot for the first time.


问:
How to connect Arduino Uno3, L293D motor driver and 3 colour sensors together?
I am trying to build an autonomous multi coloured lines following robot.

The parts I have bought so far include:

Arduino Uno 3.

3 Colour Sensors (taos tcs 230).

L293DNE motor driver.

Robot chassis including 2 dc motors, 2 wheels and 1 caster wheel.

I am trying to figure on how to connect all these components together (for example: arduino to the colour sensor, l293d to motor).  How do I connect it in order for the motor to rotate in both directions?  Do I need to solder anything?

答:
You need to have a way of connecting things mechanically (e.g. screws) and electronically (e.g. wires). Depending on the connectors that you have, yes you may need to solder something.

If you want to build a robot like that, you would need to have a basic understanding of electronics. Then you need to take the datasheet of your components, look at their electrical characteristics and make sure the circuit you make meets their needs (by carefully adding resistors, capacitors and inductors). An example from the driver you have picked:

If you are lucky, the datasheet may have a "typical usage" you could gain insight from. Example from your driver:

There is also connection to the microcontroller, which again means you should take the datasheet of the micro, look at what pins are available for what, and then decide which of your component pins should connect to which of the micro's pins. For example, you may need an interrupt from a certain component and therefore you should make sure to connect it to a pin that can generate an interrupt.

You should also pay attention not to break the micro. For example, you shouldn't try to power a motor directly by a pin of the micro because usually the current that the micro can give out at its pins is not enough to drive a motor (and you'd risk burning the micro). You have done well by buying the motor drivers.

Finally, you need to program the micro, which depending on the microcontroller may be widely different. Arduino has tried to make the coding as simple as possible, so if you don't try to do smart things and stick with the basics, its libraries should be fine.

Tip for things to go smoothly: read the datasheets carefully.


问:
How to implement a distance proximity sensor with wider range
More in the line of robotics observing their environment, I'm trying to implement a proximity sensor that can sense objects in front of it to a least up to $-30^ \circ \space$ to   $\space+30^ \circ $ of it's direction of propagation.

There are only two ways I can think of

Multiple Infrareds.     Con: more spacious

Fast-Motor.  Con: expensive in money and time-complexity wise

I'm currently using a Proximity Sensor with up to 10ft distance capability

答:
You might want to check out these ultrasonic proximity sensors for example: http://www.maxbotix.com/pictures/HRUSB-MaxSonar-EZ/HRUSB-MaxSonar-EZ%20Beam%20Patterns.gif
And then use two or three of them if needed to get a wider field.
They can be bought all over, sparkfun being one of the shops.

Regards


问:
Precision we can expect of an ultrasound-based localisation system
I'm considering building an absolute, indoor robot-positioning system based on ultrasound Time Of Flight. Transducers will be ordinary, narrow-band, 40 kHz ones.

Based on your experience, what is the best exactitude and precision we can achieve with such a system?

I'm aware that the answer to such a question will depend on many factors, both hardware and software (if applicable), but I'm not asking about the performance of one solution or another, but about the intrinsic limitations of the ultrasound technology.

答:
It closely depends on the method you use to determine location. That is, will you use lateration or angulation? If you wish to use angulation then you need to synchronize the emitters (or receivers, depending on which of the two is being localized), find the phase difference using correlation of signals and then based on that estimate the location. At this point, the most difficult thing is the synchronization part and that's what will affect the error the most.
If you're using lateration (measuring the time of flight), you need to somehow know when the signal was generated and when it arrived at the target. For this you could use some RF transmission technology (ZigBee or WiFi or something). If your detection resolution is high enough you can get a pretty good accuracy (if your sampling frequency is for example 500kHz for example it means you can detect the minimal distance of around 0.6mm because that's how much the sound travels between the two measurements) but the thing to also consider is the latency in the RF communication. That latency can probably be measured and estimated to a degree but it will affect your precision.

All in all to finally answer your actual question, if all is calibrated well you can get an error bellow 1%. Check this out for example http://link.springer.com/chapter/10.1007%2F978-1-4471-2386-6_105 their results say 0.1% error.

Regards


答:
Capacitors are used with motors in two different ways. Sometimes the same motor will have both techniques applied, and be associated with two significantly different-looking capacitors.

When motors with brushes are running normally, the motor brushes produce sparks, which cause noise "from DC to daylight". This has nothing to do with PWM -- it happens even when these motors are connected directly across a battery, without any PWM.
If we did nothing, the cable running from the electronics board (or directly from the battery) to the motor would act like an antenna, radiating TV and other radio interference.
One way people fix that problem is to attach small ceramic capacitors directly to the motor to absorb much of that noise. b c d e

When using PWM to drive the motor, when the transistors turn "on", the motor may pull a current spike / surge current -- the above noise-filtering capacitors make that current spike worse. When the transistors turn "off", the motor inductance may cause voltage spikes from the motor inductance -- the above noise-filtering capacitors help a little. More complex filters attached directly to the motor can help these two problems. a b

When a motor -- even a motor that doesn't have brushes -- is first turned on at a dead stop, and also when the robot hits an obstruction and stalls the motor, the motor pulls much higher currents than it does in normal operation -- currents that may last for several seconds. This high current may pull down the battery power rail enough to reset all the digital electronics in the system (or perhaps reset just some of the digital electronics, causing half-brain syndrome).

One work-around has 2 parts:

add large electrolytic capacitors directly across the battery (or across the battery input to the PWM motor driver, or across the battery input to the digital electronics, or often capacitors in all three locations) -- these capacitors work better at supplying high currents for a few milliseconds than the battery does.

In the few milliseconds we have before the stalled motor pulls all the energy from those big capacitors and then pulls the power rails low enough to start resetting things, program the digital system to somehow recognize that the motor has stalled and kill the power to that motor. Then that motor no longer drags down the power rail, and the digital electronics and all the other motors continue to operate normally. ("soft-start", "current-limiting", "torque-limiting", etc. are more sophisticated forms of this idea). (Those big capacitors, also absorb some of the energy that comes out of the motor when the PWM turns "off", and later put that energy back into the motor when the PWM turns "on").

The above capacitors protect other things from the motor's electrical interference.
I suppose one could argue that step (2) above prevents a stalled motor from eventually, after many seconds, overheating and failing -- but that's not really its primary purpose.

Title: Why are capacitors added to motors (in parallel); what is their purpose?

Body:
I've seen many motors having capacitors attached in parallel in bots. Apparently, this is for the "safety" of the motor. As I understand it, all these will do is smoothen any fluctuations--and I doubt that fluctuations can have any adverse effects on a motor. Apparently these protect the motor if the shaft is being slowed/blocked, but I fail to see how.

What exactly is the function of such a capacitor? What does it prevent, and how?


问:
H bridge for rover
I am building a 6 wheeled rover, one set of 3 wheels will work together and other set of 3 wheels will run together, so current in each side may vary from 3A-15A(blocked rotor) and 6V i want to make a H-bridge(for controlling direction and speed(i ll use PWM) so i will require two such H-bridges. what is the copper track thickness i should use in proteus for making the design or else shall i go for manual soldering replacing tracks with wires. Can anybody suggest a design which is relatively easy to design with some protection circuit in it (for MCU pins isolation) or suggest any suitable motor controllers from TI or any company which can be apt to my problem

答:
If you can purchase a motor driver board, Pololu has some that probably fit your specs. This board uses the VNH2SP30 from ST. The Pololu board is rated for operating voltages from 5.5V to 16V and a continuous current of 14A (peak of 30A). Continuous current and peak current of course depend on how well cooled the driver chip is.

You could also create your own design around a driver chip like the VNH2SP30. The datasheet has a standard application circuit that you may base your design off of. When designing your board, the copper thickness, usually specified in ounces of copper, is the same for the whole board and is typically 1 oz for external traces. Once you know the thickness, you can calculate the width of the trace based on the current through it. Wider traces have lower resistance per unit length and thus heat less and can handle higher current.

Title: H bridge for rover


问:
Set CANopen Node ID of Ingenia Pluto DC Servo Drive
Does anybody know how to configure the node ID of an Ingenia Pluto DC Servo Drive?

I've got a request out to their support team, but perhaps somebody here is already familiar with these drive boards.

I do have Ingenia MotionLab 2.7.2, but it does not ship with documentation and the MotionLab user manual on the site is out of date (I had previously been looking through the hardware documentation, but it turns out the info was in MotionLab documentation; although the instructions for previous versions no longer seem to apply to 2.7.2).

答:
As it turns out, it is a bug in the current MotionLab 2.7.2. In theory, the node ID should be able to be changed on the Drive Parameter screen. However, the field for changing the ID is disabled:

This was compounded by the fact that only documentation for the old MotionLab is available on their site, and the old procedure (right-click on drive in tree) no longer applies. The documentation for 2.7.2 is a work in progress and is not available yet. So missing documentation combined with this issue was the primary cause of confusion.

At the time of this writing, Ingenia has both confirmed this bug (and will be issuing an update soon) and stated that updated documentation will be available soon as well.

In the mean time, Ingenia has offered the following workaround:

Node ID can be change writing the register 0x2000 , subindex 0x1.

Just open with a terminal you communication port and write:

```<code><Current node Id> <Action> <Subindex and index in hexa> <in hexa>
</code>```

E.g.:

```<code>0x20 w 0x12000 <Node number>
</code>```

I suggest you using Realterm for instance.

[Use] the old MotionLab.

After changing the Node id, remember to ‘commit’ the parameters (save in non-volatile memory).

Theoretically, you could also do this via, e.g., libcanopen on Linux. 0x2000 subindex 0x01 can be used to write the 8-bit node ID (range 1-127), and parameters can be committed to non-volatile memory by writing 0x65766173 to index 0x1010 subindex 0x01 (source).

I'm presuming the updated software and documentation will be available by the time anybody actually finds and reads this post.

Body:
As it turns out, it is a bug in the current MotionLab 2.7.2. In theory, the node ID should be able to be changed on the Drive Parameter screen. However, the field for changing the ID is disabled:

This was compounded by the fact that only documentation for the old MotionLab is available on their site, and the old procedure (right-click on drive in tree) no longer applies. The documentation for 2.7.2 is a work in progress and is not available yet. So missing documentation combined with this issue was the primary cause of confusion.

At the time of this writing, Ingenia has both confirmed this bug (and will be issuing an update soon) and stated that updated documentation will be available soon as well.

In the mean time, Ingenia has offered the following workaround:

Node ID can be change writing the register 0x2000 , subindex 0x1.

Just open with a terminal you communication port and write:

<Current node Id> <Action> <Subindex and index in hexa> <in hexa>

E.g.:

0x20 w 0x12000 <Node number>

I suggest you using Realterm for instance.

[Use] the old MotionLab.

After changing the Node id, remember to ‘commit’ the parameters (save in non-volatile memory).

Theoretically, you could also do this via, e.g., libcanopen on Linux. 0x2000 subindex 0x01 can be used to write the 8-bit node ID (range 1-127), and parameters can be committed to non-volatile memory by writing 0x65766173 to index 0x1010 subindex 0x01 (source).

I'm presuming the updated software and documentation will be available by the time anybody actually finds and reads this post.


答:
To expand on tomsrobots answer a bit.

If your desired arm end effector pose is far from the current, you should use an inverse kinematics solver to give you the corresponding joint angles.  Typically, for high DOF arms, there are multiple solutions, so you should pick the best solution based on some metric.  Minimum distance in joint space (i.e. configuration space) to the current or some known good configuration works well.

Depending on the complexity of your arm, the IK could be as simple as some trigonometry and conditionals, or require a full-blown IK library.  See for example ROS MoveIt! and OpenRAVE.  Standard robotics textbooks should cover the basics of what is involved here.

Then, you can move the arm there in a number of ways.  One joint at a time, or all at once like you mentioned.  These move the arm in joint space and the trajectory of the end-effector will probably not be what you want.  But typically, for advanced motions you will plan a path in cartesian space and the arm will then follow the trajectory.  But for for relatively open workspaces, and small motions, a straight line in cartesian space is typically fine.

Then the arm must follow the trajectory.  If you used a motion planner, it probably gave you a trajectory in joint space.

Another way is to input your desired end-effector cartesian velocity into the arm's Jacobian, which will then give you the required joint velocities.  The Jacobian is dependent on the arm's configuration, so you need to iterate.  (i.e. get joint velocities, move a small amount, repeat.)  Again, unless your arm is very simple, you probably want a kinematics library mentioned above to calculate the Jacobian for you.  Note that you can often skip the IK and path planning steps and go straight to following a trajectory with the Jacobian if you are moving short distances, you know you are far from singularities, you have no obstacles in the workspace to get around, etc.

Title: How does one calculate the angular motion of each node in a robotic arm

Body:
A robotic usually consists of joints with sections of possibly varying width connected together. Considering we know how much each is bent and the length of each section, and their location in 3D space (not local coordinates) at time zero; how do we determine how much each joint should rotate to goto position B from position A. Both A and B are defined in world cartesian coordinates.

Now each joint can move in terms or all at once, so should all joints move simultaneously or in turns?


问:
Quadcopter Localization Beacon
I want to use an RF beacon to localize my quadcopter for autolanding, when GPS is not precise enough, for example, when my driveway is only 10 feet wide, and the GPS is only showing 20-30 ft. accuracy (with a proverbial lake of lava on either side). The quadcopter would use the GPS to fly to the rough location until it had a strong enough signal off the beacon, when it would begin to use that signal to come to a landing in a precise location, referenced off said beacon. Can someone please explain to me the concepts and theories behind building the beacon and it's accompanying receiver (suitable for connection to an Arduino via any digital or analog method) and achieving, say, a 4" or better horizontal and vertical accuracy within a 50' sphere? Minimally, the quad should have range and altitude, i.e. "I am 10 feet away from the beacon and 2 feet above it". How much added complexity would it take to make the robot fully position aware about the beacon, i.e. "x ft. South, y ft. West and z ft. above it", where the coordinate system is determined by the beacon and not linked to any sort of geographic coordinate system? If the beacon is mounted on a, say, 10 ft pole, are there any changes to be made versus having it on the ground and presuming that all activity takes place above it's x-y plane?

Last note-
This thing would prefferably operate in the 72MHz band, please presume that where I'm operating, there are not other devices operating on the same band.

答:
You might be able to do this using inductive coupling to give the quad copter some indication as to which direction it should move to approach the landing pad.

On the landing pad is a single coil on the vertical axis (this is the transmitter). On the quad-copter are two coils, 90º apart and on the horizontal axis (these are the receivers). An alternating current is passing through the coil on the handing pad, creating an alternating magnetic field around it.

If the quad-copter is centred directly above the landing pad, then no current will be induced in the receivers. If the quad-copter is to one side, then a current will be induced in the receivers. Which receiver is seeing the current will tell the quad-copter which axis to move in, but not whether to move one way or the other. You can use a band-pass filter to distinguish between the signal from the landing pad, and noise from the motors.

Deciding which direction to move in is tricky, and I'm not sure of the best solution yet.

One way would be to correlate the change in signal with velocity information inferred from the accelerometers. If the quad-copter is moving one way, and sees the induced current reduce at the same time, then it knows that it should continue moving that way.

Another way would be to pulse a DC current through the coil. Pulse it forwards for 10ms, then backwards for 30ms. Use a low-pass filter on the receivers to distinguish between this signal and background noise. By looking at the pulse widths, the quad-copter can now tell the difference between the forward and backwards directions.

You can probably make the receivers smaller than I have drawn here, and the transmitter as large as the landing pad.

Title: Quadcopter Localization Beacon


答:
It depends on the purpose, but −30∘ to +30∘ (cone shaped beam) smells like ultrasonic sensors.

However, if you don't like ultrasonic and you are more "infrared person" you may also make your own scanner (SHARP GP2Y0A21YK0F + RC servo) like here (chapter "5.3.3 Skaner 2D"):

http://www.forbot.pl/forum/download.php?id=676&sid=54f9ba7ac5b724b64bfff3686de0e39c

http://www.forbot.pl/forum/topics20/fuzja-sygnalow-sensorycznych-dla-robotow-minisumo-vt2151.htm

Title: How to implement a distance proximity sensor with wider range

Body:
More in the line of robotics observing their environment, I'm trying to implement a proximity sensor that can sense objects in front of it to a least up to $-30^ \circ \space$ to   $\space+30^ \circ $ of it's direction of propagation.

There are only two ways I can think of

Multiple Infrareds.     Con: more spacious

Fast-Motor.  Con: expensive in money and time-complexity wise

I'm currently using a Proximity Sensor with up to 10ft distance capability