问:
Finding Joint speeds for each joint of a 6DOF arm (UR10) using the Inverse Jacobian
Background: I have access to a UR-10, 6DOF robotic arm through my school (I'm very new to robotics). I know the desired set of linear speeds that I want in the x,y, z-direction in terms of the end effector
([x,y,z,rx =0, ry,=0, rz =0]). Using an analog controller I receive linear speeds in the x,y, z-direction ranging from -.1 -.1m/s.

I found the forward kinematics for the UR-10 online and begin to derive the Jacobian Matrix. (If anyone has the Jacobian matrix for a UR-10 that would be awesome.) Since I'm only interested in the linear motion, where rx,ry,rz =0 I thought I could simplify my Jacobian to a 3x3 matrix.

I realized that by doing so I would be unable able to solve for all the joints speeds 1-6.

$J^{-1} \dot{X} = \dot{Q}$

where $J^{-1}$ is the inverse Jacobian, $\dot{X}$ is the Cartesian velocity vector and $\dot{Q}$ is the joint velocity vector.
With the above simplification [3x3][3x1] = [3x1] joint velocity vector.

However, I need a 6x1, so I have the speed for each joint.

What am I doing wrong?

What are the other 3 equations I would need to define a full 6x6 Jacobian and solve for the appropriate joint speeds?

EDIT: I foresee a problem that since my linear speeds change incrementally there may be singularities when calculating my Inverse Jacobian how could I work around that?

答:
If you are only interested in linear motion, instead of simplifying the Jacobian to a 3x3 matrix, you can express this contraint in the velocity componentet and have

$\dot{X} =  \begin{bmatrix} \dot{x} \\ \dot{y} \\ \dot{z} \\ 0 \\ 0 \\ 0 \end{bmatrix}$

and still use the 6x6 Jacobian. This will result in joint velocities which to not alter the current orientation of the end-effector, only the position.

$\dot{Q} = J^{-1}\dot{X}$


问:
Denavit-Hartenberg convention in practice
How are the coordinate frames and D-H parameters determined in industry? Does one use the CAD drawing of the arm or physically take measurements of the actual arm?</p>

答: You generally need to get the measurements from CAD or manufacturing drawings, simply because there's generally no reasonable way to measure something like a joint centerline, especially when the motors and shafting are concealed under body/trim plates. </p>

ContentLicense: CC BY-SA 4.0


问:
Is it possible to calculate the gear reduction based on datasheet of SG90?
is it possible to calculate gear reduction based on the datasheet of SG90 servo motor? Because I wanted to do some modeling in Simulink and RC servo ask for gear reduction, but I can't find any information about the gear reduction.</p>

答:
If it does not say directly in the data sheet, you can calculate it from:

the nominal speed of the  DC motor vs. the nominal speed of the whole servo assembly (incl. gears).

the maximum torque of the DC motor vs. the maximum torque of the entire assembly (incl gears)

the velocity constant of the motor and the nominal voltage can be used to calculate the nominal speed of the dc-motor, after this see point 1.

the torque constant and the max current of the DC motor can be used to determine the maximum torue of the DC motor, after this see point 2.

the torque constant of the motor is specified, it equals (as value not as unit of measurment) the velocity constant of the dc motor, after this see point 3.

a detailed drawing is presented you can count the teeth on the gears and calculate the transmission ratio from those (and hope that the drawing matches the motor)

You can disassemble the servo nd count the teeth of the gears and compute the transmission ratio


答:
If you are dealing with an (existing) industrial robot, all of its nominal dimentions and all axis to axis distances are specified in its manual (e.g. Kuka). All industrial robot manufacturers do this, without exception. All values in the DH table come from this table.

In most cases, positive and negative directions of the axes are defined in the manual and/or are also marked on the robot iself. This already defines the orientation and direction of all Z axes in the DH convention, you just figure out the rest (basically the one remainig possible rotation) by yourself and fill out the table.

These are obviusly nominal values, the real measurments of the robot include assembly and manufacturing tolerances, load and temperature effects. these are disregarded in the DH Table / Convention and are added as compensation odr calibration values later on.

Title: Denavit-Hartenberg convention in practice

Body: How are the coordinate frames and D-H parameters determined in industry? Does one use the CAD drawing of the arm or physically take measurements of the actual arm?</p>


答:
CAD is used as a first estimate. Often the kinematics (coordinate frames) are part of the design specification, and you can use those numbers directly. Where they are not, all mechanical design CAD packages have tools included for measuring positions and angles in the model.

Where the first estimate is not accurate enough, a process called kinematic calibration is used. There are many techniques, and as Chuck mentions, it is often difficult or impossible to directly measure distances of interest. A web search on the topic will give you an introduction.


答:
The DH parameters need to be as accurate as possible, and that means using dimensions from CAD. However, sometimes this is still not accurate enough.  (The robot might not match the CAD exactly for various reasons.)  In this case, we turn to kinematic calibration.

Put simply, kinematic calibration is taking measurements of the arm and adjusting the DH parameters accordingly.  Although, this must be done in a very controlled and precise manner.  (We don't just use a tape measure on the arm for example).

This can take various forms.  For example if you have a very precise jig, you can make the arm touch known points on the jig.  Or if you have a high-DOF arm you can fix the end-effector and move the rest of the joints through the arm's null space.  Or you can simply instruct the arm to move to various configurations and measure the end-effector pose with high precision external sensors.  Then you typically have a large minimization problem to solve.  You need to back out new DH parameters that are most likely to give you the measurements you have seen.

To better understand kinematic calibration, the clearest source of information I could find on the subject is in the book "Robotics: Modelling, Planning and Control" by Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, Giuseppe Oriolo, chapter 2.11.  Which requires a description of the arm in DH parameters, multiplying out the kinematics equation, partial differentiation w.r.t. each DH parameter, then a least-squares fit (with the left pseudo-inverse), then iterate.

But I was never able to get this technique to work for me.  What did work was using PoE (Product of Exponentials).  In PoE, the kinematic parameters of the model vary smoothly with changes in joint axes and can handle kinematic singularities naturally. I followed this paper and was successful in kinematically calibrating my 7 DoF arm:

I. Chen, G. Yang, C. Tan, and S. Yeo, “Local POE model for robot kinematic calibration,” Mech. Mach. Theory, vol. 36, no. 11/12, pp. 1215– 1239, 2001.


问:
Calibrating Logitic C920 HD 1080p using ros kinetic
I am trying to follow the ROS monocular camera calibration for a USB camera I have, but the calibration routine fails when I try to run it. I was expecting to see an image like the one below, but I get a segmentation fault instead.

These are the commands I used to try to start the calibration routine:

```<code>mona@Mona:~$ roscore
mona@Mona:~/catkin_ws/src/usb_cam$  rosrun usb_cam usb_cam_node
mona@Mona:~/catkin_ws/src/usb_cam$ rosrun rviz rviz
mona@Mona:~/catkin_ws/src/usb_cam$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/camera/image_raw camera:=/camera
</code>```

But this is the output I get:

```<code>('Waiting for service', '/camera/set_camera_info', '...')
Service not found
Segmentation fault (core dumped)
</code>```

What am I missing? How should I get it to work? When I list the ROS topics, I get:

```<code>$ rostopic list
/rosout
/rosout_agg
/usb_cam/camera_info
/usb_cam/image_raw
/usb_cam/image_raw/compressed
/usb_cam/image_raw/compressed/parameter_descriptions
/usb_cam/image_raw/compressed/parameter_updates
/usb_cam/image_raw/compressedDepth
/usb_cam/image_raw/compressedDepth/parameter_descriptions
/usb_cam/image_raw/compressedDepth/parameter_updates
/usb_cam/image_raw/theora
/usb_cam/image_raw/theora/parameter_descriptions
/usb_cam/image_raw/theora/parameter_updates
</code>```

答:
Based on rostopic list I realized the correct name of camera:
/usb_cam instead of /camera
so the command changed to

```<code>$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/usb_cam/image_raw camera:=/usb_cam
('Waiting for service', '/usb_cam/set_camera_info', '...')
OK
</code>```

Using the /usb_cam name, I was able to connect to the camera and get video:

You might notice that CALIBRATE button is grayed out so you would need to move in various direction (back and forth/right and left) so it becomes green. Eventually you will see the following (pretty much like calibrating a parrot drone):

Now go ahead and press the calibrate button and you are good to go.

For example, I am interested in the fx, fy, cx, cy that are presented in camera matrix. There are output on screen after you click on CALIBRATE button:

Body:
Based on rostopic list I realized the correct name of camera:
/usb_cam instead of /camera
so the command changed to

$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/usb_cam/image_raw camera:=/usb_cam
('Waiting for service', '/usb_cam/set_camera_info', '...')
OK

Using the /usb_cam name, I was able to connect to the camera and get video:

You might notice that CALIBRATE button is grayed out so you would need to move in various direction (back and forth/right and left) so it becomes green. Eventually you will see the following (pretty much like calibrating a parrot drone):

Now go ahead and press the calibrate button and you are good to go.

For example, I am interested in the fx, fy, cx, cy that are presented in camera matrix. There are output on screen after you click on CALIBRATE button:


问:
Robotics RC Car hack help
I need help with a robotisation project, please.

I am new to robotics and have the Maverick RC car pictured below:

My project is to add Arduino and Raspberry Pi boards to control the speed and direction of the car. So, the hand held control was thrown out.

I started by hooking up my Arduino to the front servo marked 9 in the diagram and I can successfully move the wheels to specific angles by using the examples like servo.write(180);.

My problem is the drive wheels. I have no idea how to power the wheels from the LiPo battery and use the Arduino to control the speed.

I'm open to and would welcome any help, please.

UPDATE:

After further consultation of the RC cars' specifications, the rear drive is controlled by a MM-25 brushed motor.

My problem is how do I interface with the MM-25 using my Arduino as it's wired into the RC car?

So far, I have connected my Arduino to the brushless motor by the same connection it uses to connect to the Transmitter/Receiver. I'm running the same servo code which worked for turning the servo(front) wheels but I get no response from the rear wheels.
My code is below:

```<code>#include <Servo.h>

const int servo_pin = 9;
Servo servo;

void setup()
{
  Serial.begin(9600);
  servo.attach(servo_pin);
}

void loop()
{
  servo.write(180);
  delay(1000);

  servo.write(-180);
  delay(1000);

  /*servo.write(-180);
  delay(1000);*/

  /*servo.write(180);
  delay(1000);*/

  /*for(int pos=0; pos <= 180; pos+=25){
    servo.write(pos);
    Serial.print("Moving to: ");
    Serial.println(pos);
    delay(1000);
  }*/
}
</code>```

答: Check out this great opensource project called DonkeyCar, which sounds pretty close to what you are trying to achieve. You can fork the project on GitHub and add your own modifications as required. They have a very active Slack group as well. They are available most of the time, and are an enthusiastic bunch as well. Check them out here.</p>

Title: Robotics RC Car hack help


答: I'm fairly certain you can't control a DC motor solely by plugging it into pins on the Arduino. You could use a diode and a transistor to power the motor, however you cannot control the speed. To control the speed you will need an ESC(electronic speed controller). This can be connected to the Arduino like a servo. Hope this helps!</p>

Title: Robotics RC Car hack help

Body:
I need help with a robotisation project, please.

I am new to robotics and have the Maverick RC car pictured below:

My project is to add Arduino and Raspberry Pi boards to control the speed and direction of the car. So, the hand held control was thrown out.

I started by hooking up my Arduino to the front servo marked 9 in the diagram and I can successfully move the wheels to specific angles by using the examples like servo.write(180);.

My problem is the drive wheels. I have no idea how to power the wheels from the LiPo battery and use the Arduino to control the speed.

I'm open to and would welcome any help, please.

UPDATE:

After further consultation of the RC cars' specifications, the rear drive is controlled by a MM-25 brushed motor.

My problem is how do I interface with the MM-25 using my Arduino as it's wired into the RC car?

So far, I have connected my Arduino to the brushless motor by the same connection it uses to connect to the Transmitter/Receiver. I'm running the same servo code which worked for turning the servo(front) wheels but I get no response from the rear wheels.
My code is below:

```<code>#include <Servo.h>

const int servo_pin = 9;
Servo servo;

void setup()
{
  Serial.begin(9600);
  servo.attach(servo_pin);
}

void loop()
{
  servo.write(180);
  delay(1000);

  servo.write(-180);
  delay(1000);

  /*servo.write(-180);
  delay(1000);*/

  /*servo.write(180);
  delay(1000);*/

  /*for(int pos=0; pos <= 180; pos+=25){
    servo.write(pos);
    Serial.print("Moving to: ");
    Serial.println(pos);
    delay(1000);
  }*/
}
</code>```


答:
If you are using the motors that came with the car, the car's circuit should include a motor driver, which takes an RC signal and decodes it to control the motor. I believe that the existing controller would have different circuits for controlling the steering motor and the drive motor.

Brushless DC Motors (BLDCM) require a different motor controller board that the normal Brushed DC Motors (DCM). You can search online for controllers. The only one I know a bit about is the ODrive. This is almost certainly too large and expensive for your project.

The RobotShop has a full section of BLDCM controllers.

The big thing to know is the power that the motor uses during startup and at stall (when something prevents the motor from running and yet you're still applying power).

Sounds like an interesting project.

I did build a robot out of an RC tank, many years ago. I used the original circuit for the controller, and faked the RC signals. But it used two DC brushed motors

Title: Robotics RC Car hack help


问:
In practical terms, how close is the accuracy of camera-based visual odometry/SLAM methods to lidar-based methods for autonomous car navigation?
Benedict Evans, a general partner at Andreessen Horowitz, claims that “almost all autonomy” projects are using lidar for SLAM, and that not all of them use HD maps.

An MIT group is testing self-driving cars on public roads without HD maps.

My question is whether the difference in error between lidar and cameras is significant. Benedict Evans and others claim that lidar is necessary for accurate enough SLAM in self-driving cars, but at first glance the KITTI benchmark data seems to contradict that claim. I want to confirm or refute that impression.

The KITTI Vision benchmark leaderboard for visual odometry/SLAM methods shows a lidar-based method called V-LOAM in first place, and a stereo camera-based method called SOFT2 in fourth place. They have the same rotation error, and a percentage point difference of 0.05 in their respective translation errors.

Is a 0.05 percentage point difference in translation accuracy large or insignificant, when it comes to an autonomous car navigation?

The KITTI Vision benchmark leaderboard for odometry/SLAM methods:

答:
In other words, could this difference noticeably impact safety or reliability? -> not at all in my opinion.

What important in autonomous car navigation is localization stability rather than the odometry estimation accuracy. Maps for autonomous driving are usually prebuilt and globally optimized before they are used for a navigation. It is never required to build such an open loop trajectory for a navigation.

Even for a map building, 0.05% is almost meaningless if there is a proper place recognition system.


问:
Controlling Stepper or DC motor with L298 or L293 and getting operation similar to Servo for 6 dof arm
I will be using 1:4 gear ratio and thus will require a motor with a continuous 360 motion and a high torque for efficient functioning. Servo motors with continuous rotation and high torque are very expensive and rare, so my choice has boiled down to DC Motor and stepper motor. However I have not completely understood the way to configure them for a robotic arm. I don't want to use rotary encoders, as installing a potentiometer or hall effect sensor on the shaft will be cumbersome and inaccurate due to vibration. Is there a way one could move a DC motor or stepper motor to a particular angle with IC/modules like l293d or other motor drivers?</p>

答:
You can't control shaft angle of the DC motor without any feedback from it. Servos made for RC models or robots just do the thing - they utilize a potentiometer or rotary encoder to measure shaft angle and control it, mostly with PID regulator.

You can utilize stepper motor for Your task, as these motors are mainly used in the angular manner of control. For that, better than L293D will be dedicated stepper motor driver, like A4988 or DRV8825 (I don't know how large Your robotic arm will be, so these are just example drivers).

If You will choose DC motor over the stepper motor, mind that servos' mechanisms have much higher gear ratio than 1:4 in order to gain torque from a small DC motor.

EDIT: There is also a problem with holding the position of the stepper motor, common in CNC machines, 3D printers etc. Stepper motors can move (almost) freely, when there is no holding current applied. Therefore, when a machine is turned on, every motor has to find its origin. It is usually done by placing a switch on the minimum or the maximum position of the joint. The process of finding origin of the machine is called Homing.

Check out here how it is done by a 3D printer- You can see here a movement of the axis towards the switch. When the switch is hit, it is recognized by the software as reaching the minimum of the axis, thus zeroing joint's position.

Moreover, there is also a way of sensorless homing by measurement stepper motor current draw. For example, TMC2208 (and also TMC2130 and TMC2100) stepper motor drivers are capable of doing that. When the joint mechanically reaches its constraint, the driver knows it by measuring, that the motor is drawing more current than normally. It also sets diag1 pin to high (if it is properly configured), allowing external electronics to detect machine's home position.

These drivers are also very silent and give smoother motor movement in comparison with previously mentioned ones. You can check the difference in sound here.


答:
You can't do position control without position feedback.

You need position feedback. Your comments regarding why you're not going to use position feedback ("cumbersome and inaccurate due to vibration") are totally inaccurate. There is no vibration unless you don't mount the equipment correctly. It's not any more cumbersome than anything else.

If you want to do position control, you're going to put a position sensor somewhere.

How well you want to do position control, how accurate you want it to be, how long you want the startup/homing routine to be, those are all questions for you the designer to answer. Being lazy now and choosing to slap a limit switch on because you can't be bothered to actually look at rotary encoders means you get to wonder for the life of your robot arm whether the arm is actually in the position you think it is.

"Isn't there a way one could move a DC motor or stepper motor to a particular angle with IC/modules like l293d or other motor drivers."

You can command an incremental position change. You cannot verify the final position.

Title: Controlling Stepper or DC motor with L298 or L293 and getting operation similar to Servo for 6 dof arm

Body: I will be using 1:4 gear ratio and thus will require a motor with a continuous 360 motion and a high torque for efficient functioning. Servo motors with continuous rotation and high torque are very expensive and rare, so my choice has boiled down to DC Motor and stepper motor. However I have not completely understood the way to configure them for a robotic arm. I don't want to use rotary encoders, as installing a potentiometer or hall effect sensor on the shaft will be cumbersome and inaccurate due to vibration. Is there a way one could move a DC motor or stepper motor to a particular angle with IC/modules like l293d or other motor drivers?</p>


问:
Do servos stop at their limits automatically?
I'm moving from controlling a robot arm with basic time based motors controlled using a raspberry pi and python to a more advanced robotic arm that has servos (e.g HS-425BB). With the time based motors I must constantly keep track of the arms position (guess work) and make sure it doesn't over turn.

Do servos automatically stop if you give them a position that is outside of their boundaries rather than grinding the gears?

答:
I have worked with quite a few servos (Industrial and RC) and from my experience they don't come with a limit switch that actually takes the current off the motor when they hit a limit. They are however limited in rotation by the PWM signal you send them and are as such limited to a rotation safe area.

It does become a bit more complicated when you link several servos into a robot arm as there is a chance that individual arm segments might hit each other or the ground or... .

For a reference feedback i recommend measuring the internal voltage over the servo reference potentiometer as outlined in the following link:

http://forums.trossenrobotics.com/tutorials/how-to-diy-128/get-position-feedback-from-a-standard-hobby-servo-3279/

This analog voltage gives you an indication of the actual servo position. This voltage can be sampled from eg. an Arduino board or any other board with an analog/digital converter.

I have done something similar with a hexapod robot, and it worked perfectly.

OwnerDisplayName: GreenGiant

ContentLicense: CC BY-SA 3.0


问:
Relation between GraphSLAM and Iterative closest Point algorithm
I have lots of doubts about GraphSLAM, The GraphSLAM Algorithm with Applications to Large-Scale Mapping of Urban Structures. When I practically implement it I get matrix singularity error.

I taken the data set from UTIAS Multi-Robot Cooperative Localization and Mapping Dataset.

Now this dataset contain 75000 odometer data and 5000 sensor data. Correspondence are known correspondence. As per the algorithm initially I think the information matrix should be 75015x75015 matrix. But practically, this is impossible to implement. I am using universal java matrix package.

Then I think the robot may come to the same position after roaming certain amount of time. So I have to identify the location which is same as previous location.

I watched Lecture 7: Visual Navigation for Flying Robots where there is a description of Iterative Closest Point algorithm. This algorithm identity the same location.

But I have some doubts about the lecture. The prof said

Given: Two corresponding point sets (Clouds)

$$P = \{p_1,...,p_n\}\text{ and }Q = \{q_1,...,,q_n\}$$

Where does he get those points? Why there is there two data sets? Does $P$ represent X axis and $Q$ represent Y axis?

I have odometer and sensor raw data. From which one do I create this point cloud?

Do I really need to use this technique (ICP) for my implementation?

答:
Iterative closest point is a method to fuse two point clouds together. If Robot A drove around town and gathered some data, then Robot B drove around town and gathered some data, ICP would (theoretically) be able to join the two clouds together.

In reality, if A and B don't have a common view (didn't drive down the same street/segment), then ICP isn't going to produce anything meaningful. Even if they did observe some common terrain, you still need a pretty good guess of how those segments should be joined. ICP is an iterative closest point algorithm and is prone to getting "stuck" in local minima.

That is, without a good seed point (initial guess), an ICP algorithm might try to put your shirt on as pants, because there are two long cylinders (sleeves) for your legs and one big opening for your waist. It fits better there than it does around your feet or upside down on your torso, so it "converges" on shirt == pants.

You've asked several questions now about a colossal data set - I would suggest trying with a smaller data set first and verifying whether the algorithm works or not, how you implement it, etc. You could try the first N samples, or average to every Nth sample, etc. Trying to go from no good guidance to completely solving what appears to be a large problem is a good recipe for getting frustrated and giving up. Take smaller steps.


问:
loop closure detection in visual SLAM
A robotic system is moving a getting its current location using visual odometry (incremental estimation of rotation and translation). To correct its localization, a loop closure technique may be added. However, this technique based on image comparison is costly. I want to find a way to only use this technique of loop closure only when a potential loop closure is present.
Is there a way to use the $x$ and $y$ coordinates of the vehicle provided by visual odometry to say that based on their values a loop closure may have occured?</p>

答: I think you should go for iterative closest point algorithm. This algorithm is used for detecting loop closing. This is not very reliable but still it work well. You can check this link Visual navigation for flying Robots</p>

Title: loop closure detection in visual SLAM


问:
Can Lego Mindstorms EV3 be run on Intel Atom 1.33 GHz CPU?
The specifications at Lego official site here say that Dual Core 2.0GHz CPU or better is needed. Still, maybe quad core with 1.8 GHz (like Prestiogio Multipad Visconte's Intel Atom quad core) would work smoothly enough?

Have anyone tried to run Lego Mindstorms EV3 on such kind of CPU?

答: Most probably, yes but performance will be slow because you have a very slow CPU. You can increase performance of the software by disabling visual effects in Windows and by closing background apps.</p>


问:
Line following robot with EV3 Colour Sensor
I am trying to build an advanced coloured lines following robot with the ability to differentiate between many different coloured lines and follow them. I am looking for the right sensor that will help my robot achieve its objective.

As I was researching I came across the EV3 Colour Sensor which can detect up to 7 colours.

Is this sensor suitable for my project?

What other sensors can I use and how?

Thank You

答:
I hope you can only use EV3 Color Sensor for line following and sensing colors. There are 3 modes for the Color Sensor. You can use 2 of them for these tasks:

1.) Color Mode
This mode is best suited for sensing colors. This is really useful if the darkness of the Colors are same. It can only sense a handful of Colors: Black[1], Blue[2], Green[3], Yellow[4], Red[5], White[6] and Brown[7]. If you don't want to make your Robot follow the line precisely you can use this mode.

2.) Reflected Light Intensity
This is used to determine the reflection of the surface. This is very useful if you want to make your Robot follow the line precisely. Let's say if you want your Robot to follow in between the black line and the white line. You can get the reflected values of the white surface and the black surface and add them and dividing them by 2 will give the threshold value to make your Robot follow in between the black and white line. It is generally used to measure the darkness of a surface. The more darker the surface,lesser is the reflection. The more brighter the surface, more is the reflection.

Unfortunately you can't use both the modes simultaneously in EV3 as it will result in resource conflict letting your Robot to crash. Instead you can use 2 Color sensors to use both the modes simultaneously in each sensor.


问:
Fixed point arithmetic on microcontrollers
Often we use microcontrollers to do things in our robots, but need to make some calculations in decimal. Using floating point variables is very slow, because a software floating point library is automatically included (unless you have a high-end microcontroller). Therefore, we generally use fixed point arithmetic.

Whenever I do this, I just use an integer, and remember where the decimal place is. However, it does take some care to ensure that everything is consistent, especially when calculations involve variables where the decimal point is in a different place.

I have implemented a fixed point atan2 function, but because I was trying to squeeze every last drop of limited precision (16 bits), I would often change the definition of where the decimal point is, and it would change as I tweaked it. In addition, I would have some constants, as a quasi look-up table, which themselves have an implied decimal point somewhere.

I want to know if there is a better way. Is there a library, or set of macros, that can simplify the use of fixed point variables, making multiplication and division between mixed variables easier, and allowing declaration of decimal numbers or constant expressions, but automatically converting to the desired fixed point representation at compile time?

答:
There are a number of implementations (no libraries that I'm immediately aware of) of Binary Scaling (aka B-scaling)

In this, you keep a mental note (or even better, document the code...) of where the decimal point is, using shifts to move the decimal point up or down.

I've used B-scaling in assembler on defence projects, on even the smallest CPUs so can vouch for its suitability for anything else...


问:
Motor driver selection
I am building a 2 wheel robot to carry 7KG of load. I used this link to get the torque required for each motor which is 11Kg-cm. So I choose 2 of these motor which has 36Kg-cm(2x more) torque. I noticed that the stall current is 14A.

Can I use Adafruit Motor Shield for Arduino which is rated 3A peak current capability?

If not what current rating driver should look into?

Thanks!!

答:
You could use it, but that would mean you will have to limit your power supply a lot. When your robot starts up, it will need a serious amount of power for the time it takes to accelerate, if you have a power supply of 12V, you will probably immediately burn out the motor driver you mentioned.

A motor driver that would work (from Sparkfun, I couldn't find a high power motor driver at Adafruit) is this shield.

That said, you could use these motors, with the shield you mentioned, but you will have to limit your power supply, and that is going to cost you: speed, acceleration, torque and a big headache. You are way better off getting a higher power shield.

I am in no way affiliated with Sparkfun, I just knew they had a shield that will suit your needs.

Title: Motor driver selection


问:
EKF localization data association
I am working with ROS indigo and clearpath huskyA200 and wanted to implement the EKF localization with unknown correspondences with my own hokuyo lidar data for a school project. Giving the algorithm in page 217 of the probabilistic robotics book by Thrun. (Picture of the algorithm is given below), what does step 9 mean by “for all observed features”, does it mean all the raw data in a lidar scan? Or does it mean to process the raw data first to find the features? If it’s the latter, what would be some technique to process the raw data to find features?

This stackoverflow post helped me understand this algorithm a lot better, but now, i am just not sure how to provide the observed feature with my own lidar scan data.

Any help is appreciated, thank you.

答:
It should be processed features. Extracting features from raw data is usually called as front-end in SLAM. The easiest forms of features in cased of 2D LiDAR are corners, edges, and lines. You can run RANSAC algorithm to find line segments. Corners are found by intersection of lines and edges are ends of lines. Corners should be enough for a uni project.

ICP can be utilized to register raw scans but that becomes a different type of SLAM.

Title: EKF localization data association


问:
Quad-rotor 1-D Linear Control Simulation with MATLAB
I was Performing Programming Assignment with MATLAB for Quad Thrust and Height for an Introductory Course. The control input for a PD controller was According to the Equation

u = mass*(diff(s_des, 2) + Kpe + Kvdiff(e) + gravity)

where:

diff(s_des, 2) is the second diff. of the Desired Height which is 1 meter.

Kp & Kv are the Proportional and Derivative Gains which Require Tuning.

The Term "e" is the Position Error and diff(e) is the Velocity Error.

Note: The Desired Kp, Kv, and Height required to be within 1 Second for the Rise Time, and Less than 5% for the Over Shooting.

and the Code made by the instructor was:

```<code>function [ u ] = pd_controller(~, s, s_des, params)
% PD_CONTROLLER  PD controller for the height
% s: 2x1 vector containing the current state [z; v_z]
% s_des: 2x1 vector containing desired state [z; v_z]
% params: robot parameters
% FILL IN YOUR CODE HERE
end
</code>```

Finally, The simulator doesn't go so well, and I Couldn't Find the Error

答:
You haven't posted how you're using your function, which could be problematic, or what the error is. That said, even without that information (which will be required to get a more detailed answer), there are a few glaring issues. I'll point those out now and request that you edit your question to include how you're using the function you provided to perform a simulation, what you were expecting to see in the simulation, and what you actually got, including the exact errors you got, if any.

You gave a "control equation" of u = mass*(diff(s_des, 2) + Kpe + Kvdiff(e) + gravity). The term diff(s_des, 2) doesn't make sense in the context of the question because (a) your s_des doesn't have three entries, so you can't take diff(s_des,2) (the result is empty), and (b) you're (trying to) use the reference acceleration as a feed-forward term for your controller. This may or may not be in the scope of what you're trying to do, but your question asked specifically about a PD controller. I don't know if you're supposed to have the feed-forward term included.

Big Problem #1 - You get the current height and speed, s, and then you overwrite it: s = [0; diff(0)]; You should try just entering that command at the command prompt in Matlab and see what the result is. It's not a 2x1 vector. It certainly is not the current height and speed.

Big Problem #2 - Same as Big Problem #1, but for your references s_des.

Your error term e and the derivative error term diff(e) suffer from a similar-ish set of problems as the two Big Problems above. You're not using diff correctly. Instead of trying to take diff(e) to get the time derivative of your error, you should instead consider what constitutes your error (hint:position) and what the derivative of a position error would be, and then how you can create that given the current state and reference states you've been given.

Since most of your trouble seems to revolve around diff and indexing here's a quick primer on diff:

If you have a symbolic expression, then diff will give you the symbolic derivative of that expression. You do not have a symbolic expression. You have a 2x1 numeric vector.

If you have a numeric vector, then diff(myVector) is equivalent to diff(myVector, 1), which is equivalent to myVector(2:end) - myVector(1:end-1). That is, it starts at the second entry in the vector and subtracts from that entry the value in the previous index. It then steps through the entire remainder of the vector. If myVector is Nx1, then diff(myVector) is (N-1)x1.

If you try diff(myVector, M), then Matlab runs the diff(myVector) M times and returns that result. Every time it runs the diff command your result gets shorter by one. This is why I said earlier that you can't take diff(s_des, 2) if s_des is only 2 elements big. The starting vector is 2x1, so the result of the first diff is (2-1)x1, and the result of the second diff is then ((2-1)-1)x1, or 0x1. It's empty.

Further, from a physical meaning perspective, your s and s_des vectors are [position; speed]. What do you get when you take diff(s)? You get [speed - position]. What physical meaning does that have? None.

What I would suggest you do (and what I routinely do with all of my code) is to "break out" your inputs as the first thing you do in your code. Since the first entry in s is your current position, you might try something like:

```<code>currentPos = s(1);
</code>```

You can break out the rest of the terms in a similar manner:

```<code>currentSpeed = s(2);
referencePos = s_des(1);
referenceSpeed = s_des(2);
</code>```

Also important to note is that these terms are not a history of values. That is, you can't take diff(currentPos) and get a speed. currentPos is exactly that - the current position. Nothing more. Again, I would suggest you write the reference error equation and then take the first derivative of that.

Body:
You haven't posted how you're using your function, which could be problematic, or what the error is. That said, even without that information (which will be required to get a more detailed answer), there are a few glaring issues. I'll point those out now and request that you edit your question to include how you're using the function you provided to perform a simulation, what you were expecting to see in the simulation, and what you actually got, including the exact errors you got, if any.

You gave a "control equation" of u = mass*(diff(s_des, 2) + Kpe + Kvdiff(e) + gravity). The term diff(s_des, 2) doesn't make sense in the context of the question because (a) your s_des doesn't have three entries, so you can't take diff(s_des,2) (the result is empty), and (b) you're (trying to) use the reference acceleration as a feed-forward term for your controller. This may or may not be in the scope of what you're trying to do, but your question asked specifically about a PD controller. I don't know if you're supposed to have the feed-forward term included.

Big Problem #1 - You get the current height and speed, s, and then you overwrite it: s = [0; diff(0)]; You should try just entering that command at the command prompt in Matlab and see what the result is. It's not a 2x1 vector. It certainly is not the current height and speed.

Big Problem #2 - Same as Big Problem #1, but for your references s_des.

Your error term e and the derivative error term diff(e) suffer from a similar-ish set of problems as the two Big Problems above. You're not using diff correctly. Instead of trying to take diff(e) to get the time derivative of your error, you should instead consider what constitutes your error (hint:position) and what the derivative of a position error would be, and then how you can create that given the current state and reference states you've been given.

Since most of your trouble seems to revolve around diff and indexing here's a quick primer on diff:

If you have a symbolic expression, then diff will give you the symbolic derivative of that expression. You do not have a symbolic expression. You have a 2x1 numeric vector.

If you have a numeric vector, then diff(myVector) is equivalent to diff(myVector, 1), which is equivalent to myVector(2:end) - myVector(1:end-1). That is, it starts at the second entry in the vector and subtracts from that entry the value in the previous index. It then steps through the entire remainder of the vector. If myVector is Nx1, then diff(myVector) is (N-1)x1.

If you try diff(myVector, M), then Matlab runs the diff(myVector) M times and returns that result. Every time it runs the diff command your result gets shorter by one. This is why I said earlier that you can't take diff(s_des, 2) if s_des is only 2 elements big. The starting vector is 2x1, so the result of the first diff is (2-1)x1, and the result of the second diff is then ((2-1)-1)x1, or 0x1. It's empty.

Further, from a physical meaning perspective, your s and s_des vectors are [position; speed]. What do you get when you take diff(s)? You get [speed - position]. What physical meaning does that have? None.

What I would suggest you do (and what I routinely do with all of my code) is to "break out" your inputs as the first thing you do in your code. Since the first entry in s is your current position, you might try something like:

currentPos = s(1);

You can break out the rest of the terms in a similar manner:

currentSpeed = s(2);
referencePos = s_des(1);
referenceSpeed = s_des(2);

Also important to note is that these terms are not a history of values. That is, you can't take diff(currentPos) and get a speed. currentPos is exactly that - the current position. Nothing more. Again, I would suggest you write the reference error equation and then take the first derivative of that.


问:
rosservice via Python
I have a drone which has certain services, say random.srv. I want to use this service via Python. Now I know that there is a page in ROS wiki that tells you how to create a service client in Python. Unfortunately that is not sufficient for me. Here goes my case:

Once I start the drone node, the service is listed as

```<code>/main/random_task
</code>```

Now an important point to note is that the name of the service is as stated above

```<code>random.srv
</code>```

The function that I am writing is:

```<code>from random.srv import *
import rospy

def enableRandom():
    rospy.wait_for_service('main/random_task')
    try:
        droneRandom = rospy.ServiceProxy('main/random_task', random)
        doSomething(1)  # something seems to be missing

    except rospy.ServiceException:
        print('Service call failed')

if __name__ == '__main__':

    enableRandom()
</code>```

The thing is it gives an error saying random is undefined. But that is the name of the srv file.

Can someone also explain why it doesn't work the way it should. You can guess by this question that I am new to this.

Edit 1:
Now I understand that in the statement

```<code>from random.srv import *
</code>```

the 'random' should be the package name. This is not the case. The package name is, lets call it my-package1. The service random.srv that I want to use is in

```<code>src/my-package1/main/srv/
</code>```

Another thing to clear up is that /main/random_task is the name with which random.srv is shown in rosservice list. The new code now is

```<code>from my-package1.srv import random
import rospy

def enableRandom():
    rospy.wait_for_service('/main/random_task')
    try:
        droneRandom = rospy.ServiceProxy('/main/random_task', random)
        doSomething()

    except rospy.ServiceException:
        print('Service call failed')

if __name__ == '__main__':

    enableRandom()
</code>```

Now I get my-project1 as having invalid syntax (I guess due to having '-'symbol). If I use

```<code>from main.srv import random
</code>```

it says it cannot find 'main'.

First if I have to use 'my-project1.srv' how to I get around the syntax issue with '-'.

Secondly, if I have to use the subfolder name i.e. main.srv, why does it not recognize the package if it can recognize the services inside it (when using rosservice list on the terminal).

I think there is an issue with the syntax.

答: A lot of gratitude for Chuck for investing the time and making me learn a lot. But the issue I had was more for a stupid reason that anything else. Having multiple catkin workspaces, I tend to source the terminal if and when required. While running ROS, I run the code above using a new terminal. I just did not source it and hence I couldn't locate the packages (and consequently services) in that workspace despite the ROS running the nodes and services from those packages.</p>

Title: rosservice via Python


问:
How can I get the right sample in RRT star Dubins?
I am trying to find a solution in S(1)*R^2 (x,y, orientation) with obstacles (refer to image) using RRT star and Dubins Model.

The code takes a lot of time to find a suitable random sample with x,y, theta such that a successful Dubins path can be connected between the two points without the vehicle (a rectangle colliding any of the obstacles). The fact that the random sample needs to be at the correct angle so that the vehicle's path is collision free is 1 out of 100,000 random samples. This makes the code very slow even when my computer is at its full processing power. None of my internal codes take much time. I timed all of them, only the fact of achieving that 1 out of 100,000 sample causes the code to take so much time. I tried decreasing my discretization space by half but the problem still exists.

答:
According to the given picture, the car should move from start to goal and has to fulfill the constraints, that means the car must stay between the colored boxes. A plain RRT algorithm doesn't make much sense here, because the state space is huge. In each time step the car is able to move a small amount forward, a large amount and it can steer. If the sequence takes 20 seconds and the car can execute an action, each second two times, we will get a lot of possibilities.

The problem can be solved with an algorithm called Random-MMP, which is a multi-modal RRT pathplanner which is utilizing a motion model as heuristic. Explaining Random-MMP is easier if we assume only one mode. A mode is similar to a motion primtive which results into a sandbox like game. We call the mode “putcaronthemiddle”. If we are executing this mode interactively, the car gets the position direct on on the crossroad. The first RRT graph is generated until the mode, and the second graph is created from the mode to the goal.

In the case with only one mode, Random-MMP is equal to RRTconnect which is also growing two trees at the same time. But with more motion primitives the advantage will become more obvious. The general idea behind Random-MMP is called in the literature “task & motion planning grounding” and means to combine a geometric planner with a symbolic planner.

At the end, i want to send some greetings – with respect to the admin of this forum – to Master yoda, Dr. Emmett Brown and Chuckie Sullivan.


问:
Compatibility of my quadcopter build
I am building my first quadcopter and have multiple questions. I am using a Crius MWC Multiwii SE 2.6 flight controller which will get input from a Raspberry Pi Zero.
I have this 4in1 ESC and this PDB. The battery is LiPo 4S 45C 1550mAh.

1.) Since the 4in1 ESC has one output for each of the 4 motors. Can I connect these to the corresponding inputs on the MultiWii that would normally be used if I had 4 separate ESCs? When using 4 separate ESCs each would have additional Ground and Voltage which would be missing when using the 4in1 ESC.

My idea was to connect the 5V input and GND of the MultiWii to the PDB but I am not sure if this will suffice in powering the entire MultiWii.
I want to connect the Raspberry to the MultiWii via TX/RX Pins, same question as as before: Do I need additional GND and 5V here if I connect the entire Multiwii to the PDB?

2.) I wanted to connect the Pi Zero also to the PDB. I read that its more secure to use PWR USB port. I am thinking of sacrificing an USB cable and soldering the ends to the PDB. Is this really more secure than using the GPIO Pins and can I power both, Raspberry and MultiWii through the PDB?

Thanks in advance

答:
You can think about Your 4in1 ESC as 4 separate ones. You just have to connect four signal pins to the corresponding signals in the flight controller, as You said. Mind that three signal cables have one pin connectors, that go just to signal pins of your flight controller, whereas fourth one is a three pin connector with second pin missing - this one has the ground connection.

Yes, you should connect USB power rather than direct one. USB input is better filtrated, therefore it will be more secure for Your application than direct powering the Pi (see N. Staubs answer). It will be also easier to unplug in urgent cases, rather than directly soldered cable to the Pi.

BEC installed on Your PDB is capable of supplying 5V @2A. It should power Your configuration without a problem.

Title: Compatibility of my quadcopter build


问:
Beaglebone Black power draw
What is the minimum amount of power that a beaglebone needs to start up? This would be with no   peripherals attached besides host usb. The getting started guide claims that it can run off of a computer's usb power, but makes no mention of how many amps are actually needed. I saw a mention of older kernels limiting current draw to .5 amps when working off of usb, although that was all I could find.

Could one start a BeagleBone Black off of .3 amps? If not, how many?

答:
If the getting started guide claims you can run it of a computers USB port, it will work at about .5 amps. A normal computer power supply limits the current to a USB port to .5 amps. Doing some research on the Beaglebone Black's site http://beagleboard.org/Support/FAQ, I found this:

When powered up over USB, the regulators are somewhat limited in what they can supply the system. Power over USB is sufficient as long as the software and system running perform some management to keep it under the USB current limit threshold.

and

The recommended supply current is at least 1.2A (or 6W), but at least 2A (or 10W) is recommended if you are going to connect up anything over the USB. The actual power consumption will vary greatly with changes on the USB load.

So it seems like the .5 amps from the computers USB port, is about as low as it gets.

Title: Beaglebone Black power draw


问:
provide world map for ekf global localization problem
I am trying to implement the ekf_localization algorithm in page 217 (Table 7.3) of the probabilistic robotics book by Thrun.

From my previous post, I understand that I need to extract observed features on step 9 of the algorithm given in the book. So I am planning to use a line extraction algorithm (https://github.com/kam3k/laser_line_extraction) to extract lines, then find the center point of the line and use that point as my observed feature in step 9.

Click part1 part2 to see table 7.3.

Now, I am having trouble understanding what is the map (m) input.

Since, the ekf_localization algorithm assumes that the map is already giving, and let’s say figure 1 is the actual map that my robot will navigate in. Does this mean, that m consist of points in the world coordinate frame and that I can manually choose them? For example, the dots in figure one are my point landmarks that I provide for the algorithm (m = {(2,2), (2,4), 5,1), (5,2), (5,3), (6,2)}). If so, how many points should I provide?

Be great if you could help C.O Park.

答:
I can manually choose them? -> Generally, that process is called as "matching" or "data association". You can do it manually as well. The simplest solution is finding closest map point of your estimated point by Euclidian distance. You will find other probabilistic methods in the later part of the book.

One point is the minimum but could be unstable or not that accurate. (I am not sure actually. You need to double check.) Two points will be sufficient to determine distance and rotation. The more, the better.


问:
stable altitude quadcopter
I'm currently working on a project to generate a stable altitude and automatic control for a quadcopter
I'm using arduino as the flight controller
Ultrasonic sensor HC-SR04
MPU-6050
However my project expected outcome is to set the quadcopter to fly( altitude hold) to 50 Cm above the ground.
My problem is I don't know which one of the sensors I have to use for PID set point can anyone help me with the code or the functions the I need to use ? </p>

答:
Typically quadrotor have a nested control approach.
That means one P(I)D loop controls the orientation (using IMU readings) and another one the position (using position sensors, e.g. ultrasound for altitude).

The attitude loop is executed faster than the position one and is assumed to ensure that the desired orientation is tracked reasonably well.

The position loop is around the orientation one and provides desired orientation to be tracked based on the desired position.

This is necessary as lateral displacement of the quadrotor can only be achieved by changing the orientation so that total thrust is pointing in the direction of motion.

In your case, you might escape that as you describe only altitude (z-position) control, so you want to control the 3 orientation angle and and the altitude, which mean you can directly do as the quadrotor as 4 inputs. The only drawback is that you might see you quadrotor drifting around if you do not cits position in the horizontal plan.

Title: stable altitude quadcopter


问:
Depth accuracy of the stereo camera
I am doing a project on calibrating stereo ZED camera and  finding its accuracy and compare with the Manufacturer's accuracy of 1% at 1m depth accuracy.
For this purpose , the formula to calculate the depth accuracy  is
$dz = (z^2 * de) / (f * b)$
but how do we calculate $z$ , $de$ and $f$. Is is taken from matlab stereo-callibration app which gives 'Stereoparameter' ?

$dz$ is the depth error in meters, $z$ is the depth in meters, $de$ is the disparity error in pixels, $f$ is the focal length of the camera in pixels and $b$ is the camera baseline in meters.

答: This paper shows an approximation of the RMS error of the ZED camera as a function of distance.Depth Data Error Modeling of the ZED 3D Vision Sensor from Stereolabs</p>

Title: Depth accuracy of the stereo camera


问:
Bluetooth Controls instead of R/C Controls for simple Holonomic robot
I am new here and with little experience in robotics.

I have assembled this holonomic robot:

https://shop.wickeddevice.com/product/omniwheel-robot-complete-kit/

It has 3 Omni-wheels, 3 gearhead motors. It is controlled by a pre-programmed Arduino 1 with a custom motor shield.
It is set up to be controlled with R/C inputs from standard radio control gears. I would like to replace the control via R/C inputs with Bluetooth ones. I would like to use the robot for research purposes and the R/C does do allow me the flexibility to have pre-coded functions to input in the computer. I would like to use the BlueFruit LE that comes with an IOS app.

https://learn.adafruit.com/bluefruit-le-connect-for-ios/controller.

The current set-up comes with a Motor Shield Library + Arduino Code, see links:

https://github.com/WickedDevice/WickedMotorShield

https://github.com/WickedDevice/OmniWheelControl/blob/master/OmniWheelControl.ino

My questions are: would you advise to use the current setup with Bluetooth? Would you advise to use another motor shield?

Thanks

答:
There are many ways to interface an Arduino to BT LE.

There are many BT shields for the Arduino including the official one and Adafruit's. There are less expensive ones out there if you look.

If you're willing to do a bit more work, you could get a Raspberry Pi Zero-W (the 'W' is important!). The 'W' version of the Raspberry Pi Zero has built-in wireless and BT. I'd interface the two processors with I2C. You'd need to use a level shifter for the communications because the Pi is a 3v3 board while the Arduino is most likely a 5v device.


问:
Calculating the efficiency of Mecanum wheels
I'm part of a FIRST Robotics team, and we're looking into using Mecanum wheels for our robot.

What are the advantages and disadvantages of using Mecanum wheel versus regular ones? From looking through Google, it looks like Mecanum wheels give more mobility but don't have as much traction. Are there any other advantages or disadvantages?

Compared to regular wheels, are Mecanum wheels less efficient or more efficient in any way? And if so, is there a quantifiable way to determine by how much?

Are there equations I can use to calculate efficiency (or inefficiency) and/or speed of moving forwards, sideways, or at arbitrary angles?

A picture of a robot with mecanum wheels:

答: You might want to check out FRC 1114 Simbotics' website, especially  http://www.simbotics.org/resources/mobility . The FTC team I coach has used that as a starting point for their own work. </p>


问:
Robot localization using sensor fusion (How to model the Extended Kalman Filter)?
I am new to the robotics field and sensor fusion as well.

I am trying to localize my robot using the data from my camera and the odometery through extended Kalman filter.

I have the data offline, I synchronized them. However I have a trouble with constructing the $F, H$ matrices.

Any help?

答:
This is the advice I gave to BOB but will be useful for you as well.

I recommend you to run an ekf slam tutorial code and analyse it. There is a perfect one for you: robots.ox.ac.uk/~SSS06/Website/index.html It is the simplest EKF SLAM but quite well coded and easy to read if you know matlab. I am sure the most of your implementational questions will be easily answered by looking at this code.

Practical 1 & 2 in the above link contains 90% of the things you need for implementing mono ekf slam or 2d ekf slam.

Another material for theoretical aspect on slam is here


问:
Meaning of a negative step response with quaternion
It's not technically robotics but:

I've been trying to reproduce in Simulink a  spacecraft attitude simulation using quaternions, and the kinematics and dynamics seem to work fine, however I'm having a bit of trouble with the controller.

I followed the model give in the 7th chapter which seems to be some sort of a PD controller. The control equation I used is:

$q_e$ is the quaternion error,
$\omega_e$ is the rotation speed error

But my results seems to be off.

With : Initial quaternion and rotation speed are $q_i = [0;0;0;1]$ and $ \omega_i = [0;0;0]$

I give a desired reference of $q = [0;1;0;1]$ and $ \omega = [0;0;0]$.

I get the following response:

$q(1)$ and $q(3)$ are staying at zero as expected.

But :

$q(2)$ is going towards -1 instead of 1 (As far as I understand the sign ambiguity does not explain this since q(4) is staying around 1)

$q(4)$ is not maintaining at 1. (I am not sure if this is related to the fact that the controller is only a PD)

I've tried to add -1 gains but it doesn't seem to solve the problem.

Why would the step response of q(2) be going to -1 instead of 1 ?
And why is q(4) decreasing ?

For reference I've added the simulink model:

And the "Error quaternion" block:

Edit: (Response after Chuck's answer)

答: It looks like you are negating your reference inputs in the summing junctions.  </p>


问:
How do I motorize the elbow socket and other joints in a powered exo-skeleton?
How would you motorize the joints in an Iron Man suit? You need something fairly shallow, I would think, probably dual servos sitting on either side of an elbow or knee joint or either side of your hips, but how do you get motorized action there without dramatically adding to the thickness of the joint?

Bicycle-style chain drives wouldn't work, I would think, since the length of the chain would need to vary depending on what position you're in for at least a lot of joints.

How would you motorize the joints?

答:
Erik, your wish is my command:   </p>

<p>"High torque pancake stepper motor" comes to mind. Can you develop one, and a couple of extra's? :)  </p>

<p>Seriously, you're looking at a combination of technologies and disciplines.  Precision positioning of a "High torque pancake stepper motor" might be an acceptable direction, but it'll probably end up simply being the driver behind Nick Alexeev's (Terminator) hydraulics, after all, the back-hoe surely has its place in "motive amplification," if I may use the term sloppily. :) </p>

OwnerDisplayName: Erik  Reppen

Body:
Erik, your wish is my command:

"High torque pancake stepper motor" comes to mind. Can you develop one, and a couple of extra's? :)

Seriously, you're looking at a combination of technologies and disciplines.  Precision positioning of a "High torque pancake stepper motor" might be an acceptable direction, but it'll probably end up simply being the driver behind Nick Alexeev's (Terminator) hydraulics, after all, the back-hoe surely has its place in "motive amplification," if I may use the term sloppily. :)

OwnerDisplayName: JoeFromOzarks


问:
Why using screws instead of homogeneous transforms in kinematics and dynamics?
Can anyone give a justification for using screws (twists, wrenches) instead of the traditional approach (rotation matrices, homogeneous transforms)? Even if screws are more compact, the situation gets complicated whenever we want to consider accelerations, so using screws in dynamics seems cumbersome for me.</p>

答:
About why screw axes:

According to Kevin Lynch in his video of Twists, "just like the time-derivative of a rotation matrix is not equivalent to the angular velocity, the time-derivative of a transformation matrix is not equivalent to the rigid-body velocity" (linear and angular).

Also he mentions that, instead, "any rigid-body velocity is equivalent to the instantaneous velocity around some screw axis".

Checking his book: Modern Robotics: Mechanics, Planning and Control can explain this in more detail.

About differences between Product of Exponentials (PoE) and Denavit-Hartenberg (DH) (from comments) :

Appendix C of the same book explains the difference between product of exponentials (PoE) and Denavit-Hartenberg (DH). For a more complete description go to the book.

Essentially:

Once a home position for the robot is defined and the base and end
effector frames set (which can be chosen arbitrarily), then the PoE
formula is defined.

No link frames are needed in PoE.

PoE is supposed to be more natural and intuitive.

DH needs to have link frames set in a way that DH parameters exist,
they cannot be chosen arbitrarily.

DH parameters can become ill-conditioned in some situations.

PoE works with a joint value $theta$, while DH differentiates between prismatic
and revolute joints, assigning different variables to it ($d$ and $theta$).

That said, one can choose to compute forward kinematics in both ways. It can also be proven that the PoE formula can be derived from the DH parameter representation.

Hope this helps.


答:
Welcome to Robotics, PaoloH! This is a fantastic question for Robotics - It has some Matlab/Simulink, some control theory, some spatial (quaternion) representations, etc. Robotics is the place to come when your question spans multiple fields!

In looking at your question, the thing that I noticed is that your reference quaternion is $[0; 1; 0; 1]$. It is not a unit quaternion, and I believe this may be your issue.

I looked over your block diagram, and I didn't see anything glaringly wrong there. As SteveO mentioned, the way you're treating the references is a little unusual, but the math all works out. I can't see what you're doing behind the "reference quaternion" or "error quaternion" blocks, but let's take a look at that unit quaternion.

Right now, the magnitude of your reference quaternion is

$$
\sqrt{0^2 + 1^2 + 0^2 + 1^2} = \sqrt(2) \approx 1.414 \\
$$

If you want to convert your reference quaternion to a unit quaternion, then you divide each term of the quaternion by the magnitude of the quaternion, and you wind up with a reference unit quaternion of:

$$
q_{\mbox{ref}} = \left[\begin{array}{ccc}
0 \\
\frac{1}{\sqrt{2}} \\
0 \\
\frac{1}{\sqrt{2}} \\
\end{array}\right] \\
q_{\mbox{ref}} \approx \left[\begin{array}{ccc}
0 \\
0.707 \\
0 \\
0.707 \\
\end{array}\right];
$$

You can review your quaternion output plot and see that q(2) and q(4) are both moving toward a numeric value of ~0.7. The only real problem seems to be that the polarity on q(2) is wrong.

I would guess your "reference quaternion" block is to make the skew symmetric matrix for the "error quaternion" block? The sign problem on your quaternion output could be hiding anywhere, but I'd double check the skew symmetric matrix (that it is actually skew symmetric; $\Omega^T == -\Omega$), and then I'd check the gains. When I said the math all works out on the reference handling, I double checked that just now and it works out for the $\omega$ speed handling. I can't actually tell for the quaternion handling.

Typically, error is (reference - feedback), then you apply gains and sum the scaled error terms.

You have your error as (feedback - reference), and then you apply gains and negate the scaled error terms. BUT, it looks like, for quaternion error, you actually ARE taking (reference - feedback) but then you're still inverting it anyways.

If this isn't enough to get your question resolved, please edit your question to show what's going on under the "Reference quaternion" and "error quaternion" blocks.

Title: Meaning of a negative step response with quaternion

Body:
It's not technically robotics but:

I've been trying to reproduce in Simulink a  spacecraft attitude simulation using quaternions, and the kinematics and dynamics seem to work fine, however I'm having a bit of trouble with the controller.

I followed the model give in the 7th chapter which seems to be some sort of a PD controller. The control equation I used is:

$q_e$ is the quaternion error,
$\omega_e$ is the rotation speed error

But my results seems to be off.

With : Initial quaternion and rotation speed are $q_i = [0;0;0;1]$ and $ \omega_i = [0;0;0]$

I give a desired reference of $q = [0;1;0;1]$ and $ \omega = [0;0;0]$.

I get the following response:

$q(1)$ and $q(3)$ are staying at zero as expected.

But :

$q(2)$ is going towards -1 instead of 1 (As far as I understand the sign ambiguity does not explain this since q(4) is staying around 1)

$q(4)$ is not maintaining at 1. (I am not sure if this is related to the fact that the controller is only a PD)

I've tried to add -1 gains but it doesn't seem to solve the problem.

Why would the step response of q(2) be going to -1 instead of 1 ?
And why is q(4) decreasing ?

For reference I've added the simulink model:

And the "Error quaternion" block:

Edit: (Response after Chuck's answer)


问:
How should I understand sequential importance resampling in a particle filter?
Suppose I implement a particle filter with $n$ particles. This is a brief description of my understanding of a particle filter.

For the first step, I throw out $n$ particles some distance from my vehicle. I weight the particles according to some Gaussian distribution:

$$
w_{j,t} = \frac{e^{-X_{j,t}^{2}/2\sigma^{2}}}{\sum_{j=1}^n{e^-{X_{j,t}^{2}/2\sigma^{2}}}}
$$

where $X_{j,t}$ is some (noisy) difference between a measurement taken at the vehicle and at the particle taken at time t. I then translate these particles with my vehicle (with some uncertainty) and do the same thing again, and the weights of these particles (the same particle pool) is

$$
w_{j,t+1} = \frac{e^{-X_{j,t+1}^{2}/2\sigma^{2}}}{\sum_{j=1}^n{e^{-X_{j,t+1}^{2}/2\sigma^{2}}}} w_{j,t}
$$

We resample if, according to wikipedia, $K = 1/\sum_j{w_{j,t}^2} < thresh$, where thresh is some threshold we pick. Resampling is done according to each particles weight (the probability of being chosen is given by that particle's weight).

My question is thus: if $K<thresh$, that means that some particles are highly weighted. So won't resampling give us a very degenerate list of the highest weighted particles, on average? Suppose this new, resampled population is composed of only n/2 different particles, 2 times each. How do you get n particles back?

答:
One of the easiest techniques to get more particles back is to again spread particles all over the workspace (just like you did in the first iteration) and continue the filtering routine normally.

Also, this will help to the overall tracking procedure.


答: After thinking about the problem, I believe the answer lies in the noise. You translate your particle "batch" every time step, and re weight each time. If $K < thresh$, you resample, with potential degeneracy. However, you don't know the position of your vehicle with infinite precision, and so all particles get moved with some error, and this removes the degeneracy. The previously degenerate particles retain their "influence" because you have more particles in a certain region depending on the degeneracy. The more highly degenerate a particle, the more particles test the next area around where the previously degenerate particle would be without noise to gain even greater precision.

Title: How should I understand sequential importance resampling in a particle filter?

Body:
Suppose I implement a particle filter with $n$ particles. This is a brief description of my understanding of a particle filter.

For the first step, I throw out $n$ particles some distance from my vehicle. I weight the particles according to some Gaussian distribution:

$$
w_{j,t} = \frac{e^{-X_{j,t}^{2}/2\sigma^{2}}}{\sum_{j=1}^n{e^-{X_{j,t}^{2}/2\sigma^{2}}}}
$$

where $X_{j,t}$ is some (noisy) difference between a measurement taken at the vehicle and at the particle taken at time t. I then translate these particles with my vehicle (with some uncertainty) and do the same thing again, and the weights of these particles (the same particle pool) is

$$
w_{j,t+1} = \frac{e^{-X_{j,t+1}^{2}/2\sigma^{2}}}{\sum_{j=1}^n{e^{-X_{j,t+1}^{2}/2\sigma^{2}}}} w_{j,t}
$$

We resample if, according to wikipedia, $K = 1/\sum_j{w_{j,t}^2} < thresh$, where thresh is some threshold we pick. Resampling is done according to each particles weight (the probability of being chosen is given by that particle's weight).

My question is thus: if $K<thresh$, that means that some particles are highly weighted. So won't resampling give us a very degenerate list of the highest weighted particles, on average? Suppose this new, resampled population is composed of only n/2 different particles, 2 times each. How do you get n particles back?


答:
Addressing the shoulder joint, which is rather more complicated than elbows and knees... After this one, the other joints become far simpler to visualize or engineer.

Here is how the ball and socket shoulder joint could work:

Freedom of movement: Approximately 60 degrees end to end, all around. Less than for humans, but it can be tweaked to around 80 degrees without difficulty just by making the half-torus narrower.

The static half-torus (shown in shiny steel here) is for strength, and would be joined to the torso exoskeleton by a rigid set of struts. Half torus = torus with an inner coaxial cylinder excised, tentative diameter of cylindrical hole 145 mm.

The inner blued-steel hollow sphere is where the arm goes through, just beyond the actual shoulder. Tentative diameter of sphere 138mm, diameter of inner cylindrical hole 100 mm.

Rings of little stepper motors on both front and hidden edges of half-torus, gripping inner hollow sphere.

Stepper motors have outer ring rotor, inner stator, and rubberized omniwheel "teeth" to move the inner sphere.

Inner sphere will of course be attached to a rigid exoskeleton matching the upper arm dimensions, up to the elbow joint.

This is how the motors act upon the inner sphere, close up:

This is how each omniwheel stepper motor will work:

The omniwheel design is required for the teeth to allow frictionless motion axial to the rotation direction.

Title: How do I motorize the elbow socket and other joints in a powered exo-skeleton?

Body:
How would you motorize the joints in an Iron Man suit? You need something fairly shallow, I would think, probably dual servos sitting on either side of an elbow or knee joint or either side of your hips, but how do you get motorized action there without dramatically adding to the thickness of the joint?

Bicycle-style chain drives wouldn't work, I would think, since the length of the chain would need to vary depending on what position you're in for at least a lot of joints.

How would you motorize the joints?

OwnerDisplayName: Anindo Ghosh


问:
D-H parameters verification
This robot has 2 revolute joints in advance then one cylindrical joint, then one revolute joint, then another cylindrical joint, then three revolute joints at the end.

There is no D-H table for that and I modeled it in Simulink with the help of Simscape. Now I need the D-H table for the controller part in the Matlab function.

I know that If the rotation of z-axis happens about its X-axis like joint number 2, I can show this change as an Alpha in my D-H table. As it illustrates, rotation of z-axis of revolute joint number 4 happened about the y-axis of TJ2. How can I show this kind of rotation of z-axis in my D-H table?

答:
Here is a video on what the DH parameters are that I highly recommend to everyone that wants to learn about them.

I think I understand your question, and the trouble you're having is coming from the fact that your frames are not aligned correctly per the DH standard. Since they're not aligned correctly, your terms are not working out right.

The important thing is that, as mentioned around 0:42 in the video, "The DH parameters are derived from the common normal between the z axes. The common normal is orthogonal to both vectors and is also the shortest line between them."

So the problem when you ask,

As it illustrates, rotation of z-axis of revolute joint number 4 happened about the y-axis of TJ2. How can I show this kind of rotation of z-axis in my D-H table?

is that you can't. Your frames are drawn incorrectly; the x-axis should be orthogonal to both axes. Instead, in the case of TJ2, $x_{TJ2}$ is parallel to $z_3$.

In fact, in looking over your diagram again, this looks like a common problem for all of your joints - each of your x axes is parallel to the z-axis of the previous joint. You need to redraw your frames and then you can work out the DH parameters.

Title: D-H parameters verification


问:
Controlling a dc servo with serial communication
I am going to buy this motor :-

https://robokits.co.in/motors/encoder-dc-servo/faulhaber-coreless-17w-encoder-motor-120rpm-pid-dc-servo-drive?zenid=im3bp6grppt2f2ofdo2r6pq5c2

The datasheet of its driver:-

http://robokits.download/documentation/Serial_DC_Encoder_Servo_Driver.pdf

I don't know how will I be able to control this motor with Arduino .
I know about the values that control the position and speed of the motor by reading the datasheet but the part where Arduino will be used to send these values is still unclear.I know about serial communication but I have only used it for communication between PC and Arduino.
And can I control more than 1 of these motors with one Arduino ?

答:
You need to read and understand that datasheet.

This board does not have addressing, so without additional hardware you can only have one per serial port.

For a demonstration, use a USB-Serial cable connected between the motor controller and a computer. You can use any serial program you have to communicate with the motor controller.

Examples of serial programs include hyperterm and miniterm. You need to set the serial settings for this connection to 38400 baud, 8 bits, no parity, ad one stop-bit. The motor controller is preset for this connection.

Then you can send commands.

To use this board to control motors from the Arduino, you will need to use either the Serial class or the SoftSerial class. You should be able to use multiple SoftSerial instances to control these motors.

You would need to connect between the pins of the serial port of the Arduino and the motor controller. You would need to create the serial connection with the same parameters as above. Then you have to send a command to the board, always remembering to terminate the command with a carriage return. Since I don't have one of these boards, I don't know if it expects a "\n", "\r" or some combination.

This is an interesting board, but there are too many limitations to see it being any more than a toy, in my opinion. It wouldn't have been difficult to add a few features to make it a usable tool.


问:
Adding encoders to Nomad 4WD
i have a nomad 4wd rover kit but i saw that motors doesn't have encoders. But to use odometry with ros i need it. I cannot found any suggestion on google search, so i ask here if someone could route me to some solutions.

thanks

Edit: Sorry, i forget to add the kit link: https://www.servocity.com/nomad

答:
This is the Actobotics Nomad chassis kit, I assume.

I did this with another Actobotics kit. Buy two extra motors of the same type with encoders, and use these for the rear motors. Get the ones with the same gearbox.

These are the motors that come with the kit.

Here are the original motors.

Here are the ones with encoders.

Title: Adding encoders to Nomad 4WD


问:
Why can Humans single out audio in a crowd? What would it take for a robot to do the same?
I was at a Robotics conference earlier today and one of the speakers mentioned robots not being able to function as well in a crowd because they can't single out audio like a person can.

Why can people single out audio so well?  And what would it take for a robot to do the same?

I'm aware of Active Noise Reduction (ANR) like on Bose Aviation headset, but that is not what I'm talking about.  I am thinking about the ability to take everything in but process only what you feel is important.

答:
What the speaker said at the conference was not accurate.  Perhaps they meant "our robot can't single out audio like a person can", but the statement "[robots] can't single out audio like a person can" is false.

Here is a partial list of systems that can determine the source of an audio signal, and track it:

Conference phones (and many cell phones), with technique(s) described in papers this one

Gunfire locators

Underwater robots with towed microphone arrays, e.g. the AUV described in this paper

Mobile land-based robots

The term you're looking for is a "phased array" of microphones (see also: Matlab phased array toolbox).  NASA uses phased arrays to localize the noise coming from spinning rotor fan blades.


问:
Converging to better solutions by running RRTstar for multiple Iterations
In the Literature I have read so far, I saw RRT star was running in multiple loops to converge to a better solution ( near optimal). I was wondering how I could implement the same, as most pseudocodes don't explain that part.</p>

答:
RRT* indeed runs in multiple iterations to converge to an asymptotically-optimal solution.

In simple words: you could understand RRT* as an RRT, but with: 1) the stopping criteria being time/iterations instead of reaching the goal node and 2) with an extra re-wiring step that chooses, inside of a neighborhood of radius r from your already wired sample, the neighbor that can see its path cost more reduced, and attempts to connect to it. With this last methodology you get more styled branches which lead faster to the goal.

Here you got a video that explains RRT.

The same author makes another video on RRT* (in particular the re-wiring process).


问:
Servo motor power consumption issue
I am using servo motor model no. MG995 with Arduino. I don't know the current it consumes while powered on and while lifting a 10 kg of weight. I am currently using a 5 V, 1 A power supply with one motor but in future I need to connect 6 motors to single supply.</p>

答:
From the TowerPro website from the MG995:

Specification:

Weight: 55 g

Dimension: 40.7×19.7×42.9 mm

Stall torque: 9.4 kg/cm (4.8v); 11 kg/cm (6 V)

Operating speed: 0.20 sec/60° (4.8 V); 0.16 sec/60° (6.0 V)

Operating voltage: 4.8~ 6.6 V

Gear Type: Metal gear

Temperature range: 0- 55 °C

Dead band width: 1 µs

servo wire length: 32 cm

Current draw at idle 10 mA

No load operating current draw 170 mA

Stall current draw 1200 mA

From the stall torque at 6 V it can lift a maximum of 11 kg at 1 cm from the axis of the servo, so your load of 10 kg would be on the limit. THe MG995 may not be sufficient.

Also, as the stall current of one servo is 1200 mA you probably need a bigger power supply, or rather one that is capable of supplying more current.

Even with no load, six servos, when operating, will consume (6 x 0.17 =) 1.02 A, so again you will need a bigger supply.

The MG996R has a similar specification:

Specification:

Weight: 55 g

Dimension: 40.7×19.7×42.9 mm

Stall torque: 9.4 kg/cm (4.8 V); 11 kg/cm (6.0 V)

Operating speed: 0.19 sec/60° (4.8 V); 0.15 sec/60° (6.0 V)

Operating voltage: 4.8~ 6.6 V

Gear Type: Metal gear

Temperature range: 0- 55 °C

Servo Plug: JR (Fits JR and Futaba)

Dead band width: 1 µs

Servo wire length: 32 cm

Current draw at idle 10 mA

No load operating current draw 170 mA

Stall current draw 1400 mA

So you probably need to rethink your choice of servo.

Title: Servo motor power consumption issue


问:
4 Wheel Differential Drive Robot with different speeds
Differential drive robot with 4 wheels,
If for example the back wheels were using different motors than the front ones ( ie : running at a faster/slower speed )
in general, would that generate more moving ( tourqe/force ) than having free ruining wheels instead ?
or using free running wheels would be a better option because of the slip related to the slower wheels ?

Note : its a sumo bot

答:
Dynamic friction is always lower than static friction. If you are purposefully putting your wheels into a slip mode, then you are putting the wheels into a condition where they have less traction.

For maximum pushing/stopping power, you would want your wheels torqued to the point just before they begin to slip. This is what anti-lock brakes do; an ABS system reduces braking pressure to prevent the wheels from locking up, which maximizes braking power.


问:
How exactly does sensor fusion work in Kalman filters?
I've been looking into implementations of Extended Kalman filters over the past few days and I'm struggling with the concept of "sensor fusion".

Take the fusion of a GPS/IMU combination for example, If I applied a kalman filter to both sensors, Which of these will I be doing?

Convert both sensors to give similar measurements (eg. x, y, z), apply a kalman filter to both sensors and return an average of the estimates

Convert both sensors to give similar measurements (eg. x, y, z), apply a kalman filter, and return an estimate of the sensor I trust more based on a certain parameter (measurement noise covariance)?

答:
I realize this question already has an accepted answer, but I'd like to provide some additional input. The question of sensor fusion is a good one, but, depending on the application, you don't typically want to "convert" (i.e., integrate twice) the IMU to obtain xyz position. Frankly, in my experience, the best way to approach fusing GPS and IMU data for a mobile robot (quadcopter, unmanned ground vehicle, etc) is already provided within the EKF framework:

Identify a plant process model and associated process noise for the robot.

2a. Identify an observation model and associated measurement noise for the GPS

2b. Identify an observation model and associated measurement noise for the IMU

tl;dr: to answer your specific question: you'd be doing neither! The IMU provides acceleration corrections to the process model, and the GPS provides position corrections to the process model. The sensor fusion aspect is more or less a weighted average based on the process noise and measurement noise. Sure, a purely kinematic process model might act as a double integrator, but that's not the only choice of process models. It might sound like semantics, but I think it represents a fundamental misunderstanding of the Kalman filter to speak in terms of "converting" the IMU to provide xyz corrections.

Additional thoughts:

The plant process model can be a simple kinematic model (constant velocity or constant acceleration) or a sophisticated dynamical model. It is generally best to start simple and add complexity later if required. Process model are typically developed from first principles (physics), but you can probably find some decent ones online if you get stuck. The same is true for observation models for a GPS and IMU sensors.

The measurement noise statistics can be found from the manufacturer data sheets or experimentally.
[Aside: if you're working with real instruments, it's best to try to get your own data on the measurement noise. If a static test will give you representative data, set the sensor on the bench, collect a bunch of data, and determine the measurement noise statistics. Pro tip: the std dev of the noise (aka sigma) often varies inversely with the square root of the sampling frequency, e.g., sampling at 10Hz instead of 1KHz reduces sigma by an order of magnitude. You can see this mathematically by working out the expected values.]

With a GPS and IMU, a more sophisticated dynamical plant process model will likely just improve the estimate of linear velocity. Depending on the update rate of your GPS and how much you care about your velocity estimate, the added complexity of a dynamic model may be unnecessary for your given application. If you have a good linear-velocity sensor, a dynamic model is rarely required. Many papers have been written and accepted to respected journals and conferences with kinematic process models.

[Aside: The difficulty of dynamic models is that their accuracy depends on knowing: 1. the structure of the model. 2. the parameters (mass, drag, etc) used in the model. The structure of the model can often be developed from first principles, but parameter estimation can be difficult even for known model structures.]

The "black art" of the EKF is the choice of process noise. In the linear case, Kalman proved that the KF will converge regardless of the noise (we understand how to propogate Gaussian distributions through linear systems), but the same isn't true for the nonlinear extension. There are many papers written on the subject of estimating process noise for nonlinear models. This still an area of active research. My advice is just to play with the process noise until you achieve acceptable performance.

Also: the paper linked in the accepted answer is certainly interesting, but far from the simplest approach. Based on a quick scan, the purpose of that paper is to report a new method/approach for real-time rejection of bad data from the IMU or GPS based on fuzzy logic and "contextual variables." NB: Again, in the context of EKFs, "bad data" means data inconsistent with the expected measurement noise. This is an important problem to address because the accuracy (and even stability) of the EKF hinges on the idea that measurement data from the instruments have the noise characteristics that you specified.

This is a key important point because it means any additional instrument, no matter how bad the noise is, won't make the state estimate worse PROVIDED the measurement noise used in the EKF matches the noise from the actual measured data. NB. this can be proven mathematically for the KF, but not for the EKF, though it works as expected the vast majority of the time with reasonable process noise.

Instrument failure and outlier rejection are worth investigating and understanding...after you've already implemented an EKF that can handle asynchronous measurements and a bias in the IMU measurement. Start simple and add complexity.

Hope this helps.


问:
ArduIMU noisy output in Quadrotor
We are using ArduIMU (V3) as our Quadrotor's inertial measurement unit. (we have a separate board to control all motors, not with ArduIMU itself).

Now we have a problem with ArduIMU's sensors output. When we put our quadrotor steady on the ground with motors on, instead of getting 0 degree in roll and pitch we have a noisy output something like the image below( -6 to 6 degree error ):

delta_t = 0.2s

We are sure that this isn't a mechanical problem, because we checked the mechanical joints and everything.

I should mention that with motors off everything is going well. Also we checked that if we vibrate the device slowly on yaw axis or any other axis, it still shows the noisy output.

We are using DCM filter inside ArduIMU, also we tested with Kalman filter but no difference.

We also tested FRI low-pass filter, results is good but there is about 3 seconds delay in the output.

We also checked that if we separate the ArduImu's power from our circuit, it still no difference.

What's the problem with ArduIMU and how we can get rid off this noisy output ?

Update:
We think that the problem with our PID controller is because of these noises ... Is this a true assumption ? We can't tune our PID parameters ( using Ziegler–Nichols method ) when we have noisy data. We tested Ziegler–Nichols method when we have low rate noises and we successfully tuned our PID but when noise appears we are unable to tune PIDs. Is there anyway for us for tuning our PID in such situation ? Is this problem is because of the noises or the PID itself can get rid of them ?

答:
This answer is incorrect (TaW) It is based on IMU noise that's about 1000 times faster than it really is, based on a typo in the discussion following the original question.

I'm not a big fan of the Ziegler-Nichols method.  It's an ad-hoc method that is not only not guaranteed to stabilize all plants, it comes with a guarantee that there will be some plants that it cannot stabilize.  Furthermore, it has a history of coughing up an underdamped system.  Its only advantage seems to be that it comes up often in web searches.

I would suspend the copter on one of the horizontal axes, parallel to the IMU, and I would tune the PID controller using the usual seat of the pants method (derivative, then proportional, then integral).  Then I'd go back and measure the frequency response of the thing (still tethered), and tune the PID properly.

Then I would repeat for the vertical axis.

Only then would I cross my fingers, hold my breath, and go fly.

For some reason, I seem to think that this is a good description of the seat of the pants PID tuning method:

http://www.embedded.com/design/prototyping-and-development/4211211/PID-without-a-PhD

With that much noise in the IMU output would bandlimit my differentiator.  That'll limit the bandwidth of your control loop, but if you don't do it then your differentiator will swamp out any other control signals.

Title: ArduIMU noisy output in Quadrotor


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

答:
I'm biased (since I have TA'd his course twice), but I think Prof. Marin Kobilarov's derivation of the KF/EKF is far superior to Thrun's. I have read almost every book on KF/EKFs mentioned in previous answers, and I think Marin's lecture notes are excellent for the theoretical aspects of optimal state estimation. Thrun's presentation is far from the worst, though. The beauty of Marin's approach is that he develops the KF measurement updates from an optimization standpoint: he starts with a simple least-squares approach and goes through the necessary and sufficient conditions for optimality for both linear and nonlinear measurement models.

The course website also has some easily-digestible matlab code: https://asco.lcsr.jhu.edu/en530-603-f2017-applied-optimal-control/

Lecture 10 is specifically about optimal state estimation, namely the KF/EKF: https://asco.lcsr.jhu.edu/docs/EN530_603_F2015/lecture10.pdf

PS. During my orals/quals, I was asked to derive the EKF by hand from memory. If I hadn't learned the above approach, which I find very intuitive, I think I would have been lost in mathematical minutia. As always, YMMV.


答:
Firstly consider the servo torque limitations, if loading increase from specified limit the it start stalling and even can gear get fail and burn servo itself, possibly.

And another concern is with power supply. You are using metalgear servo with power supply of just 1 A.
As per the specification provided by greenonline (in previous answer), the servo needs 1.2 A at stall condition. You require higher ampere power supply. Your setup will work with ideal no load condition but not on loaded condition.

You should not power servo directly form the Arduino. You should design the driver circuit or board for power supply and common both ground of the Arduino board and driver circuit.

And it is recommended that you should use multiple power supply and divide the power supply to the group of servos. It will help in stabilizing your working and power. High ampere drawn by one servo does not affect the other of power supply is separated.

If you have higher power supply system in which you can control the voltage and ampere both then you can go for single supply also. Considering 1.2 A stall current and all 6 servo are same then you should supply 1.2×6 = 7.2 A for working without any problem.

Title: Servo motor power consumption issue

Body: I am using servo motor model no. MG995 with Arduino. I don't know the current it consumes while powered on and while lifting a 10 kg of weight. I am currently using a 5 V, 1 A power supply with one motor but in future I need to connect 6 motors to single supply.</p>


问:
Practicality of using magnetometer inside AUV
I have an AUV with a 12 inch diameter, 29 inch long capsule. Inside the capsule sits an Intel NUC computer, an NVIDIA Jetson GPU, an Arduino Mega, a Sparton IMU (9 DOF) as well as a custom voltage regulator. Given the noise, would it be practical to attempt to use my magnetometer, even with calibration and filtering? If so, what should I keep in mind regarding the placement of my IMU in the AUV's capsule, given that I have already read this post?

I have tried moving it as far away from the sources of noise as possible but the noise persists. I looked into shielding, but that looks like it would block the Earth's magnetic data as well, which would render the shield pointless.

答:
As mentioned in the previous answer, many small, low-cost underwater (and aerial) vehicles use a magnetic compass. You need a good procedure for both hard-iron and soft-iron calibration of your magnetometer. Constantly having to calibrate them sucks, but they're way less expensive than a FOG. With good calibration, you should be able to achieve adequate performance with the magnetometer. If you're operating indoors in a tank, you should be able to rely on visual based odometry and other approaches that have limited applicability in the open ocean. DVL-based dead-reckoning has worked just fine, but, if you don't have a DVL, you'll get much better performance with an EKF...but your IMU may provide a KF output (I know the microstrain does). Also, instead of shielding the compass, you might try shielding the external sources of electro-magnetic interference.

Giancarlo Troni's paper on bias calibration is probably worth a read: https://ieeexplore.ieee.org/document/6942597/

If your AUV has a DVL, Giancarlo spent much of his PhD working on DVL-AHRS alignment and calibration:
https://ieeexplore.ieee.org/document/6405003/

https://ieeexplore.ieee.org/document/6094942/


问:
How often does a robot perform A* (A star) path planning in an unknown map?
I have read through lectures/ tutorials on A* but they have all been via computer simulations. I have an autonomous wheeled robot that is traversing an unknown map (essentially, it'll be a tabletop with no obstacles but has edges it can fall off of); it has an indoor GPS system, IMU, and cliff sensors. I'm trying input a desired waypoint.

Does the robot assume that everywhere is traversable, break up the map into a grid, calculate the best path, and go for it OR is it supposed to iterate this process? If the latter, how should the robot proceed in iterating? I'm thinking that it would travel in the "best path" until the cliff sensor is triggered and it will have to recalculate a new best path.

答:
I don't see any sensors being states that can detect the obstacles.

it has an indoor GPS system, IMU, and cliff sensors.

Indoor GPS and IMU cannot detect the obstacles. The cliff sensor can only sense if the robot is going to fall off the table that if it's near the table edge. None of them can tell if an obstacle is coming into the robot's path. So, first need to have a sensor that can accomplish this. You can look into LIDARs(costly) or cheap ultrasonic sensors depending upon your task.

Now once the surrounding obstacle data is available, an algorithm for path planning comes into play.

Theta * can be used for path planning if the initial map is unknown. Check out this video to see it in action.
Hope it helps.