math function

Hi,

I am going to to build a symtem with plenty of fomular, anyone know what code to perform integration function and transfer function?

Thanks and regards.

Transfer function is best done with a look up table.
Integration is best done by using discreet methods.

If the system is a real time system, how would the coding be?
It's function is to integrate acceleration to velocity then position.
And integration in PID function.

Thanks for the help.

Regards

to integrate acceleration to velocity then position.

If this is data from an acceleration sensor then the results are less than perfect because of noise on the output of the sensor. This gives a DC term into the integrator which causes the output to drift consistently, giving an error in any positional reading. I assume you want to do an inertial navigation system or a dead reckoning system. The results of trying to do this are not very good.

You have to write the code to implement what ever algorithm you are using, look here for the algorithms you can use:-

Mine is to build a 'virtual' position signal (with the affect of force detected) and compare with the the actual position calculated and correct the actual position to be same as the virtual one (the force will vary all the time).

Thanks for the help~=)

Regards.

the force will vary all the time

Is this a quote from Star Wars ? :wink:

seen this - Arduino Playground - PIDLibrary - ?

I have read that link before, but now the quetions is I have two different input and require two different Kp, will this working as well? If so how to modify the code?
I am doing job like converting simulink(done by others) to arduino code.

attached image is how does my PID look like.

p/s: I duno how to insert image, not sure can bee seen or not?

Thx for the help
I misunderstanding the simulink..
Now I trying with the PID() function

Is there any sample code for doing integration and transfer function?

Thanks for the help~~~

Theory

Some practice: