Motorizing the Lego Technic 42075 First Responder, Part 3

In Part 1 of the series, I used the EV3 brick and motors to motorize the Lego Technic 42075 retail set.  While very flexible in programming and remote controlling the vehicle, the EV3 brick takes up the whole truck bed because of its size.

In Part 2 of the series, I used the Power Functions brick and motors.  The smaller sizes of the brick and motors allowed me to retain the truck bed “side doors” and the spotlight attachment.  It also allowed both driver and passenger seats to be retained because the engine motor can be mounted underneath the vehicle, instead of taking up the passenger space.

Using the Power Functions had its limitations.  Infrared is used to control the engine and steering motors, so line of sight is necessary when controlling it remotely.  Additionally, I felt there were too many extra Technic pieces needed to mount the Power Functions brick.  The infrared limitation can be overcome by using an sbrick receiver, an amazing 3rd-party product that communicates via Bluetooth, and can control up to four Power Functions motors.

SBrickPlus

There are other pure-Lego options that are available.  One option is using the Power Functions 2.0 brick and motors.  The PF 2.0 brick is controlled via Bluetooth, and the motors are same in size to the Power Functions motors.  The brick and motors have to be purchased individually, unless you have the 60197 Passenger Train retail set or the 76112 Batmobile retail set.

LegoPowerFunctions2

The Power Functions 2.0 motors are similar to the WeDo 2.0 motors, and the bricks are also similar; just additional mounting extensions on the WeDo 2.0 brick.  Since I have the WeDo 2.0 set, I opted to use mostly extra pieces from that set to motorize the 42075 First Responder.  There are a few additional Technic pieces I used to mount the motors, in the same way I mounted the Power Functions motors.

First step is again clearing off the cabin and truck bed space, in preparation for attaching the brick and motors.  From the re-used pieces, you can prepare the attachment of the spotlight and its beams.  Note again that I interchanged the 3LU-axle with the 5LU-axle because I need the 3LU-axle to attach the engine motor.  The spotlight and beams are offset upwards from the original position by 2LUs.

Lego42075-WeDo2-01 Lego42075-Wedo2-02 Lego42075-WeDo2-03

Although a little more compact, note that the Power Functions 2.0 or the WeDo 2.0 bricks are 4LUs in width so the construct for attaching the brick is asymmetrical (towards the left side of the truck).  Because of the smaller size of the brick, the rear of the truck can stay pretty much the same as the retail set build.

Lego42075-WeDo2-04 Lego42075-WeDo2-05 Lego42075-WeDo2-06 Lego42075-WeDo2-07

Finally, use a few extra Technic pieces to mount the engine motor underneath the vehicle, and the steering motor in the center of the cabin.

Lego42075-WeDo2-08 Lego42075-WeDo2-09

With the WeDo 2.0 brick and motors, you can use or write simple programs (Android program shown here) or use the WeDo 2.0 applications to control the engine and steering.

Posted in Robotics | Tagged , | Leave a comment

Motorizing the Lego Technic 42075 First Responder, Part 2

After my work of motorizing the Lego 42075 with an EV3 brick and EV3 motors, I searched and found similar work with motorizing the same retail set, but using the smaller brick and motors from Lego Power Functions; link here.

I have enough Lego pieces around the house to create a similar build.  And couple with my own goal of minimizing the set of needed extra pieces, trying to re-use as much of the pieces in the Lego 42075 retail set.  Because of the smaller brick and motors, the “side doors” on the truck bed can be retained and used to hide the brick.

First is designing a stable mount of the PF power brick unto the truck bed.  All the pieces shown here are extra pieces that are not part of the 42075 retail set.  Note that I also interchanged the out-of-the-box 3LU-axle (I’m using “LU” as the unit of measurement for the Lego pieces) with the out-of-the-box 5LU-axle, because I need the 3LU-axle to attach the engine motor.

Lego42075-PF-01 Lego42075-PF-02

Next would be to securely attach the rear end of the brick to the rear of the truck, while providing some anchor points for the truck bed side doors.  This is a mix of existing pieces and extra pieces, and builds the attachment all the way to the underside of the truck bed.

Lego42075-PF-03 Lego42075-PF-04

Next are the extra pieces to re-attach the beams that hold the spotlight accessory.  Because of the bulk of the brick taking up space on the truck bed, the spotlight and beams are shifted back by 2LUs and up by 2LUs; it is at least still functional.  Note the front attachment, re-used from existing pieces, that securely attaches to the front cabin to prevent wobbling on the spotlight and beams.

Lego42075-PF-05 Lego42075-PF-06

Then use some extra pieces to place the steering motor in the center of the cabin.

Lego42075-PF-07 Lego42075-PF-08

Finally use a similar set of extra pieces to attach the engine motor.  Thread the motor cable inside the vehicle frame before attaching it.  Because the Power Functions motors are shorter than the EV3 motors, there is enough space at the bottom of the vehicle to place the engine motor (in contrast to having the EV3 motor take the space on the passenger side of the cabin).

Lego42075-PF-09 Lego42075-PF-10 Lego42075-PF-11 Lego42075-PF-12

At the time of assembly, I could not find my Power Functions infrared receiver and remote control, so I was not able to thoroughly test this build.  There is a cavity behind the cabin to place the infrared receiver and attach it to the two motors and the Power Functions brick.  I did not pursue this build any further because of its limitations, and decided towards a different and better build – see Part 3 of this series.

Lego42075-PF-13

Posted in Robotics | Tagged , | Leave a comment

Motorizing the Lego Technic 42075 First Responder

I’m finally getting around to writing about my experience in motorizing the Lego Technic 42075 First Responder.  This is a truck-like vehicle, similar in form to the Lego Technic 8081 Extreme Cruiser, but on a smaller scale.  I’ve previously put an EV3 brick and motors on the 8081 Extreme Cruiser documented here and here. When the smaller 42075 First Responder came out last year (2018), it looked like the space of the truck bed was just enough to put an EV3 brick, and I can surely find some space around the cabin to put the EV3 motors.

Lego42075-Box

One of my goals in motorizing the First Responder is to keep as short as possible the list of Lego pieces that are not part of the First Responder retail set.  Of course, the EV3 brick and two EV3 medium motors are necessary to provide the basic engine and steering control, but there were additional Lego pieces, such as extra gears, needed to completely attach the brick and motors.

Motorizing the set with EV3 required a very minimal set of extra pieces.  There are only the four knob wheels which provide a 1:1 gear ratio with 90-degree directional changes, and an extra axle (shown later below to attach the engine motor).

From the retail build, remove the pieces comprising the canopy and truck bed; these pieces will be re-used in the following steps to attach the brick and motors.

Lego42075-EV3-01 Lego42075-EV3-02

Re-attach one of the gears that will be used for the steering mechanism.  Add the frame extension that will be the base for mounting the engine motor.

Lego42075-EV3-03 Lego42075-EV3-04

Turning the vehicle over, attach the first in the chain of knob wheels by using the extra axle. This attaches to the differential for the rear wheels that comes as part of the retail build.  Also continue building up the frame extension for the engine motor mount.

Lego42075-EV3-05 Lego42075-EV3-06 Lego42075-EV3-07

Complete the chain of knob wheels that ends up under the engine motor mount on the right side (passenger side) of the vehicle.

Lego42075-EV3-08 Lego42075-EV3-09 Lego42075-EV3-10 Lego42075-EV3-11

Rebuild the canopy with the steering motor in the middle interior of the vehicle, lined up to the gears that drive the steering mechanism.  The driver seat from the retail build can be retained.  Mount the EV3 brick upon the truck bed.

Lego42075-EV3-12 Lego42075-EV3-13 Lego42075-EV3-14 Lego42075-EV3-15

Finally, attach the engine motor vertically to the axle that jaunts up on the passenger side.  Additional pieces are used to secure both the steering motor and engine motor.

Lego42075-EV3-16 Lego42075-EV3-17 Lego42075-EV3-18

With the same nodejs program I used with the 8081 Extreme Cruiser for remotely controlling the EV3 brick through Bluetooth, I note that the chain of knob wheels provide a very stable gear train for running the EV3 motors. There is hardly any slippage on the gears.


Posted in Robotics | Tagged , | Leave a comment

Connecting a Parallel Printer to an Apple II (IIgs)

I almost gave up on this project.  It was a project meant to have been a jump-off point for a more ambitious one, but at the rate I end up working on these types of projects, I should probably scale back on my project list.

The Apple II Parallel Interface card (APIC), Apple Product 670-0021, caught my attention a few years ago. It is one of the interface cards that would allow you to connect standard parallel printers to your Apple II/IIgs. It stands out among other parallel interface cards because the cable attached to the card ends in a female DB-25 port instead of a standard 36-pin male Centronics port that connects directly to the printer. That DB-25 port opens up a lot of opportunities for connecting all kinds of peripherals.

Except that… in typical Apple style, the pinout for that DB-25 port, or the 26-pin ribbon connector in the APIC, is arranged in a very… uhm… eccentric way. From what I’ve searched, the only devices that offered this pin arrangement is the APIC and the Apple Lisa parallel port.

If you search for the typical DB-25 connector parallel port pinout offered in the IBM PC and compatibles, there is an almost one-to-one mapping to the 36-pin Centronics port of parallel printers. That DB-25 connector is the IEEE 1284 Type A standard as described here. At the very least, the data pins are in a contiguous arrangement. Pins 2-9 on both the DB-25 and the Centronics connector are the data pins. With the APIC, the following photo shows the arrangement as documented in the manual:

APIC DB-25 Pinout

That insane arrangement was enough for me to temporarily shelve my project for years. Then in 2013, David Schmenk used the APIC for a similar project. He probably wondered about that same peculiar DB-25 pin arrangement on the APIC, and went further to document the necessary mapping monstrosity to hook it up to a QuickCam camera.  I just wanted to hook the APIC up to a parallel printer.

Towards my goal, I dug up the only remaining parallel printer I have in storage. It’s an HP DeskJet 340, a portable printer that originally sold in the `90s for $300. I also had the standard DB-25 to Centronics cable that I used to connect the printer to old PCs.

For those who want to connect the APIC to the parallel printer seamlessly, the standard DB-25 to Centronics cable is not suitable.  Instead, look for a cable that matches Apple Product 590-0042 which compensates for the APIC pin arrangement.  If you want to build your own cable, the mapping is documented in the Apple Peripheral Interface Guide:

AppleProduct-Cable-590-0042

I took the challenge of building my own adapter, even though my soldering skills are way lower than that of David’s. When I paid a visit to Fry’s, I saw this useful RS-232 wiring adapter for adjusting the wiring connections of an RS-232 DB-25 cable:

RS-232 Wiring Adapter

I started to re-map the pins, only to find out that the adapter does not allow re-mapping of Pin 1. In RS-232 connections, pin 1 is always connected to GND.  I really needed Pin 1 because that pin is used for the STROBE signal to the printer. I could have played around with some gender changers, but that would tie Pin 13 to GND which I might need for bidirectional data transfer (Pin 13 is the SELECT line for the parallel connection which is needed for Nibble mode data transfer). I gave up on the adapter, and proceeded with the following embarrassment:

APIC Wiring  APIC DIP Switches 

APIC Pin # Name IEEE 1284 Pin #
2 Signal Ground 18
4 Signal Ground 19
5 Data Out, Bit 0 2
6 Data Out, Bit 1 3
8 Data Out, Bit 2 4
11 Data Out, Bit 5 7
12 Data Out, Bit 6 8
13 Data Out, Bit 7 9
15 Strobe Out 1
16 Acknowledge In 10
20 Signal Ground 20
22 Data Out, Bit 3 5
23 Data Out, Bit 4 6
24 Signal Ground 21

To test the cable, I installed the Harmonie DeskJet printer drivers, installed the GS/OS Teach application, and typed a short sentence. The printouts turned out well. There was an initial run (first sheet) that indicated one of the pins probably being disconnected and always getting a bit value of 1 on the lowest data pin — double checking and tightening the wiring fixed that problem.

Apple IIgs Harmonie  APIC Printouts

The follow-up project that I have in mind is to write software drivers that make use of the Nibble data transfer mode.  This would be similar to David Schmenk’s code for reading image data from the QuickCam camera.  It would make use of the BUSY, PAPER OUT, SELECT, and ERROR signal lines connected to four of the APIC Data In lines.  The data rate limit for Nibble mode is around 100kbps.  Ultimately, it may be enough to use the APIC as a cheap interface card for mass storage devices like the Iomega Zip Drive, whose block transfer protocol is widely documented in the Linux drivers repository (see the PPA3 driver here).

Posted in Retrocomputing | Tagged , , | Leave a comment

Apple IIgs Case Mod

Ever since a tiny little power adapter for the Apple IIgs was made available by James Littlejohn, I’ve always wanted to see what I can put into that cavernous space created by the absence of the old power supply.

The old Apple IIgs power supply takes roughly 1/5 of the internal space of the IIgs case.  In 2007, a tiny 2.5” x 2.5” power adapter called the LittlePower adapter was made available to allow a standard ATX power supply to be used.  I bought my LittlePower Adapter IIgs from ReactiveMicro at that time.  I think it’s now known as the LittlePower Flip and is sold at UltimateApple2.  Combined with the similarly tiny ATX Pico power supply from mini-box, it frees up a lot of space inside the case.

A plan for putting a standard 5 1/4” peripheral in there materialized and stayed in my workbench waiting to be allocated some time.  A recent long weekend gave me that time to grab some tools and start hacking at the case.

AppleIIgsCaseMod-2     AppleIIgsCaseMod-3

I’m not a professional case modder and it shows.  I was experimenting with the attachments on my rotary tool and the mistakes are evident in the top side of the hole.  This was more a proof-of-concept than anything else.

It now allowed me to use my Apple II High Speed SCSI Card to connect both an internal solid state drive (scsi2sd from Michael McMaster) and a SCSI CD-ROM device.  Remember to set the booting drive with a higher ID in the SCSI chain.

AppleIIgsCaseMod-1     AppleIIgsCaseMod-4

Internally, with the 5 1/4” device in there, you would lose the use of Slots 1 and 2.  I was able to squeeze the scsi2sd solid state drive towards the rear of the case, and the IDC cable runs underneath the device into the SCSI card on Slot 7.

AppleIIgsCaseMod-6     AppleIIgsCaseMod-7

I probably violated a dozen of best practices to electronically isolate components from each other.  I didn’t even use cardboard shielding between some cards in the slots.  So please, if you want to do this mod, do it right and take the necessary precautions.

To keep the 5 1/4” device somewhat steady in place, I attached a mounting plate underneath the device.  These mounting plates are the same ones used for these devices in older Macintoshes, particularly the LC series.  You can still readily buy them as spare parts.  I drilled a couple of slits in the mounting plate with a rotary tool.  The slits are positioned in such a way to mate with the two plastic standoffs from the bottom of the case that were formerly used to keep the old power supply in place.

AppleIIgsCaseMod-8     AppleIIgsCaseMod-9

Using the CD-ROM was frankly just the proof-of-concept.  Since I rarely use a CD with my IIgs, it would be more appropriate to use an external SCSI CD-ROM device.  I will probably replace it with the SCSI floptical drive I used in an older post.  Or even with one of those SCSI-PCMCIA devices having the 3 1/2” form factor and having the PCMCIA/CF/SD slots in front for easy access.

UPDATE 11/8/2016:

As originally planned, the SCSI CD-ROM will be rarely used.  Instead, I first tried with a SCSI floptical drive and was able to mount 1.44 MB MSDOS disks.  The GS/OS MSDOS FST driver only has read capability, so I can transfer files into, but not out from, my Apple IIgs.  The drive is also an MFM-encoding drive, and cannot read the GCR-encoding 800 KB disks used with the standard IIgs external disk drives.

AppleIIgsCaseMod2-1     AppleIIgsCaseMod2-2

I suppose I could reformat a diskette as a 1.44 MB ProDos read/write block device, which should make it look like a very small-capacity hard disk.  However, I eventually settled for one of those SCSI-CF devices where I could use higher-capacity cards to transfer files in and out.  The SCM Microsystems PCD-50B provides multiple card readers in a 3.5” form factor.  With the standard adapter bracket and faceplate, it substituted into the 5.25” opening.  The only issue with this model is that the multiple card readers are addressed using multiple LUNs with a single SCSI ID.  I think the Apple II High Speed SCSI card firmware (or driver) only makes use of LUN #0, which is the PCMCIA slot.  In order to use CF or SD cards, I had to put them in one of those PCMCIA-CF-SD adapters.

AppleIIgsCaseMod2-3     AppleIIgsCaseMod2-4

Posted in Retrocomputing | Tagged , | 5 Comments

Remote Controlled EV3 Robot with Dual Gyro Sensors

I’m in the middle of another project involving the LEGO EV3 system.  My 11-year old has been making some inquiries about the gyro sensor that came with the EV3 Education kit.  To make the lesson more interesting, I wrote a simple EV3 project to illustrate the use of the gyro sensors, and as a bonus, also to illustrate the use of Bluetooth messaging.

The most common EV3 robot design we have used is the two-wheeled robot.  The two wheels are controlled by independent motors, and can therefore be used to move the robot forward/backward, as well as steer the robot left/right by varying the speed (and rotational direction) applied to the two motors.

The project is to remote control this kind of EV3 robot to move forward/backward and to steer left/right.  Instead of a joystick-like remote control, I want the controller to use gyro sensors, in the same way some smartphones use similar sensors to determine the phone orientation.  Such a controller can technically be attached to an arm, and the movement of the arm controls the robot, making it a hands-free experience.

A hands-free controller like this can accomodate three separate axis of rotations.  Some of you may be familiar with the concepts of pitch, roll, and yaw, such as those used in joysticks that control airplane movement.  For our EV3 robot to move forward/backward and left/right, we only need two axis of rotations.  I used pitch and roll in my simple controller design because those two concepts naturally fit the intended movements of the robot.

The controller is really very simple, with the two gyro sensors on port 2 and 3 of the EV3 brick, attached with a few hassenpins.

EV3-RemoteControlSender

The core part of the controller program merely measures, in degrees, the pitch and the roll of the controller and sends them out as Bluetooth messages to another EV3 brick.

image

The complete controller program has a few more steps added for robustness, debugging, and a mechanism to reset the gyro sensors because of accumulated errors caused by sensor drift.  It is still a relatively small program.

EV3-RemoteControlSender-Program

The receiving program in the EV3 robot is also simple.  The core part of the program receives the pitch and roll values, applies gain factors to both of them (to translate the pitch and roll degrees to values that can be applied to an EV3 move and steering block), and sets the parameters for the move and steering block that controls the robot wheels.

 image

The complete receiver program also just has a a few additional steps, mainly to limit the resulting values to fall within –100 to 100, which are the values that can be fed into the move steering block.

EV3-RemoteControlReceiver-Program

Here’s what a sample run of the two programs look like:

Posted in Robotics | Tagged , | Leave a comment

Putting an EV3 into a Lego Technic Cruiser, Part 2

Continuing from my previous post, I was ready to put in a second EV3 motor and drive train for the rear wheels of the cruiser.

The Mindstorms EV3 retail set comes with two large motors and one medium motor.  Conventionally, the two large motors are used to drive the wheels of an EV3 robot, using two-wheeled turning (where the wheels along the same axis are rotated in opposing directions to turn the robot left or right).  The medium motor is conventionally used for peripheral movements, such as moving a robot arm up and down.

Note that two-wheeled turning is not typically used in standard vehicles.  In a standard vehicle, the engine drives one axis, either front-wheel or rear-wheel driving, and the steering wheel is used to turn the front wheels left or right.  Most Lego Technic sets, aside from the robot sets, are patterned after a standard vehicle.

I’ve already put the EV3 medium motor as the steering motor for my modified cruiser.  Now I’m trying to find a position for an EV3 large motor to drive the gear that is exposed underneath the dashboard.  These are some of the positions I’ve explored:

LegoCruiser-P2-1  LegoCruiser-P2-2  LegoCruiser-P2-3

That large motor sure takes up a lot of space.  The first two configurations put the motor axis at the front, under the hood, and I would need to have a gear train going backward to the gear under the dashboard.  However, the big part of the motor takes up a lot of space inside the cruiser cabin.

I really wanted to leave some space inside the cabin for future expansion, like a toy figure, a camera, or an Arduino.  So I initially settled for that third configuration, where the motor axis is inside the cabin and have a shorter gear train going towards the gear under the dashboard.  The big part of the motor does take up the whole front and precludes me from putting the hood back onto the cruiser. I also had to borrow a large gear from the EV3 set as part of the gear train.

LegoCruiser-P2-4

Even with that third configuration option properly set up, I felt that the 90-degree angle in the gear train was a weakness.  I tried spinning the motor axis manually to see how it runs, and the gears would often slip at that 90-degree angle.

I was in a bind.  None of the configurations seemed to work out.  Because I wanted the gear train to be stronger, the only other possible solution is to place the motor horizontally inside the cabin.  It would take up the whole cabin space, but the motor axis would fall directly above the gear under the dashboard and there would be no angles in the gear train.

I gave up for the day and noodled over it for a couple of weeks.  One day afterwards, I had a conversation with Claire about the difficulty I’m having with the modified cruiser.  I showed her the different configurations I’ve been trying with the motor and the unsuitability of each of those configurations.  After looking at it for a few seconds, she casually suggested, “Dad, just use another EV3 medium motor.”

o_O

I had been so caught up with trying to fit that EV3 large motor to drive the cruiser, that I never even thought of testing out a different piece.  The EV3 medium motor is not as powerful as the large motor, but after running some tests, we found that it was still enough to drive the cruiser.  Back last summer, when I purchased the EV3 set, I was so hooked into EV3 so that I also purchased additional pieces, additional sensors, and an additional medium motor.  I did have a second EV3 medium motor to use.

Going back to look at the engine space where I can place the second medium motor, I looked for mount points where I can attach the motor.  There is the gray frame at the bottom, there are the black horizontal beams running front to back on each side, and there are a couple of red connector pins at the front.

LegoCruiser-P2-5

One of my goals with this project was to “borrow” as few pieces as possible from other Lego sets.  If I can complete this by utilizing just the Lego Cruiser pieces, plus the EV3 brick and motors, then it would be easier for others to do the same.  I had some leftover pieces from the right angle gear train that I removed, some pieces from the passenger chair, some pieces from the V4 engine, and some pieces from the cruiser rear that I could reorganize.  With all those pieces, I came up with a construct that would rival that of a Star Wars vehicle.

LegoCruiser-P2-6  LegoCruiser-P2-7  LegoCruiser-P2-8

Since these are just leftover pieces, the construct is asymmetrical.  I think I also included too many mount points: four mounts to the bottom frame, two or three mounts to the horizontal beams, and an axle mount to one of the red connector pins.  It came out really stable, but I could have saved more pieces by reducing the number of places where I mounted the motor.  Assembling the construct is pictured as follows:

LegoCruiser-P3-1  LegoCruiser-P3-2  LegoCruiser-P3-3  LegoCruiser-P3-4  LegoCruiser-P3-5  LegoCruiser-P3-6  LegoCruiser-P3-7  LegoCruiser-P3-8  LegoCruiser-P3-9

Attaching this construct into the engine cavity of the cruiser is a little difficult.  It would have been easier to attach it while early in the process of building the cruiser frame.  The number of mount points I used also added a bit to the difficulty.

Once I got the motor in there, the rest is just attaching the decorative parts of the cruiser:  the steering wheel, the driver chair, the hood, the side doors, and the modified rear panel.  There was one beam and a few small pieces left, but I am surely glad I was able to rebuild the cruiser with its own set of pieces.

LegoCruiser-P4-1  LegoCruiser-P4-2  LegoCruiser-P4-3  LegoCruiser-P4-4  LegoCruiser-P4-5  LegoCruiser-P4-6

The drive motor is attached to Port C of the EV3 brick, and the steering motor is attached to Port D.  The USB port used to download a program to the brick is still accessible.  Using the Bluetooth connection is preferable since you don’t have to fiddle with wires nor need to run the program using the buttons on the EV3 brick.  Here’s a link to a video showing the autonomous cruiser running a short EV3 program:

https://www.youtube.com/watch?v=p-XC_OytYgE

In the test runs, I noticed that the 3-gear straight gear train that drives the rear wheels would occasionally slip.  I may have underestimated the weight that the EV3 brick puts on the cruiser and the increased torque requirements to move the cruiser forward.  I don’t think a stronger motor is needed, so I just lowered the speed of the motor to reduce the gear slippage.

Posted in Technology | Tagged , | Leave a comment

Putting an EV3 into a Lego Technic Cruiser

This is the first of few posts about my project in getting an EV3 brick into one of the Lego Technic retail sets.

I’ve always had a Lego Mindstorms robot kit ever since Lego came out with the NXT.  Though I’ve played with Lego bricks since I was a kid, it was only with the NXT that I became interested with these Technic sets.  And I was hooked.  I even purchased the older Mindstorms Robotics Invention System right after I got the Mindstorms NXT.

I have been following the Mindstorms EV3 since Lego announced and showed it at CES 2013.  After months of deciding between the education set and the retail set, I eventually bought the latter last summer (although I’m still keeping an eye for a good deal on the education set).

The EV3 was a radical evolution.  The memory capacity was greatly increased that you don’t have to worry about running out of space for the programs you download to the brick.  The now Linux-based system opens up a lot of possibilities.  Even the motors and sensors were significantly improved.

I’m always on the lookout for things where I can embed the EV3 brick, motors, and sensors.  This time I thought of looking into one of the existing Lego Technic sets.  My initial candidates were the Lego 8070 Supercar and the Lego 8081 Extreme Cruiser.  Both of them are retired sets, and there are other current sets that can possibly substitute, but the 8081 Extreme Cruiser attracted me because it really looks like it was made to be modified the way I was planning to.

I started out with assembling the cruiser, but excluding the parts that are purely decorative.  I call these excluded parts “fluff” because they are not part of the structural or functional aspects of the set.  As I expected, the V4 engine is purely fluff.  I was partly surprised that the steering wheel is fluff and not used to steer the front wheels.  I left alone the suspension system and the differential mechanism for the rear wheels.

LegoCruiser-1  LegoCruiser-2

The wheel/gear at the roof is used to manually steer the front wheels.  The next step is to replace this manual steering mechanism with an EV3 motor.  I removed the gear system with the 90-degree angle rotation and that left a cavity at the bottom almost enough to squeeze in the EV3 medium motor; I eventually had to remove one of the straight horizontal beams in order to snugly fit the motor.  I sacrificed the first of two front seats for the parts needed to attach the motor.  Note that it really helps if you temporarily detach the wheels while you’re working with the vehicle structure.

LegoCruiser-3  LegoCruiser-4  LegoCruiser-5  LegoCruiser-6

Next comes the part of finding the place to put the EV3 brick into.  It’s too bulky to put it in front in place of the V4 engine.  The rear part of the cruiser has a very nice enclosure where the EV3 brick can be inserted into.  I repositioned the couple of angled beams that block the full brick from being inserted.  With that, the brick can be inserted further and its weight is better supported by the vehicle structure.  It was even able to accommodate the brick with a rechargeable battery – the rechargeable battery option adds one unit of measure to the height of the brick.

LegoCruiser-7  LegoCruiser-8  LegoCruiser-9

At this point, the only major piece remaining to be attached is the EV3 motor that will drive the rear wheels.  The Extreme Cruiser set actually exposes the rear wheel drive with a single gear right underneath where the dashboard would be.  The set comes with nothing to turn that single gear, except maybe by reaching in with a finger.  The gear is actually just used to drive the decorative movement of the V4 engine.  However, it was strategically placed so that it can easily be driven by adding a gear train and a motor.

Positioning this gear train and second EV3 motor brought some complications.  More on that, and the solution suggested by my kid, on my next post.

Posted in Technology | Tagged , | Leave a comment

Getting the kid started with Lego Technic and Mindstorms

Last summer, I started to teach my kid about building with Lego Technic, particularly using the EV3 Mindstorms set.  Though she had been building with non-technic Lego bricks for years now, the Technic pieces involve a different mindset, dealing more with beams and pins rather than bricks and studs.

One of the original constructs from Claire is this dog head that we attached to a mini robot we built from one of the Lego books we have:

LegoEV3DogHead

The robot was from Yoshihito Isagawa’s Lego Mindstorms EV3 Idea Book, but the head was Claire’s original design.

Posted in Technology | Tagged , | Leave a comment

Creating an Apple IIgs GS/OS Live CD

The Apple II High-Speed SCSI card is one of my favorite peripheral cards for the Apple IIgs.  I typically install System 6.0.1 into a SCSI hard drive and use that as my boot and mass-storage drive.  Any old “SCSI” hard drive should work, but what I use is the scsi2sd adapter that allows me to emulate the SCSI drive with a microSD card.  It additionally allows me to make a raw backup of the drive contents using any disk imaging tool on a machine that has a slot for SD/microSD (I use the standard dd utility).  With CiderPress, I can even import files into the microSD card.  Files that I later read from within the GS/OS environment.

GS/OS can either boot from a drive containing a raw ProDos file system (maximum size is 65535 blocks, each block being 512 bytes, a little less than 32 MiB in total size) or, with the SCSI card, from a partitioned drive with a ProDos partition (the partition having the same size limits).  For a partitioned drive, it has to be using the Apple Partition Map (APM) style of partitioning, and not the more common MBR or GPT partitioning.  The APM partitioning style was standard with older Macs, those that were before Intel-based Macs came about.

If you treat the CD as a regular block device and lay out the blocks like that of a hard drive, partitioned with APM style partitioning, then GS/OS can be booted from that CD.  Of course, with just APM style partitioning, the CD will not have the ISO9660 file system and will not be natively mountable in systems that do not understand APM-partitioned block devices.  These types of GS/OS-bootable CDs were evident in some popular CDs distributed around that time.  Examples are the Golden Orchard CD and the early Developer CDs made by Apple (like the Phil and Dave’s Excellent CD).

Below are the steps I followed to create a GS/OS-bootable CD.  This is just one of many ways that it can be done; I was just trying to use the simplest, and free, method on a Windows machine.

Third-party utilities.

If you haven’t done so already, download CiderPress.  This used to cost a few dollars, but Andy McFadden has since made it free and open-source.  This utility will let you work with ProDos and HFS file systems, with either raw file systems or an APM-style partitioned drive, and with either a real block device or an image of a block device.

Another utility I used is a drive image overlay/extraction utility.  There is either the Windows port of dd, or the Windows port of busybox (that includes dd as one of the commands).

Another utility I used is a Windows port of mkisofs.  I used this to initially create the APM partition map.  There are other options available to do this, including 1) using pdisk on an OS X machine, 2) using the commercial TransMac software, 3) using a combination of VirtualBox and GParted, or 4) waiting for Andy to include this feature in CiderPress (I saw that it is one of the requested features).

Finally, a hex/binary editor is always useful.  I use HxD because it’s simple and free.

Creating the bootable ProDos file system.

GS/OS needs to be installed into a ProDos file system somehow.  CiderPress easily lets you create an empty 32 MiB ProDos disk image – you then assign the disk image in an Apple IIgs emulator like KEGS/gsport and follow the standard GS/OS hard drive installation process.  Or you could download some pre-built bootable 32 MiB ProDos disk images around the net.  Check out Alex Lee’s What Is The Apple IIGS site.  I will use a ProDos file system image (e.g., P1_BOOT.PO) as the first, and sometimes only, partition in my APM-style partitioned disk image.

Creating the partitioned disk image.

I create a folder containing my file system images (e.g., P1_BOOT.PO, P2_APPS.PO, P3_HFS.PO, etc.) and run mkisofs:

mkisofs.exe -hfs -part -no-desktop -o CD.iso C:\FileSystemImagesFolder

This creates a hybrid ISO9660/HFS CD.  A hybrid CD is one where the CD files can be accessed using both the ISO9660 file system and the HFS file system, with only a single copy of the file data somewhere on the CD.  The files here, of course, are the file system images P1_BOOT.PO, P2_APPS.PO, and P3_HFS.PO; not the individual files within the the file system images.

If you plan to put more than one file system image in the CD, my example makes use of 32 MiB (65535 blocks) file system images so that using the hex/binary editor to modify the partition map will later be easier.

The partition map that mkisofs creates contains two entries only – an entry for the partition map itself, and another for the hybrid HFS file system.  The partition map starts at offset 512 (0x200) of the disc image and each entry is 512 bytes in length.

image  image

Replacing the partition map entries.

If I only had one file system image to put on the CD (e.g., P1_BOOT.PO), then that file system image will be positioned at offset 0xC000 (block 0x60) of the CD image.  We can replace the second partition map entry with the following pre-made 512-byte file:

image

busybox.exe dd bs=1 count=512 if=PRODOS1_65535.PME of=CD.iso seek=1024 conv=notrunc

What ends up is that we keep the CD ISO9660 file system, but we replace the hybrid HFS file system entry in the partition map with the ProDos partition map entry.

If I wanted to put more than one file system image on the CD, I need to enumerate the partition map entries at 512-byte intervals, then I need to edit each partition map entry to reflect the number of partitions and the offset of each partition in the CD.

For example, suppose I also wanted to make the second P2_APPS.PO (65535 blocks) and P3_HFS.PO (65535 blocks) file systems visible in GS/OS:

busybox.exe dd bs=1 count=512 if=PRODOS1_65535.PME of=CD.iso seek=1536 conv=notrunc

busybox.exe dd bs=1 count=512 if=HFS_65535.PME of=CD.iso seek=2048 conv=notrunc

Then edit the disc image to specify the correct count and location of the file system images:

image  image

image  image

Burn the CD image.

The final step is to burn the CD image into a real CD-R.  On Windows, I use ISO Recorder, but any raw-disc-image burning application should work.  For such a small CD image, I sometimes use the smaller 185 MB pocket-sized CD-R discs.  If you have the scsi2sd or other mass-storage devices (e.g., MO drive, SCSI-IDE bridge), you can actually dump the same CD image into those devices.

IMAG1469

Boot the CD from a SCSI CD-ROM drive.

Put the CD into a SCSI CD-ROM drive, attach the drive to the SCSI chain, and boot from the CD.  Remember that the Apple IIgs boots off from the SCSI device with the highest SCSI device ID, and that an unmodified Apple High-Speed SCSI card does not provide termination power to the SCSI bus.  Either mod the card or have another device provide termination power.

Here are some screenshots of one of my Apple IIgs booted from a CD with two file system images (the bootable ProDos file system image and one additional HFS file system image).  Note the block devices are locked/readonly.

IMAG1524  IMAG1525

Caveat with all the above – it should be obvious that because this is a CD, the drive is read-only.  Applications that attempt to write data back to the drive may or may not fail, but will surely lose that data because it is not persisted.

Files.

Posted in Retrocomputing | Tagged | 1 Comment