Introduction
A very simple robot built on .Net Gadgeteer. You can find more information on .Net Gadgeteer on Codeplex here.

Blurry Cam of Robot
Blurry Cam Image of Robot

Video of robot here.


Project Description

.Net Gadgeteer is an open-source hardware rapid prototyping platform developed by Microsoft Research. It is great of connecting hardware modules together to create new devices. For a .Net developer interested in robotics as a hobby, Gadgeteer is a great way to get started because you will leverage your existing skills as a C# developer and use tools like Visual Studio which you are already familiar with. You can program and debug your robot from Visual Studio. And you just need a usb cable. No programmer hardware required.

Because this is a robot demonstration it will obviously require that you have a robot chassis. In this demo I am using the excellent chassis from Seattle Robotics Society(SRS). SRS is a non-profit dedicated to public education on all aspects of robotics here in the Puget Sound area.

Second you will need a motor controller. There are available .Net Gadgeteer motor controllers from GHI which is very easy to use. However, I wanted to show here how to do something a little more challenging. Therefore, I am using a Pololu Dual Serial Motor Controller which is a high current controller that can power a 6 motor robot up to 13A continuous per channel.

So let's get started. Assuming you already have the .Net Gadgeteer SDK installed, start Visual Studio, open a New .Net Gadgeteer project.

In the designer drag on the modules as below:

RobotDiagram.JPG

Here I am using Seeed Studio's OLED Display because it is small and fits well on a small robot chassis. You can easily substitute the GHI's 3.5" touch display if you have space for it. Notice that I renamed the modules in the Visual Studio designer. You can do this yourself by clicking on the name at the bottom of the modules image after you have dragged it onto the designer. This name will be the name of the object's instance variable.

The UART extender is used for connecting with the Pololu serial interface. Here is what the wiring looks like on the Pololu controller.
MotorControllerWire2_2.jpg

And here is a close up of the wires to the extender ("UART") module:

MotorControllerWiring.jpg

How did I know which pin and socket to use? Good question. If you look at the .Net Gadgeteer MCU there are numbers and letters next to each socket. The letters tell you what type of ports are available on the socket's pins. So "A" means analog is available on this socket. "U" means UART is available. "S" for SPI and so on. If you need to know which pin is which you can either try them all and usually the compiller will throw an error if you pick wrong. Or you can look at the schematics on GHI's website. Note that you only need to get this deep into the hardware when you are interfacing custom hardware. If I was using the motor module from a GHI then I wouldn't need to do any of this.

I wanted to show how to use the serial interface (UART) because of all the extender interfaces it is the most difficult to figure out on your own. But here is all you need to do. On my blog I also use this same technique to connect to Sparkfun's Bluetooth module (BlueSmirf).

Here is the important section of code that intializes the socket interface:
GT.Socket socket = GT.Socket.GetSocket(UART.ExtenderSocketNumber, true, null, null);
serial = new GTI.Serial(socket, 115200, GTI.Serial.SerialParity.None, GTI.Serial.SerialStopBits.One, 8, GTI.Serial.HardwareFlowControl.NotRequired, null);

The baud rate is determined by the hardware. So in this case I had to set the jumpers on the Pololu controller. See Pololu documentation on jumpers here.

Here is an overall view of the wiring. I think the only missing references are to wiring the motors. The motors terminals are labeled but you should be referring to the Pololu documentation (or the documentation of the motor controller you are using).
RobotWiring.jpg


I welcome feedback. Let me know if this article was helpful or not. Also what details would you like me to expand upon.









Last edited Dec 29, 2011 at 10:25 PM by Michael_Ashby, version 19