Friday, July 25, 2014

LEGO - LEGO's first programmable product




LEGO is among one of the world's most recognised brand names. Most people would be familiar with LEGO's passive building bricks but how familiar are they with LEGO's electronic products? When I think about electronics and LEGO I think about the upper end of the Technics range (more complicated LEGO sets based around gears, pins, rods and beams) or the MindStorms products (sets revolved around the concept of a small programmable controller allowing for robotic type creations). However, electronics and LEGO go back a long way, long before the release of MindStorms. In fact it was back in the mid 1960s that kits with motors began. As a kid I remember being very impressed by the LEGO light bricks and motor powered vehicles. It was something special compared to the other generic LEGO parts. You have to remember that going back a few decades the variety of LEGO building blocks was not like it is today and Technic sets were not all that common. These sets were powered by a battery pack (3 x 1.5V cells) resulting in the 4.5V standard which lasted in production until the mid 1990s. The sets included a motor or a light or both. It wasn't until around the mid 1980s that LEGO injected funding into extending the electronic product range and in collaboration with MIT (Massachusetts Institute of Technology) processes were set in motion that resulted in some fantastic products. These products are not limited to but include the initial Technic Control Center (4.5V) sets released in 1986, followed by the Technic Control Center (9V) sets in 1989, Control Lab in 1993 and then leading into the very popular Mindstorms from 1998 which is currently into its forth generation of products. LEGO's first programmable product, the Technic Control Center (4.5V), was built around the long running 4.5V standard and harnessed the processing power of the more common computer platforms of the time (Apple II, BBC Micro, Commodore 64, IBM-PC, MicroBee and a few others). Several commercial programs were available for controlling the equipment, LEGO Lines, LEGO TC Logo and then later LogoWriter Robotics.

The use of LEGO for home robotics started before 1986. In 1977 LEGO Technic was introduced and within a year gearboxes and better motors were available. Also from the mid 70s the micro computer market made great technological strides and so by the late 70s using LEGO for home robotics was certainly possible. However this was still the domain of the electronics enthusiast as controller\interface boards needed to be hand built and the computer manually programmed. What LEGO did with their first programmable product was to jump on the bandwagon of bringing this technology to the masses. It allowed a working robotic contraption to be built within hours not weeks or months and basically by anyone who could read a book and follow instructions.

The Technic Control Center (4.5V) series includes sets [9700-1]: Technic Control Center, [1090-1]: Technic Control I and [1092-1]: Technic Control II. However these are just the Lego brick sets and instruction cards. It gets very confusing because like many LEGO sets aimed at the education sector, to get anything going, you need a variety of different packages. In this case you would also need the computer interface card, a controller board, software (LEGO Lines, LEGO TC Logo or LogoWriter Robotics) and the teacher's guides for programming examples and tutorials. All these were sold separately. There were some sets called starter kits, such as the [951-2], which bundled all of this together. The 4.5V control series is not to be confused with the 9V control series which came after it. It is easy to do because the titles are so similar (9V series :- [8094-1]: Control Center, [8485-1]: Control Center II, [9753-1]: Technic Control Center I and [9752-1]: Technic Control Center II). The static bricks are compatible between the series but the electronic parts are not. The best way in trying to identify these sets is through the LEGO set numbers which I have enclosed with square brackets. Sometimes even this is not enough ie sometimes the Technic Control Centre set is denoted as [9700] and sometimes as [9700-1]. Also, some of the old LEGO numbers have been reused and now refer to newer Lego items.

I was interested in getting one of these sets up and going on my Apple II computer but the asking prices for the full kits was far more than what I wanted to spend. For this to work I needed to find a different source. After scanning the web every now and again over several months I came across a controller board which is the most critical part of the setup. The interface cable was missing and the power adapter did not suit my power sockets so by just taking the controller board saved me some shipping costs. The cable was easy to make up and I found a suitable power adapter in my junk box. To connect this to the Apple II I needed an interface card. I started the process of building the LEGO interface card myself as there is not much to it. It so happened that I found one listed and bought that instead. I purchased a few electronic LEGO parts off ebay and used my existing LEGO bits, not that I had much that was suitable, to build a few freestyle contraptions. This kept me happy for a while.

The Technic Control Center sets were only released via LEGO's Education arm (dacta) so in its day you were not going to find one of these sets at your local toy store. To begin with I wasn't looking at getting an entire set because I assumed the parts were difficult to get. How wrong I was. These kits were sold in huge quantities so there are plenty of the parts still around. Even the most useful part, the motor, by being available in many sets going back to the 1960s is still readily available in large quantities. The only problem is that the majority of these kits have been split up and sold off in pieces. The parts are obtainable but just not from one single source. I was able to obtain all the parts I needed for all three sets ([9700-1], [1090-1] and [1092-1]). To keep costs low I obtained mostly used parts and removed any duplicates between the sets. I still ended up with about one thousand pieces of Lego and even with shipping costs taking up about a quarter of all costs it still ended up being a fraction of the price that I have seen some kits go for. At times it was frustrating but just like most things, if you put in the effort (for the most part) you will be rewarded. Obtaining LEGO this way is not for everyone as it is a very time consuming process. Having purchased used parts as opposed to getting expensive new in the box sets I'll be more inclined to get the LEGO out and use it. I think Emmet would give that the thumbs up (if he had any that is). The following is a write up of my findings and challenges. I hope to complete it one day and keep it as a resource for others who wish to do the same.

The following is a breakdown of all the components of the system :-


1. Computing platform.

First thing needed is a computing platform. No points for guessing that my platform of choice is ... the Apple II. If an Apple II platform is used then it has to be one of the Apple II models that has an available bus for the interface card to slot into. That is if you want to use the commercial software that is available for the sets. Technically you could use the Apple IIc to control the LEGO but you would need to create a serial to parallel adapter and write your own software. If you don't have a real Apple II but you do have the Lego set pieces and the controller board then check out these websites https://lgauge.com/article.php?article=technic/articles/LEGOInterfaceA and https://burf.co/blog/2012/11/24/lego-dacta-interface-a-vb6-control/. They shows you how to hook up to a modern day machine. Alternately, if you wanted a more compact solution you could interface straight into the LEGO controller by using a microcontroller board.


2a. Software - LEGO Lines. 




LEGO Lines is a software package that allows you to setup lines of commands which are then passed through to the controller board in sequence.

The components of LEGO Lines are as follows :-

    [950-035] LEGO Lines Teacher's Pack and Disc (APPLE II) 

Just for reference purposes [1455] is the BBC Micro version, [9536] is the Commodore version and [9537] is the IBM-PC version.
The Commodore 64 version of LEGO Lines software can be found in the Extra Info section below.

Since the Logo based software packages only came out on the Apple II and the IBM PC this software package was mainly used on the other computer systems because they didn't have a competing product.

The 5.25 floppy disk images and the manual can be found here :- https://docs.google.com/open?id=0B5PVarmqxaOnbVVDbmxVSk0xT0U
Only the "Teacher's materials" book is provided as it contains the contents of the "Resources booklet" and the "Classroom materials" plus a whole lot more, including a section on how to talk to the controller using Applesoft BASIC, machine language or LOGO II.


2b. Software - LEGO TC Logo.




LEGO TC Logo (TC stands for "Technic Control") is a cut down version of the LogoWriter software package but with the addition of the right extensions to make it interact with the interface card and ultimately the controller board.

The 5.25 floppy disk image and the manuals can be found here :- https://docs.google.com/open?id=0B5PVarmqxaOnRkRERnN1VUx4cjg

The components of LEGO TC LOGO are as follows :-

    [952] Building cards for set [951-2] ([966] equivalent IBM-PC version)
        [198326] LEGO TC Logo - Teacher's Guide
        [198331] LEGO TC Logo - Reference Guide
        [198327] LEGO TC Logo - Quick Reference Guide
        [198323] LEGO TC Logo - Getting Started
        [198325] LEGO TC Logo - Teaching Turtle
        [198324] LEGO TC Logo - Making Machines

    or when purchase separately

    [9545] LEGO TC Logo Teacher's Pack and Discs (APPLE II)
    [9546] LEGO TC Logo Teacher's Guide (APPLE II)
    [9547] LEGO TC Logo Student Guides (APPLE II)
    [9548] LEGO TC Logo Reference Guide (APPLE II)


2c. Software - LogoWriter Robotics.

LogoWriter is a software package based around the Logo language but it contains a different working environment to other Logo implementations of its time. As well as the Logo interpreter it contains a word processor and allows for better integration of graphics and text. The first version of the software was released in 1986 but it didn't get the LEGO control extensions until the release of the LogoWriter Robotics version in 1988.

The components of Logowriter Robotics are as follows :-

    [907] LOGOWRITER Robotics - Apple IIe/IIGS 5.25" ([909] equivalent IBM-PC version)
    [908] LOGOWRITER Robotics - Apple IIe/IIGS 3.5" ([910] equivalent IBM-PC version)

If any one has the software and/or documentation for this software package then please contact me.


3. Computer interface for Apple IIe/IIGS - [9767] interface card.  



It's the controller board that does all the important work when it comes to controlling the LEGO parts and not the interface card. Instead of building different controller boards for each of the computing platforms, like what fischertechnik did with their competing robotic products, the designers here decided that they would build a universal controller board which was the workhorse of the set then develop a simple adapter for each of the computing platforms. Therefore the interface card is an Input/Output card that acts as an adaptor to the controller board. The beauty of this design is that after all these years it makes the LEGO version so much more obtainable than the fischertechnik alternative.

This card comes up on ebay every now and again but it is usually priced way above for what it actually is (probably because it has LEGO printed on the card and is for an Apple branded computer). If you have purchased the LEGO kit for one of the other computer platforms and can't get the IIe/IIGS interface card version or you just want to build the card yourself then please find the schematic here.



Instructions on how to install the card and test it can be obtained here :- https://docs.google.com/open?id=0B5PVarmqxaOnVl9Qb2NleWQ3QzQ

Just for reference purposes [9771-1] is the IBM-PC version of the interface card. The BBC Micro version was just a cable [9773] and so was the Commodore 64 version [9765].
The Commodore 64 interface cable schematic can be found in the Extra Info section below.


4. Controller board - [70288] or [70455] LEGO Interface A.





The controller board, also known as the Interface A (Interface B being the controller board for the 9V series), contains the model number [70288] or [70455]. [70288] is the older of the two and contains LEDs that have a rounded top. The other contains LEDs that are flat on top and are flush with the casing. You will usually find these in the form of a kit [1093-1] or [9750-1]. These kits include the controller board, power adapter and the connection cable. If you can only get hold of the controller board itself then that's ok. The interface cable is easy to make and its parts are obtainable from any hobby electronics store. The cable is a straight through with 20 pin female sockets at each end.

The power requirements for the newer controller board are very versatile. It can take 7-15V AC or 12-24V DC and so long as it's rated 11VA or higher it will work well. Since the board has a bridge rectifier the plug polarity on a DC power supply will not matter. Note that the power requirements for older controller board are slightly different. I tried running the older controller using a DC supply. The outputs work but the inputs do not. The controller board comes up on ebay every now again. Otherwise there were still a dozen or so available from BrickLink (see section 5b below) last time I checked.

The control and the power circuitry on the controller board are optically isolated. It contains two digital inputs and six outputs (capable of being pulse width modulated) where each group of two outputs can be sacrificed for one bi-directional output. The board uses power transistors to do the switching which allows it to perform speed control of the motors. In contrast to many hobby controller boards and kits of the time which relied on relay technology.

Information on the setup of the Interface A can be found here :- https://docs.google.com/open?id=0B5PVarmqxaOnUW1PTkZ4YXFCQVk

I took the box apart and took a few snap shots of the board.




5a. LEGO parts - electronic.

With the release of these sets, new electronic parts were added to the LEGO brick family, the touch sensor switch and the optical sensor with its rotary encoder wheel.

    Output Parts
        [08010dc01] - Electric, Light Brick 4.5V 2 x 2 with 3 Plug Holes, Trans-Clear Diffuser Lens
        [6216m2] - Electric, 6216m2 - Motor 4.5V Type 2 for 2-prong connectors WITH middle pin

    Input Parts
        [x1167cx1] - Electric Touch Sensor Brick 3 x 2 4.5V Complete
        [x1161cx1] - Electric Light Sensor Brick 3 x 2 4.5V Complete, Optosensor
        [2958pb02] - Technic, Encoder Disk 3 x 3 with 4 Black Sections on One Side and 8 on Reverse Pattern

    Wire
        [766c375] - Electric, Wire 12V / 4.5V with two Variable Color 2-prong connectors, 375 Studs Long (Tip color can be OldGray/Light Gray, Blue, Yellow, Black or Red)
        [766c14] - Electric, Wire 12V / 4.5V with two 2-prong connectors, 11 Studs Long
        [766c96] - Electric, Wire 12V / 4.5V with two 2-prong connectors, 96 Studs Long

Things to be careful of when looking at the LEGO set part lists on websites such as ToysPeriod. I think most of it is correct but so far I have come across some parts that are missing or incorrect in colour or incorrect in part number or have ambiguous part numbers. I will note the discrepancies that I find.

Part "[6216m] - Electric Technic Motor 4.5V" is ambiguous. It could mean "[6216m1] - Motor 4.5V Type 1 for 2-prong connectors WITHOUT middle pin" or "[6216m2] - Motor 4.5V Type 2 for 2-prong connectors WITH middle pin". The wire that comes with the kits is 2-prong with the extra plastic middle pin so the type 2 motor is required. If you have some of the old 2-prong wire without the middle pin then you can use either motor.

The light brick "[08010cc01] - Electric, Light Brick 4.5V 2 x 2 with 2 Plug Holes, Trans-Clear Smooth Lens" is listed as belonging to set [9700] but I don't think that is correct. I used "[08010dc01] - Electric, Light Brick 4.5V 2 x 2 with 3 Plug Holes, Trans-Clear Diffuser Lens" which contains the middle hole and matches the wire plugs that I have.


5b. LEGO parts - non electronic.



The best place to get LEGO parts is to raid the kid's Technic sets. If that fails, then head straight over to BrickLink https://www.bricklink.com/. Do not pass go and do not collect 200 dollars. BrickLink is a community of LEGO enthusiasts and has the biggest LEGO trading market that I have come across. From over two thousand possible vendors it has all the LEGO parts needed to create the Technic Control sets. I'll still look at other sites such as BrickOwl https://www.brickowl.com/ and ebay https://www.ebay.com but I'll use BrickLink as a reference point to see if I can get a bargain. The issue with using the BrickLink marketplace is that it is very cumbersome to use. It's an interface you would expect straight from the 1990s and I can see how it would keep some people away. It is in the process of a redesign but the change over date has not been determined so I was not going to wait. It was well worth the effort in learning how to use the site.

My process of obtaining the set parts went like this :-

First of all I needed a parts list for each of the three sets and the most complete lists I could find were at ToysPeriod https://www.toysperiod.com/. I know now that the ones at BrickLink are more complete but not by much. Putting these lists into a spreadsheet allowed me to remove duplicates between the sets. I also removed the parts I already had and parts that I had suitable replacements for like the minifigures.

The next step was to generate a .bsx file. This file is a structured XML file that is used by several programs when transferring LEGO part lists. I used BrickStore https://www.brickforge.de/software/brickstore/ to generate the .bsx file of my required parts. I chose to set the condition column to "U" for used, otherwise the software that uses this list will only try and match bricks in new condition.

At this stage I could have used BrickLink to determine who had each of my required parts for the best price but each vendor has their own pricing list and each vendor only has a subset of the parts that I needed. What was needed was a way to trawl through the data and work out which parts could be purchased from which vendor at the most cost effective price. BrickLink does not provide this functionality but Brickficiency https://github.com/WindmillHelix/Brickficiency2 does just that. I loaded my .bsx file into Brickficiency and I let it do all the hard work. This software uses the latest vendor price lists from BrickLink (so long as you are web connected) to work out different scenarios based on some starting parameters. This program is not going to give you the correct answer first time around. It takes a while for the program to run (depends on the starting parameters) and it takes a bit of time to get the starting parameters right. My suggestion is to get a super computer to run this on if you can. The output gives you price lists including totals based on the number of selected vendors. The more vendors I selected the cheaper it was in parts but more expensive in postage costs. I factored in $10 to $15 postage per vendor which resulted in a sweet spot of five vendors.

Now that the list of vendors is determined you need to check the vendor information at BrickLink. Some of these vendors may not ship to your destination, some vendors may have a total buy price which exceeds your order price and some vendors may have lot prices which exceed your order price. If that is the case then you will need to add these vendors into what is called the Blacklist in Brickficiency's starting parameters and run the process again.

Once you have done this a few times and have not given up hope then you can go into loading the lists from Brickficiency into BrickLink. Creating a BrickLink WantedList for each list / order will make it easier later than only using the default WantedList. The loading into BrickLink process goes through a verification stage to make sure the part numbers are correct. I got stuck at this stage on a few items due to using the part lists from ToyPeriods. Even though it cost me some time I'm still grateful to those who have spent their time in compiling these lists and making them available. The second process is to create orders, one for each vendor. The process is tedious in itself because you have to match each item in your list to a lot number from the vendor. An item can have multiple lot numbers so you need to pick the best one. Sometimes the vendor has made a mistake and an item in the new condition lot is priced less than the old condition lot. Sweet, you pick the new condition lot. Other times you may find that the lot contains a description that the part is of poor quality or you wanted a quantity of two but you can only purchase the lot in quantities of ten. Also double check your order because the order may be missing parts if that vendor has sold the part in the time it took you to get this far. You may be able to massage your orders around a bit to get around these issues or worst case, which happened to me, is you may have to go back and rerun Brickficiency. These last few steps took me about two weeks, including learning how to use both systems, before I was ready to place an order.

Once the orders were placed it didn't take the vendors long to dispatch the orders and it wasn't long before I received them. I must tell you though that getting used LEGO parts was like getting a box of chocolates, you never knew what you were going to get inside, and it so happened that I did get some chocolate. There was some brown stuff stuck in one of the parts. I can think of some other brown things it could have been so I'm just going to stick with chocolate. Most of the vendors were spot on and most of the used parts were as good as new however one part was broken, a few were past their usable life, some were missing (vendor replaced with different colour or similar parts). Also one of the vendors was a heavy smoker. Out of a thousand parts and only having these few issues I thought was fantastic. At this stage I realised I was missing a few parts due to the initial incomplete list so I had to put in an extra order anyway which gave me a chance to reorder the problem parts. I washed all the used parts and they came up great.

Parts to watch
"[4459] - Technic Pin with Friction Ridges and Slots" should be changed to "[2780]- Technic Pin with Friction Ridges and Slots"
"[367a] - Baseplate 24 x 24" was missing
"[3743] - Technic Gear Rack 1 x 4" should be OldGray/Light Gray and not Black (if you are particular about using the original set colours)




6. Literature.

In terms of building the LEGO contraptions, I was creating freestyle contraptions until I was able to obtain the set's building cards.

    [9873] Building cards for set [9700-1] https://docs.google.com/open?id=0B5PVarmqxaOneUhJQ1BOT2hCVXc
        Set 9700 Activity Card 1 - General
        Set 9700 Activity Card 2 - Traffic Light
        Set 9700 Activity Card 3 - Car
        Set 9700 Activity Card 4 - Car Park Gate
        Set 9700 Activity Card 5 - Conveyor
        Set 9700 Activity Card 6 - Merry-go-round
        Set 9700 Activity Card 7 - Washing Machine
        Set 9700 Activity Card 8 - Turtle
        Set 9700 User Instructions

    [9874] Building cards for set [1090-1] https://docs.google.com/open?id=0B5PVarmqxaOnZ0M3dE8wY1lBdGM
        Set 1090 Activity Card - Parts Tray Organiser
        Set 1090 Activity Card A - Ferris Wheel
        Set 1090 Activity Card B&C - Automatic door, Washing machine
        Set 1090 Activity Card D - Conveyor Belt
        Set 1090 Activity Card E - Robot Arm
        Set 1090 & 1092 User Instructions

    [9875] Building cards for set [1092-1]  https://docs.google.com/open?id=0B5PVarmqxaOnWHZRc3dLMDRHSUU
        Set 1092 Activity Card - Parts Tray Organiser
        Set 1092 Activity Card A - Plotter
        Set 1092 Activity Card B, C&D - Traffic Sign, Scale & Metrics
        Set 1092 Activity Card E - Crane
        Set 1090 & 1092 User Instructions

    [959] Technic Control I Resource Guide https://docs.google.com/open?id=0B5PVarmqxaOnT0ZfQUhpVW84SDA

    [9761] ICC for IBM/Apple Computers (ICC stands for "Ideas for Communication and Control")

There are websites out there containing LEGO building instructions for sets. Great for getting freestyle creation ideas.


    https://www.worldbricks.com/
    https://www.bricklink.com/
    https://lego.brickinstructions.com/
    https://www.toysperiod.com/
    https://service.lego.com/
    https://letsbuilditagain.com/
    https://www.brickfactory.info/


Here is one of my custom builds that I am working on. A single octave keyboard transmits keystrokes by multiplexing the signals through the LEGO controller and the TC Lego program plays the appropriate notes on the Apple II computer. You can see from the photos that not everything has to be a LEGO part. If you can't get the right parts then you can usually substitute by using alternate products.



Other robotic type retro LEGO builds can be found here:-



1. The robot book by Richard Pawson https://docs.google.com/open?id=0B5PVarmqxaOnSE1kT2MzLWZtSkU

2. Make and program your own robots : for the Sinclair Spectrum by William Clark (or the Commodore 64 / Vic 20 version)
Can be downloaded from here https://www.worldofspectrum.org/infoseekid.cgi?id=2000479

3. Atari Robokit http://www.robokit.info/index.html

4. [1038-1] ERBIE the Robo-Car https://docs.google.com/open?id=0B5PVarmqxaOnSl96OHozWDFIZ28

Extra info:

    Update: 15th November 2015. Dutch Version.
    Update: 12th April 2021. English (translated) Version.

    Update: 30th May 2016.
    Here are a few more ports of the commercial software for other computer platforms. I don't have the hardware to test these on so all I can say is "Good Luck".

Conclusion.

I find myself in a position where not only do I have some great sets to play with but I really enjoyed the challenge of putting it all together. It took me back on a nostalgic trip in several different ways. I was able to relive my LEGO days and also experience the time when not every consumer product is handed to you on a platter. Sometimes to get the things you wanted, you needed to work the system out, put bits together or even build it yourself. The road was not always easy but the journey was just as enjoyable as the end result. That is what I love about retro computing.

Enjoy and have fun.

Thank-you very much to everyone who helped out. You have helped in making this a great resource.

34 comments:

Peter Neubauer said...

Thank you for the research and archiving efforts. I'm finding the reference manuals particularly interesting and inspiration for a Logo interface to modern robots.

Brett Leahy said...

My High School found one of these program things and 5 sets with wire, battery box and push buttons in them. the school bought them in 1989 and we havent got any apple II computers just standard Lenovo school coomputers, would we be able (somehow) to still use it for programming or do we have to modify it?

Lukazi said...

Yes you can use it for programming however you would not be able to use the commercial software listed in my blog. Instead you would have to write your own software like in the websites that I listed in "1. Computing platform". You would also need to build an interface between the Lenovo and the LEGO Controller board. One way to do this would be to use a USB to parallel FIFO board.

Leo said...

Do you happen to own any of the listed software (Lines ot TC Logo) for the bbc micro or the pc?

Lukazi said...

Hi Leo,

I do have a LEGO Lines disk image for the BBC Micro and LEGO TC Logo files for the IBM PC. I was meaning to add them to the blog at some stage. I will do so some time this week when I get some spare time.

Cheers,
Alex.

Leo said...

That would be great and very much appreciated! Your blog is so inspirational that made me dig out my old computers from my childhood and started a quest of my own to revive them and bring back those childhood memories. I happen to love Lego as well, so the combination of old computers and Lego is twice the fun :)

Leo said...

I just downloaded the software for the bbc micro from the links you provided and I look forward for my interface to arrive to check it out.
Many thanks again for your help, regards from Cyprus :)

Lukazi said...

Hi Leo,

No problem. Great to see someone using the information from the blog. Good luck with getting your project going.

Cheers,
Alex.

Leo said...

My interface A arrived today. It came with the PC interface (ISA) and the PC cable.
Now I have to find a way to make a BBC cable or find a way to connect the ISA board to my pc which has only PCI card bus. Any ideas?

Lukazi said...

Hi Leo,

For a PC solution, if you want to use the commercial software (LEGO Lines, TC LOGO Logo) then you will need to get an old PC with ISA slots otherwise if you want to write your own software for control then you could use your current PC with a USB to parallel connector or any of the hobby interface boards ie Arduino, Raspberry Pi, FX2LP module etc.
For a BBC Micro solution you will need to make a cable that goes from the Interface A to the User port or Parallel port on your BBC Micro (I don't know which port is required by the commercial software). I was able get the Commodore 64 cable working just by trial and error (I was lucky that my best guess worked first time). I don't have access to a BBC Micro.

Good luck.
Alex.

Ragooman's Hack said...

great webpage !
I'm hooked on using the Lego 9750 computer interface now. This time I will be connecting mine to the C64. I saw the other pic with yours connected to the CBM Pet, that's great ! - everything going thru the User Port.

I see you had an alternate solution for the motor connectors. I wasn't sure what size or spacing that has, 8mm or 10mm. It would seem from looking at mine, it would need 8mm spacing.
Would you still have to the part# for that terminal strip and the pins used inside that ?

I was also looking for replacement motor jacks on the Lego 9750 itself. I supposed finding the original parts for this might be very difficult. But maybe there was an alternate solution for this as well.
thanks !
Dan

Lukazi said...

Hi Dan, Thanks. Yes the Educator 64 (pretty much a C64) uses the User port when working with the commercial software "Logo Lines".
Regarding the alternate motor connectors, I purchased mine from Jaycar (a local electronic store). Here is the link but it doesn't tell you much http://www.jaycar.com.au/plug-socket-12-way-screw-terminal-strip/p/HM3202. Look for "12 way terminal strip" or "12 way terminal block" on google and it should give you some hits. The cables are still pretty easy to get. Just go to http://www.bricklink.com/ type in "4.5v wire" select the picture and hit the "Buy" button to find all the sellers.
Regarding replacing the jacks on the Lego 9750, I think that might be difficult. Buying another 9750 might be a better option. Again "BrickLink" is your friend. Type in 9750, 70288 or 70455 and you should see plenty of hits.
Hope that helps. Good luck. Alex

Leo said...

Hello again. Finally after a couple of months of hard work (summer is the air traffic controllers nightmare ) I had some spare time to work on my 9750 interface and my BBC micro. I managed to build a serial data cable to connect my pc with the bbc micro, and using dfsxfer and dfsmanager I transferred the disc image of Lines to my bbc. Everything is now saved on a 51/4 disc and runs great. The interface is working fine and I even tested some programs on it. The only thing remaining is to find a way to save and load my programs. According to the Apple reference manual , you press Apple key + s but this is not applicable on the BBC. Nevertheless I am enjoying my trip to memory lane and all thanks to your help. Many many THANKS !!!!

Leo said...

I am so lucky ! After finishing my post here , I checked in the web for any available documentation for the BBC interface and found an ebay listing of the 1455 kit which includes the reference manual for the BBC Lines software. The seller included some photos of the book pages and guess what, one of the pages was the one that describes all the shortcuts for the various functions. Below is a list of all the keys together with their functions :

Shift + arrow UP key Go to start of the program
Shift + arrow down key Go to the end of the program
ctrl + f3 Disc directory
ctrl + f4 Boxed display
ctrl + f5 Exit to Basic
ctrl + f6 Clear all program
ctrl + f7 Print program
ctrl + F8 Load program
ctrl + f9 Save program
f8 insert line
f9 clear line

Lukazi said...

Hi Leo, Happy to hear that it has worked out and you are having fun with it. Also thank-you for adding the details here so that it may help someone else in the future. Cheers. Alex.

Ragooman's Hack said...

Alex,
I found another alternative on Mouser and Digikey to make the connectors for these Lego cables.
The come in a single female horizontal molex connector
And so you can arrange them on a 100mil grid on the pcb to build a matching 2 pin connector
Place them in the rear of your project box along the edge of the pcb,
so you can equip it for many more inputs and outputs

http://www.digikey.com/product-detail/en/cinch-connectivity-solutions-johnson/105-1104-001/J578-ND/241123

http://www.mouser.com/ProductDetail/Johnson-Cinch-Connectivity-Solutions/105-1104-001/?qs=mXFFu1Tk4DUOhVNGiM8a1A%3D%3D

Ragooman's Hack said...

Alex,
I'm having problems trying to read the *.do file in the 2nd disk image, Lego TC Logo
I tried reading that with CiderPress and AppleCommander with luck

From the error messages between them, Applecommander mentioned one possible reason might be this is a Protected disk

Did you have any luck trying to read this with any viewer ?
Dan

Ragooman's Hack said...

Alex,
I didn't think of it before
I just tried loading it on AppleWin and it loads fine !!
I used each ][+, ][e and Enhanced ][e modes in the emulator
LinApple is supposed to be a port of AppleWin,
so it should work there too

​I get the splash screen and then pressed enter to get to the main screen

So it must be a Protected disk, right ?
Dan

Lukazi said...

Hi Dan.

Thanks for the info on the connectors. "Lego Technic TC Logo.do" is not Protected in the sense of copy protection. It does have its own operating system so it's not a file based program but a disk based program ie it reads the sectors of the disk directly to obtain the code and data information. It will run as a disk image on most, if not all Apple II emulators (it may have prerequisites like needing 128k but I'm not sure on that). You can use tools such as Omnivore or DiskBrowser to see the assembly code or program data on the disk. If you were good with boot tracing then you may be able to convert it into to a file based system but it may be a lot of work. Since controlling the LEGO contraptions is very much a physical activity I've never needed to run the software in an emulator but instead I've used it to burn a real floppy and used it on a real Apple II.

Cheers,
Alex.

Ragooman's Hack said...

Alex,
I was digging thru those disk images some more,

You know the 1st disk image,
the Lego Lines disk image you have on here
That disk is the BASIC code version of the Lego TC Logo disk
The Lego TC Logo software is just the "flashy" version for the kids

That disk image already has everything we need to code with the Lego 9750
I didn't look closely last night cause we were so busy with that *.do file.

I see that Lego Lines disk image has a complete software toolkit suite, eg. SDK.
With all of the Basic code to do that same exact thing
Plus, there's a pdf on there, the Teacher's manual,
Which also shows how to program everything in Basic .and. Machine code
While using the Apple interface card and how it's memory mapped in the Apple ][

This is great, cause we thought we would have to resort to translating the IBM code
Everything starts on pdf page 138 in that Teachers manual,
How to use that Lego Lines software starts on pdf page 161
The Basic code info starts on pdf page 170
And the Machine code info starts on pdf page 173
Dan

Ragooman's Hack said...

Alex,
just wanted to give you an update.

Have you encountered any strange problems with using the code in Applesoft Basic version. The code that's found in the Teacher's Manual in the Lego Line sip file. It starts page 170 in the pdf.

We could run a single motor just fine and on any output port of the 9750. But, when we try to run multiple motors, such as the 2 motors on our robot. Then one of them always stutters. Its a kind of toggling action, shuts Off and turns On very quickly.

We turned that code upside down and couldn't find a clue yet to why its happening. I would even print all of the variables using VTAB and HTAB. so we can check them as it runs. All we do is write some Main code to read the Joystick Button to activate the motors. When the values get printed, everything looks fine, and we don't see where the code fouls up.

So the code in their subroutines work fine with just one motor but not multiple motors. We follow their steps exactly on how to use the variables and call the subroutines from our Main code.

But we haven't any luck with that code. And we had several people look at it. BTW, months before this we experienced a similar problem with the IBM version and their Basic code.

Then we just resorted to hard-coding the Poke values directly, without using any of the math they use. So if we want to turn On one motor or use 2 motors to make the robot spin around, then we just use a specific value in the Poke statement. And everything works perfectly.
Dan

Ragooman's Hack said...

Alex,
another update
I just noticed something about the subroutines,
They use the same variable to poke and peek the 9750 box ---> DB
There might be some corruption there that's being overlooked
So I'm changing the code now so it will have separate variables for that
Then the Peek will use DR, and then the Poke will use DW
Dan

Lukazi said...

Hi Dan,
Thanks for letting me know your issues. I have not used LEGO under AppleSoft yet however I did have a quick look at the routines and I agree that there doesn't appear to be anything wrong with them. I have used three motors simultaneously (wheels, robot arm up/down and gripper) using LOGO and there was no problem with stuttering. The only problems I had were with timings. LOGO (and I suspect AppleSoft too) is not very good with sub second timing. Also a variable load on the motors caused timing events to change. Both these problems can be easily fixed by using feedback and writing the program in Assembly code.
Cheers,
Alex.

matusik said...

Hi Alex,
i ejoyed your blog as it trasmited me in the 70th as we cooperated with Lego in former Czechoslovakia to use the "interface A" on the own computers called PMD-85 (build arround i8080).
Would say you have investigated the matter very well.
:-)))

As my son found the inteface A and the 1090 in my respository he took it for his boys.
He found also a nice project:
http://wiki.lvl1.org/Lego_Interactive_Interface-A_Driven_via_Arduino
driven by arduino 2560 board.
Will see what he will do with.

Wish a pleasant day
ivan

Ragooman's Hack said...

Alex,
I see in the Lego version of Logo they have several commands, such as, SETPOWER, COUNTER, and others which involves a Timing mechanism. My friend used the Logo software sometimes, besides Applesoft, together with these commands on some of his robot projects.

The SETPOWER command resembles a PWM function for the motor speed control. And the COUNTER command provides a Timing function to keep keep of elapsed time.

I suspect these commands are taking advantage of the Timer inside the 6522 chip on the Lego 9767 card. I wanted to connect my o'scope to IRQ pin.21 on the 6522 to see what's happening.

Have you confirmed this in any way ??

Lukazi said...

Hi Dan,
I have looked at the PWM signals on the output pins of the LEGO Interface A but I have not looked at the IO card in much detail. The SETPOWER instruction in LOGO controls the PWM waveform to the outputs pins (PortB 0 to PortB 5). That is six PWM ports. The 6522 has two 16-bit timers so maybe one timer is being used for time splicing and then the Apple II does the PWM counting.

The COUNTER instruction in LOGO gives you the number of pulses on the input pins since the last RESETC instruction (there are two counters - PortB 6 and PortB 7). PULSEWIDTH returns the time (1/1000ths of a second) between the last two input counts (there are two timers - PortB 6 and PortB 7). I suspect the /IRQ pin.21 is being be used to tell the Apple II that there is an input on PortB 6 or PortB 7. It is also possible that the two 6522 timers are being used for the PULSEWIDTH time. To find out you could decompile the LEGO TC Logo software or use a logic analyser to determine what is being sent to the 6522 chip by the Apple II. Both these options would be a bit of work.

Cheers,
Alex.

Evan K. said...

Hi Alex. I'm the other half of "we" that Ragooman mentioned in earlier comments. I am giving a presentation on the whole Technic Control Center kit and its full context at Kfest next week. Google indicates you gave a similar talk at WoZfest a couple of years ago. (I found your slides at https://www.slideshare.net/roughana/legos-first-programmable-product.) Did anyone ever locate a disk image for LogoWriter Robotics? Ps. For the demo itself, I built (with some coding help from Ragooman and others) a forklift and a V8 motor. The forklift has a tank-like chassis (treads, not wheels) and a standard-looking forklift mechanism (works by using rack-and-pinion method to lift). It's programmed in BASIC. The V8 motor is programmed in Logo and uses the SETPOWER command to accelerate as you move the joystick up. This week I'm adding the optical sensor to show RPMs on the screen. Presumably my presentation will end up on Archive.org and/or YouTube.

Lukazi said...

Hi Evan,
In 2014 I did find a picture of "LogoWriter Robotics" on the applemacintosh.se website in Sweden. You can find it in the WayBackMachine as it is not longer operational. Jason, from http://www.appleiioz.com, and I contacted the guy several times but he did not have a way of copying the software. I spoke to the guy about a year ago when he sold off his LEGO stuff on ebay. Again I tried to obtain a copy but with no luck. I think an IBM copy in French exists on the web somewhere but I don't know of any other copy for the Apple II. The search continues.

I build a relay board for the Apple II (in anticipation for another LEGO show) to demonstrate how you would program the LEGO directly via assembler or basic and how it was done before the commercial packs became available ie before 1986 using relay technology and not using the board with the power transistors. This is a work in progress.

I like the sound of your project and I look forward to watching the KFest video presentation of it when it becomes available.

Cheers,
Alex.

Ragooman's Hack said...

Alex,
Don't mention Assembly programming in front of Evan :)
I've been trying to get him into that for too long, maybe next year.

Some of my old robot projects from the 70s used relays. But then I moved on to the old-school H-bridge circuits using 2N3055 transistors by the end of the 70s. I think because the mosfets were still quite expensive versus the bipolar parts -- for the hobbiest.

One of my personal favorite projects is reviving the old-school robot projects from the 70s. Since a lot of my stuff was cannibalized for spare parts since 40yrs ago. I still have some of my old robot projects from the 80s and 90s, but they too need to get rebuilt.

But this latest project is bring backing some of the vintage construction style and electronics used back then. I'm using a KIM-1 again. Along with the 22/44 pin cards that you used to find at Radio Shack. And a backplane to add more sensor cards and I/O ports. I even still have a set of motors from back then. And of course, it has the characteristic shape of R2D2 since that was big in pop culture then -- but minus the third leg. Sort of like the RB5X. As usual, have to find enough spare change to buy the other parts.
Dan

Unknown said...

Alex here's the video of my Kfest presentation. https://archive.org/details/2017_Kfest_Lego_Programming_for_the_Apple_II_Evan_Koblentz

Lukazi said...

Hi Evan,
Thanks for providing a direct link to your Kfest presentation. I enjoyed it very much. Looks like you had lots of fun with your projects. It's addictive stuff once you get started. I would be interested in seeing the documentation that you were able to obtain that I wasn't unable to source. Happy to include it here in the blog or a link to it once you have permission for its distribution.
Thanks,
Alex.

Leo said...

Hello everyone, it has been a while since my last post but I had to share this link with you. I am sure you will find it very useful in your Lego control journey.
https://archive.org/details/vintagelegorobotics
Stay safe 😃 👍

Anonymous said...

Hi! Could you please give information about, where can i get spares/replacement for the 2 prong cable end? Banana plugs, or keywords that i should use.

Lukazi said...

Have a look at my answer from 10 September 2016. Basically you can buy the 12 way terminal plug blocks which you can cut into pieces or you can still get the original cables from BrickLink. Good luck.