A group of 3 including myself are going to build the AL5D robot. Our professor would like us to have this robot be programmable from remote distance sites. We have access to pc’s. He wants us to be able to use some software such as Visual Studio to create an interface to program the robot, however the package we purchased was Lynxmotion AL5D 4 Degrees of Freedom Robotic Arm Combo Kit (With Electronics and RIOS) with Product code : RB-Lyn-277.
My question is this: Since this robot comes with the RIOS, does the RIOS have any SDK’s that come with it that we can use to build a Visual Studio app in order to program this robot or must we use the RIO software? If we must use the RIO software is there a way to interface into the software with Visual Studio in order to program the robot?
We will only have about 3 months once the robot arrives in the next week or two to get this robot built and functional for our project. Any help pointing us in the right direction would be greatly appreciated.
We are a group of students that are working on our bachelor’s towards electro-mechanical engineering and none of us are familiar with robot programming besides the small section in one of our classes on programming industrial robots.
I do believe you can control RIOS through a socket services. Look at section 12 of that PDF. It talks about a demo program that is written in Borland C++. Should not be hard to convert to a visual studio application.
Note: Rios simply talks to the SSC-32 through a serial port. You also have the option of completely bypassing using RIOS and write your own arm control software that outputs commands directly to the SSC-32. Details about this are in the SSC-32 manual (lynxmotion.com/images/html/build136.htm).
As I mentioned, RIOS will talk to the SSC-32 through a serial port. Your computer may not have one, so you may need to add one. This is most often in the form of a USB to serial adapter, such as: lynxmotion.com/p-699-usb-to- … cable.aspx. But it could also be in the form of two XBee modules, or through Bluetooth, or Wify…
Good Luck
Kurt
Update: looks like you may have some stuff like USB to serial…
You don’t need to use RIOS - you can have the Arduino Ethernet control the SSC-32 using serial commands via the Tx/Rx pins (also ensure that GND is common). You can create whatever interface you want and then have the Arduino send the appropriate serial commands to the SSC-32. Since none of you really have background in programming, consider learning Arduino.
Well, we have received our parts for our robot. We will be assembling it over the break between semesters. I have read your posts. I appreciate all of the information. CBenson mentioned something about learning Arduino. From what I know so far, Arduino has its own IDE and there is also a plugin for Visual Studio to help with debugging. If I use Arduino, then the program is a closed loop program is that correct? I wasn’t sure because it looks like using Arduino you have to send to the board your program and that is where the program resides and not on the pc.
Is it possible to use Arduino and not send the program to the board? Again, we are noobs but I do have experience in writing C# and VB code. I don’t mind writing in Arduino and it sounds like our professor is very interested in this type of language as well, but I want to make sure we can send commands from the pc to the robot and not have to worry about having the program reside on the board.
The previous senior design group in the past year developed an application to connect to a pc in the robot lab room that was connected to a robot. It also has an IP cam that is embedded into the application so that the distance students remoting in would be able to see this robot live. We are going to try and take parts of this program and integrate it into a windows form application that would also have a few controls for the robot and a text window to write a program. It would be pretty neat to be able to write the Arduino file from within this application.
Can this be done? Any other ideas are greatly appreciated.
Indeed. You’ll see the basic program has two sections:
void setup(){}
void loop(){}
The setup is there to configure the basic parameters (like baud rate), and whatever is in the loop section will run indefinitely.
You create the code on your computer, then upload it to the board, where it runs. If you cycle the power, it will run whichever program was last on it. You can also create a program which accepts commands from the computer via the USB (serial) port.
Of course. The camera should not be fed through the Arduino though. You’ll need to create code for the Arduino which essentially updates the servos’ positions and accepts new positions commands via serial. Alternatively, since it is a full microcontroller, it can also take care of the inverse kinematics. Another option would be to create a program running on the PC to take care of the inverse kinematics. Your interface would simply display the video feed, but not be related to the arm itself.
The robot was built over the Christmas break by two of the other students. Now it is my turn to work on communicating and writing an interface for the robot so the distance students can write a program to send move commands to the robot. I will do the conversions in the background. I have chosen to use C# as the programming language since this is the one I am most familiar with.
I was able to send commands after reading through the ssc-32 manual that was previously mentioned. Thank you Kurte for the information. Right now, once I power on the robot and connect to it with the RS232 cable to the ssc-32 board, the LED on the board is green. Once I send a command the first time, the LED light goes out but the robot does not perform the command. If I send the command a second time, the robot takes off and goes as fast as it can no matter what speed I set it to go. After the second time, if I send the robot other multiple commands, the robot reacts like it should to the speed that I am setting it. That is problem number one.
Problem #2 is that after reading the ssc-32 manual, it looks like if I send multiple commands with a Time instead of speed that all commands should perform simultaneously and they should finish at exactly the same time. This is not the case. The robot is performing them serially, such as the shoulder moves and when that is complete the elbow moves and so on until the string of commands have been completed. Is this what is supposed to happen or am I missing something?
Problem #3: I am thinking that I want to have move limits based on the position of the robot so that if the elbow is at a 90 degrees from the shoulder that the shoulder would not be able to move past a certain point so as the servo would not continue to try and run as the arm is hitting the ground. I am not sure how I would go about doing this, but I think there should be some sort of formulas I could create to make sure the robot does not get damaged by sending it unmovable commands. Also, since distance students will be sending commands to this robot, it may also improve our chances of damaging the servos by allowing the students to send commands that would put the servo in a continuous movement. I hope this is making sense to you all.
Does anyone have any ideas on how I would begin proceeding with such formulas or what my next steps would be? Also, is there any feedback I can receive from the ssc-32 about the position the servos are in? That may help me with deciding on how to introduce the move limits.
All three issues are related to the code. There is quite a lot of sample code for IK for the AL5 arms now. Verify what your code is actually sending to the SSC-32 and cross-reference that with the syntax described in the manual. You’ll need to include some of your code here.
#1) Not sure why the first command is not responding, maybe timing in your code or the like… However the first time a servo gets a command, it will go there at top speed. Why? Because these servos do not have any feedback capabilities, so as soon as it gets the first pulse, it will jump to where that pulse is… My normal way for an arm is to have a park location and when I tell the arm to turn off, I have it first move to the park location. When I tell it to start, I first tell it to go to the park location so hopefully the servos don’t move much and then tell it to go to the start position.
#2) need to see code or stream of commands that are being output. That is if you for example send a after sending out the first command, it will start working at that point. But for example if your command is something like: #1P1200#2P1400#3P1800T250 The three servos should all move to their new locations at the same time.
#3) Code. Not sure how you are controlling the Arm. If you look at the code I have for Trossen Arm, it is 2K, 3K and BackHoe mode… WIth the 2K and 3K, you set your desired locations and the code should have limits that for example says Y can not be less than … If it goes beyond those positions, bug in your IK. With BackHoe I did not put in those limits as I might want to dig… But if you desired to limit it. You could compute the FK (forward Kinematics), which is pretty simple. Take the Angle first joint is at, take Sine and Cosine multiply times length, do for next joint… This would tell you where each joint would put the next end… You could then try to limit the last joints angle…
Awesome everyone. Thanks for your help. I am not very robot savvy but I think when you all refer to IK you are referring to inverse kinematics correct? #1) I like your idea kurte. I was thinking along the same lines. We were going to home the robot in a straight vertical upward position, but once power is off, the servos lose power of course and the robot joints will fall, thus not leaving it in park state. However, I think there is a rest position I could use and I think I will use that. I don’t think it is a timing issue because right now all I have is a textbox on a form with a send command to send the robot the command so why it doesn’t do anything the first time I send something is beyond me. If I do not figure that one out it will be just to simply add the rest command twice before firing off any other commands to allow for the speed.
#2) The stream of commands is exactly as you put it in your #2 kurt. I can send something like that: #1P1200#2P1400#3P1800T250 and then what happens is #1 channel will finish first and then #2 will finish second and #3 would finish next. When the robot has finished moving the robot will be in the correct position that all three channels were sent but I just thought it would look more smoothly as the 3 channels finish at exactly the same time which would mean a channel with a longer movement may move faster than a movement that takes a short amount of time so they finish exactly at the same time.
#3) I will work with the Forward Kinematics for now to look at the angles and do as you mentioned by multiplying the length of the joint by sine and cosine. That makes a lot of sense and I think I was getting to this same conclusion. I think I was just a little bit confused at first because I am unsure of how to convert the servo position to an angle without just trying many many different positions. Is this how you would go about doing this or is there an easier way to figure out angle to servo position conversion?
Everyone’s help has been greatly appreciated.
Eric
So now after experimenting with this robot for the past couple of days I have created a slider for each of my joints and on the scroll event I am sending a serial command to the ssc-32 board. Everything seems to be working really great except for one thing and I think it has to do with flow control.
As I am moving the slider for any joint on the robot, the joint is moving along just fine but out of nowhere the joint will go a little berzerk. It quickly goes to one end of the spectrum of the slider as fast as it possibly can and then when I move the slider again it will assume the position that matches the slider. I am not sure why the servo flips out like that except that may be overloading the serialport with data and I am not using flow control. Any ideas?
I always suspect power… Like power drops off to SSC-32 logic and it resets… Maybe not in your case, but that is the first thing I check.
Always possible data gets corrupted and/or you get some form of data overflow… You can potentially check on your C# side that maybe only output data at a maximum of lets say .1 second or the like. Or for example if you are using Visual studio or the like, you can check your output buffer to see how many characters are pending to be output and don’t output if too many…
Today, I have learned of one more constraint with this robot and the SSC-32 card. The serial string that is sent must only be able to accept a limited number of commands at once. For instance, if I send a command such as #0P500#1P1000#2P1700#3P2200#4P2500S200 the speed of the robot still moves as quickly as possible and speed is ignored. If I send the robot the command for the same moves as 2 separate lines, then the speed is accepted and the arm will move slowly. I would send a command like the code below in order for it to accept the speed.
This must be an issue with your C# code. As I have my hexapods outputting complete commands for 18 or 24 servos…
I don’t know which compiler and the like you are using, but for example on many compilers like Visual Studio WriteLine already appends on your NewLine character which in my VB apps is set to 13 as well. If you wish to break up the Write into multiple IO outputs, you can use the COM.Write method instead which does not append on the new line string.
Note: The SSC-32 normally reads characters in more or less as fast as possible and will only start executing them when it receives a CR character.
Also while I don’t think it is the issue, many Comm classes also have a property like WriteBufferSize, which you can query or set. There is always the slight possibility that this is too small and it splits your write up. If MS compiler I doubt this is it as I don’t think it allows a buffer smaller than 2048.
you don’t show the code you use to send the commands, so you may be sending an unnecessary data spew that could overload the receiving buffers. You might want to make sure you only send commands that are different and not repeating the same command every loop of your program. Also some ms delay between the data transmissions might avoid issues.
I am using Visual Studio to write the code. I used to have the code setup so that it was like this:
string carriageReturn = (char)13;
COM.Open();
COM.WriteLine("#0P500#1P1000#2P17003P2200#4P2500S200 " + carriageReturn);
COM.Close();
That allowed me to send all the information for all servos at once. However, when it was sent like this, it ignored the speed on the end of the line. It moved as fast as possible and didn’t care how slow I made the speed. I will look into the WriteBufferSize if any and see if there is something I can do there to increase the size, but either way as you stated, the SSC-32 will not begin executing until it receives the CR so if it was seeing the CR it should have seen the S200 property as well.
Are you saying that I would not need to add the CR on the end of my line of code as you suggested that COM.WriteLine appends the new line automatically or I still need to send that? I am going to try both ways tonight anyways but was just trying to clarify what you mentioned in your post kurte.
My next steps are also to create a standalone database and for my interface I will have sliders for each joint and as the robot comes to the position that the user needs, they will be able to save there position as a 3 character id and then the positions will be logged to the database associated with that 3 character id. Once they create all the movements they need to perform a task (i.e. pick up an object and move it) They will have a small multiline text box on the screen where they can write their commands such as MOV abc where the MOV command will call the database and get the abc id and send it to the ssc-32 to make the robot move. They will be able to enter multiple commands in this window as if they were programming an industrial robot. Hopefully this will not be too difficult to program.
I will keep you posted as new developments arise. Thanks again for everyone’s help.
Again note: the first move for a servo the speed or time value will not have an effect. Why? There is no feedback information from these servos. So there is no way to know where they are. So the SSC-32 will simply output the pulse and the servos will get there as fast as they can. Once the first move is done, it will use the speed or time values to get to the desired location (pulse width) at the appropriate time.
Our project is coming along right now. Currently I have been setting up the program so that the user can move each axis by using a slider in my windows form. Once the user has a position they would like to save, then they are able to save this command to a local database. I am going to be writing some more code to add to the functionality of the windows form.
Once the user has saved all of the positions they are going to need to create a program, then they will call these positions from the database by writing a program in a multiline textbox. I will write code to parse out and translate the code so that the robot receives the commands.
I have one more question that maybe someone would be able to help with. It says that you can use “Q” to query the movement status. I am guessing I would do this just like I do any other command by doing a COM.WriteLine(“Q” + carriagereturn). How do I get the feedback. Do I need a COM.ReadLine or is there something else I should be doing. Very curious because I would like to enable a button on my form and make it Green while the robot is not moving to show that the robot is stopped and can accept commands or I want it to be red while the robot is moving so it cannot accept commands.