# Tag Info

11

The glaring issue I see at the moment is that you are forcing polarity on the I and D terms. In general, you are using a lot of sign checks, sign assignments, and conditional programming. None of that belongs in a PID controller. The entire controller should look like: pError = Input - Output; iError = iError + pError*dt; dError = (pError - previousError)/dt;...

7

The answer is that 3-axis accelerometers don't have a left handed coordinate system just for the gravity. In static condition (i.e. if the accelerometer is not accelerating with respect to any inertial frame) they measure the opposite of gravity acceleration, not the gravity acceleration itself. In more general terms, the accelerometers measure the ...

7

You already know the answer - because as you say it contains an accelerometer and a rate gyro. An accelerometer measures linear acceleration, a rate gyro measures angular velocity. These are the only quantities the unit will actually measure. The other properties - whether positions, velocities or accelerations - have to be calculated by the controller. For ...

7

Gyro is needed to stabilize angular acceleration. Knowing only your attitude, drone doesn't know how fast on which axis is rotating, knows only where is gravity vector. Gyro gives you feedback on angular acceleration and that's what gives your drone stability. Also, you can use only gyro in your drone, it will stabilize movement, but won't get back to ...

7

A couple things, the first is that the controller does not really care what the "real" values are. Everything is relative, if the controller sees that it is sinking it will increase the thrust until it is not sinking. If it is tilting too far to the left it will decrease the right thrust and increase the left thrust. (Here is a good resource if you want to ...

6

Yes. The px4 software for the pixhawk autopilot has an extended kalman filter that uses an accelerometer, a gyroscope, gps, and mag. A paper describing the a smaller ekf which only estimates attitude can be found on archive.org and code for the full ekf can be found on github with further information on archive.org.

5

The gyrometer gives you angular velocity about each axis. You simply integrate these values to get the roll, pitch and yaw of the robot. Since this is 2D, all you care about is yaw, and you'll integrate one value. Of course, there are many different ways of integrating the value you read from the gyrometer. The easiest way is to sample the gyro, timestamp ...

5

Assuming your vehicle is roughly horizontal to the ground, you won't be able get a good estimate of yaw from the accelerometer. Consider the nominal case: when your accelerometer is pointing straight down (Ax=0, Ay=0, Az=g) the reading will never change as you change yaw angle. Normally, to get yaw angle vehicles use a magnometer (measure earth's magnetic ...

5

How to estimate a robot's position depends on how well you'd like to estimate it. If you just need a rough guess, try odometry, it works OK. For better results, you have to incorporate more sensors. That's an incremental process that involves a lot of sensor fusion, and suddenly, you've built an Extended Kalman Filter. The best way, in my opinion, is to use ...

4

I am not allowed to comment, so I have to add a reply. By position, do you mean the location in space (so X, Y coordinates), or orientation (tilt, etc)? If position, you can use the accelerometer values and integrate acceleration to get distance traveled, though this is fairly inaccurate. We have tried to do this for a quadcopter, and the drift due to error ...

4

If your object $O$ has a different orientation from your global frame $S$, and you know what that difference in orientation is, you can create a 4x4 transform matrix between the two: $$T = \left[ \begin{array}{cc} R & s \\ 0 & 1 \end{array} \right]$$ where $R$ is the 3x3 rotation matrix, $s$ is the 3x1 translation vector, $0$ is a 1x3 row of ...

4

First off, it doesn't sound like you're actually doing SLAM. You didn't mention an exteroceptive sensor (e.g., laser, camera) that actually maps the environment. With just an IMU, you are doing localization, or more specifically, dead-reckoning. With just an IMU, there is no way to actually implement pose-graph SLAM in its usual formulation. That being said,...

4

This is a complete re-working of the answer I had originally provided. If you're curious, you can check the edit history and see what was posted earlier. In comments to this question, OP stated that they might be able to get throttle and steering angles for the robot, but they probably wouldn't be accurate. That's okay; it's better than nothing. OP also ...

4

Mags are used in almost all UAVs. It will be useful and it will be a unique source of information. Adding a some shielding between the mag and your computers and power lines will greatly reduced the noise. Noise can be further reduced by twisting all of the wires that carry significant current (wires to motors and ESCs). Be aware that the measurement will ...

4

The IMU itself cannot distinguish between "true" linear acceleration and "fictitious" (Coriolis) linear acceleration induced by rotation of the IMU coordinate frame with respect to an inertial frame. You must make that distinction in your choice of models. Your estimator will represent your robot's acceleration in some way in its state, ...

3

Gyroscopes will only give you the rate of change of the yaw angle, not the absolute yaw angle. Unless you plan to set the yaw angle initially and have it drift further and further into garbage values (as you integrate the rate of change), you'll need another sensor to provide periodic updates on your actual yaw. This could be a magnetometer (compass), or ...

3

Using an IMU you can only measure: acceleration, rate of rotation, and direction of magnetic field. You cannot measure velocity, you can only integrate the acceleration to infer velocity. As you can imagine, this leads to velocity drift, which in turn leads to a lot of unbounded position drift. There are three parts to your problem: Infer the robot's ...

3

by searching for a different topic I found your post and I work with the Sparkfun Razor 9DOF IMU too. Actually it was a pain in the ass to get it all work. First of all you have to do the tutorial razor-9dof-ahrs form ptrbrtz. When this is working you can do the next steps. Btw.: read it carefully and you should be able to do it on your own!!! First I ...

3

Ultrasonic transducers are the best bet, in my opinion. However, they might cost you a little over "a few bucks". You have two options: Set two/three ultrasonic Rx/Tx pair along one plane. Trigger them sequentially, in quick succession and triangulate your object in 3D. A drawback of this approach is that the sensor noise would be phenomenal. The other ...

3

Unfortunately, with just an IMU there's virtually no way for your quad to know that it's drifting so it can't stop it. For outdoor flight you can add a GPS to detect the drift. For indoor flight, many people use vision systems to detect the drift. Depending on how close you are to walls, you could also look at ultrasonic range sensors to detect drift.

3

IMUs have accumulating error and can not be a reliable sensors by themselves if you want to measure velocity or even worse, position. I believe your safest bet would be doing a sensor fusion between an IMU and a vision sensor using feature extraction and Kalman filter. Using only a camera can introduce unpredictable errors specially in featureless ...

3

I went through the header files of the 12cdev lib and I figured it out. you have to first add the line VectorInt16 gyro; to your motion variables, then you add the line mpu.dmpGetGyro(&gyro, fifoBuffer); to your outputs.

3

This is really simple. First of all, you need to understand how the sensor works. In other words, you need understand whether the measurements is coming from linear or nonlinear model. Second, what is the type of the sensor's noise? CASE STUDY: Let's say you want to simulate DC Voltemeter to measure a battery's voltage of 5 Volt. In an ideal case, the ...

3

This will depend on what you mean by "displacement" and for how long you want to do this. Can you supply more details on what your trying to accomplish and why? As Bending Unit 22 mentioned, you integrate acceleration to get velocity, and then integrate velocity to get position. The problem with this though that any drift/error/noise on the ...

3

So you have acceleration readings from your IMU (linear and angular), and you get velocity readings (linear only) from wheel encoders. Get velocity from linear and angular accelerations with $$v = v + a*\mbox{dT}$$ Get angular velocity from your wheel encoders by exploiting geometry of the vehicle  \dot{\theta} = \mbox{atan2}((v_r - v_l) , \mbox{...

3

Basically it does not matter. But you have to be carefull if the plate is rotating fast, because the rotation of the plate around its center point, with the IMU placed out of center, will cause the accelerometer to measure centrifugal forces. If your task is to stabalize the platform, this won't be an issue for you.

3

ROS has a package called robot_localization that can be used to fuse IMU and GPS data. This package implements Extended and Unscented Kalman filter algorithms. The package can be found here.

3

No, it is not possible to eliminate the cumulative position error caused by sensor noise and bias without using an additional sensor which can report any kind of position measurement. Even the best sensors and filtering will not be able to eliminate in a closed-loop fashion the position error.

3

Calibration procedures for magnetometers exist, to compensate for soft iron (nearby ferromagnetic objects) and hard iron (nearby magnetic fields) offsets, which skew the measurements. However, these procedures usually map a static disturbance correction and apply it to all new measurements. On the contrary, your environment changes from one end of the tube ...

3

Part 1. Use one or the other. Often odometery is used instead of kinematics or dynamics for prediction, at least in my work. Part 2. This is handled by the construction of the measurement equation jacobian. Every time a measurement comes in, construct a Jacobian for the whole state. You'll notice that some of the state elements are independent of the ...

Only top voted, non community-wiki answers of a minimum length are eligible