Absolute Encoder Questions / SSI via 5i25

More
22 Aug 2013 03:38 - 23 Aug 2013 02:57 #37937 by PKM
First I connected the encoder the opposite way to yours. It responded, though only one normal response and then 0x01FFFFFF. I had to take it away from the magnetic stripe and set again, then it would give one normal response and so on.

I just switched the wires and it looks better, the normal response comes every read cycle. But I'm not sure about the binary output. Or I might decode wrong (I've made a gray_to_abs component from the wikipedia code)

gray_to_abs.comp

Not sure at all that it's correct, is unsigned ok here?

What is the simplest way to send write_strobe each servo period? I tried to connect stepgen to write_strobe but then I can't set the SSI parameters. Some switch is nesessary, it gets a bit complicated. I probably have to try connecting stepgen in postgui_hal
Last edit: 23 Aug 2013 02:57 by PKM.

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

More
25 Aug 2013 18:36 #38063 by PKM
Great news! I will try it asap, hopefully today or tomorrow.

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

More
25 Aug 2013 22:44 - 25 Aug 2013 22:45 #38074 by PKM
No abs_encoder in rtlib.
Make log:

make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-122-rtai'
/home/pkm/linuxcnc-dev/src/hal/drivers/mesa-hostmot2/abs_encoder.c: In function `hm2_absenc_parse_md`:
/home/pkm/linuxcnc-dev/src/hal/drivers/mesa-hostmot2/abs_encoder.c:147: warning: passing argument 2 of ˜`hal_export_funct` from incompatible pointer type
/home/pkm/linuxcnc-dev/src/hal/hal.h:621: note: expected void (*)(void *, long int) but argument is of type `˜void (*)(struct hostmot2_t *)`
Last edit: 25 Aug 2013 22:45 by PKM.

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

More
25 Aug 2013 23:24 #38075 by andypugh
That's only a warning, it shouldn't matter.
Are you running installed or run-in -place?
Don't forget the sudo make install or the . ./scripts/rip-environment.

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

More
25 Aug 2013 23:33 #38076 by PKM
I use run-in-place. But just no abs_encoder in rtlib folder, and loadrt abs_encoder causes error

5i25_7i76.hal:9: Can't find module 'abs_encoder' in /home/pkm/linuxcnc-dev/rtlib

Sure I did everything.

./autogen.sh
./configure --enable-run-in-place
make
sudo make setuid
. ./scripts/rip-environment
linuxcnc

The patch was OK, at least there's abs_encoder.c in its folder, abs_encoder strings in src/makefile.

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

More
25 Aug 2013 23:58 #38078 by andypugh
It is part of the Hostmot2 driver.
Try loadrt hostmot2 then loadrt hm2_pci

With the firmware PCW posted you should find some
Hm2_5i25.0.absenc... Pins.

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

More
26 Aug 2013 00:22 #38080 by PKM
Actually I first tried adding
addf hm2_5i25.0.trigger_encoders servo-thread

and received error
HAL: ERROR: function 'hm2_5i25.0.trigger_encoders' not found
5i25_7i76.hal:12: addf failed

And then I thought addf needs loadrt and started that loadrt abs_encoder thing.

Without addf it starts, I see absenc 00 and 01.
I'll try to set some parameters now.

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

More
26 Aug 2013 02:00 - 26 Aug 2013 02:09 #38085 by PKM
OK, I started config with
addf hm2_trigger_encoders servo-thread

and I'm flooded with popping errors
hm2/hm2_5i25.0: Data transmission not complete before encoder position read. You may need to place the absenc_trigger function earlier in the thread

Also, I can't find absenc.num_instances parameter in the tree.

upd: Looks like it's hm2_pci call parameter num_absencs
Last edit: 26 Aug 2013 02:09 by PKM.

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

More
26 Aug 2013 02:40 #38087 by PKM
I've set some parameters

setp hm2_5i25.0.absenc.00.bit-length 25
setp hm2_5i25.0.absenc.00.frequency-khz 50
setp hm2_5i25.0.absenc.00.gray-code 1

Still flooded with earlier-in-the-thread errors, so the machine starts 30 seconds.
And looks like no actual readings from the encoder.

Other settings nesessary?

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

More
26 Aug 2013 03:20 #38090 by PCW
50 KHz is _way_ too slow especially if you expect the SSI read to be
finished by the end of the other hostmot2 reads (24 bit x 20 usec = 480 uSec!)

In fact my encoder will not even read at that rate as the
SSI reset time is ~20 usec so it just resets every clock

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

Time to create page: 0.152 seconds
Powered by Kunena Forum