Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re4: robotic laser welder

by bikeNomad (Priest)
on Jul 31, 2001 at 00:53 UTC ( #100963=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: robotic laser welder
in thread robotic laser welder

With the right controller hardware, you can do robotics with Perl. The LM629 chip I mentioned implements a PID control algorithm. I've found that two or three of these work fine for robotics with multiple motors running simultaneously, even from a high-level language. You just program them so that their trapezoids are the same length and have the same duration of acceleration, then start them simultaneously (you'll probably want hardware that's set up for simultaneous starting).

More and more, it doesn't make sense to have a single central program/processor running everything from low-level control (motors and limit switches) to high-level control (scheduling, receiving commands from the network, UI). Processors (and specialized controllers like the LM629) are cheap; they should be put into hardware that needs them. It almost never makes sense to have a general purpose computer controlling motor hardware directly (i.e. reading encoders and controlling PWM or steps). You want an embedded system that can present a reasonably high-level interface (like the one that was described in the original post, or like my semiconductor machine robots).

Where Perl is somewhat weak for robotics and other embedded systems work (IMO) is in its lack of threading, and in its lack of a standard idiom for handling exceptions. With die/eval you have one option: to abort the operation (you can, of course, retry the whole eval block if you want). Other languages offer better control on exceptions.

For instance, Smalltalk allows you to retry the method call that threw the exception (as opposed to the whole block in Perl), or to resume it as if nothing had happened. This has been helpful in my embedded systems work for handling robot errors like timeouts, and in situations where there could be some chance of human-assisted error recovery.


Comment on Re4: robotic laser welder
Re: Re4: robotic laser welder
by ginseng (Pilgrim) on Jul 31, 2001 at 01:31 UTC
    I agree wholeheartedly. It looks like the LM629 will move the positional control layer down into hardware, and works like a specialized DSP. Ideal. I'm sure the application is becoming pervasive enough to justify high volume production of specialized silicon.

    I'm all in favor of offloading to coprocessors. It's been a fascination for me since reading the thesis that described the Connection Machine in 1986, and realizing that two or three processors are probably more within reach for me than 65,536 of them ;) I still want a i960 coprocessor card, even though i no longer have a computer that is slower than the i960...

    The problem is, IMO, that the interesting work is being done on the coprocessor, not on the glue program. If Perl is simply connecting the user to the hardware, the program might be mundane. (I'm the same way with Internet programming. I want to implement business logic, not build interfaces ;)

    I haven't gotten into exception handling greatly, but what's wrong with using {..} or do {..} rather than dying? Ah, I see...you may be re-eval'ing the whole block, as you said. Yes, I see...no way to say, handle this exception this way, as we would with signal handling. (Can one define new signals?)

    Continuing as if nothing happened and relying on the operator to extricate the situation is not too trying, though. I don't know how Smalltalk handles that, but it doesn't seem to need a special code construct, to me. But I am not a language designer, just a code mechanic.

    You seem to have the skills and tools to get into hardware, right? I've done that at jobs, generally where I had someone nearby with hardware expertise to watch over my shoulder. I've prototyped PIC systems and the like (8051, etc.) and designed some circuit boards, but I really don't like hardware. It's one of those things that gets my hair falling out. (Like the week I spent trying to figure out a software bug that only happened when the flourescent lights were off...turned out to be a UV-EEPROM without it's window cover on...I didn't clear that particular register while initializing the program.) At any rate, I envy people who are good at hardware, and have put together good tools for working with it. They aren't stuck (like me) with making do with what's at hand.

    'Course, if I really made do with what's at hand, I'd probably take my old EISA RAID controller and have fun with it's coprocessor, complete with a meg of memory...

Re: Re4: robotic laser welder
by kayman (Initiate) on Apr 27, 2005 at 20:01 UTC
    Has anybody tried circular profiling with LM629?
      That's hard, in general; the LM629 does a trapezoidal velocity profile. Good luck doing a true circle. If you match the corners on the trapezoids you can do straight line segments easily.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://100963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2014-11-27 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (185 votes), past polls