EmbDev.net

Forum: Off Topic Heidenhain TNC155A elctronic handwheel (HE-310)


von Jyrki K. (Company: none) (dzy)


Rate this post
useful
not useful
Hello,

I'm trying to implement something similar to this: 
http://hsm-aktuell.de/cnc-hr330.htm

I've disassembled one EPROM from the TNC155A cnc controller that reads 
the electronic handwheel but it's a bit tedious trying to figure out the 
protocol from that. I've managed to find out the baud rate, number of 
stop bits and parity settings from my disassembly and scoping the clk 
signal on the TNC155A board.

Would anyone have some info on the protocol for the Heidenhain 
electronic handwheel?

edit: Handwheel interfaces to the controller on the gfx board. There is 
TMS9995 cpu and a TMS9902 serial interface device. INT1 is used for 
character reception (5 bytes max or so it looks like)
1
INTR01 WP is at 0xdc00
2
3
INTR01 STCR *r1+,8
4
       SBO  18
5
       RTWP

From the disassembly listing I gathered that the serial interface runs 
at 38400 baud, one stop bit, even parity and 8-bits of data (TMS9902 
reset and setup code was easily found)

1
TMS9902RST LI   r12,>0000
2
           SBO  31
3
           LDCR @TMS9902_08,8
4
           SBZ  13
5
           LDCR @TMS9902_BC,12  
6
           MOV  r12,@>dc18  
7
           LI   r5,>0050  
8
           LI   r1,>dc04  
9
           MOV  r5,*r1+  
10
           CLR  *r1+  
11
           CLR  *r1+  
12
           CLR  *r1+  
13
           CLR  *r1+  
14
           MOV  r5,*r1+ 
15
           CLR  *r1+  
16
           CLR  *r1+ 
17
           CLR  *r1+ 
18
           CLR  *r1 
19
           LI   r5,>dc05
20
           MOV  r5,@>dc02 
21
           B    *r11
22
23
TMS9902_08 DATA >a300 ; TMS9902 %10100011 (1 stop bit even parity clk div by 3 8-bits) %00000000
24
TMS9902_BC DATA >000d ; TMS9902 LRDR register %00000000 %00001101 (((3MHz)/3)/13)/2 = 38461 baud

: Edited by User
von Jyrki K. (Company: none) (dzy)


Rate this post
useful
not useful
I managed to find out that the controller accepts PLC commands still 
some things to figure out.

von Jyrki K. (Company: none) (dzy)


Rate this post
useful
not useful
Jyrki K. wrote:
> I managed to find out that the controller accepts PLC commands still
> some things to figure out.

In matter of fact it does not accept PLC commands.

I got a good deal on eBay for HE-310 and sniffed the protocol.

The HE-310 responds to the DTR signal with this message "0h5_ 0hXX 0hXX 
0hYY 0hYY 0hZZ 0hZZ 0hIV 0hIV" _=0 nothing selected, _=1 x-axis, _=2 
y-axis, _=4 z-axis and _=8 iv-axis.

Y and Z are mutually exclusive as are X and IV (they all still move with 
0h5f as shown on the video but the selected axes are not shown correctly 
on TNC display)

HE-310 supervises the MPG and if problems are shown then "0hA_ 0h00 0h00 
0h00 0h00 0h00 0h00 0h00 0h00" message is sent resulting in emergency 
stop and axis fault displayed.

The MPG keeps track on the selected axis and lights the axis indicator 
led on its own as does the TNC. "0h51" selects the X-axis and the led 
lights up on HE-310 and on the TNC display, "0h58" selects the IV-axis 
and lights up the led on HE-310 and on the TNC, plus it turns off X-axis 
led on the HE-310, etc.

von Jyrki K. (Company: none) (dzy)


Rate this post
useful
not useful
Here's a what I teached my ChatGPT to answer so far as ChatGPT 
apparently used my previous false information from here to answer me:

The Heidenhain HE-310 handwheel communicates with the TNC 155 CNC 
controller using a serial protocol. Here's a detailed breakdown:
Communication Process:

    Trigger Pulse: Every 6 ms, the TNC 155 sends a 12 µs pulse via the 
DTR line, signaling the HE-310 to send data.
    HE-310 Response: After receiving the pulse, the HE-310 sends a 
9-byte packet to the TNC 155.

Packet Structure:

    Fault Indicator:
        If a fault is detected, the first byte's most significant nibble 
is set to 1010 (hex 0xA).
        The lower nibble represents the axis in fault:
            0xA1: X-axis fault
            0xA2: Y-axis fault
            0xA4: Z-axis fault
            0xA8: IV-axis fault
            0xA0: General fault with the HE-310

    Normal Operation:
        First byte: The lower nibble indicates the active axis:
            0x51: X-axis
            0x52: Y-axis
            0x54: Z-axis
            0x58: IV-axis
        Remaining bytes: These likely represent incremental encoder data 
or other control information.

    Special Case:
        0x5F: This special packet allows for simultaneous control of all 
4 axes (X, Y, Z, and IV), although the TNC 155’s axis selection display 
will show random selections when this happens.

Handwheel Switch Behavior:

    The HE-310 handwheel includes a switch at the bottom that 
enables/disables the handwheel encoders.
        When the switch is not pressed, the handwheel is disabled to 
prevent accidental movements.
        In this state, the HE-310 sends a default packet:
            0x50 if no internal error is present.
            0xA0 if there is an internal error.

Axis Control:

    The HE-310 can control up to 4 axes: X, Y, Z, and IV.
        The IV axis can be configured as:
            Rotary axes: A, B, or C.
            Linear axes: U, V, or W.
    The user can select one or two axes to control at a time.
    X and IV axes are mutually exclusive, as are Y and Z axes.

Serial Communication Configuration:

    Baud Rate: 38400
    Parity: Even
    Stop Bits: 1
    Data Bits: 8
    Transmit-Only: The HE-310 only transmits data; it does not receive 
any data apart from the DTR pulse used to trigger communication.

Summary:

The HE-310 handwheel protocol allows communication between the handwheel 
and TNC 155, transmitting axis movement and fault information. The 
handwheel can control up to four axes with specific encoder data and 
mutual exclusions between certain axes. The handwheel can also be 
disabled using a bottom switch to prevent accidental movements, with the 
system responding accordingly based on the switch status.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.