I have been trying to set up a absolute linear encoder combo from renishaw (RLS AS10 scale with LA11-2Do reader). I'm unable to get stable measurements from the scales. Steps I've followed:
1. I have mesa 6i25_7i76_7i74 boards. I made a post asking for BISS firmware for 6i25_7i77 combination here but couldn't make the smart serial expansion on 7i77 to work as a BISS interface for the encoder input. Eventually bought 7i76_7i74 boards and PCW made a bit file for 3 channel BISS protocol and I flashed 5i25_7i76_7i74biss3d.bit file onto 6i25 card.
sudo mesaflash --device 5i25 --readhmid
[sudo] password for spinnercnc:
Configuration Name: HOSTMOT2
General configuration information:
BoardName : MESA5I25
FPGA Size: 9 KGates
FPGA Pins: 144
Number of IO Ports: 2
Width of one I/O port: 17
Clock Low frequency: 33.3333 MHz
Clock High frequency: 200.0000 MHz
IDROM Type: 3
Instance Stride 0: 4
Instance Stride 1: 64
Register Stride 0: 256
Register Stride 1: 256
Modules in configuration:
Module: DPLL
There are 1 of DPLL in configuration
Version: 0
Registers: 7
BaseAddress: 7000
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: WatchDog
There are 1 of WatchDog in configuration
Version: 0
Registers: 3
BaseAddress: 0C00
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: IOPort
There are 2 of IOPort in configuration
Version: 0
Registers: 5
BaseAddress: 1000
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: BISS
There are 3 of BISS in configuration
Version: 0
Registers: 4
BaseAddress: 4A00
ClockFrequency: 200.000 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: QCount
There are 1 of QCount in configuration
Version: 2
Registers: 5
BaseAddress: 3000
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: SSerial
There are 1 of SSerial in configuration
Version: 0
Registers: 6
BaseAddress: 5B00
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 64 bytes
Module: StepGen
There are 5 of StepGen in configuration
Version: 2
Registers: 10
BaseAddress: 2000
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Module: LED
There are 1 of LED in configuration
Version: 0
Registers: 1
BaseAddress: 0200
ClockFrequency: 33.333 MHz
Register Stride: 256 bytes
Instance Stride: 4 bytes
Configuration pin-out:
IO Connections for P3
DB25 pin# I/O Pri. func Sec. func Chan Sec. Pin func Sec. Pin Dir
1 0 IOPort StepGen 0 Dir/Table2 (Out)
14 1 IOPort StepGen 0 Step/Table1 (Out)
2 2 IOPort StepGen 1 Dir/Table2 (Out)
15 3 IOPort StepGen 1 Step/Table1 (Out)
3 4 IOPort StepGen 2 Dir/Table2 (Out)
16 5 IOPort StepGen 2 Step/Table1 (Out)
4 6 IOPort StepGen 3 Dir/Table2 (Out)
17 7 IOPort StepGen 3 Step/Table1 (Out)
5 8 IOPort StepGen 4 Dir/Table2 (Out)
6 9 IOPort StepGen 4 Step/Table1 (Out)
7 10 IOPort SSerial 0 TXData0 (Out)
8 11 IOPort SSerial 0 RXData0 (In)
9 12 IOPort SSerial 0 TXData1 (Out)
10 13 IOPort SSerial 0 RXData1 (In)
11 14 IOPort QCount 0 Quad-IDX (In)
12 15 IOPort QCount 0 Quad-B (In)
13 16 IOPort QCount 0 Quad-A (In)
IO Connections for P2
DB25 pin# I/O Pri. func Sec. func Chan Sec. Pin func Sec. Pin Dir
1 17 IOPort BISS 0 Din (In)
14 18 IOPort BISS 1 Din (In)
2 19 IOPort BISS 2 Din (In)
15 20 IOPort None
3 21 IOPort BISS 0 Clk (Out)
16 22 IOPort BISS 1 Clk (Out)
4 23 IOPort BISS 2 Clk (Out)
17 24 IOPort None
5 25 IOPort None
6 26 IOPort None
7 27 IOPort None
8 28 IOPort None
9 29 IOPort None
10 30 IOPort None
11 31 IOPort None
12 32 IOPort None
13 33 IOPort None
2. Installed linuxcnc-uspace 2.9.2 on debian 12 running 6.1.0-28-rt-amd64 PREEMPT and made a few configuration to make the encoder spit some data. Found a post here about someone succesfully set up renishaw resolute glass scale and they had mentioned this line is the most important in setting up the encoder: loadrt hm2_pci config="num_encoders=1 num_pwmgens=0 num_stepgens=5 sserial_port_0=00xxxxxx biss_chan_0=null%1bzero%2uxencoder%24eerror%1bwarning%1bcrc%6f"
3. I did some more digging around to narrow down other BISS related settings in the HAL config:
setp hm2_5i25.0.biss.00.timer-number 1
setp hm2_5i25.0.biss.00.frequency-khz 1000
setp hm2_5i25.0.biss.00.xencoder.scale 1000
setp hm2_5i25.0.biss.00.xencoder.counts-per-rev 5000
setp hm2_5i25.0.dpll.01.timer-us -500
setp hm2_5i25.0.stepgen.timer-number 1
This somehow makes the encoder spit some data but it was very skipy and changed direction even when I was moving the reader head in one direction. Assuming I was moving the reader head with my hand keeping the magnetic scale on the table was not optimal, I waited till the machine was assembled to test it on proper linear stages.
Now that I have mounted the machine axis onto linear guideways and reading from the scale is still the same level of skippy and changes direction abruptly.
Asking around modern LLMs went through all the encoder related documents and suggested the my reader model LA11-2Do with 1 micro meter resolution spits 20bits of left leaning position data and suggested I need to bit shift by 6bits to correctly read the scale.
I then went on trying so many of the suggestions all failing to recognize the syntax, the LLM suggested that though
BISSTag module was included in the ModuleID, the parameter bit-shift seem to be missing. So we need to hardcode the bitshift value for example:
entity biss is
generic (
bit_shift : integer := 6 -- Set this to your desired value (e.g., 6)
);
port (...);
end entity;
It suggests me to load the firmware with loadrt hostmot2 config="firmware=/path/to/recompiled_firmware.BIT".
Though I'm skeptical about the process's validity because I heard that we don't need to load the firmware from our computer but they are stored onboard. I want to know is there a possible solution to this.