Roberto Caminiti wrote: > Hi everybody, > I have built a CNC machine with a PC, a Mesa 5i20 card and three > stepper motors using the hm2_5i20 hostmot driver. > Now I have some problem: > > 1 - How have I configure the thread time in the .ini file for good > working? I have to follow the same instruction to configure a software > stepgen with parallel port or not?
Configuring your threads for hostmot2 (or any hardware-assisted stepgen) is a little different than for software step generation via the parport. First of all, read this quick description of the threads EMC2 uses: <http://www.linuxcnc.org/docs/2.2/html/config_ini_config.html#sub:%5BEMCMOT%5D-Section> For hardware step generation such as hostmot2, you can think of it as running the base thread in the FPGA on the 5i20. Thus emc2 does not need it up on the PC. So just omit the base thread, and make the servo and trajectory threads the same as they would be for any other system. > 2 - It's correct to connect all functions with servo-thread? All hostmot2 functions, and anything else that belongs in the servo thread, yes. I'm not exactly sure how the functions get split up between the servo thread and the trajectory thread, maybe someone cluefull can fill in the gaps here? > 3 - How hm2_5i20 set the correct axis speed to hardware stepgen > without a dedicated HAL connection? I'm a bit fuzzy on how exactly this part works, hopefully someone more knowledgable can jump in here and clue us both in. I think it works roughly like this: The trajectory planner exports a bunch of HAL objects with names like axis.N.motor-pos-cmd, one for each axis the machine has. Yours should have axis.0, axis.1, and axis.2. When the trajectory thread runs, it chooses the next position command (that is, the next location for each of the axes to be at). It sets the axis.X.motor-pos-cmd pins to these values. The person building the machine (the "machine integrator", that's you!) needs to connect the trajectory planner position-command pins to the stepgen position-command pins using some HAL config code like this (from core_stepper.hal, part of the "stepper" sample config): # connect position commands from motion module to step generator net Xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd net Ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd net Zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd The hostmot2 driver names its pins a bit differently than the software stepgen shown in the example above, so it would look something like this instead (untested!): net Zpos-cmd axis.2.motor-pos-cmd => hm2_5i20.0.stepgen.02.position-cmd When the servo thread runs it will run hm2_5i20.0.read() and hm2_5i20.0.write(). These functions will read the current stepper count from the FPGA, compute the new step rate (based on things like positional error and maxvel and maxaccel), and send the new step rate to the FPGA. The FPGA will immediately change the signals it sends out to the stepper driver so that it's moving at the speed the hostmot2 driver chose. I'm not sure if that answers your question, ask if you want something else or if you want more detail on something. > The new hm2_pci have better performances than the old? which? The performance is the same, but hm2_pci supports more cards than just the 5i20. All the PCI Anything I/O boards (including the 5i20) are supported by hm2_pci, so i'm going to concentrate my efforts at the hm2_pci driver and eventually (for emc2 2.3) remove the hm2_5i20 driver. There's no reason not to switch from hm2_5i20 to hm2_pci. The HAL objects dont change name, and it should not require any config changes. -- Sebastian Kuzminsky ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
