Hey blakrapter,
I’m a student in Robotics & Automation at college right now and am in my final year (finish in August).
There is a lot that transfers over from hobby robotics to industrial… but it’s not usually the programming language you learn. It’s the broader concepts that transfer.
Most industrial applications use PLCs (Programmable Logic Controllers) which are horribly confusing unless you’re really smart or you take a class on them. There is some information on the net for them, but it’s sparse and since there are several different brands each with their own language structure… there’s little hope of learning how to use one unless you want to take some night school (plus they’re expensive, at a couple thousand dollars each, plus software licenses). They are really great from controlling I/O, sensors, actuators, motors, etc. They are really annoying for programming intelligence. A PLC does I/O really well, but not much else. That being said, anything a PLC can do, a micro-controller can do as well plus a whole lot more.
Micro-controllers are what the SSC32 is. The SSC32 (from my understanding) has firmware (a program) that takes whatever string of characters you send it and then sends output signals to servo motors. To program a micro-controller, you’d need to know what computer languages a given micro-controller can understand. Sometimes they have a proprietary language, but there are several out there that can understand C code. Basically if you learn C you can transfer those skills to just about any other language you want, you just have to learn a new syntax (structures are almost always the same). Programming a micro-controller is called “embedded programming” since it’s generally programmed once and rarely touched except to fix bugs.
The next level up is what you do to send those strings of characters to the SSC32 board. For example, I haven’t got a clue what the SSC32 program looks like, but the manual tells me what kinds of commands it accepts. It accepts ASCII character strings that terminate with a character 13 (an enter) using a serial cable. A serial cable connects from my computer’s comport to the SSC32 board. Now, to control my robot I wrote a program (in C) that first opens a connection with the com port (“COM1”) sets it up to 115,200 baud rate and all that jazz. Then all the rest of my program does is manipulate character strings, cutting them up, pasting them together (concatenating) and finally tacking a char(13) to the end of them and then writing that to the com port. I didn’t need to understand how the SSC32 board works to be able to do that, I just needed to know what the program embedded on the board would interpret.
Now, that’s the kinda stuff you’ll have to learn every time you start a new project. First how to establish communications, serial cable, wires, is it digital or analogue, do I have to interface a PLC with a PC… etc. Once communications are established, what is the expected input for a desired output. The SSC32 board expects a command to look like “#0 P1234 S100char(13)” the char(13) is a non-displayable character. The number following # tells it what motor you want to command, the number after the P tells you the pulse you want, the number after the S tells it what speed to set it at and finally the char(13) tells the board that you’re done sending the command and that it can execute it immediately. All that is determined by whatever program is on the board. Without the board, the servo itself would determine what command is required. Instead of character strings, it would be PWM (Pulse Width Modulation) which at the moment, I don’t know how to send directly from a PC. I’d have to research that.
If you were to buy an industrial robot, it would probably come with it’s own language/software. The manual would tell you want kinds of things it understands like loops, goto, if-then-else statements and that sorta stuff, but if you know a programming language like C already, then you already know the structures and it’s just a matter of learning the new syntax. An industrial robot is likely to come with several inputs and outputs which are literally just wires that you can either read a voltage from or send a voltage to. Generally 5VDC or 24VDC are signal voltages (VDC = Voltage Direct Current). So if you were using a PLC, you would wire PLC outputs to Robot Inputs (and vice versa) and you have communication. In the PLC program you would read inputs from sensors and based on multiple signals, send an output signal to the robot. The robot would read that input signal and based on its program, act on those signals. For example, a part present sensor tells the PLC that a part is ready, the PLC then tells the Robot that a part is ready. The robot then runs a sequence to pick up that part and place it somewhere else. The robot then tells the PLC it’s completed it’s task. In some cases a sensor may be directly attached to a robot input, but a PLC is usually used as a middle-man because it may control and coordinate the sequence of an entire assembly line and not just that robot.
Oh and also note, that the purchased industrial robot is most likely controlled by an embedded chip (micro-controller). A purchased robot just saves you from having to physically build the robot, wire it, and create a program to work out how to turn on-off motors directly or open/close valves etc. It takes away that very low level of complexity so that all you have to do is program the robot to move from point A to point B, not how much each motor needs to move in unison so that it move in a straight line from A to B.
here’s an example with the SSC32
say the servo is currently at Pulse 500
you send the command: “#0 P1000 S100”
The above moves servo 0 to position(pulse) 1000 at a rate of 100 pulses per second.
if the servo started at Pulse 500, then it would take 5 seconds to complete the move. Now you didn’t have to explicitly send each command every 1/100th of a second ie:
#0 P501
#0 P502
#0 P503
…
#0 P998
#0 P999
#0 P1000
because the micro-controller knew how to interpret S100. If you intend to build you own robot, then you’ll also have to deal with these low level type of commands whether you put them on a micro-controller or incorporate them into an executable program on your PC.
The nice thing about something like a purchased robot is the ability to teach points (something I haven’t figured out how to program yet on my SES Arm, if it’s even possible). Basically most industrial robots, will allow you to first “Home” the robot which is kinda like zeroing a vernier… it just lets the robot know where it is and all its movements for that session will be referenced from it’s home position. Then to “teach” a point, you physically/manually move the robot to where you want (while all joints are limp) and then you freeze it (the joint stay where you move them, but become stiff) and then you save that position as a point. The robot records the positions of all its motors/servos and you can tell it to move to Point1 for example at any future date and it will go to the exact position you put it in before. Otherwise you have to explicitly tell it how far to move in the X,Y,Z planes… and in a lower level scenario you’d have tell each motor/servo where to be so that the tip of the robot ends up in the right spot (something I’m programming my SES Arm to do right now).
I didn’t specifically answer all the questions you had, but I just am relating my experience with what I’ve learned in my course and what I’m applying to this robot at the moment.
conestogac.on.ca/fulltime/pr … 92c&v=0801
Reading the class descriptions may give you an idea where you might want to start based on your current knowledge.
Also, these labs along with the powerpoint slides for notes would be a fantastic way to learn C programming without paying $3,700 a year in tuition
I’d also suggest downloading everything before the end of August because it’ll be reset most likely for next semester or in January.
conestogac.on.ca/~cdobson/
Also google is your friend for finding new functions in C. A dozen “if statements” just won’t cut it forever in the more complex programs, so you’ll have to learn the “switch/case statement”, also atoi and itoa are useful to know exist… I only recently learned how to use malloc. To find new functions to use, your best option is to just look at all the functions names in a given library and see if any of them fit the task you need to accomplish
Here’s a good resource:
cplusplus.com/reference/clibrary/cstdio/
Frequently functions you write start really big and then after many hours of head-scratching and debugging, it gets smaller and smaller… possibly even being replaced by a standard function already contained in the library you included and had no idea existed when you started.
The program I’m writing for the SES Arm will be posted at a later date when I finish it. I’ll also be posting all the versions it went through.