Encoders setup

More
10 years 2 months ago - 10 years 2 months ago #78419 by barsam
Encoders setup was created by barsam
Hello Everyone.

This is my first post at the forum as I am new to the world of linuxcnc.
Lately I converted an Optimum BF20 to CNC and while I had setup everything to work with Mach3, as this is the software I have used for my other CNC machines, I decided that it was time to try linuxcnc for this one.
Since all the electronics were already there, I decided just to swap the smoothstepper with a Mesa 7i80 board.
So the setup at the moment is: 7i80 as a controller, PMDX-126 as a breakout board, and a C53 from CNC4PC as an encoder’s board.
I have used the C53 for my CNC router and I am very happy with it, so that is why I got this one again.
For encoders I have used some self-made boards using the AS5311 IC and magnetic strips.
So far I have managed to make a custom firmware for the mesa board to use the existing boards and the PDMX-126 seems to be fully functional. But after straggling for couple of days, I was not able to get a feedback from the encoders board.
I have checked everything related to hardware and all looks fine. The encoder board is pulsing at the controller side (checked with oscilloscope), so the problem is either the firmware of 7i80 or the setup of linuxcnc.
I have run out of ideas and since this HAL setup thing is totally new to me, I will need some help from experts.
Attached I have the VHD file (changed to txt extension) of my custom firmware and the HAL file of the linuxcnc setup.


File Attachment:

File Name: BF20.hal
File Size:13.96 KB


File Attachment:

File Name: PIN_PDMX_C53_68.txt
File Size:11.92 KB
Last edit: 10 years 2 months ago by barsam.

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #78421 by PCW
Replied by PCW on topic Encoders setup
Sounds like a wiring issue of some kind, i would check that the encoder a,b,index pins change as expected
if you ground the FPGA pins (they have pullups so will be high if not driven)

encoder channel 0's pins should be named:

hm2_7i80.0.encoder.00.input-a
hm2_7i80.0.encoder.00.input-b
hm2_7i80.0.encoder.00.input-index

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #78460 by barsam
Replied by barsam on topic Encoders setup
Thank you for your replay.
As I mentioned on my first post, I had checked all the connections and everything was fine. Never the less, I re-checked today and I confirmed, using a digital logic analyser this time, that the signals are getting to the connector of the 7i80 board. Of course I should mention that the check was done while the connector was not connected to the 7i80 board. Checking the signals while the connector is plug, is king of difficult without un-mounting the board.
One thing I don't understand though is what do you mean by saying;

“encoder channel 0's pins should be named:

hm2_7i80.0.encoder.00.input-a
hm2_7i80.0.encoder.00.input-b
hm2_7i80.0.encoder.00.input-index”?

I can see that these are pins in the HAL configuration, but should I mention them somewhere in the HAL file?

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago - 10 years 2 months ago #78465 by PCW
Replied by PCW on topic Encoders setup
No, but if you use LinuxCNC "watch" menu and ground the appropriate DB25 pins, you can check that your encoder inputs are in the expected places
Last edit: 10 years 2 months ago by PCW.

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #78513 by andypugh
Replied by andypugh on topic Encoders setup

barsam wrote: One thing I don't understand though is what do you mean by saying;
“encoder channel 0's pins should be named:

hm2_7i80.0.encoder.00.input-a
hm2_7i80.0.encoder.00.input-b
hm2_7i80.0.encoder.00.input-index”?

I can see that these are pins in the HAL configuration, but should I mention them somewhere in the HAL file?


No, you don't use them in HAL, but you should be able to watch them with Halscope:
linuxcnc.org/docs/2.7/html/hal/tutorial....ec:tutorial-halscope

You should also be able to watch the hm2_7i80.0.encoder,00.counts HAL pin in Halscope and see if there is any activity there.

Please Log in or Create an account to join the conversation.

More
10 years 2 months ago #78517 by barsam
Replied by barsam on topic Encoders setup
I finally managed to find the cause of the problem.
The C53 board has pull-up resistors for all the input signals, which in combination with the pull-up resistors of the Mesa board are blocking the signals.
I removed all the resistors from the C53 board and the signals are now passing.
Of course I am faced with a different issue now. The position of the encoder is not consistent with the stepper position. And it is not because of the scale. Going back and forth, it seems like the position of the encoder is different every time.
I am not sure if this is because of noise, missed pulses, or misaligned encoders.

Please Log in or Create an account to join the conversation.

Time to create page: 0.246 seconds
Powered by Kunena Forum