VB 2005 for Lynx 6

Hi peeps.
Am very new to the robot world and am learning VB 2005. Is anyone familiar with creating basic movement commands for the Lynx 6 robotic arm. If so an example would be greatly appreciated. Thanks in advance.

S

What microcontroller are you using? This will make it easier to answer your original quesiton. I dont know how to land on the moon if I dont know what galaxy I’m in.

Since snoopaloop is using the Lynx6, I would guess hes using the SSC-32?

If you are, there are plenty of VB examples on the forums about how to send commands to the SSC-32 via VB and a COM connection.

Yes I am using the SSC-31. I have tried one example of VB 6 and tried my best to convert it without luck. Will keep trying. If anyone has done this successfully, a look at the code would be greatly appreciated.

Snoopaloop - try this

Connect serial cable from VB ready computer to SSC32

  • Set the baud rate of this com port to whatever baud rate you would like to use and that the SSC32 supports - 2400, 9600, 38400, 115,000 in this case) for this example I will use 9600.
  • plug a servo into channel 10 (could be any and many dependent on how many servos are in your arm)
  • From the instructions for the SSC32 there are a list of commands that are accepted as ASCII strings of decimal numbers that make things happen. Learn these.

Within VB6.0

  • Set up a Form along with a serial control object (MsComm)

  • Add the MsComm object (named MSComm1)

  • Add a scrollbar control (named Hscroll1)

  • copy code below to move this servo to center upon form load and to move servo on channel 10 based on scrollbar movement

Private Sub Form_Load()
Dim scroll1value As Integer

MSComm1.Settings = “9600,N,8,1”
MSComm1.CommPort = 1
If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
Else
MSComm1.PortOpen = False
End If

HScroll1.SmallChange = 100 'sets up speed of movement within the form itself
HScroll1.LargeChange = 200
HScroll1.Min = 500 'sets scrollbar minimum equal to lowest Pulse width of SSC32
HScroll1.Max = 2500 'sets scrollbar minimum equal to highest Pulse width of SSC32
HScroll1.Value = 1500 'sets Hscroll1 to center position which cooresponds to servo center at pulse width of 1500 when sent out serially

scroll1value = HScroll1.Value

End Sub

Private Sub HScroll1_Change()
MSComm1.Output = “#10 P” & HScroll1.Value & “S750” + Chr$(13)
End Sub

The line under the HScroll is the format you can use to send control signals to the SSC-32

NOTE: this is for control of one servo. You would have to build in complex movements from there

Hope this helps

Chris

Thanks gents.
Hoping to perfect it in VB 2005 with windows voice. Will post it once its done (may take a bit…)

Snoop

If he’s using VB2005 the MSComm isnt available. .NET framework 2 & 3 have a replacement called serialport.

Essentially its the same, all the rest will work but .NET treats everything as unicode so it send strings as 2 byte not one.

to get round this build your form as cwkoehler has said but instead open the serialport as:

in declarations put:

Private WithEvents cCommPort As New System.IO.Ports.SerialPort

in your port open routine put:

        cCommPort.BaudRate = 115200
        cCommPort.DataBits = 8
        cCommPort.Parity = IO.Ports.Parity.None
        cCommPort.PortName = mCommPort
        cCommPort.DiscardNull = False
        cCommPort.Handshake = IO.Ports.Handshake.None
        cCommPort.ReceivedBytesThreshold = 1
        cCommPort.Encoding = System.Text.Encoding.GetEncoding(28591)
        cCommPort.Open()

the System.Text.Encoding.GetEncoding(28591) bit gets around any problems unicode may cause.

I’ve been using VB.NET and WIndows Mobile .NET to control the SSC and it works well.

you are correct sir - my oversight

I have been monitoring this thread as well and thank all of you for the information. I have been playing around with the VB 2005 express edition. The way that I have been using the serial port looks like:

[code] Private Sub Try1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Try1.Click
’ Send strings to a serial port.
Dim si As SEQ_ITEM
Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort(ComLB.Items(ComLB.SelectedIndex), BaudCB.Items(BaudCB.SelectedIndex))
com1.WriteLine(-1)
si = SEQS.Items.Item(SEQS.SelectedIndex)
com1.WriteLine(si.ToString)
End Using

End Sub

[/code]
I may try some of the other methods mentioned here.

There is a myriad of ways to achuieve the same thing. Which ever works and you understand is the best.

My style of coding comes from using VB right back to VBDOS and QBDOS. Pedantic but functional…

I have created the VB 2005 movement program and am working on having it voice activated. I will post the program once its completed.

Sounds great. It will be fun to pick up different pieces!

I have completed the speech controlled Lynx 6 program in VB 2005. I will gladly post it or would be easier if I could upload the file. Is there a place where I can do that?

i’m very interested

Does anyone know if there is a place where I can upload the VB file for others to aquire it?

If you email it me at [email protected] I will put on my website on monday as it is currently completeley ampty and I need something to put there, also if anyone else has any robotics programming code they want making avaliable I will gladly publish that as well, if you send me the zipped files and a description that you want putting on the site.

Thanx

How do I get to your site?