New Products - December 2019

The last velocity that is given after integrating when the acceleration is 0 is the velocity of the robot at that given time. You could easily find displacement from there if you know when the robot changes velocity again.

1 Like

Lol I didn’t think about it that way your right! If acceleration drops to 0 without any negative acceleration, will now you have a record of the velocity which you can use to determine displacement for the time acceleration stays at 0. Once acceleration starts decreasing, the velocity will gradually drop and you can go back to double integrating. Lmao makes so much sense thanks!! I’m assuming unless you use Riemann sums or trapezoidal approximation, or another approx. method for that matter, you cant really calculate the integral? Unless there’s a secret integral function I don’t know of… @jpearman

2 Likes

I hope this is the case, and if not then maybe it can be implemented in an update to simplify our lives (especially with this new sensor).

1 Like

It’s important to remember what an integral is, a continuous accumulation. Computers cannot do continuous math (well, not as easily). The value the accelerometer gives you is the acceleration at this step in time. It’s my understanding that a position tracking system based off of a 3 axis accelerometer would look something like this (Accelerometer API made up)

int accel_x, accel_y, accel_z, vel_x, vel_y, vel_z, pos_x, pos_y, pos_z;
int angle;

int dt, lastTime;

while(true) {

    dt = pros::millis() - lastTime;
    lastTime = pros::millis();
  
    // Get accelerations
    accel_x = accelerometer_x() / dt;
    accel_y = accelerometer_y() / dt;
    accel_z = accelerometer_z() / dt;

    // Update velocity
    vel_x += accel_x;
    vel_y += accel_y;
    vel_z += accel_z;

    // Position
    pos_x += vel_x;
    pos_y += vel_y;
    pos_z += vel_z;
  
    angle = gyro_x();

   pros::delay(5);
}

Consider the acceleration as a rate, and normalize to your correct units of time, and accumulate accordingly.

3 Likes

Does the accelerometer have the ability to measure distance? If not, would I have to calculate distance traveled from the accelerometer?

This thread is moving quick, so I may get @DRow to add this to the original post. We have a new knowledge base article on the Inertial Sensor:

2 Likes

Unfortunately, it will not be possible to integrate ourselves.

The sensor is plugged into the VEXos CPU, meaning that with the architecture of the V5, the bridge between the user CPU and the VEXos CPU only updates at 10ms. This means the user only has access to 10ms sensor sample rate, making it nearly impossible to integrate or even remotely beat VEX’s integration which can run at 1ms on the VEXos CPU.
This means that we are fully dependent on whatever integration VEX chooses to do.

The reason it was possible to do custom integration on the Cortex system was because the user had access to a much higher sample rate.

Furthermore, measuring distance is also likely unfeasible. This involves double integration (acceleration -> velocity -> distance), which requires some really expensive sensors to properly pull off. Not only are we dependent on VEX to try and do it for us (which will likely be pretty hard for them), it would be magnitudes worse for us to do it on the user CPU.

These limitations of the V5 architecture make the accelerometer have quite a limited use. You might be able to use it to detect collisions or something, but good luck trying to do anything sophisticated.

Edit:
Here is a diagram from the V5 architecture page that shows how distant the user code is from the sensors.

image

15 Likes

This whole thread has become Calc 1 all over again

5 Likes

This is still really useful but I’m a little disappointed I won’t be able to use the accelerometer for more complex things. Already ordered this sensor though, I wonder how good it will actually be in comparison to the older sensors.

2 Likes

The gyro part of it is still very useful, provided it does not drift too much.
And who knows what you could use an accelerometer for.

3 Likes

I imagine mounting it to the tray for seeing if it is directly vertical could be useful. A simple use, but definitely possible. Better way of sensing tray position than just motor rotation.

2 Likes

For the cost of the inertial sensor, I think it’s better used on the chassis. If you could get your hands on multiple then that could be useful but I don’t think it’s necessary because the tray is for the most part an isolated system so the IME values are relatively accurate most of the time if not all of the time.

1 Like

No, the only difference between the kits are the red slides match the V5 red and black color scheme better, and they include four 12in linear slides, instead of two 12in and two 17.5in linear slides, like the old kit did.

18 years to a century

3 Likes

The first few orders of the V5 Inertial Sensor have already shipped.

20 hours is < 18 years, right?

15 Likes

Are the longer slides going to be continued to be sold (17.5" long ones) I don’t care about color, but do want access to the longer metal.

Thanks!

1 Like

Can somebody do a review of the sensor and put it on the forum? I might cop if it’s good

1 Like

For the average person, that is correct. But for VEX, they seem to be correct 99.5% of the time.

10 Likes

New accelerometer may not do what people want, but it already accomplished a mission of sparking great interest to advanced math among many students! Great PR job DRow!

@Connor, please, stop mixing mechanical engineering with quantum mechanics. lol

People got suspended for just mentioning antigravity engines before…

10 Likes

I guess fin you calculate it correctly it can be used to measure distance but not very accurate.