A debug current/voltage module would be handy

Hi all guys, I am new here in this forum, I am the one who has been working in Microsoft in the PowerKit Nicolas told you, from now on I will take care of questions and any information you want :slight_smile:

Fisrt of all thanks for the interest, very good feedback and such an interesting topics you bring here

@ GMod Yes it looks a bit scary :stuck_out_tongue: I have been working on designing this for 2 months and after few prototypes this is what is much easy to use (connect, cables, boards…) maybe there are better ways so I am open to any feedback about the design. The module uses a power monitor from TI INA226. The reason is that it works on its own, so you can just configure it and let it averaging or giving you alerts if something happens, it has a calibraiton parameter so you can change resolution depending on what you connect. This is very important because if you connect a power module the Current could be Amps, while if you connect an LED we are talking about mA, so if you want high resolutions independently of waht you connect it is very useful power monitor. It uses a 0.01 Ohm shunt resistor.

@ mhectorgato I have been testing the module using a T35 display and a cellular radio module, and it is very useful as you can see how each module demands current, how the power supply ā€œsuffersā€ and all this, and as it is an independent system, you can see how Gadgeteer resets and so on, I will send some pictures with the nice graphs exposing all this :slight_smile:

@ Jeff_Birt We have designed a single module (see Nicolas pictures) that you can connect to any socket/device/power module, it make its easier and very inexpensive, but the point about having a ā€œShieldā€ is that sometimes you want to know in detail what is going on in each module/socket, record all data and look at it afterwards, re-play a power sequence to find very small spikes or flickering of the voltage that made to board to reset… if you use a multimeter you just get very big averages of current, where you can’t actually see spikes (as the GPRS module does) that make the main board to reset.

One point I find very interesting, and I think will be what will make this to be nice, it the possibility to add power managment code! I mean, you can connect the power module to your main board and make real time power managment within your code, or even, if you can have the power board running on the side communicating with your main board using serial for example. It could improve a lot designs and make all power managment less painful (specially for non hardware people, as we are aiming to them mainly).

If you have any feedback/comments or just dont agree about something let me know and I will answer! thanks for reading!!

Jordi

Don’t get me wrong, it’s a good kind of scary. :slight_smile:

Where did you place the parts for the current sensing? With all the board space taken up on top and bottom by sockets… :slight_smile:

Really nice chip. Will study it for future uses. :slight_smile:

That is pretty much what I did as I have a power cycle device that I built with Gadgeteer that was powering the GPS test device on for 12 minutes and that device would write to a SD card how long it took to get a GPS lock (the times above), then the power cycler would cut power to the GPS tester for 3 minutes (ie forcing a cold reboot) and repeat. So it works out to be 4 tests per hour and so I ran each test over many hours (eg 12 hours or more) to reduce the error due to satellites in view etc.

Right now I’m just running the same test, but with Seeed’s GPS and MakeGPS running at the same time so I can see a direct comparison of the performance of both GPS units.

Later I’ll run a comparison between the Love and GHI Dual power modules, but I need to get a barrel connector so I can plug a wall wart into them (as don’t have a bench top power supply).

What you can do is:

[ol]Time how long it takes to get a lock.
Immediately send the command to the GPS that forces a cold reboot
Goto 1[/ol]

There is no need to actually power off the GPS…

This will give you cycles in the minutes…

@ Duke Nukem - could you start another thread (or email me) about what you are up to with the GPS stuff? I read through this one and am still not clear…

I didn’t want to skew the results by false weighting during good satellite positioning (ie lots of short cycles), so I went for a fixed cycle time repeated over a long duration to randomize satellite positioning equally (or at least sort of equally) for all tests. Ideally I would have wanted to run 3 test devices side-by-side but I only have one MakeGPS module, hence my attempt to eliminate satellite positioning from the factors influencing the overall results.

When I say for example it took 2:24, that would be from power up (ie start a timer in main()) to the UpdateStats event raised by the MakeGPS module. I don’t care about the rest of the ā€˜on’ cycle as the ā€˜off’ cycle will reset the board back to a fresh start condition when it powers back on.

So currently for my own interest I’m running a similar test using the MakeGPS module and the old Seeed GPS module, now in this case I don’t really care about satellite positioning as each GPS has the same positioning opportunity as they are being tested concurrently (you can hang 2 GPS modules off a Cerberus board).


public partial class Program
    {
        private DateTime _start;
        private bool _connected = false;
        private bool _connected2 = false;
        
        // This method is run when the mainboard is powered up or reset.   
        private void ProgramStarted()
        {
            Debug.Print("Program Started");

            multicolorLed.GreenBlueSwapped = true;
            multicolorLed1.GreenBlueSwapped = true;

            multicolorLed.TurnRed();
            multicolorLed1.TurnRed();

            if (sdCard.IsCardInserted)
            {
                sdCard.MountSDCard();
            }

            if (sdCard.IsCardMounted)
            {
                StreamWriter textFile = new StreamWriter(sdCard.GetStorageDevice().RootDirectory + @ "\GPSCompare.txt", true);
                textFile.WriteLine("New Test");
                textFile.Close();
            }

            _start = DateTime.Now;

            makeTracks.Configure();

            gps.PositionReceived += new GPS.PositionReceivedHandler(gps_PositionReceived);

            makeTracks.GPS.CoordinatesUpdated += new OnCoordinatesUpdated(OnGpsCoordinatesUpdated);
            makeTracks.GPS.AltitudeChanged +=
                new OnAltitudeChanged((MTK3339 sender, double m, int f) => UpdateStats(sender));
            makeTracks.GPS.SpeedChanged +=
                new OnSpeedChanged((MTK3339 sender, double k, double m) => UpdateStats(sender));
            makeTracks.GPS.CourseChanged += new OnCourseChanged((MTK3339 sender, double d) => UpdateStats(sender));
            makeTracks.GPS.SatellitesUsedChanged +=
                new OnSatellitesUsedChanged((MTK3339 sender, int s) => UpdateStats(sender));

            makeTracks.GPS.Error += new OnError(GPS_Error);
            makeTracks.GPS.SatellitesUsedChanged += new OnSatellitesUsedChanged(GPS_SatellitesUsedChanged);

            makeTracks.GPS.SatellitesInViewChanged += new OnSatellitesInViewChanged(GPS_SatellitesInViewChanged);
        }

        void gps_PositionReceived(GPS sender, GPS.Position position)
        {
            TimeSpan running = DateTime.Now - _start;

            //Debug.Print(position.LatitudeString + " " + position.LongitudeString);

            if (!_connected2)
            {
                StoreResult(running, 0, position.FixTimeUtc);
                _connected2 = true;
                multicolorLed1.TurnGreen();
            }
        }
        

        void GPS_SatellitesInViewChanged(MTK3339 sender, MTK3339.SatelliteInView[] e)
        {
            foreach (MTK3339.SatelliteInView satelliteInView in e)
            {
                Debug.Print(satelliteInView.PRNNumber.ToString() + " " + satelliteInView.SignalNoiseRatio.ToString());
            }
        }

        void GPS_SatellitesUsedChanged(MTK3339 sender, int count)
        {
            Debug.Print("Satellites Used " + count);
        }

        private void GPS_Error(MTK3339 sender, string data)
        {
            Debug.Print("ERROR " + data);
        }

        private void OnGpsCoordinatesUpdated(MTK3339 sender) //static 
        {
            /*
            TimeSpan running = DateTime.Now - _start;

            Debug.Print("Coordinates at " + running.Seconds.ToString() + " runtime");

            Debug.Print("Coordinates: " + sender.Latitude + ", " + sender.Longitude + " (" +
                        sender.MapLatitude.ToString("F6") + ", " + sender.MapLongitude.ToString("F6") + ")");
            */
        }

        private void UpdateStats(MTK3339 mtk)
        {
            TimeSpan running = DateTime.Now - _start;

            /*
            Debug.Print("Update at " + running.Seconds.ToString() + " runtime");

            Debug.Print("Time: " + mtk.Time);
            Debug.Print("Coordinates: " + mtk.Latitude + ", " + mtk.Longitude + " (" + mtk.MapLatitude.ToString("F6") + ", " + mtk.MapLongitude.ToString("F6") + ")");
            Debug.Print("Altitude: " + mtk.Altitude.ToString("F2") + "m (" + mtk.AltitudeInFeet.ToString("F2") + "ft)");
            Debug.Print("Satellites Used: " + mtk.SatellitesUsed);
            Debug.Print("Course: " + mtk.Course.ToString("F2"));
            Debug.Print("Speed: " + mtk.Speed.ToString("F2") + "km (" + mtk.SpeedInMPH.ToString("F2") + "mph)");
            */

            if (!_connected)
            {
                StoreResult(running, mtk.SatellitesUsed, mtk.Time);
                _connected = true;
                multicolorLed.TurnGreen();
            }
        }

        private void StoreResult(TimeSpan runtime, int satellites, DateTime time)
        {
            if (sdCard.IsCardMounted)
            {
                DateTime temp = new DateTime(1900, 1, 1, runtime.Hours, runtime.Minutes, runtime.Seconds);

                StreamWriter textFile = new StreamWriter(sdCard.GetStorageDevice().RootDirectory + @ "\GPSCompare.txt", true);
                textFile.WriteLine(time.TimeOfDay.ToString() +";" + Mainboard.MainboardName + ";" + temp.TimeOfDay.ToString() + ";" + satellites);
                textFile.Close();
            }
            
        }
    }

Cool. Added code tags. Hope it helps… :slight_smile:

@ GMod(Errol) - lol

After 48 test cycles of (12 min powered, 3 min non powered) the side by side comparison of the Seeed GPS to the new MakeGPS:

Number of cycles Seeed was able to get a fix, but the MakeGPS wasn’t able to: 8
Number of cycles MakeGPS was able to get a fix, but the Seeed wasn’t able to: 12
Number of cycles that neither was able to get a fix (within 12 minutes, remember I’m in my home office): 2

Seeed / 	MakeGPS

Average 0:07:00 / 0:02:47

Min 0:02:24 / 0:00:53
Max 0:10:36 / 0:07:07

Dev 0:02:15 / 0:01:32

Rather clear that the new MakeGPS is better then the old Seeed GPS module.

Its a comparison test of three different runs, so this could skew the results between runs (for example power module x happens to be tested when there are more satellites viewable in the sky, then say when power module y is being tested). Hence the fixed cycles over a long duration which should even out the satellite positioning for each module, ie its not a speed test, its a comparison test so you have to level the playing field between runs as much as you can.

Thanks for the info - I too have had better success with the MakeGPS than the Seeed.

Have you had a chance to test with a Love power module?

Not yet using a non USB power source, as I want/need to get a barrel connector first.

@ Duke Nukem - Now I get what you’re up to. Thanks for those stats and taking the time to do the testing.

OK next round of testing, using 9V / 650ma wall wart from my MeeBlip, powering the Love Power Module barrel connection and then the GHI module and we see how those in terms of affecting MakeGPS performance. Is that a suitable power setup, or do we want more volts etc?

9V, 650mA is fine. Please please please can you start a new thread?