Welcome, Guest. Please login or register.


Author Topic: Fischertechnik Robot Interface 30520. (Read 1593 times)

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Fischertechnik Robot Interface 30520.
« on: 2019.December.24. 04:17:17 »
Do you remember the Fischertechnik robot arm mentioned on the Werner Lidner thread here and here?

Some time ago I got a cheap Fischertechnik Interface from Ebay because, being the connection maniac I am, wanted to replicate the experiment shown.



I still have not put it on use, in part due to the lack of a robot arm, and in part because there is a lot of information on Internet but it has to be hunted on non English pages about interfacing other computers, like C64, Atari ST, Apple II, Amiga, CPC/Schneider, BBC and more.

This all has just changed Yesterday when I have found  the very same robot arm on an Ebay bid. I will receive it on January, but buying it has pushed me to search the needed information.

Fischertechnik released all over of some years several variations of the Centronics/printer port interface(you can see some of them here). I think that all of them can be interfaced to the Enterprise, because only the first 0-5 data bits for output, and the /READY signal for input, are used in the protocol.

There are older computers like the C64 or Apple II that interface different because they lack a /READY signal on their printer ports.

Almost all the different interfaces have a flat cable with an aerial 20 pin DIL female connector like the one seen on the above picture, where the provided adapter for every computer is plugged. Of course we have to make ourselves the Enterprise adapter, but it is not so difficult if we have the information:







(Remember, on the flat cable the red lead mark the pin 20 of the connector)

Ok, now let's think that the Enterprise is correctly connected to the interface and it to the robot arm(pdf manual attached). We could play with the software provided by Werner, but he said that it was a limited version based on a PC Pascal program compiled on IS-DOS(CP/M).

I think we don't need to limit ourselves because, on the Robot Arm manual(pages 57-60), we have a wonderful Z80 machine code listing with all the options, and also some examples of CPC Basic listings that can be easily transcripted to IS-Basic. We only have to adapt the CPC Z80 ports dedicated to the parallel port to the very similar Enterprise ports.

CPCs use 16bit port EF00h to output the data bits, and bit 6 on port F500h for the BUSY signal(contrary to /READY). On the Enterprise we use the 8 bit port B6h for the output data bits and bit 3 of the B6h port for input the /READY signal. Only left us to know if a 1 on the CPC ports is a 1 on the Enterprise ports or on the contrary a 0.

24139-3

24141-4

24143-5

24145-6


Fischertechnik manuals.
« Last Edit: 2020.January.02. 15:51:17 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #1 on: 2019.December.24. 11:30:26 »
I have found more information about the CPC ports used:





And this is the known Enterprise information(fixed):



The protocol used by the interface, as I have said, only uses the first five data bits and /READY, it behaves totally different to a Centronics port.
« Last Edit: 2020.January.02. 01:19:39 by gflorez »

Offline BruceTanner

  • EP lover
  • *
  • Posts: 515
  • Country: gb
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 68.0 Firefox 68.0
    • View Profile
Re: Fishertechnik Robot Interface 30520.
« Reply #2 on: 2019.December.24. 12:19:13 »
Good find! :smt041 should be a very interesting new year!

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #3 on: 2019.December.24. 13:20:16 »
Yes! The good point is that, altough the Enterprise Parallel port is unidirectional, this interface manages to input data from the robot arm, like the position of the axis. Still better, we don't need to have that robot arm, other artifacts can be controlled with only the interface, if they have sensors and motors, like for example, orienting an aerial antenna.
« Last Edit: 2020.January.02. 01:18:53 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 76.0 Firefox 76.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #4 on: 2019.December.24. 14:37:21 »
Then the Parallel to Interface  connexions are like this:

Code: [Select]
EP Printer Pin  Interface pin    Signal                Comment
-------------------------------------------------------------------------
A7 (Data Bit0)       8          Load-out       ;motor control output
A6 (Data Bit1)       7          Load-in        ;digital sensor 8bit input
A5 (Data Bit2)      10          Data-out       ;data output from computer
A3 (Data Bit3)       9          Clock          ;data clock
B3 (Data Bit4)      12          Trigger-x      ;analogue sensor X input
B5 (Data Bit5)      11          Trigger-y      ;analogue sensor Y input
B2   (Ready)        18          Data/Count-in  ;data input to computer
A1-B1 (GND)      1,2,19,20      Ground         ;ground
              13 shorted to 15  
              14 shorted to 16  


This is the internal block diagram and the flow chart of the signals.




Seems overwhelming.... but  don't worry, who deal with the protocol are the Machine Code routines.
« Last Edit: 2020.May.27. 16:48:46 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #5 on: 2019.December.26. 16:58:29 »
I have managed to extract the CPC Z80 assembly file from the pdf.

Next, I have to study how can I fix it for the EP.
« Last Edit: 2020.January.02. 01:18:03 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #6 on: 2019.December.27. 00:01:37 »
Fixed a lot of errors in the listing.
« Last Edit: 2020.January.02. 01:17:37 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #7 on: 2019.December.27. 14:23:04 »
Tape image of the CPC German cassette companion(for a lot of computer kits, not only Robot Trainer).

I have extracted to plain ASCII the Basic listings for the robot arm.



Edit: System.txt installs in Ram exactly the same Machine Code program shown on the instructions.

Also, there is a modification on the listing for the CPC 6XX series, that have the Basic variables zone fixed on AE68h, instead of the common AE85h zone for the CPC 4XX series.
« Last Edit: 2020.January.02. 01:17:08 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #8 on: 2019.December.27. 20:44:14 »
Fast and easy adapter.







Edit:   But bad...... the red lead marks wrongly the pin 20, not pin 1, so I have to turn upside down the flat cable or make again the connections......
« Last Edit: 2020.January.02. 01:16:49 by gflorez »

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #9 on: 2020.January.01. 23:29:14 »
The heart of the machine code routines are:

Code: [Select]
SHOUT: LD BC,#EFOO ;pointer to printer port
LD C,A ;use C as work register
LD E,#08 ;loop counter
LOOP: LD D,#30 ;static bit pattern
LD A,C
RLCA ;next bit
LD C,A
JR NC,NULL ;=O?
LD D,#34 ;set DATA OUT
NULL: OUT (C),D ;output
LD A,D
OR #08 ;set CLOCK
OUT (C),A ;Ausgabe
DEC E ;loop counter
JR NZ,LOOP ;end of loop
LD D,#39 ;set LOAD OUT
OUT (C),D ;output
RET

And

Code: [Select]
SHIN: LD D,#32 ;set LOAD IN
LD BC,#EFOO ;pointer to printer port
OUT (C),D ;output
LD D,#3A   ;set CLOCK
OUT (C),D   ;output
LD E,#08 ;loop counter
LOOP2: RLA ;shift data byte
AND #FE ;clear bit O
LD BC,#F500 ;pointer to BUSY input
LD C,A
IN A,(C) ;read BUSY
AND #40 ;mask BUSY input
RLA ;and shift into carry
RLA
LD A,C
JR NC,NULL2 ;test DATA-IN
OR #01 ;set Bit O
NULL2: LD BC,#EFOO ;pointer to printer port
LD D,#30 ;reset CLOCK
OUT (C),D ;output
LD D,#38 ;set CLOCK
OUT (C),D ;output
DEC E ;loop counter
JR NZ,LOOP2 ;end of loop
CPL ;negative logic
RET


The data is sent/read to/from the interface bit to bit with a fixed protocol, but I think there aren't restrictions on how much time is employed in doing it because, if you read the  very similar 6502 routines, the same timings are used.

Think of it,  why a totally different architecture, processor, system clock, will maintain the same code timings?

So, I only have to rearrange the I/O routines to the EP Z80 ports and they will work.

But I have to change the parsing of the Basic commands used as, both on the C64 and on the CPC they have used very computer specific ways to enter or read the parameters.

And the routines have to be relocatable, if I want to end with similar Basic listings on the Enterprise, but the length of the code will be the biggest handicap.

I will try it and then would thank a more skilled opinion.
« Last Edit: 2020.January.02. 01:16:16 by gflorez »

Offline BruceTanner

  • EP lover
  • *
  • Posts: 515
  • Country: gb
  • OS:
  • Linux (Ubuntu) Linux (Ubuntu)
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #10 on: 2020.January.02. 09:10:01 »
If it is any help, this is EXOS's parallel printer output routine:
Code: [Select]
WC_PAR:: LD A,B ;Send data to parallel output port
OUT (DATA_PORT),A
;
PL1: LD A,(FLAG_SOFT_IRQ)
CP ?STOP## ;Check for STOP key interrupt
LD A,.STOP## ;Load error flag
RET Z
IN A,(INPUT_PORT) ;Poll READY line
BIT 3,A
JR NZ,PL1
;
LD A,(PORTB5) ;Fetch map of port B5
OR 00010000B ;Force STROBE low
OUT (STROBE_PORT),A ;Send data strobe
AND 11101111B ;Reset STROBE high (normal state)
OUT (STROBE_PORT),A ;Send to port
XOR A ;Clear accumulator
RET ;Back to kernel
DATA_PORT and INPUT_PORT are both 0B6H and STROBE_PORT is 0B5H.

Clearly on the CPC the value in B is important when you do an OUT (C),r or IN r,(C) - on the EP the value in B is not used (the instruction should have been called OUT (BC),r and IN (BC),r!) If you do an OUT (n),A or an IN A,(n) as the EXOS code does then 0 is used as the high byte of the port address, so the CPC code has to avoid using that form of OUT and IN. Even so,
Code: [Select]
SHOUT: LD BC,#EFOO ;pointer to printer port
LD C,A ;use C as work register
is just wasting time and space!

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #11 on: 2020.January.02. 11:55:57 »
Thanks for your tips. And more will be welcome, please.

It seems that on the CPC, the Parallel(EFXXh) and the Ready(F5XXh) ports, the important is the High byte, because on the  input routine C is modified and used for other purposes and the port is still working correctly. In fact, you can find these ports described with that nomenclature on some CPC pages.

STROBE is not used by the FT interface, instead they take the READY signal for serial input and Data bit 1 for serial output. Also, you can see that, at the end of the SHIN routine, they complement the received byte because READY is BUSY for the CPC. But again we must negate it because on the EP parallel port a 0 on the Ready bit is +5v on the connector pin(but this still has to be tested).

While writting this I am just received the robot arm. Here you have some pictures out of the box:

24212-0

24214-1

24216-2

24218-3

24220-4

24222-5

24224-6

It is smaller than I expected(for example, the base/box measures only 25x19cm, less than an A4 sheet), and it seems very dusty and underused, although complete. I don't know if it became used in the past so, first of any test I have to follow the assembly instructions.


Offline Zozosoft

  • EP addict
  • *
  • Posts: 13718
  • Country: hu
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Firefox 71.0 Firefox 71.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Fischertechnik Robot Interface 30520.
« Reply #12 on: 2020.January.02. 15:07:22 »
If you do an OUT (n),A or an IN A,(n) as the EXOS code does then 0 is used as the high byte of the port address
Not important on the Enterprise, but at these case the A register sent to high byte. On ZX Spectrum used this is for the keyboard handling:
LD A,n
IN A,(0FEh)

Offline BruceTanner

  • EP lover
  • *
  • Posts: 515
  • Country: gb
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 68.0 Firefox 68.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #13 on: 2020.January.02. 16:26:00 »
these case the A register sent to high byte. On ZX Spectrum used this is for the keyboard handling:
LD A,n
IN A,(0FEh)
I didn't know that! Thank you for today's lesson :lol: :bow:

Online gflorez

  • EP addict
  • *
  • Posts: 2931
  • Country: es
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 72.0 Firefox 72.0
    • View Profile
Re: Fischertechnik Robot Interface 30520.
« Reply #14 on: 2020.January.09. 20:45:30 »
Do you see the wooden part on the Enterprise GMB robot arm?

24242-0

This is not the straight part my Robot arm came with, it was tailored to improve some large movements of the arm.

I will do a similar one in  aluminium.