Absolute Encoder Questions / SSI via 5i25
20 Aug 2013 05:35 #37865
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
Here are 7i76 and 7i77 configs with SSI interfaces on the sserial expansion ports
Note that the SSI firmware is subject to change, especially in regards to how a cycle is started
suggested method is to set the pstart bit in each instance and use the global start register to start multiple channels
The data written to the global start register should be a bitmask of channels to start (its dont care currently but this will change)
A complete SSI interface should have the ability to set the bit size and start and end bits for counts per turn and
turn counts fields. In addition it should have the ability to extract the data twice and verify that the data repeats
(this is done by the rather inefficient method of setting the data transfer size twice as large as needed, in this case the SSI encoder repeats its output data) a gray/bin option is needed as well
Note that the SSI firmware is subject to change, especially in regards to how a cycle is started
suggested method is to set the pstart bit in each instance and use the global start register to start multiple channels
The data written to the global start register should be a bitmask of channels to start (its dont care currently but this will change)
A complete SSI interface should have the ability to set the bit size and start and end bits for counts per turn and
turn counts fields. In addition it should have the ability to extract the data twice and verify that the data repeats
(this is done by the rather inefficient method of setting the data transfer size twice as large as needed, in this case the SSI encoder repeats its output data) a gray/bin option is needed as well
The following user(s) said Thank You: PKM
Please Log in or Create an account to join the conversation.
20 Aug 2013 12:53 #37868
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
I flashed the 5i25 with 7i76x2_ssi.bit and it went OK
Then I cut a config
When it starts I use Show HAL Configuration. There are raw pins. First I entered commands to test window but then I made a script
#!/bin/bash
#set DDR to IO pins 0 and 12
halcmd setp hm2_5i25.0.raw.write_address 0x1100
halcmd setp hm2_5i25.0.raw.write_data 0x1001
halcmd setp hm2_5i25.0.raw.write_strobe 1
#set AltSource to IO pins 0 and 12
halcmd setp hm2_5i25.0.raw.write_address 0x1200
halcmd setp hm2_5i25.0.raw.write_data 0x1001
halcmd setp hm2_5i25.0.raw.write_strobe 1
#set 25 for number of SSI bits, 1 to Pstart (bit 8) and 656 to SSIBitRate
halcmd setp hm2_5i25.0.raw.write_address 0x6A00
halcmd setp hm2_5i25.0.raw.write_data 0x2900119
halcmd setp hm2_5i25.0.raw.write_strobe 1
#start reading cycle
halcmd setp hm2_5i25.0.raw.write_address 0x6B00
halcmd setp hm2_5i25.0.raw.write_data 1
halcmd setp hm2_5i25.0.raw.write_strobe 1
#try to read the value
halcmd setp hm2_5i25.0.raw.read_address 0x6800
exit 0
Nothing happens. 0x6800 remains 0xFFFFFFFF. I use O-scope for TX on 7i76 and no signal at all (though it switches once when setting DDR).
What is wrong?
Then I cut a config
hal
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=0 num_pwmgens=0 num_3pwmgens=0 num_stepgens=0 enable_raw"
setp hm2_5i25.0.watchdog.timeout_ns 10000000
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hostmot2
loadrt hm2_pci config=" num_encoders=0 num_pwmgens=0 num_3pwmgens=0 num_stepgens=0 enable_raw"
setp hm2_5i25.0.watchdog.timeout_ns 10000000
addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf hm2_5i25.0.write servo-thread
addf hm2_5i25.0.pet_watchdog servo-thread
When it starts I use Show HAL Configuration. There are raw pins. First I entered commands to test window but then I made a script
ssi script
#!/bin/bash
#set DDR to IO pins 0 and 12
halcmd setp hm2_5i25.0.raw.write_address 0x1100
halcmd setp hm2_5i25.0.raw.write_data 0x1001
halcmd setp hm2_5i25.0.raw.write_strobe 1
#set AltSource to IO pins 0 and 12
halcmd setp hm2_5i25.0.raw.write_address 0x1200
halcmd setp hm2_5i25.0.raw.write_data 0x1001
halcmd setp hm2_5i25.0.raw.write_strobe 1
#set 25 for number of SSI bits, 1 to Pstart (bit 8) and 656 to SSIBitRate
halcmd setp hm2_5i25.0.raw.write_address 0x6A00
halcmd setp hm2_5i25.0.raw.write_data 0x2900119
halcmd setp hm2_5i25.0.raw.write_strobe 1
#start reading cycle
halcmd setp hm2_5i25.0.raw.write_address 0x6B00
halcmd setp hm2_5i25.0.raw.write_data 1
halcmd setp hm2_5i25.0.raw.write_strobe 1
#try to read the value
halcmd setp hm2_5i25.0.raw.read_address 0x6800
exit 0
Nothing happens. 0x6800 remains 0xFFFFFFFF. I use O-scope for TX on 7i76 and no signal at all (though it switches once when setting DDR).
What is wrong?
Please Log in or Create an account to join the conversation.
20 Aug 2013 19:42 #37885
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
Did you cycle the computer power after flashing the 5I25?
If not, you are still using the old firmware
If not, you are still using the old firmware
Please Log in or Create an account to join the conversation.
20 Aug 2013 20:03 #37886
by andypugh
I am not sure that you don't need to actually physically unplug the power to power-cycle the PCI card.
It definitely takes more than a restart.
Replied by andypugh on topic Absolute Encoder Questions / SSI via 5i25
Did you cycle the computer power after flashing the 5I25?
If not, you are still using the old firmware
I am not sure that you don't need to actually physically unplug the power to power-cycle the PCI card.
It definitely takes more than a restart.
Please Log in or Create an account to join the conversation.
20 Aug 2013 21:04 - 20 Aug 2013 22:19 #37887
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
Now I tried again, after several hours of power-off. Still nothing. I even verified the firmware against the bitfile.
My guess is I could be setting wrong SSI register. Is it supposed to be register 0 channel 0?
New regmap has channels, how are they supposed to work? A few devices on one port possible?
My guess is I could be setting wrong SSI register. Is it supposed to be register 0 channel 0?
New regmap has channels, how are they supposed to work? A few devices on one port possible?
I did not try this firmware. But with 7i76x2_ssi.bit TX state actually changes when I set GPIO12. Is it meant this way?freeby.mesanet.com/7i77_ssi_7i74.bit
Has just one SSI interface on the 7I77s RS422/485 expansion port
Note that this expansion port is a RS-485 capable interface so has a /XMIT
enable on GPIO-0 you will need to set low by making GPIO-0 an output and setp-ing it low
in your hal file
Last edit: 20 Aug 2013 22:19 by PKM.
Please Log in or Create an account to join the conversation.
20 Aug 2013 21:25 #37889
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
Looks like I zipped up the wrong bitfiles, I will make a new zipfile when I get to work in a few hours, sorry
Please Log in or Create an account to join the conversation.
20 Aug 2013 21:58 #37892
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
Sure, no problem. Thanks for your help!
Please Log in or Create an account to join the conversation.
21 Aug 2013 00:29 - 21 Aug 2013 00:31 #37899
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
These should be the correct bit files:
freeby.mesanet.com/ssi2.zip
(for some reason the forum doesn't like attachments anymore)
Edit:I take that back it takes them but does not show that it did in the edit window, sigh...
freeby.mesanet.com/ssi2.zip
(for some reason the forum doesn't like attachments anymore)
Edit:I take that back it takes them but does not show that it did in the edit window, sigh...
Last edit: 21 Aug 2013 00:31 by PCW. Reason: cranky forum software
The following user(s) said Thank You: PKM
Please Log in or Create an account to join the conversation.
21 Aug 2013 01:19 #37901
by PKM
Replied by PKM on topic Absolute Encoder Questions / SSI via 5i25
That works, I have a response from the encoder!
Please Log in or Create an account to join the conversation.
21 Aug 2013 22:01 #37930
by PCW
Replied by PCW on topic Absolute Encoder Questions / SSI via 5i25
I might note that if you have the clock polarity wrong the encoder will not work, but if you get the data polarity wrong
the encoder will work but the gray to binary converter will output gibberish.
With my Siemens SSI encoder the wiring is:
TX+ --> /CLOCK
TX- --> CLOCK
RX+ --> /DATA
RX- --> DATA
I will probably change the default polarities (reverse both)
so this is more natural when I finalize the SSI firmware.
the encoder will work but the gray to binary converter will output gibberish.
With my Siemens SSI encoder the wiring is:
TX+ --> /CLOCK
TX- --> CLOCK
RX+ --> /DATA
RX- --> DATA
I will probably change the default polarities (reverse both)
so this is more natural when I finalize the SSI firmware.
Please Log in or Create an account to join the conversation.
Time to create page: 0.110 seconds