Faller Octopussy - Homemade Control Box Project
Why do I want to build a new Octopussy Control Box?
The Control Box supplied with the Octopussy model powers the motor at standard speed for about 90 seconds, after which, the motor is slowed down. The motor continues to run at this slow speed, for about another 30 seconds, until a reed switch (inside the gear box) is activated by a magnet attached to a rotating gear. At this point the motor stops.
On my model, the motor slows down several revolutions too soon - the cars are still rising and falling. I would prefer it if the motor would run at standard speed for a little longer and only slow down once all the cars have descended to ground level.
Like the Indiago Control Box, I will use a programmable Picaxe chip to control the motor. Software will be used to vary the speed of the motor by means of pulse width modulation (PWM) - basically, switching the motor on and off very quickly, and varying the on/off times.
However, unlike the Indiago model, the motor controlling the Octopussy is a DC motor, so I won't have to bother having two power sources. I should be able to power the motor, chip and circuit using the same power source.
Phase 1 - Prototyping
The first task was to create a prototype circuit that would power the motor and detect when the reed switch has been activated.

And this is the flow diagram of the above circuit:

Phase 2 - Software
After measuring the voltages output by Faller's Octopussy Control Box at the motor terminals during one run of the ride, the first task was to try to reproduce these voltages using my prototype circuit.
Using the book Programming and Customizing the Picaxe Mircocontroller as a guide, I started to produce a table of the measured voltages at the motor, when different pulse lengths were sent to the transistors. It quickly became apparent that the most useful range of values was produced when the transistors were switched on for 1ms and off for 1 - 15 ms.
With this information, it then became a case of trial and error to produce code that would start the motor slowly, bring it up to standard speed, continue at this speed for the required length of time, before slowing down and then stopping the motor when the reed switch was activated.
The most pleasing results were produced with the following code:
symbol inner = b0 symbol outer = b1 symbol offperiod = b2 symbol onperiod = b3 ride: gosub findstart gosub startup gosub mainride gosub slowdown gosub endride pause 10000 goto ride end findstart: let onperiod = 1 let offperiod = 4 do while pin2 = 0 high 0 pause onperiod low 0 pause offperiod loop pause 5000 return startup: let onperiod = 1 for outer = 1 to 15 for inner = 1 to 70 high 0 pause onperiod low 0 let offperiod = 15 - outer pause offperiod next inner next outer return mainride: let onperiod = 1 let offperiod = 1 for outer = 1 to 110 for inner = 1 to 200 high 0 pause onperiod low 0 pause offperiod next inner next outer return slowdown: for outer = 1 to 7 for inner = 1 to 90 high 0 pause onperiod low 0 let offperiod = outer pause offperiod next inner next outer return endride: let onperiod = 1 let offperiod = 7 do while pin2 = 0 high 0 pause onperiod low 0 pause offperiod loop for outer = 8 to 15 for inner = 1 to 20 high 0 pause onperiod low 0 let offperiod = outer pause offperiod next inner next outer return |
; COMMENTS
;
;
;
;ride:
; The 'ride' consists of performing the
; following subroutines in a neverending
; loop, with a 10 second pause at the end
; of each loop.
;
;
;
;
;
;findstart:
; This subroutine checks to make sure
; that the model is in the 'start'
; position, i.e. the magnet inside the gear
; box should be facing the reed switch.
; If not, the motor runs at slow speed
; ('on' for 1ms & 'off' for 4ms) until the
; magnet triggers the reed switch (pin2 = 1).
;
;
;
;
;startup:
; This subroutine causes the ride to start.
; Initially, the motor is switched 'on' (high 0)
; for 1ms and 'off' (low 0) for 14ms. After
; every 70 pulses, the 'off' period is reduced
; by 1ms, causing the motor to increase in speed.
; After a few seconds, standard ride speed is
; achieved.
;
;
;
;
;mainride:
; The motor runs at a constant speed.
;
;
;
;
; The motor is switched on (high 0)
; The subroutine pauses for 1ms (pause onperiod)
; The motor is switched off (low 0)
; The subroutine pauses for 1ms (pause offperiod)
;
;
;
;slowdown:
; This subroutine causes the motor to slow down
; (but not stop) by slowly increasing the
; motor's 'off' time.
;
;
;
;
;
;
;
;
;endride:
; This subroutine keeps the motor turning
; slowly (1ms 'on' / 7ms 'off') until the
; reed switch is triggered (pin2 = 1).
; At this point, the motor is slowed down
; further, until it stops.
;
;
;
;
;
;
;
;
;
;
;
;
;
|

| Key | Component | Value | Purpose (as I understand it) |
| C3 / D4 | Capacitor / Diode | 100nF / 1N4001 | To reduce high-frequency interference and absorb back emf. |
| T2 / T4 | Transistor | BC337 | To amplify the small current from the chip sufficiently to drive the 220mA motor. |
| BR1 | Bridge Rectifier | W02M | Used here to allow DC connection pin to be positive or negative. |
| R2 / R3 | Resistor | 1k / 10k | Used to divert a small current to an input pin when the reed switch is closed. |
| R4 | Resistor | 10k | Restrict current flow through chip to the transistors. |
| R5 / R6 / R7 | Resistor | 4k7 / 10k / 20k | Recommended connections / values by Picaxe |
| U2 | Voltage Regulator | L7805CV | Converts input DC (in this case 9vDC) to 5vDC. |
| C1 / C2 | Capacitor | 100nF / 100uF | Smoothes the DC output from the Voltage Regulator |



Video@YouTube