Replies

  • hi,

    last two days i spend some time to get the code running on an teensy2 board.

    see https://github.com/wolkstein/MavLink_FrSkySPort

    the teensy2 port is located in https://github.com/wolkstein/MavLink_FrSkySPort/tree/s-c-l-v-rc/Mav...

    this port do nearly the same than my teensy3 s-l-v-rc version and works with my lua script including some audio severity apm status messages. i must comment some of them because teensy2 have not so much memory to hold all strings.

    theoretical the code also run on a pro-mini board. but i have currently no pro mini to test it.

    /g

    wolke

    wolkstein/MavLink_FrSkySPort
    This MavLink_FrSkySPort repository is discontinued! The development is moved to Clooney82/MavLink_FrSkySPort where we work together on this. Please d…
    • Wolke. Sorry if what I am about to ask is elsewhere in this huge thread. I have made your voltage divider and I am successfully getting cell readings on my Taranis. Despite using 1% resistors I am slightly off on a few cells so I just need to adjust your divider values. I do not understand how they work. I understand Ohm's Law and I can see you are using 10 bit (1024) resolution.

      Looking at MavLink_FrSkySPort.ino line 197 for S4 which is: 470.134166514,// 10bit 58.7966886122,  

      On cell 4 say I am getting 3.92V when I should be getting 3.83V for example (Cannot remember what the actual difference was), what would be the formula for correcting the software divider on line 197. How does 470.134166514 relate to 58.7966886122?

      • hi,

        on teensy3.1 i am using 13 bits resolution. see this in setup: " analogReadResolution(13);". this mean i work with 13bit resolution on teensy 3.1 the commented valus are unused and only for the use with 10bit resolution. for example teensy2 or pro mini.

        so the divider work for each analog input.

        table is for 10bit resolution

        A0 4,2V  237.350026082

        A1 8,4V 116.006256517

        A2 12,6V 77.3509473318

        A3 16,8V 58.7966886122

        A4 21,0V 46.3358699051

        A5 25,2V  39.4176445024

        to calculate the divider you need an good multimeter. and you must enable debug mode. uncomment //debugSerial.begin(57600); on line 225. also uncomment line 284-295. this will show you A0-An in serial console.

        now it is simple to calculate. example for third cell. use the multimeter and measure the voltage from gnd to S3. full charged ~ 12,5 V mostly. now you see the raw analog read input on serial console. if you no see the third value maybe you read something around 999. this mean A2 read at 12,5V real voltage a value from 999.

        the calculation for the right software divider is simple. 999 / 12.5V = 79.92. know you know the divider for A2(S3) :).

        i use 13bit instead of 10bit because the better accuracy on 6S cells.

        edit. do not use an lipo tester to measure. most lipo testers works very inaccurate on higher voltage(s3-s8). 

        • To anyone else making this take note that even if you use exactly the correct resistors, 1% spec, you are likely to be off by as much as .5v unless you calibrate as Wolke outlined above. I calibrated this by calculating my own dividers and now it is spot on.

          @Wolke - this one is for you. Why do you stipulate that you do not Connect the battery ground to the Teensy ground? I can see no way that this could ever damage the electronics unless you reversed the polarity of the Lipo balance leads, which is hard to do if you use a proper connector. By NOT connecting the ground the analog inputs basically float high when the balance lead is unconnected and you basically have a 15-16 V reading (if you use 4S) or 3.9V readings per cell when unconnected. This could be an issue if you were not paying attention and took off. By glancing down your battery looks great but it is unconnected.

          What am I missing? If you connect the battery ground pin to the Teensy ground then it will pull it low when the balance lead is unconnected making the battery monitor read 0V or something close and not an almost fully charge voltage. Can you explain this? Could you not even use a pull-down of say 10K from the voltage diver ground to Teensy ground so things get pulled low when unconnected?

          Thanks

          Marc

          • Update. Seems I had a bad A0 that was reading 3.89V regardless of what the actual voltage is. I modified the code to not read from A0 and it is now not showing 15.5V but 7V when Lipo is disconnected -- not sure why A0 being bad caused this but no matter. When I disconnect the Lipo and connect the divider ground to the Teensy ground I get blank cell readings (good) instead of 1.9V floating values. So my questions remains: Can connecting the grounds really result in harm as it pulls the inputs to zero with the battery disconnected?

            Thanks

            Marc

            • gnd line,

              in my case i use two 3s batteries in series. so i have two main battery plugs on copter in serial connection. if the ballancer gnd line is directly connected to teensy, all current flow trough this balancer gnd  line if i disconnect the main-plug on the negative site first. because in this case the current run from main plug+ to balancer gnd. but now not firstly inside my main power distributor. firstly inside the teensy also through the apm/pixhawk and so on. i burned one teensy because this. the teensy produce an small cloud and was dead. lucky, because this burning teensy-FUSE had saved my apm board:) and my x8r.

              /g

              wolke

              • I run 2 x 3S LiPo's in parallel. Using my current method I know only how to monitor the cells on one battery through FLVSS. Is there a way you can think of which would let me monitor the cells of both battery balance leads at the same time? So monitor all 6 cells independently? Thanks, Paul

              • Got it. Thanks. That makes sense now. I had not considered the situation where the main ground was disconnected the lipo positive was connected and the teensy was acting as a ground return through the FC. 

        • That makes sense now. Many thanks.
    • https://github.com/wolkstein/MavLink_FrSkySPort/tree/s-c-l-v-rc/Mav...

      I tested this on a pro mini and found that I had to comment out line 359 -  //parseStatusText(statustext.severity, statustext.text);  to get the data to flow.

      Also the GPS is reporting incorrect and weird values.

      Other than that, all else looks good.

      wolkstein/MavLink_FrSkySPort
      This MavLink_FrSkySPort repository is discontinued! The development is moved to Clooney82/MavLink_FrSkySPort where we work together on this. Please d…
This reply was deleted.

Activity