Le lundi 23 novembre 2009 11:16:14, Adriano Gonçalves a écrit : > Hello all, > > I have some experience in CNC robotics, but im really new to HAL structure. > > Im developing a servo driver, with will get the samples from the encoders > and send them to the parallel port in packages, and also will get the duty > cycle information from the parallel port and send it to the motors. > > My problem is. I need to write a "driver?" on the HAL structure to make > that communication protocol that i created, with is: > > IN - 8 bytes of data -- lower significant part of the encoder position. > motor1 > IN - 8 bytes of data -- higher significant part of the encoder position. > motor1 > IN - 8 bytes of data -- lower significant part of the encoder position. > motor2 > IN - 8 bytes of data -- higher significant part of the encoder position. > motor2 > IN - 8 bytes of data -- lower significant part of the encoder position. > motor3 > IN - 8 bytes of data -- higher significant part of the encoder position. > motor3 > IN - 8 bytes of data -- lower significant part of the encoder position. > motor4 > IN - 8 bytes of data -- higher significant part of the encoder position. > motor4 > IN - 8 bytes of data -- lower significant part of the encoder position. > motor5 > IN - 8 bytes of data -- higher significant part of the encoder position. > motor5 > > OUT - 8 bytes of PWM data to the 1st motor > OUT - 8 bytes of PWM data to the 2nd motor > OUT - 8 bytes of PWM data to the 3rd motor > OUT - 8 bytes of PWM data to the 4th motor > OUT - 8 bytes of PWM data to the 5th motor > > > Is it easy job? and can any1 send me a tutorial about simple HAL > programming. > > Tnx alot, Adriano.
Hi Adriano, I'm not sure I understand what you're tring to do. Do you need each // port line input to act as a serial input for 8 bits words representing low and high part of the data from the encoder ? Do you need each // port line output to send 8 bits words serial data to your PWM hardware ? If this is the expected behaviour, I'm not sure EMC can work that way. For what I know, EMC inputs directly data from encoders, and measure time difference between pulses, and with that calculates the encoder position. For the output, what il usually done is to output motor commands on two lines: one for direction, one for the step pulses. 1 or 0 on the direction line change the motor direction rotation, each pulse on the step line makes the motor rotate for one step in the selected direction. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users