NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Stepper/Variable Reluctance Motor HELP PLEASE!!!...Thanks

November 17, 2009
by tony
tony's Avatar

We have an interesting situation. We are trying to take over the cruise control of a 1993 Lincoln Town car.

This is what we have found:

the motor has a socket with 4 terminals labeling the terminals from left to right 1-4 we have that the motor moves in steps depending on the order of terminals energized.

I mean that using terminal 1 as the common (+or-) and then closing the circuit on terminal 2 then 3 then 4 with 5 VDC moves the motor in one directions. Reversing the order say 2 then 1 then 3 reverses the rotation.

Picture of Motor top view

How we think it is working

The other socket on the picture is for an electromagnetic actuator that engages the wire to the accelerator. This eliminates the need to reverse the order of the steps since disengaging it returns the accelerator to its original state (just like when you remove your foot).

We are unable to find a controller that can control this motor configuration. Also we will need to "hold" the accelerator at a given position for x amount of time by maintaining 5 VDC at the last "step"

I hope someone can steer us in the right direction as we have hit a wall right now.

Any help would be greatly appreciated.

Thanks.

November 17, 2009
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi Tony,

First, I suggest you take a look at Motors and Microcontrollers 101 which talks about how to control an inductive load using a MOSFET, a diode, and a resistor.

You will need to apply this strategy to each of the three phases, so you'll need three MOSFETs, etc. One microcontroller pin should go to each.

Can you then try just writing a simple program to manually set each pin one by one? Something like:

// suppose the three MOSFET gates are connected to PB1, PB2, and PB3.
DDRB |= (1<<PB1) | (1<<PB2) | (1<<PB3);
PORTB &= ~((1<<PB1) | (1<<PB2) | (1<<PB3));
while(1) {
  // phase #1
  PORTB |= (1<<PB1);
  delay_ms(100);
  PORTB &= ~(1<<PB1);

  // phase #2
  PORTB |= (1<<PB2);
  delay_ms(100);
  PORTB &= ~(1<<PB2);

  // phase #3
  PORTB |= (1<<PB3);
  delay_ms(100);
  PORTB &= ~(1<<PB3);
}

Is that the kind of thing you mean? Hope this helps get you started.

Car-specific note: are you sure that the metal case isn't itself a terminal in some way? That's the case in lots of car-related gadgets, with the chassis of the car being the ground terminal and the current return path. Measure the resistance between each terminal and the case -- might give you a clue.

Also, BE CAREFUL WITH CARS. I hope you realize that you're trying to put some source code you wrote in control of a 4000 pound vehicle, and that mistakes are an inevitable part of the design process. I don't know enough about cars to know what happens if your motor decides to just keep going, or if your solenoid doesn't fire when you want to disengage. But it can't be good. There are a lot of edge cases to think about, and writing failsafe code is a real challenge even for the best, most experienced professional embedded systems designers, and people can get killed when even simple mistakes in seemingly unrelated subsystems occur. There are a lot of things you can do to reduce the potential damage you can cause: watchdog timers, etc. But the most important ones are that you have other, more experienced people review your code and system design, and that you design the system to "fail gracefully" -- make sure there are lots of ways to override this system, that any confusing or potentially erroneous inputs lead the system to shut itself down, etc. The car companies spend megabucks and serious engineering talent on making sure systems like that work as they're supposed to and then fail gracefully (because things will fail -- the trick is making them fail in a safe, recoverable way). You are talking about building a serious threat to life and property -- do not take what you're doing lightly.

From the perspective of controlling this motor as a benchtop exercise on how to handle these kinds of motors, please use my suggestions above. But I do not recommend that you proceed with integrating such a system into a vehicle.

Mike

Post a Reply

Please log in to post a reply.

Did you know that Morse code is a compact way to transmit human-readable text over binary channels? Learn more...