Go Down

Topic: math function (Read 1 time) previous topic - next topic



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.



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~=)



the force will vary all the time

Is this a quote from Star Wars ? ;)

seen this - http://arduino.cc/playground/Code/PIDLibrary - ?

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


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~~~


- http://en.wikipedia.org/wiki/Trapezoidal_rule -
- http://en.wikipedia.org/wiki/Numerical_analysis -

Some practice:
- http://www.cplusplus.com/forum/general/26335/ -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131