Rennlist Discussion Forums   membership | rennlist | gallery    
sponsors | chat | upload photo | classifieds  


Go Back   Rennlist Discussion Forums > Air/Oil Cooled Technical Discussion Areas > 993 Forum
Welcome, mojorizing.
You last visited: Today at 08:19 PM
Private Messages: 0 Unread, Total 59.
User CP FAQ Calendar New Posts Quick Links Log Out


This Rennlist Forum is sponsored by       your online Performance source.
Reply
Thread Tools Search this Thread Rate Thread Display Modes
Old Today, 04:12 PM   #1
cowtown
Addict
Rennlist Member
 
cowtown's Avatar
 
Join Date: Nov 2003
Posts: 372
Default How to: build a programmable spoiler control module for your 993

Hi guys,
Several people asked for information on building the spoiler module I posted earlier here: http://forums.rennlist.com/rennforu...ad.php?t=322313

I've decided not to follow up on this project with any sort of group buy/build/etc. and am releasing this into the public domain so hopefully some other 993 owners get some use out of it. It was a fun and challanging project to figure out how to built this. I've posted the identical thing to the "DIY" section.

Colin

------------------------------

The 993 spoiler control module is a fairly simple device that takes the VSS (vehicle speed sensor) input, counts the number of pulses over a given period of time, then uses that speed information to raise or lower the rear spoiler. The problem with USA cars is that the spoiler raises at about 50 mph, then goes back down at 3-4 mph. On many US roads, this leads to constant up-down-up-down behavior, which wears things out and just looks goofy.

This circuit completely replaces the control box, which is located under the passenger-side dash. It is totally programmable, meaning you can set the spoiler-up speed, spoiler-down speed, and you can give it some "intelligence" limited only by your ability to write BASIC code. The sample code I've provided contains a delay so that the car much reach the trigger speed and stay at that speed (or above) before the spoiler will go up. Check out the code later in this post.

The brain of the box is a PIC 16F88 micro controller, using the PICAXE integrated BASIC interpreter layered on top. These chips can be purchased for next to nothing from reved.co.uk. They are flexible, powerful, easy-to-use devices. If you want to use a PIC 16F88 without the PICAXE interpreter, you'll have to write your own code.

Code for the box is uploaded over a laptop serial port. The circuit has an integrated serial port to receive data, and it's active whenever there is power to the box, ready to take code updates.

Building this project isn't for the faint of heart - you should know how to read schematics, test using a VOM, and solder components. You should also know troubleshooting basics for PCB circuitry, because stuff like this never works right the first time.

Finally, I couldn't source the connector that mates to the 993 harness. Not wanting to cut into the car's wiring, I built a plug from rod stock. On the board layout below, there is a space to solder rod stock of the correct diameter to create a male plug. However, this just caused more problems because or clearance issues - you'll want to run leads from the PCB to whatever you use for a connector.

Disclaimer: I'm not a trained engineer, and I don't design things like this for a living. This is a hobby for me. I've used this on my 993 for around 8 months with no problems at all. But I don't claim that's it's an optimal solution. I don't even claim that it's particularly well-designed. I do not provide any warranty for
the circuit, code, or anything else in this post. I also will not be liable for any damage or malfunction you cause by building this circuit, using this circuit, or reading this post.

Here it is:

------------------Bill of Materials (BOM)------------------

C1 0.1uF
C2 0.1Uf 50V
C3 100uF 50V
C4 100uF 50V
C5 0.1uF
C6 33uF
C7 0.1uF
C8 220pF
C9 220pF
C10 220pF
CN1 SPOILER_UP
CN2 SPOILER_DOWN
D1 1N4001 6A 100V
D2 1N5377 36V5W Zener
D3 1N4148
D4 1N4148
D5 1N4148
D6 1N4148
DARL1 ULN2803
Fuse1
FUSE2
LED1 ERROR
LED2 SPOILER_DOWN
LED3 SPOILER_UP
LED4 HEARTBEAT
PIC1 PICAXE-18X / PIC 16F88
PLUG1
Q1 2N3704 NPN TO-92B
R1 10K
R2 10K
R3 10
R4 330
R5 10K
R6 10K
R8 330
R9 330
R10 10K
R11 10K
R12 22K
R13 10K
R14 10K
R15 4K7
R16 330
R18 330
R19 330
RELAY1 MOTOR ON/OFF - 125 OHM COIL
RELAY2 Motor fwd/rev
RELAY3 WARN LAMP - 125 OHM COIL
S1 RS232
V1 LM7805


------------------SAMPLE CODE------------------

#picaxe 18x

'---CONSTANTS---
SYMBOL COUNTPERIOD = 548 'Number of ms (500=1/2sec) to count VSSIN PULSES - 548 gives estimated PULSES = actual MPH
SYMBOL NUMTRIGGERS_UP = 2 'Number of times the VSSIN must be reported as fast/slow for the tail to be powered up
SYMBOL NUMTRIGGERS_DOWN = 9 'Number of times the VSSIN must be reported as fast/slow for the tail to be powered down
SYMBOL MPH_RAISETAIL = 65
SYMBOL MPH_LOWERTAIL = 10
SYMBOL MPH_COMMANDRAISE = 80 'speed that tail will be immediately raised, bypassing "numtriggers" counter
SYMBOL MPH_WARNLAMPOFF = 3

'---INPUTS---
SYMBOL VSSIN = 7 'Input for VSSIN signal
SYMBOL TAILSTATE_UP = pin1 'low if tail is up
SYMBOL TAILSTATE_DOWN = pin0 'low if tail is down
SYMBOL MANUAL_BUTTON = pin2 'Common for Switch - goes HIGH on button push - stays low if tail is already in that position

'---OUTPUTS---
SYMBOL WARN_LAMP_RELAY = 1 'Output for dash spoiler warning lamp
SYMBOL TAIL_REVERSE_RELAY = 2 'LOW = reverse (lowering), HIGH = forward (raising)
SYMBOL MOTORPOWER_RELAY = 3 'Output for tail motor power on/off
SYMBOL ERROR_LED = 7 'Output for error LED
SYMBOL TAIL_DOWN_LED = 5 'Output for spoiler Down LED
SYMBOL TAIL_UP_LED = 6 'Output for spoiler Up LED
SYMBOL HEARTBEAT_LED = 4 'Output for HEARTBEAT_LED LED


'---VARIABLES---
SYMBOL MANUALMODE = bit0 '1 if in manual tail up/down mode
SYMBOL INITWARNING = bit1 '0 if waiting for VSS signal, 1 if lamp has been turned off (VSS received)
SYMBOL PULSES = b1 'Holds VSSIN pulse count
SYMBOL TRIGGERS_UP = b2 'Holds count of highspeed trigger events received for tail up decision
SYMBOL TRIGGERS_DOWN = b3 'Holds count of lowspeed trigger events received for tail down decision
SYMBOL TAILTIMER = w2 'Holds count of time spent raising/lowering tail
SYMBOL BUZZERTIMER = w3 'Holds secondary counter for buzz-on-error logic


'---------------------------------------------------------------------INIT----
'CURRENT TAIL POSITION:
' TAILSTATE_UP TAILSTATE_DOWN
'UP 0 1
'MIDDLE 1 1
'DOWN 1 0
sertxd("-BEGIN-",13,10)
pins = %00000000
pause 5000 'ensure warning lamp shows briefly if device resets during driving
if TAILSTATE_DOWN = 0 then LightDownLED 'update tail status LEDs
if TAILSTATE_UP = 0 then LightUpLED
'---------------------------------------------------------------------INIT----

'-------------------------------------------------------------MainLoop--------
MainLoop:
if MANUAL_BUTTON = 1 then ButtonPushed 'console button pushed
toggle HEARTBEAT_LED
if MANUALMODE = 1 then MainLoop
count VSSIN, COUNTPERIOD, PULSES 'sample speed signal from VSS
SERTXD("PULSES=",#PULSES,13,10)
if INITWARNING = 0 and PULSES > MPH_WARNLAMPOFF then TurnOffWarnLamp 'turn off dash light on first VSS received
if PULSES >= MPH_RAISETAIL and TAILSTATE_UP = 1 then MoveTailUp
TRIGGERS_UP = 0 'speed fell below MPH_RAISETAIL - reset counter
if PULSES <= MPH_LOWERTAIL and MANUALMODE = 0 and TAILSTATE_DOWN = 1 then MoveTailDown
TRIGGERS_DOWN = 0 'speed went above MPH_LOWERTAIL - reset counter
goto MainLoop
'-------------------------------------------------------------MainLoop--------

'-------------------------------------------------------------BUTTON PUSHED---
ButtonPushed:
pause 30 'button bounce
if MANUAL_BUTTON = 0 then MainLoop
sertxd("Button Pushed",#PULSES,13,10)
MANUALMODE = 1 'no speed sensing up/down
TRIGGERS_DOWN = 0
TRIGGERS_UP = 0
if TAILSTATE_UP = 1 then MoveTailUp 'if tail is down or is in the middle (should never happen), raise it
if TAILSTATE_UP = 0 and TAILSTATE_DOWN = 1 and PULSES < MPH_RAISETAIL then MoveTailDown 'if tail is up and speed is low, move it down
sertxd("Manual Tail Down Command Ignored - SPEED IS TOO FAST",#PULSES,13,10)
MANUALMODE = 0 'otherwise, speed must be too high for lower - ignore lower command and take no action
goto MainLoop '(and do NOT enter manual mode)
'-------------------------------------------------------------BUTTON PUSHED---

'-------------------------------------------------------------LOWER TAIL------
MoveTailDown:
sertxd("Moving Tail Down",#PULSES,13,10)
if TAILSTATE_DOWN = 0 then MainLoop
if MANUALMODE = 1 then skiptriggers_taildown
TRIGGERS_DOWN = TRIGGERS_DOWN + 1
if TRIGGERS_DOWN < NUMTRIGGERS_DOWN then MainLoop 'wait until we get NUMTRIGGERS number of speed readings
TRIGGERS_DOWN = 0 'reset trigger count
skiptriggers_taildown:
sertxd("Lowering Tail",13,10)
high MOTORPOWER_RELAY 'power on to tail
for TAILTIMER = 1 to 4000
if TAILSTATE_DOWN = 0 then stoplower
next TAILTIMER
sertxd("FATAL ERROR: MoveTailDown: ",#TAILTIMER," Loops with no signal that tail is DOWN",13,10)
goto ErrOut
stoplower:
low MOTORPOWER_RELAY
sertxd ("Loop done",13,10)
pause 150 'let relay settle
MANUALMODE = 0
sertxd("Finished lowering Tail. TAILTIMER=",#TAILTIMER,13,10) 'in case this was a manual lower, cancer manual mode
goto LightDownLED 'LED update
goto MainLoop
'--------------------------------------------------LOWER TAIL----------------

'--------------------------------------------------RAISE TAIL----------------
MoveTailUp:
sertxd("Moving Tail Up",#PULSES,13,10)
if TAILSTATE_UP = 0 then MainLoop
if MANUALMODE = 1 then skiptriggers_tailup
if PULSES >= MPH_COMMANDRAISE then skiptriggers_tailup
TRIGGERS_UP = TRIGGERS_UP + 1
if TRIGGERS_UP < NUMTRIGGERS_UP then MainLoop 'wait until we get NUMTRIGGERS number of speed readings
skiptriggers_tailup:
TRIGGERS_UP = 0
sertxd("Raising Tail",13,10) 'reset trigger count
high TAIL_REVERSE_RELAY 'select tail direction
pause 150 'let relay settle
high MOTORPOWER_RELAY 'power on to tail
'sertxd ("MoveTailUp loop",13,10)
for TAILTIMER = 1 to 4000
if TAILSTATE_UP = 0 then stopraise
next TAILTIMER
sertxd("FATAL ERROR: MoveTailUp: ",#TAILTIMER," Loops with no signal that tail is UP",13,10)
goto ErrOut
stopraise:
low MOTORPOWER_RELAY
sertxd ("Loop done",13,10)
pause 150 'let relay settle
low TAIL_REVERSE_RELAY
pause 150
sertxd("Finished Raising Tail. TAILTIMER=",#TAILTIMER,13,10) 'let relay settle
goto LightUpLED 'LED update
goto MainLoop
'---------------------------------------------------RAISE TAIL----------------

'-----------------------------------------------TAIL STATUS LEDS--------------
LightDownLED:
sertxd("LED: Tail Down",13,10)
low TAIL_UP_LED
high TAIL_DOWN_LED
goto MainLoop

LightUpLED:
sertxd("LED: Tail Up",13,10)
low TAIL_DOWN_LED
high TAIL_UP_LED
goto MainLoop
'-----------------------------------------------TAIL STATUS LEDS--------------

'-----------------------------------------------TURN OFF WARNING LAMP ON VSS--
TurnOffWarnLamp: 'got a good VSS on startup - turn off warning lamp
INITWARNING = 1
high WARN_LAMP_RELAY
goto MainLoop
'-----------------------------------------------TURN OFF WARNING LAMP ON VSS--

'-----------------------------------------------CRITICAL ERROR----------------
ErrOut:
pins = %00000000
erlp:
toggle ERROR_LED
pause 750
goto erlp
'relay used as warning buzzer - "SOS" pattern
for BUZZERTIMER = 1 to 3
for TAILTIMER = 1 to 10
toggle TAIL_REVERSE_RELAY
PAUSE 2
next TAILTIMER
pause 100
next BUZZERTIMER
pause 750
for BUZZERTIMER = 1 to 3
for TAILTIMER = 1 to 100
toggle TAIL_REVERSE_RELAY
PAUSE 2
next TAILTIMER
pause 100
next BUZZERTIMER
pause 750
goto erlp
'-----------------------------------------------CRITICAL ERROR----------------
Attached Images
    
__________________
Colin
'95 993 - GP White - LWF, HD/M030, HID, Motorsound, RS Mounts, Focal K2P, OBC Retrofit
'75 930 - Goes to 11
cowtown is offline Report Bad Post   Reply With Quote Quick reply to this message
Old Today, 04:14 PM   #2
ed devinney
Addict
Rennlist Member

 
ed devinney's Avatar
 
Join Date: Jun 2001
Location: Virginia USA
Posts: 1,009
Default

<golf clap> Very nice work and a stand-up move to publish - thanks!
__________________
1996 993 coupe, Iris Blue/Classic Grey
1988 951 S
ex: 1972 'cuda 340, 1996 993 black/cashmere
ed devinney is online now Report Bad Post   Reply With Quote Quick reply to this message
Old Today, 07:12 PM   #3
Coleman
Addict
Rennlist Member
 
Coleman's Avatar
 
Join Date: Jul 2002
Location: Santa Barbara Ca.
Posts: 639
Send a message via AIM to Coleman
Default

very nice work, Colin. Shame with all the work/effort you put into this project, you're not gonna make them available.. Hmmm.. I could most likely get these manufactured in china at some of my electronics factories.. Who wants in??

Coleman.
__________________
'Would you... like to be modified?'
'I had in mind something a little more radical.'
95 narrow 993- Triple Black, RS leather doors
Kinesis K28R's 18" matte black, S02A's
PSS-9's, RS Sways, RS Droplinks, Upper strut Tie bar
RS Cams
RS Carbon Heater fan delete
HID's 8000k, Black corner signals
RSR Exhaust, Ovals, Cat bypass
Turbo Euro Front Bumper, Turbo S Ducts, grill deletes.
Split C2S rear grill, handle delete.
GT LSD, Autothority chipped
RS clutch, RS flywheel
Coleman is offline Report Bad Post   Reply With Quote Quick reply to this message
Old Today, 08:14 PM   #4
gonzilla
Addict
Rennlist Member
 
gonzilla's Avatar
 
Join Date: Jul 2005
Location: Manhattan Beach, CA
Posts: 429
Default

Quote:
Originally Posted by Coleman
very nice work, Colin. Shame with all the work/effort you put into this project, you're not gonna make them available.. Hmmm.. I could most likely get these manufactured in china at some of my electronics factories.. Who wants in??

Coleman.


Me! (as long as it's not a smal fortune!)
__________________
Mike
'96 Polar Silver 993
RL Member # 060216-3449
gonzilla is offline Report Bad Post   Reply With Quote Quick reply to this message
Unread Today, 08:21 PM   #5
FLYT993
Addict
Rennlist Member
 
Join Date: Nov 2006
Location: SoCal
Posts: 290
Default

Quote:
Originally Posted by gonzilla
Me! (as long as it's not a smal fortune!)


This is something I'd definitely consider, as I'm forever manually deploying the damn thing. Annoyance aside, I actually like it. I know it's adolescent, but it makes me feel like I'm deploying the flaps on an airplane prior to take off...and have you ever seen the smiles on 12-15 yr old boys when they see it rising and falling? Priceless. And it's something no other car in the world does.
__________________
Dan
95 C4, Blk/Gray, Bone Stock...For Now
RLM# 061205-4400
04 4Runner
98 Lexus LS400...For Sale!
FLYT993 is offline Report Bad Post   Reply With Quote Quick reply to this message
Reply


Quick Reply
Message:
Options


Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 08:55 PM.


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.
Copyright © 1998 - 2007, Rennlist.com