I used a window motor from a 1998 Audi A4 (looks like offside/ right hand side). I made sure to get one with some wiring attached.Domt177 wrote: ↑Fri Jan 22, 2021 3:24 pmWhat sort of motor do you use to move in and out of park, trying to find one now (maybe you could send me the one you use)xp677 wrote: ↑Tue Jan 05, 2021 10:38 pm Yep, the GS has a solenoid as part of the shifter assembly. For a bare transmission, you don't get that.
Since I used a motor to move in/out of park, I do the lockout in software (I take the two brake pedal sensors as inputs).
I'm not sure how you'd implement a lockout solenoid, to be honest, it might be best to find a suitable shifter assembly from an existing car (maybe a Ford or GM or something common/cheap to play around with).
These motors have a control PCB inside with two relays and some various components, I stripped the components out and wired the relay coils to two of the pins on the connector. This gave me CW / CCW control without having to add my own relays or driver.
I bonded a steel crank onto the output shaft with some epoxy, and made up a linkage to connect it to the transmission.
I chose the window motor because they are cheap and powerful enough. I couldn't find a suitable solenoid. The motor cost something like £5 from eBay.
Video here: https://imgur.com/9qusPSo
Here's the code I used. This is not compatible with the VCU, but it works fine for my application. You can maybe use it to get started? Sorry, I don't have time to talk you through it.
Code: Select all
//Parking Lock
#define LOCK_PARK 0
#define LOCK_NEUTRAL 1
#define LOCK_NEITHER 2
#define LOCK_ERROR 3
#define VEH_SPEED_SHIFT_THRESHOLD_LOW 1 //speed below which gear shift / park lock will happen
#define VEH_SPEED_SHIFT_THRESHOLD_HIGH 10 //speed above which prnd input is ignored
byte parking_lock = 2;
bool shifting = 0;
void gear_selection()
{
if (prnd_gear == current_gear)return; //nothing to do
if (veh_speed_kph > VEH_SPEED_SHIFT_THRESHOLD_HIGH || veh_speed_kph < -VEH_SPEED_SHIFT_THRESHOLD_HIGH) //if above certain speed, ignore input
{
prnd_gear = current_gear; //cancel shifter selection of moving
return;
}
else if (brake_pressed) //new gear has been selected, and we are below the required speed, and brake pedal is pressed
{
//read park lock state
if (!digitalRead(pin_trans_neutral) && digitalRead(pin_trans_park))parking_lock = LOCK_NEUTRAL;
else if (digitalRead(pin_trans_neutral) && !digitalRead(pin_trans_park))parking_lock = LOCK_PARK;
else if (digitalRead(pin_trans_neutral) && digitalRead(pin_trans_park))parking_lock = LOCK_NEITHER;
else if (!digitalRead(pin_trans_neutral) && !digitalRead(pin_trans_park))parking_lock = LOCK_NEITHER;
if (current_gear == GEAR_PARK || shifting) //currently in park, request to come out of park
{
shifting = 1;
if (veh_speed_kph < VEH_SPEED_SHIFT_THRESHOLD_LOW && veh_speed_kph > -VEH_SPEED_SHIFT_THRESHOLD_LOW)
{
if (parking_lock == LOCK_PARK || parking_lock == LOCK_NEITHER)
{
digitalWrite(pin_trans_motor_neutral, 1);
digitalWrite(pin_trans_motor_park, 0);
}
if (parking_lock == LOCK_NEUTRAL)
{
digitalWrite(pin_trans_motor_neutral, 0);
current_gear = prnd_gear; //after parking lock has finished, update the current gear
shifting = 0;
}
}
return;
}
if (prnd_gear == GEAR_PARK || shifting) //currently not in park, request to go into park
{
shifting = 1;
current_gear = GEAR_NEUTRAL;
if (veh_speed_kph < VEH_SPEED_SHIFT_THRESHOLD_LOW && veh_speed_kph > -VEH_SPEED_SHIFT_THRESHOLD_LOW)
{
if (parking_lock == LOCK_NEUTRAL || parking_lock == LOCK_NEITHER)
{
digitalWrite(pin_trans_motor_neutral, 0);
digitalWrite(pin_trans_motor_park, 1);
}
if (parking_lock == LOCK_PARK)
{
digitalWrite(pin_trans_motor_park, 0);
current_gear = prnd_gear;
shifting = 0;
}
}
return;
}
if (current_gear != GEAR_PARK && prnd_gear != GEAR_PARK) //not in park or going into park
{
Serial.println("changing gear (N/R/D)");
shifting = 1; //this sets torque to zero
if (veh_speed_kph < VEH_SPEED_SHIFT_THRESHOLD_LOW && veh_speed_kph > -VEH_SPEED_SHIFT_THRESHOLD_LOW)
{
current_gear = prnd_gear;
shifting = 0;
}
return;
}
}
}