Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re4: robotic laser welder by bikeNomad
in thread robotic laser welder by ginseng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-16 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found