Servo Controller GO Module - Netduino Go - Netduino Forums
   
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.
Photo

Servo Controller GO Module


  • Please log in to reply
10 replies to this topic

#1 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 03 October 2012 - 12:14 PM

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

#2 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 03 October 2012 - 01:00 PM

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

--
Asbjørn


#3 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 03 October 2012 - 01:21 PM

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.

#4 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 03 October 2012 - 01:52 PM

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.

--
Asbjørn


#5 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 03 October 2012 - 02:14 PM

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.

#6 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 03 October 2012 - 02:37 PM

Do you mean the netduino or netduino go?, the netduino have 2 uarts, but the go doesn't have it directly (I might be lying here), the Shieldbase will get uart, and the Daq already have an uart. One option could be to use the shieldbase and deploy the framework directly, and use it as an netduino (there are some posts about that), but so far, there are some much needed protocols that we don't have access to on the Go's yet..

--
Asbjørn


#7 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 03 October 2012 - 02:43 PM

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.


Serial communication is well established on the original Netduino and Netduino Plus and is a common way of getting debug information out to a dumb terminal.

The code below might work for you (I pulled it out of one of my projects) but your solution does not have to be this complex. There are also several threads on 'Netduino serial communication' (with various levels of complexity) here in the forums. If you have any trouble making progress, I'll try to help.

        public class SerialPort : IDisposable
        {
            private System.IO.Ports.SerialPort _serialPort;

            public static string NewLine
            {
                get { return "\r\n"; }
            }

            public SerialPort() : this(SerialPorts.COM1)
            {
            }

            public SerialPort(string portName)
            {
                _serialPort = new System.IO.Ports.SerialPort(portName, 9600, Parity.None, 8, StopBits.One);
                _serialPort.Open();
                _serialPort.DataReceived += OnDataReceived;
                Thread.Sleep(50);
                _serialPort.Write(Encoding.UTF8.GetBytes("\r"), 0, "\r".Length);
            }

            public System.IO.Ports.SerialPort Native
            {
                get { return _serialPort; }
            }

            public void Dispose()
            {
                _serialPort.Dispose();
                _serialPort = null;
            }

            public event DataReceivedHandler DataReceived;

            private void OnDataReceived(object sender, SerialDataReceivedEventArgs e)
            {
                var port = sender as System.IO.Ports.SerialPort;
                if (port == null)
                {
                    return;
                }

                DataReceivedHandler handler = DataReceived;
                if (handler == null)
                {
                    return;
                }

                var buffer = new byte[port.BytesToRead];
                int numBytesRead = port.Read(buffer, 0, port.BytesToRead);
                if (numBytesRead <= 0)
                {
                    return;
                }

                var message = new string(Encoding.UTF8.GetChars(buffer));
                handler(new DataReceivedEventArgs(message));
            }

            public virtual void Write(byte[] bytes)
            {
                _serialPort.Write(bytes, 0, bytes.Length);
            }

            public virtual void Write(string message)
            {
                Write(Encoding.UTF8.GetBytes(message));
            }

            public virtual void WriteLine(string message)
            {
                Write(message);
                Write(NewLine);
            }
        }


#8 6677

6677

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 October 2012 - 04:12 PM

From my understanding of Go Modules you have a uC at the other end anyway so surely its possible to send a command on the GoBus that then "orders" the uC's UART to operate the servo driver. Noob here so maybe wrong.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 October 2012 - 04:51 PM

From my understanding of Go Modules you have a uC at the other end anyway so surely its possible to send a command on the GoBus that then "orders" the uC's UART to operate the servo driver. Noob here so maybe wrong.

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

#10 QuantumPhysGuy

QuantumPhysGuy

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationKentucky, USA

Posted 03 October 2012 - 04:55 PM

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?

#11 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 October 2012 - 05:16 PM

Hi QuantumPhysGuy,

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?

The Virtual I/O classes/methods are the standard classes/methods. You use OutputPort, AnalogInput, PWM, etc. just like normal. You just need to specify the correct virtualized pin (shieldBase.Pins, shieldBase.AnalogChannels, shieldBase.PWMChannels, etc.).

We're testing virtualized SerialPort for Shield Base this week. I should be posting an update which enables 2-3 UARTs on Shield Base by next weekend. Then we just have SPI and I2C to go.

Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.