I am measuring acceleration continuously using keil mcbstm32f4 development kit and calculating the time dt for integrating acceleration to get velocity. Velocity= summation of a*dt.Since dt is very small=8.3us between 2 acceleration measurements.The code for calculation is attached . I am performing these calculations in a loop continuosly but in real time the velocity is not showing correct, for example in z axis for 9.8 m/s2 or 1g it should show 9.8x1=9.8m/s velocity but it is increasing very slowly as the stm32f400 is not able to do that many calculations (1/8.3us=1000000/8.3 =calculations) fastly in 1 s. So i want to know how to increase the speed of operation by utilizing all the cores.
while (1) { float x1=(acc.x * 25/1000)/2.4489;///2.4489; float angx1=(ang.x * 25/1250); float y1=(acc.y * 25/1000)/2.4489;///2.4489; float angy1=(ang.y * 25/1250); float z1=(acc.z * 25/1000)/2.4489;///2.4489; float angz1=(ang.z * 25/1250); float x2=(acc.x * 25/1000)/2.4489; float y2=(acc.y * 25/1000)/2.4489; float z2=(acc.z * 25/1000)/2.4489; float x3=(acc.x * 25/1000)/2.4489; float y3=(acc.y * 25/1000)/2.4489; float z3=(acc.z * 25/1000)/2.4489; // float navgx=0; navgx=(x1+x2+x3)/6; float navgy=0; navgy=(y1+y2+y3)/3; float navgz=0; navgz=(z1+z2+z3)/3; velx=velx+(navgx*0.000083); vely=vely+(navgy*0.000083); velz=velz+((navgz-9.81)*0.000083); }
>>So i want to know how to increase the speed of operation by utilizing all the cores. All the cores? How fast is the cores running currently? Perhaps you can use some actually floating point constants, and see where you can fold them to do multiplications rather than division. Do you work with someone with some competence who can guide you?
MCBSTM32f400 utilizes 4 cores, i want to use them indvidually for different functions in parallel operation to utilize them to the fullest for maximum speed. It runs at 168 mhz.
Perhaps you can use some actually floating point constants, and see where you can fold them to do multiplications rather than division. Please if possible provide some reference or link for reading.
Do you work with someone with some competence who can guide you? No, but I am improving every day if you give me some hint then i will be able to do it.
Basically at any instant i want to measure the instantaneous acceleration and angular velocity so that i can make accurate calculations for velocity .I want these readings very frequently for maximum accuracy.
Does it?!
I'm pretty sure that the STM32F400 has only one core!
Please explain ...
www.st.com/.../stm32f407ig.html
http://www.keil.com/support/man/docs/mcbstm32f200/
www2.keil.com/.../learn
http://www.keil.com/books/
The links mentioned above are general I wanted any reference or guidance particular to this problem. Is it possible to do 2 processes parallel simultaneously or if I use some os like rtx or cmsis can I get better performance by using threads?
Yes - your issues do seem to be general.
eg, understanding the number of cores available.
Are we clear on that one now?
"Is it possible to do 2 processes parallel simultaneously"
Again, that's a general question.
And the general answer, for a single core, is: "No".
"if I use some os like rtx or cmsis can I get better performance"
Again, a general question on what an OS does & what it gives you.
It won't make the hardware execute the instructions any faster!
Yeah thanks for resolving my doubts but still the main problem needs unsolved that is how to speed up calcultions.If the while (superloop) take 0.1s for execution for example it should be able to do 1/0.1 =10 calculations in 1sec.Please refer to the initial post for more details.