Velocity, acceleration and jerk: Difference between revisions

From wikiluntti
Line 106: Line 106:
v(t) =  
v(t) =  
\begin{cases}
\begin{cases}
L \sin( \frac1{t_0}\frac\pi2 t )  && \text{if } t< t_0 \\
\frac L2 \sin( \frac{\pi}{t_0} t - \frac\pi2  )  && \text{if } t< t_0 \\
L && \text{if } t\geq t_0  
L && \text{if } t\geq t_0  
\end{cases}
\end{cases}

Revision as of 22:35, 24 September 2020

Introduction

The Newton force rule states that force and acceleration are proportionally related. Is it possible to accelerate without noticing the jerk? The method is used in elevators, for example, and hopefully in modern (electric) cars.

We consider the acceleration the robot is subjected to while accelerating it using different acceleration functions.


Robot

Almost any robot will be ok, we use Asimov 2/ Verne.

Sensor

The Vernier acceleration sensor with the NXT Adapter is used. The sensor is attached to port number 4.

Very simple test program to see what are the measured values is shown below. The values are in arbitrary scale, and need to be normalized. We found, that the

#!/usr/bin/env python3
# https://sites.google.com/site/ev3devpython/

from ev3dev2.sensor import *
from ev3dev2.sensor import INPUT_4

import time
import os
import csv 

os.system('setfont Lat15-TerminusBold32x16')  # Try this larger font

p = Sensor( INPUT_4 )
p.mode="ANALOG-1"

def measureAcc(p):
    acc = p.value(0)
    return acc

f = open('acc.csv',"w")
writer = csv.writer(f) 
tstep = 0.001

while True:
    acc = measureAcc(p)
    print( acc )
    writer.writerow((time.time(), acc ))
    time.sleep( tstep )

The resulted file acc.csv is then manually downloaded into a computer, and plotted using Python Pandas:

import pandas as pd
import matplotlib.pyplot as plt

# Read CSV file into DataFrame df
df = pd.read_csv('acc.csv', index_col=0)

# Show thedataframe
print(df)
plt.plot(df)

Theory

The time derivative of position is velocity, then we have acceleration, and the derivative of acceleration is called jerk, . Then we have snap, crackle and pop.

See the Wikipedia page on the physiological_effects of jerk. Anyway, there might be jerky rides.

We measure the acceleration of robot, and use a numerical differential method to estimate the jerk. We use the symmetric differential;

in which the first-order error cancels, and the error is where .

We will start from zero to ms where the speed should be at maximum value, .

Standard Scheme

The ev3dev Python standard scheme is . . .

Linear acceleration

because the continuity constraint gives that .

Sinusoidal acceleration

Sine acceleration

The sine curve is a harmonic motion between -1 and 1 with period . We use only one period, and scale that to correct acceleration function. The sine accelerates rather smoothly.

See the interactive Desmos graph.

Logistic Curve

The logistic Curve with parameters.

A logistic function is S-shaped curve (or sigmoid curve) is a function with equation

where is the value of the sigmoid's midpoint, is the curve's maximum value and is the curve's growth rate. See the Desmos graph.

The bumb function

There exists some well-known every-where differentiable functions, with a compact support. One example is

which is an example of a with support in . We are going to take half of the curve to be our velocity function.

See more at Math Stack Exchange.

Example Codes

Exercises