This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Calliope Mini as external Accelerometer
#3
Dear Sebastian,

thanks for your helpful reply!


(03-05-2020, 12:04 PM)Sebastian Staacks Wrote: The best thing of course would be if you can increase the data rate of the Calliope, but that is something at the Calliope-end of the problem.


Actually there is a characteristic called "Accelerometer Period", which "determines the frequency with which accelerometer data is reported in milliseconds."
[Micro:bit Docs]

But I was not able to write a proper new value with nRF Connect due to too many questions (hex or uint16 ? with or without "0x"? from right to left or from left to right? byte array or uint8?)


(03-05-2020, 12:04 PM)Sebastian Staacks Wrote: An alternative might be looking for a specific service that is advertised by both of them,

Unfortunately my Calliope mini isn't advertising any service according to nRF Connect.


(03-05-2020, 12:04 PM)Sebastian Staacks Wrote: ... and let the formula modules delete the data every time it has been processed

Great hint, thanks! Didn't noticed/understand this option before.
But when deleting the data after processing of Ax_mg, Ay_mg and Az_mg, there is noting to calculate with for the "Absolute" graph... So now I'm deleting only after processing the "Absolute" formula.
(NB: Since the position of the modules in the editor window is important, it could be a good idea to give an extra hint for the user when using the "clear at the input" option)

Although I still get a kind of a stair-case plot the "smoothness" is now ok for me.

If you have further comments to my code I would love to hear them:

Code:
<phyphox xmlns="http://phyphox.org/xml" xmlns:editor="http://phyphox.org/editor/xml" version="1.7" editor:version="1.0" locale="en">
    <title>Acceleration</title>
    <category>Calliope mini</category>
    <color>42C9C9</color>
    <description>Shows the movement of a Calliope mini

</description>
    <link label="Documentation of BLE micro:bit">https://lancaster-university.github.io/microbit-docs/resources/bluetooth/bluetooth_profile.html</link>
   
    <translations>
        <translation locale="de">
            <title>Beschleunigung</title>
            <description>Zeigt die Bewegung eines Calliope mini

</description>
            <string original="Acceleration x">Beschleunigung in x-Richtung</string>
            <string original="Acceleration y">Beschleunigung in y-Richtung</string>
            <string original="Acceleration z">Beschleunigung in z-Richtung</string>
            <string original="Absolute">Betrag</string>
            <string original="Acceleration">Beschleunigung</string>
        </translation>
    </translations>
    <data-containers>
        <container size="0" static="false">Ax_mg</container>
        <container size="0" static="false">Az_mg</container>
        <container size="5000" static="false">t</container>
        <container size="0" static="false">Ay_mg</container>
        <container size="5000" static="false">A_abs</container>
        <container size="5000" static="false">Ax</container>
        <container size="5000" static="false">Ay</container>
        <container size="5000" static="false">Az</container>
    </data-containers>
    <input>
        <bluetooth editor:uuid="179" editor:posx="46.83332824707031" editor:posy="274.83335876464844" id="Accelerometer" name="mi"  mode="notification" rate="1" subscribeOnStart="false">
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="0">Ax_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="2">Ay_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="int16LittleEndian" offset="4">Az_mg</output>
            <output char="E95DCA4B-251D-470A-A062-FA1922DFA9A8" conversion="string" extra="time">t</output>
        </bluetooth>
    </input>
    <output>
    </output>
    <analysis sleep="0"  onUserInput="false">
        <formula editor:uuid="227" editor:posx="191.5833282470703" editor:posy="63.583343505859375" formula="([1]/1000)*9.81">
            <input as="in" clear="false">Ax_mg</input>
            <output as="out" clear="false">Ax</output>
        </formula>
        <formula editor:uuid="228" editor:posx="256.41668701171875" editor:posy="182.4166717529297" formula="([1]/1000)*9.81">
            <input as="in" clear="false">Ay_mg</input>
            <output as="out" clear="false">Ay</output>
        </formula>
        <formula editor:uuid="229" editor:posx="319.58331298828125" editor:posy="307.58335876464844" formula="([1]/1000)*9.81">
            <input as="in" clear="false">Az_mg</input>
            <output as="out" clear="false">Az</output>
        </formula>
        <formula editor:uuid="230" editor:posx="475.8999938964844" editor:posy="555.8333587646484" formula="(sqrt([1]*[1]+[2]*[2]+[3]*[3])/1000)*9.81">
            <input as="in">Ax_mg</input>
            <input as="in">Ay_mg</input>
            <input as="in">Az_mg</input>
            <output as="out" clear="false">A_abs</output>
        </formula>
    </analysis>
    <views>
        <view label="Graph">
            <graph editor:uuid="237" editor:posx="645.6500244140625" editor:posy="64.48333740234375" label="Acceleration x" aspectRatio="3" style="lines" lineWidth="1" color="ff7e22" partialUpdate="true" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">t</input>
                <input axis="y">Ax</input>
            </graph>
            <graph editor:uuid="238" editor:posx="674.933349609375" editor:posy="221.10000610351562" label="Acceleration y" aspectRatio="3" style="lines" lineWidth="1" color="00ff00" partialUpdate="true" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">t</input>
                <input axis="y">Ay</input>
            </graph>
            <graph editor:uuid="239" editor:posx="702.75" editor:posy="373.5999755859375" label="Acceleration z" aspectRatio="3" style="lines" lineWidth="1" color="0000ff" partialUpdate="true" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">t</input>
                <input axis="y">Az</input>
            </graph>
        </view>
        <view label="Absolute">
            <graph editor:uuid="240" editor:posx="729" editor:posy="523" label="Acceleration" aspectRatio="1" style="lines" lineWidth="2" color="ff7e22" partialUpdate="true" history="1" labelX="t" labelY="a" labelZ="" unitX="s" unitY="m/s²" unitZ="" logX="false" logY="false" logZ="false" xPrecision="2" yPrecision="2" zPrecision="2" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" scaleMinZ="auto" scaleMaxZ="auto" minX="0" maxX="0" minY="0" maxY="0" minZ="0" maxZ="0"  mapWidth="0"       >
                <input axis="x">t</input>
                <input axis="y">A_abs</input>
            </graph>
        </view>
    </views>
    <export>
    </export>
</phyphox>

Again a few notes:
  • I extended the container size to 5000. This way I get graphs showing roughly the last 30 seconds.
  • I enabled "partial Update". Forgot this before in 3 of 4 graphs.
  • I tried to swap the calculations: Firstly the "Absolute" graph, then "x/y/z". Seemed to be no difference.
  • I tried to to combine the calculations: Firstly x/y/z, then connecting the output of them to the "Absolute" formula. I thought this would be a great idea - but it didn't worked out.

Final question:
How would I permanently distribute this work? I created a little Icon, now I'm getting up to 10 Offline QR-Codes and the Online-QR-Code is not permanent for sure. Same would go for another config file for the magnetometer, which I'm planing to edit soon.

May I add a little bug report:
  • When marking a few characters in an input-field in the editor and then pressing "Delete", the editor is asking me "Would you like to delete this module?"
  • When searching for bluetooth devices within the app I have to touch the desired entry quite often (5 to 10 times) until it is recognized by the app.
Thanks again for all your help!
Reply


Messages In This Thread
RE: Calliope Mini as external Accelerometer - by Jonathan Haug - 03-08-2020, 05:53 PM

Forum Jump: