Enterprise Forever

:UK => Hardware => Topic started by: gflorez on 2019.December.24. 04:17:17

Title: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2019.December.24. 04:17:17
Do you remember the Fischertechnik robot arm mentioned on the Werner Lidner thread here (https://enterpriseforever.com/hall-of-fame/qa-with-werner-lindner-technical-director-of-the-enterprise-computers-gmbh/msg46115/#msg46115) and here (https://enterpriseforever.com/hall-of-fame/qa-with-werner-lindner-technical-director-of-the-enterprise-computers-gmbh/msg46277/#msg46277)?

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

(https://www.fischerfriendsman.de/normalos/7568ce.jpg)

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 (https://www.fischerfriendsman.de/index.php?p=7&sp=9&add=1:7568#R7568)). 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:

[attachimg=7]

[attachimg=1]

[attachimg=2]

(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.

[attach=3]

[attach=4]

[attach=5]

[attach=6]


Fischertechnik manuals (https://www.dropbox.com/s/302glcljfshlixt/Fischetechnik.rar?dl=0).
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2019.December.24. 11:30:26
I have found more information about the CPC ports used:

[attachimg=2]

[attachimg=3]

And this is the known Enterprise information(fixed):

[attachimg=1]

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.
Title: Re: Fishertechnik Robot Interface 30520.
Post by: BruceTanner on 2019.December.24. 12:19:13
Good find! :smt041 should be a very interesting new year!
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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.

[attachimg=1]


Seems overwhelming.... but  don't worry, who deal with the protocol are the Machine Code routines.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2019.December.27. 00:01:37
Fixed a lot of errors in the listing.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2019.December.27. 20:44:14
Fast and easy adapter.

[attachimg=1]

[attachimg=2]



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......
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: BruceTanner 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!
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez 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 (http://www.cpcwiki.eu/index.php/Printer_Port).

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:

[attach=1]

[attach=2]

[attach=3]

[attach=4]

[attach=5]

[attach=6]

[attach=7]

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.

Title: Re: Fischertechnik Robot Interface 30520.
Post by: Zozosoft 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)
Title: Re: Fischertechnik Robot Interface 30520.
Post by: BruceTanner 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:
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.January.09. 20:45:30
Do you see the wooden part on the Enterprise GMB robot arm?

[attach=1]

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.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.06. 13:05:09
Sorry for the long time not reporting....

The Robot arm and the interface are powered by a ridiculous 7V non stabilised power supply that I don't own nor like. I have found that I can use 9V stabilised instead. So I could use a Enterprise or Spectrum PSU, but I don't want to mix connectors. I also want a powerful one for this project, so I have ordered a Chinese 5Amp PSU.

I have the parallel cable fixed and ready, but I have to inspect better the robot, if it is well mounted.

When I have collected all, first I will test the files found by Werner, he said that they were CP/M(ISDOS) commands.  

Then I will start doing Basic+Machine-Code tests.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.09. 01:05:51
At last I have received the Chinese PSU, so it is time to move.

I have checked the robot arm thoroughly. Now I can say that all is correctly mounted and complete, not so easy as it seems, hundred of little parts, and the instruction book poorly detailed on some steps.

But I can also say that it has never worked. All the effort and caution put on the assembly by the owner was not hold on the wiring phase. As a result, some of the leads are shorter than needed, directed through the wrong hole, or connected on  the incorrect motor, sensor or switch.

Then, I have had a nice afternoon fixing the jungle of leads, at the end not so difficult, but I can understand the frustration of accomplishing the task without some knowledge.

Next, I have tried to feed the 4 motors with the PSU, first to one side and then to the other inverting the polarity, perfect.

One minor problem has appeared when I have feed correctly the robot arm with the PSU trough the FischerTechnick interface: one of the motor driver chips on the interface is stuck and one of the motors is always turning. This is unusual because I still have not connected the EP to the set.

I have checked the components near the motor driver chip and I have found a burned diode. I have de-soldered the component and this is a picture of the zone:

[attach=1]

I don't have components at my house, so more on Monday.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: BruceTanner on 2020.February.10. 12:54:48
I hope the IC is not damaged too, it might be difficult to get a new one.

I was interested to see what that IC does, but I could not find any information.

But then I discovered the part number is TLE4201S1, not TLE420ISI as it looks (ie. one-sss-one at the end.)

So now that I have found it, I might as well post the datasheet here in case you do not have it. On page 554 (:lol: it starts at page 551 :lol:) there is an example circuit with four diodes...
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.10. 19:22:01
It is a motor driver. I think it is not damaged. I am going to substitute all 16 diodes, because almost all have bad aspect.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.11. 13:17:19
Good news!

It seems that the interface works, but I have to  investigate more.

I have loaded the Teach.com app(from the Werner files) on IS-DOS, and this screen appears:

[attach=1]

I can understand more or less because the menu is mid English mid German. So I have pressed T, and this (https://www.dropbox.com/s/wdzz281bk6p8153/Robot%20arm%20working.mp4?dl=0) is what has happened!

I have switched off all after this attempt, because I still don't know if the rotation of the motors is on the correct gender, or if the numerous switches and sensors are correctly wired. But I think it is a very good start.

Edit: the program has a lot of sub-menus. I will try to translate it to English with an Hex editor.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.12. 16:49:20
Sadly, only one Driver chip works, so I have localised and order some of them in China.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: szipucsu on 2020.February.13. 10:34:10
I can understand more or less because the menu is mid English mid German. So I have pressed T, and this (https://www.dropbox.com/s/wdzz281bk6p8153/Robot%20arm%20working.mp4?dl=0) is what has happened!
It is cool!
Anyway, English and German? The word "modus" seems Latin. (Just a joke.)
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.13. 12:20:33
The Chinese chips will slowly arriving, so meanwhile I will try Turbo Pascal on IS-DOS, luckily we have the corrupted .PAS source and a .BAK.

----

Yes, curiously the German language maintains the verb as the last word on a sentence, just like the goodly spoken English.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: tofro on 2020.February.13. 19:36:11
They've kept the menu initials in English, apparently.

It is (from top to bottom)

"Teach", "Run", "Save", "Load", "Home", "End"
Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.14. 10:51:52
Yes, probably they have translated from English.

Maybe we all together can make a better translation, I have put here the German text:

Diskettenfehler!
Dreiachsiger Trainingsroboter
Teach-In Verfahren
auf      -       zu
Altes Teach Programm loeschen (j/n)
J/N   ------> Y/N
Roboter faehrt in Heimposition
Tastenfunktion:    Position (Soll/Ist):
1 Roboter nach links
2 Roboter nach rechts
3 Oberarm vor
4 Oberarm zurueck
5 Unterarm ab
6 Unterarm auf
7 Zange auf
8 Zange zu
Schrittweiten
Zeitkonstante Greifzange +/-     sec
Z 256 Segmente
X 64 Segmente
C 16 Segmente
V 8 Segmente
B 4 Segmente
M Menue
H Heimposition
ENTER Lerne
ERASE Loeschen
Nr.  Dreh     Oarm      Uarm     Zange
Ausfuehrmodus
Wieviele Durchlaeufe:
Teach-In Tabelle (Durchlauf
Teach Programm auf Diskette abspeichern
Datei-Name:
Teach Programm von Diskette laden
T Roboter Teach-In Modus
R Teach Programm ausfuehren
S Teach Programm abspeichern
L Teach Programm laden
H Heimposition anfahren
E Programmende
Sind Sie sicher (j/n)



Title: Re: Fischertechnik Robot Interface 30520.
Post by: tofro on 2020.February.14. 16:47:05
Just one correction:

Replace "Zange" and "Greifzange" with "Greifer"

And propose to change "R", "S", "L" with "Gelerntes Programm ausf├╝hren"/"abspeichern"/"laden"

Title: Re: Fischertechnik Robot Interface 30520.
Post by: gflorez on 2020.February.14. 19:13:19
Thanks, but.... I intend to translate it all to English. I can maintain a fixed German version in case somebody more wants to play with the FischerTechnik interface.

My final objective is to do the Basic+MC version, that will be more usable than this program.
Title: Re: Fischertechnik Robot Interface 30520.
Post by: Zozosoft on 2020.February.16. 14:25:48
So I have pressed T, and this (https://www.dropbox.com/s/wdzz281bk6p8153/Robot%20arm%20working.mp4?dl=0) is what has happened!
It is simply amazing! Something that we have never seen, now over decades and over many country borders starts working again! :smt038