Archive for May, 2014

Hardware in the loop algorithm testing

Thursday, May 29th, 2014

Algo­rithm imple­men­ta­tions live their grown-up life in C, but fre­quently they are devel­oped with tools like Mat­lab. Also, exper­i­men­ta­tion, tun­ing and char­ac­ter­i­za­tion are con­ve­niently done in Mat­lab. Con­se­quently, I con­stantly find myself hav­ing to port code from Mat­lab to C and hav­ing to check the con­sis­tency between Mat­lab and C imple­men­ta­tions. In the case of the Open­Shoe mod­ules, the embed­ded plat­form makes this work worse than usual. Orig­i­nally (back in 2011) we had some frame­work (found on source­forge) for test­ing the C imple­men­ta­tions of the algo­rithms but it was not main­tained and it is now hope­lessly out of sync with the cur­rent run­time frame­work. With the new mod­ules we have renewed exper­i­men­ta­tion, tun­ing, and char­ac­ter­i­za­tion needs. There­fore, I have now added built-in sup­port (to ensure it’s main­tained), in the run­time frame­work, for push­ing iner­tial data over the USB, run­ning some pre­con­fig­ured pro­cess­ing func­tions (con­fig­ured by com­mands), and get­ting some requested states back. This I use to check the con­sis­tency between Mat­lab and C imple­men­ta­tions of the pro­cess­ing func­tions and related logics.

A side note is that it’s a pain check­ing the con­sis­tency between C code and Mat­lab code when using float­ing point vari­ables, espe­cially with sin­gle pre­ci­sion. C and Mat­lab sim­ply don’t give iden­ti­cal results and then it’s hard to know whether this is due to some small actual error or if it’s just numer­i­cal lim­i­ta­tions. The insta­bil­ity of the iner­tial nav­i­ga­tion makes it even worse. There­fore, the code has been para­me­ter­ized such that it can be com­piled with dou­ble pre­ci­sion for off-line test­ing (the 32-bit uC means that using dou­ble pre­ci­sion is too slow for real­time processing).

Status report: testing and integration

Tuesday, May 20th, 2014

The test­ing and inte­gra­tion of the new MIMU22BT mod­ules are slowly pro­gress­ing. So far so good! Above you see one of the mod­ules with a cas­ing printed in white by www.beta-prototypes.com. My feel­ing is that the new mod­ules give sig­nif­i­cantly improved per­for­mance but this far I have not made any rig­or­ous per­for­mance tests. Before I did this I wanted to increase the inter­nal sam­pling fre­quency (see pre­vi­ous post) and write soft­ware such that I could log all the raw data to an Android phone rather than a lap­top. Car­ry­ing around a phone instead of a lap­top is way more con­ve­nient when col­lect­ing a lot of data. The for­mer is done while the lat­ter remains.

We have now essen­tially replaced the old ADIS16367-based mod­ules in the TOR sys­tem with the new mod­ules. The wire­less con­nec­tions are a great improve­ment com­pared to the old cabled con­nec­tions. I don’t miss bro­ken cables, unplugged con­nec­tors, USB hubs, and the trip­wires the made up at all. (The wire­less con­nec­tion to the Android phones is up and run­ning but to log all raw data in order to carry out a per­for­mance eval­u­a­tion the wired con­nec­tion need to be set up as well.)

In the test­ing and inte­gra­tion we have not encoun­tered any major hard­ware issues this far. There are a bunch of small things I would like to change such as place­ment of LEDs, exchange the power switch with a push but­ton with a latch cir­cuit, and so on. How­ever, over­all the mod­ules seems to work reli­ably, for our purposes.

Increased sampling frequency

Tuesday, May 20th, 2014

Due to some legacy code from the first MIMU3333 test boards, the inter­nal sam­pling fre­quency of the board was pre­vi­ously set to around 400Hz while the inter­nal sam­pling fre­quency of the IMUs was a 1000Hz. The main rea­sons for the low sam­pling fre­quency was that the IMUs (of the MIMU333 test board) were orig­i­nally con­nected to two dif­fer­ent ports on the uC and that the uC was run­ning on a sin­gle inter­nal PLL, which lim­ited the inter­nal clock fre­quency since the USB needed 48MHz. These hur­dles have now been cleared and the sam­pling fre­quency of the board is now set to 1000Hz, just like the inter­nal IMU sam­pling frequency.

Unfor­tu­nately, the 1000Hz sam­pling fre­quency is not with­out prob­lems. For the MIMU22BT boards every­thing works fine. How­ever, for the MIMU4444 array boards, the sam­pling fre­quency works fine inter­nally but the USB can­not keep up in case you want all raw data from all 32 IMUs. If you try to out­put all raw data from all IMUs at every sam­pling instant, the sam­pling fre­quency will drop to around 500Hz since the uC will be wait­ing for the data to be sent. I’m not sure whether this is a lim­i­ta­tion of the USB pro­file, the USB stack, or our code.

The mech­a­niza­tion and the fil­ter­ing of the aided iner­tial nav­i­ga­tion can be run at 1000Hz. This means that the clock fre­quency, i.e. power con­sump­tion, can be traded for sam­pling fre­quency. Cur­rently, the uC makes up around 2/3 of the power (cur­rent) con­sump­tion of around 100mA. Its power con­sump­tion will scale rather lin­early with the clock fre­quency. Con­se­quently, the power con­sump­tion could, in prin­ci­ple, for exam­ple, be reduced by 1/3 by halv­ing the clock fre­quency at the cost of halv­ing the sam­pling frequency.