Craig wrote: > I need to do some simple robotics (placing small objects in a sequence > of locations). > > The operaion will consist of: > > Homing followed by an alternating sequence of: > > 1. executing an x,y,z move (effectively g0 x... y... z...) where the x, > y and z values come from a file written by another program. > > 2. executing other code (mostly control of solenoids via a second > parallel port). > > The machine will be stopped at the x,y,z location while executing the > other code. (There is no need to synchronize the xyz motions as only > the end points matter.)
I bet you could use the toolchange logic in EMC to do this: G0 <whatever location> M6T1 G0 <some other location> M6T2 Each M6Tn line results in 'n' appearing as an integer value on a HAL pin (not sure what the pin name is offhand), then a bit HAL pin goes true to request the toolchange (or other activity). Next EMC begins monitoring another HAL pin, which needs to go true when the toolchange or whatever is finished, at which point the next line of code will be executed. You can simply route those HAL pins to the outside world, or you could use them to trigger a ClassicLadder program that runs your solenoids and stuff. > > I would also need to set the acceleration and velocity profiles for > steppers controlling x, y and z. > > From John's posting on "about the axes A and B" it seems HAL components > + some other code might be the best way to go. The HAL approach can be _extremely_ flexible, since you are simply interconnecting components, and can mix and match them any way you want. The standard HAL stepgen block has accel and velocity limits, but they are applied on an axis-by-axis basis, so you don't get true coordinated motion. If X has to move 1", and Y has to move 10", both will accel, cruise, and decel obeying their limits, but X will finish its move before Y (assuming they have the same limits). Coordinated motion would move both axes together, limited by the accel and velocity limits of whichever one takes longer. I'm sure you could do coordinated motion in HAL, but if thats what you need it might make more sense to use EMC, since its trajectory planner already does coordinated motion. > What component will I need? and, Assuming you have steppers, "stepgen" is the most important, along with "threads" to set up realtime threads. > where should I look for them in the documentation? There are man pages for most HAL components. There is also the HAL reference manual http://www.linuxcnc.org/docs/HAL_Documentation.pdf I STRONGLY recommend that you read (and run) the tutorial in section 2 of the HAL manual. The second exercise there actually sets up two axes of stepper and makes them move (or at least generates the step pulses, its up to you to wire up the drives and motors). If you have more questions after running the tutorial, just ask. If this gets too far away from EMC, we might take the conversation off-list, but start here. > ( and if need be in the source code) > > Notes: The file format for the xyz values can be an arbitrary ascii > format. I will be writing the code to generate these files in Java. For stuff that doesn't need to be hard realtime, its very simple to access HAL from C or Python programs, or you can use halcmd in shell scripts, or from any language that lets you execute shell commands. For example, if you use stepgen and the parport driver and a few other hard-realtime HAL components to actually do the motion, you can set the target position from a non-realtime program. From the shell, you could just do: halcmd sets Xcmd 4.7 halcmd sets Ycmd 3.1 This assumes that your HAL configuration has signals Xcmd and Ycmd, which are the position commands to the step generators. > > I am a marginal and rusty C++ coder, I haven't written any C++ in the > last 10 years, C++ is definitely not needed for HAL. Hopefully you won't need to write any new components at all, but even if you do, realtime ones are written in C, and non-realtime ones can be written in C or Python. > nor have I used a Unix like environment in 10+ years. You'll want to brush off your command line skills ;-) Regards, John Kasunich ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
