Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

QuantumPhysGuy's Content

There have been 30 items by QuantumPhysGuy (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#38582 Something new is brewing in the Secret Labs

Posted by QuantumPhysGuy on 05 November 2012 - 08:45 PM in General Discussion

Nicky and Nevyn:

Thank you for the additional details. We've created an updated firmware release for Netduino Go, and will be posting it on Thursday.

Chris


Maybe a GO! Firmware update?



#37336 Documentation

Posted by QuantumPhysGuy on 17 October 2012 - 06:39 PM in Project Showcase

Xmldoc is newer embedded in the dll files, you write it in the source, as comments.. I guess you know that?
The compiler will extract that as xml files placed next to the dll file, so you can get inline docs, or create chm docs.


Yes I know that. NETMF doesn't support, all the way, the embedding of the XML comments due to size. Just had that issue. So I am telling the VS2010 compiler, by checking "XML Documentation File" in the Build properties of each SecretLabs project, then using Sand Castle to compile it all to an CHM format and HTML format.



#37332 Documentation

Posted by QuantumPhysGuy on 17 October 2012 - 06:22 PM in Project Showcase

Are you really going to create bolt-on documentation?, if documentation was done in the sourcecode using xmldoc, then it could be extracted, and since secretlabs don't have any public repo, you need to do it on your own copy of the source, and loose it with next version..
But it would have been nice if it was there..


That's currently what I am doing. Major problem is NETMF doesn't support XMLDoc imbedded in the DLLs fully due to size. So, I'm have to have VS2010 generate the xml files per library and import them into sandcastle.

It should be easy to migrate each exported XML over to the new versions of the SDK when they are released. Sandcastle would then flag which methods aren't documented and I can fix from there.



#37324 Documentation

Posted by QuantumPhysGuy on 17 October 2012 - 03:55 PM in Project Showcase

I'm not sure where else to post this, but after talking to a few people I've noticed one of the things that the Netduino SDK lacks is documentation. I think I am going to take on the task of creating XML documentation for all the classes, methods, properties, and events from the Netduino SDK. Once I'm done I'll be able to export the XML documentation as a CHM and HTML documentation for the Netduino SDK/API. Here's hoping everything works out. :)



#37150 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 03:59 AM in Netduino Go

Ok, now that I made the change. My readings are off by 3.5°. Here is my code:

    	private static AnalogInput aiTemp;
...

Suggestions?


Maybe I should check circuits before asking questions.

I added a 0.1uF ceramic disk capacitor on the out pin of the TMP36 and my readings match the multimeter...

Thanks for the help Chris and Gutworks.



#37149 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 03:56 AM in Netduino Go

If you read this post over, you will see some of the work carb has done using this sensor and a Touch Display. A little further down I converted his sample to C#. Hopefully you can find a couple hints or useful snippets to help you along the way, such as the formula used and a way to average the sample to filter out some of the ADC noise.


Ok, now that I made the change. My readings are off by 3.5°. Here is my code:

    	private static AnalogInput aiTemp;

    	public static void Main()
    	{
        	ShieldBase shieldBase = new ShieldBase(GoSockets.Socket8);
        	SevenSegmentDisplay ssDisplay = new SevenSegmentDisplay(GoSockets.Socket2);
        	Double dTemp;

        	aiTemp = new AnalogInput(shieldBase.AnalogChannels.ANALOG_PIN_A0);
        	
        	while (true)
        	{
            	dTemp = GetAverageTemperature() * 9 / 5 + 32;
            	ssDisplay.SetValue(dTemp.ToString("N1") + "F");
            	Thread.Sleep(1500);
        	}
    	}

    	private static Double GetAverageTemperature()
    	{
        	Double dTotalTemp = 0;
        	Double dAverageTemp;

        	for (Int32 i = 0; i <= 19; i++)
        	{
            	dTotalTemp += GetTemperature(aiTemp.Read());
            	Thread.Sleep(50);
        	}

        	dAverageTemp = dTotalTemp / 20;

        	return dAverageTemp;
    	}

    	private static Double GetTemperature(Double dReadValue)
    	{
        	Double voltage = dReadValue * 3.3;
        	Double temp = voltage - 0.5;

        	return temp * 100;
    	}

Suggestions?



#37148 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 03:44 AM in Netduino Go

Hi QuantumPhysGuy,

You may have found some sample code for this sensor that was written using the 4.1 .Net MF. The 4.2 .Net MF has introduced some changes to the AnalogInput class. The Read() function in 4.2 behaves much differently than it's predecessor, and it now returns a value between 0.0 and 0.9999, which technically provides you with better precision. The shield base is also using a 12 bit ADC unlike the Netduino Plus which is 10 bit. The old Read() returned the raw AD value, a number between 0-1023, and so if you wanted to replicate this value you can use the new to 4.2 ReadRaw() function. The ReadRaw() will return a value in the range of 0-4095.

If you read this post over, you will see some of the work carb has done using this sensor and a Touch Display. A little further down I converted his sample to C#. Hopefully you can find a couple hints or useful snippets to help you along the way, such as the formula used and a way to average the sample to filter out some of the ADC noise.

Cheers,
Steve


Thanks! That makes much more sense. The sample I was looking at was from the 2010-2011 time frame.



#37146 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 03:00 AM in Netduino Go

Here is something odd, once I removed the terminal and jumper wires I had on the breadboard the readouts from the NGO went to normal and they are close to what my multimeter said by about ~0.01 volts... Is it possible it was causing "noise" on the ADC?



#37145 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 02:57 AM in Netduino Go

Hi QuantumPhysGuy,


What voltage are you measuring on the 3V3 header of your Shield Base?

Also, just curious: why multiply by 3300 and then divide by 1024?

Chris


Voltage is showing 3.35.

I was doing that to account for the 3.3V and also the bits from the ADC. Is that not correct?



#37143 ADC Question / Issue

Posted by QuantumPhysGuy on 14 October 2012 - 02:49 AM in Netduino Go

I am trying to get a reading from a TMP36 temperature sensor from my Netduino Go. I currently have my breadboard setup where I see the reading from the TMP36 on my multimeter and also have the signal sent to the NGO.

One thing I am noticing right off is the difference from the voltage my multimeter is reading versus the NGO. Currently my multimeter is showing 0.72V coming from the TMP36, but my NGO is showing 0.685v - 0.690v.

Here is my conversion for the ADC:

ShieldBase shieldBase = new ShieldBase(GoSockets.Socket8);
AnalogInput aiTemp = new AnalogInput(shieldBase.AnalogChannels.ANALOG_PIN_A0);
Double dVolts = aiTemp.Read() * (3300 / 1024F);

So you can see when I do the math to convert the volt reading to degrees I am coming up with not so acurate readings. Using the multimeter the temp would be 22° C which is correct for the room I am in, but the NGO shows ~66° C.

Does anyone have any tips on this?



#36938 TristatePort Issue

Posted by QuantumPhysGuy on 10 October 2012 - 03:59 AM in Netduino Go

Okay, that's very interesting. This is with beta 4?

If you create it as an InputPort do you get the same issue?

Chris


Yes this is with beta 4, but I was having this same problem with beta 3. The below code worked without error:

InputPort ipPort = new InputPort(shieldbase.Pins.GPIO_PIN_D5, false, Port.ResistorMode.Disabled);



#36933 TristatePort Issue

Posted by QuantumPhysGuy on 10 October 2012 - 03:44 AM in Netduino Go

Hi QuantumPhysGuy,

Is the pin being used already, by any chance?

We're passing exceptions via GoBus--but only the root Exception class. We'll be adding the others soon as well so you can get full exception details.

If you create a TristatePort for that pin directly from your code...do you also get the exception?

Chris


D5 isn't being used except for trying to create the TristatePort.

Currently this throws the same exception:

TristatePort _port = new TristatePort(shieldbase.Pins.GPIO_PIN_D5, false, false, ResistorModes.Disabled);



#36931 TristatePort Issue

Posted by QuantumPhysGuy on 10 October 2012 - 03:33 AM in Netduino Go

I have narrowed it down a bit. It appears what is actually failing is the GoBus.GoBusSerialTransport.CallFunction.

I finally tracked the exception down to line 1098 of GoBusSerialTransport.cs but not 100% sure why it threw an exception.

Line 1098:
if (functionResponse.Exception != null)
{
throw functionResponse.Exception;
}

Any ideas?



#36817 TristatePort Issue

Posted by QuantumPhysGuy on 09 October 2012 - 12:16 AM in Netduino Go

I am trying to get the Parallax Ping))) Sensor working with the Netduino GO and the Shield Base. I am using the Ping class that was created by afulki which can be found here.

Whenever I try to run the code I get an error that states:
An unhandled exception of type 'System.Exception' occurred in GoBusSerialTransport.dll

This is my Program.cs:
        public static void Main()
        {
            ShieldBase shieldbase = new ShieldBase(GoSockets.Socket1);
            Thread.Sleep(5000);
            ParallaxSensors.Ping pPing = new ParallaxSensors.Ping(shieldbase.Pins.GPIO_PIN_D5, 1000, true);

            pPing.RangeEvent += new ParallaxSensors.Ping.RangeTakenDelegate(pPing_RangeEvent);

            Thread.Sleep(Timeout.Infinite);
        }

        public static void pPing_RangeEvent(object sender, ParallaxSensors.PingEventArgs e)
        {
            Debug.Print("Range: " + e.Distance + " cm");
        }

It seems to be failing on line 72 of the code posted by afulki, but I can't figure out why.
_port = new TristatePort(pin, false, false, ResistorModes.Disabled);

This is the stack trace information for the error:

Exception was thrown: System.Exception

GoBus.GoBusSerialTransport::CallFunction
NetduinoGo.ShieldBase::CreateTristatePort
System.Reflection.MethodBase::Invoke
Microsoft.SPOT.Hardware.TristatePort::.ctor
PINGSensor.Program::Main


Does anyone have any ideas?



#36597 Servos with Netduino GO

Posted by QuantumPhysGuy on 05 October 2012 - 10:32 PM in Netduino Go

Did you connect the GND on the Netduino to the GND on the breadboard?

Regards,
Mark


Yes, that finally fixed, I also put in a 7805 as well.



#36580 Shield Base Firmware (beta 3)

Posted by QuantumPhysGuy on 05 October 2012 - 03:19 PM in Netduino Go

I am having somewhat of a problem with my shield base after the update. I have a simple code flashing the power led on the Go when I push the button, which runs fine. But whenever I add:

private static NetduinoGo.ShieldBase GoShield = new NetduinoGo.ShieldBase(GoSockets.Socket5);

to the code I get a System.Exception in GoBusSerialTransport.dll. The shield base is on socket 5 and before upgrading, the shield base initialized without any problems. It seems the Go does connect to the shield, as the blue LED lights up, but it crashes shortly after. I am running the 4.2.0.1 firmware and the shield base flash completed successfully. The debugger output should be attached.

Any hints would be greatly appreciated.

Jens


I had a similar issue - make sure you are using the new ShieldBase.dll library.



#36568 Servos with Netduino GO

Posted by QuantumPhysGuy on 05 October 2012 - 12:29 PM in Netduino Go

I ran into another odd issue last night using a Servo. I have 4 AA batteries which are supplying 6V of power. I hooked them up to my bread board and ran the VCC and GND to my servo, I have the SIG set to PIN D5 on the Netduino Go. When I sent signals to the servo nothing happened. If I wire the VCC and GND directly to the NGO it worked fine. The servo is rated for 4V - 6V, any idea what would cause this?



#36479 Servo Controller GO Module

Posted by QuantumPhysGuy on 03 October 2012 - 04:55 PM in Netduino Go

Yes, you can expose a PWM on a GoBus module as virtual I/O. You can then control the PWM on the module as if it were a PWM on your mainboard.

This is how the Shield Base works today.

Chris


Thanks! This is a Shield Base that will be connecting to the Parallax Server Controller that I referenced in my first post. I was just curious if I could send certain 8 byte commands to the controller from the Shield Base Go Module. Are the Virtual I/O classes/methods documented anywhere so I can study them?



#36462 Servo Controller GO Module

Posted by QuantumPhysGuy on 03 October 2012 - 02:14 PM in Netduino Go

The only problem right now is the i2c part, it's not available yet, but coming on the shieldbase someday, only the (well, rather expensive) DAQ from Nwazet you have i2c.
atleast, i think those are the only i2c options right now.


Do you have any idea how to emulate a serial port on the netduino to send commands at a certain baud rate to another device? I'm slowly researching this but curious if anyone else has attempted it.



#36458 Servo Controller GO Module

Posted by QuantumPhysGuy on 03 October 2012 - 01:21 PM in Netduino Go

And Adafruit have an i2c based one: https://www.adafruit.com/products/815


That might be easier than the Parallax one. Using the parallax controller I would have to figure out how to "emulate" a serial controller on the Netduino.



#36452 Servo Controller GO Module

Posted by QuantumPhysGuy on 03 October 2012 - 12:14 PM in Netduino Go

I'm going to be working on getting communication working with the Parallax Propeller Servo Controller in the next few days, but I think this would be a great add-on as a GO module. The controller allows you to control 16 servos, or 32 with "networked" controllers, with an independent power source for the servos. Not sure if this the proper forum to request a new module but I'm excited about working with this board and seeing a GO module to do the same would fantastic. Parallax Servo Controller Board: http://bit.ly/SCnoMF



#36385 Servos with Netduino GO

Posted by QuantumPhysGuy on 01 October 2012 - 07:34 PM in Netduino Go

Hi QuantumPhysGuy,

As of the last Shield Base update the PWMChannels enums, PWM_0 to PWM_5 have been disabled. Perhaps try using the newly added enums which better reflect the actual Shield Base pins. (i.e. PWM_PIN_D5)

So try using:

PWM servo = new PWM(shieldbase.PWMChannels.PWM_PIN_D5, 20, 2, PWM.ScaleFactor.Milliseconds, false);


I was using the incorrect version of the ShieldBase library. Thanks for pointing that out with the enumerator I didn't I have!



#36383 Servos with Netduino GO

Posted by QuantumPhysGuy on 01 October 2012 - 07:12 PM in Netduino Go

Just a theory...try moving:

shieldbase = new ShieldBase(GoSockets.Socket1);
...into your main function. The classes may be getting constructed out of order.

Chris


Modified what you suggested. Same result:

            try
            {
                ShieldBase shieldbase = new ShieldBase(GoSockets.Socket1);
                Potentiometer pot = new Potentiometer(GoSockets.Socket7);

                PWM servo = new PWM(shieldbase.PWMChannels.PWM_0, 20, 2, PWM.ScaleFactor.Milliseconds, false);

                servo.Start();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message + "\n" + ex.StackTrace);
            }
Stack Output:

Exception was thrown: System.Exception
NetduinoGo.ShieldBase::CreatePWM
System.Reflection.MethodBase::Invoke
Microsoft.SPOT.Hardware.PWM::.ctor
Servo.Program::Main



#36345 Servos with Netduino GO

Posted by QuantumPhysGuy on 01 October 2012 - 03:59 AM in Netduino Go

Hi QuantumPhysGuy,

If you want the PWM to be high for 2ms, you'll want to set the duration to 2ms instead of 18ms.

Also, be sure to upgrade your Shield Base to the latest firmware. There were some PWM bufixes in the newer releases.

Chris


Thanks Chris, I update the code to reflect your changes and I updated the Netduino GOs firmware and my shield base. Now I am having another odd issue. When the code executes it takes about 15 seconds for the POTs GO bus to turn on. The shield base is right away, the problem is, after repeated System.Exceptions in mscorlib.dll, the application just crashes...

Any ideas on this?

Here is the modified code:

        private static ShieldBase shieldbase = new ShieldBase(GoSockets.Socket1);

        public static void Main()
        {
            try
            {
                Potentiometer pot = new Potentiometer(GoSockets.Socket7);

                PWM servo = new PWM(shieldbase.PWMChannels.PWM_0, 20, 2, PWM.ScaleFactor.Milliseconds, false);

                servo.Start();
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message + "\n" + ex.StackTrace);
            }
        }

Stack Trace Output:

Exception was thrown: System.Exception
NetduinoGo.ShieldBase::CreatePWM
System.Reflection.MethodBase::Invoke
Microsoft.SPOT.Hardware.PWM::.ctor
Servo.Program::Main


Another odd thing, I have the servo attached to D3, 5V, and GND. It will pulse, about every 5 - 10 seconds.



#36337 Servos with Netduino GO

Posted by QuantumPhysGuy on 01 October 2012 - 02:02 AM in Netduino Go

I have a parallax standard servo I am trying to get working with the Netduino Go Shield Base. I currently have the servo connected to 5V, GND, and analog 0.

When I turn the netduino on the servo moves just a bit but once I run the below code, nothing happens. Does anyone know why? I'm fairly new at all of this.

The servo says 0.75-2.25 ms high pulse, 20 ms intervals. So I "think" I have the constructor correct on the PWM.

            ShieldBase shieldBase = new ShieldBase(GoSockets.Socket1);
            PWM servo = new PWM(shieldBase.PWMChannels.PWM_0, 20, 18, PWM.ScaleFactor.Milliseconds, false);

            servo.Start();




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.