- Posts: 926
- Thank you received: 280
Please Log in or Create an account to join the conversation.
You don't understand the question.Hey tux, thats not exactly within the scope of the remora project, and more of a general linuxcnc thing.
But since I am also trying to do lathe threading, here is my attempt so far. the encoder/spindle portion is at the bottom
github.com/cakeslob/Remora/blob/nucleo_s...nuc_q/remora-xyz.hal
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I try to explain what I did.
Code:Also, please check that you can actually keep up with the encoder pulses per rev. If not then I'll need to look at how we can implement hardware counting which may / may not be available on the pins.
Please Log in or Create an account to join the conversation.
Good to see you are making progress.
Code:Also, please check that you can actually keep up with the encoder pulses per rev. If not then I'll need to look at how we can implement hardware counting which may / may not be available on the pins. I try to explain what I did. ### Test 1 ### In the ec500-rt1052.txt : { "Thread": "Base", "Type": "Encoder", "Comment": "Encoder A-IN9 B-IN10", "PV[i]": 0, "ChA Pin": "P3_19", "ChB Pin": "P3_20" } In the remora-ec500.hal : # Initialize the encoder (spindle) loadrt PRUencoder names=encoder.1 addf PRUencoder.capture-position servo-thread setp encoder.1.position-scale 1200.000000 #6 # connect the hal encoder to linuxcnc net encoder-count remora.PV.0 encoder.1.raw_count net encoder-phaseZ remora.input.11 encoder.1.phase-Z I removed the blocks configured IN9 and IN10 as inputs from ec500-rt1052.txt (I suspect the pins may be defined only once). Works as expected. I ran halmeter, chose encoder.1.position and seen that value changed when encoder turned. I ran halcmd setp encoder.1.index-enable 1 The pin changed state to True, but when encoder changed index output the index-enable changed to False and position changed to zero. ### Test 2 ### In the remora-ec500.hal I removed the line with net encoder-phaseZ remora.input.11 encoder.1.phase-Z In the ec500-rt1052.txt I added this line : "Index Pin": "P3_21" and removed declaration this pin as input. I can change value of encoder.1.position, but encoder Z output does nothing, the encoder.1.index-enable after set is always True, and positon not resets. What I do wrong ?[/i]
Please Log in or Create an account to join the conversation.
Works with line < net encoder-phaseZ remora.input.11 encoder.1.phase-Z > in remora-ec500.hal, but I suspect the PRUencoder component works, not internal EC500 procedure.
[/code][/i][/code]Code:[i][code]You will also need to set the Data Bit in the encoder configuration. [code]{ "Thread": "Base", "Type": "Encoder", "Comment": "Encoder A-IN9 B-IN10", "PV[i]": 0, "ChA Pin": "P3_19", "ChB Pin": "P3_20", "Data Bit": 11, "Index Pin": "P3_21", }[/i]
Please Log in or Create an account to join the conversation.