Peter C. Wallace wrote: > Not sure how it hooks into HAL, or how the driver handles homing, but in > hardware, the index polarity is set by a bit in the CCR > (CounterControlRegister) This would have to be set correctly to match your > index signals _Active_ polarity. > > Also the index mask input would have to be in the proper state if index > maskiing is enabled
Well, I've fixed the (not-yet-released) version 2.2 driver. Turns out it was the mask - EMC and HAL don't use it, but it was enabled anyway. Changed the driver to turn off index masking, and index now works. The 2.1.x version of the driver is a mess - it doesn't use the "canonical encoder interface" that all other HAL encoder drivers use, so HAL pin names are non-standard. The code that drives them is also very different. I'm tempted to port the 2.2 driver over into the 2.1 branch, instead of attempting to fix the one that is there. But that decision will have to wait until tomorrow, its after 1:30am. I found a more disturbing problem - both versions seem to lose counts going in one direction (but not the other). I have a 2500 line encoder hooked up, so I should get 10000 counts per rev. Going forward thats exactly what I get. But turning it backwards, I get between 9700 and 9800 counts per rev. I have a 7i31 LED board connected, so I can carefully turn the encoder until I see the index LED light up, and I know I've done EXACTLY one turn. I suppose I should try other encoder channels, and/or another board, since I have two 5i20s, but its late - I'll look into it more tomorrow. I'm using the bitfile that is compiled into the driver. I don't think the corresponding VHDL source is in CVS anymore, the source we have matches some newer bitfiles. I'll try one of the newer ones tomorrow. Testing a bitfile when I can't examine the source is futile. The source that I did examine doesn't have any obvious issues. 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
