Hi all,
I am trying to control a 3 phase motor, part of an engine RPM cockpit indicator from cold-war era British jet aircraft such as the Lightning, Buccaneer, Victor, Vulcan, etc....
It's a "Synchronous Hysteresis Motor" and is about 50 / 60 years old, pre-dating the idea of a BLDC motor, but it's not far off in terms of how you drive it.. The motor will run at variable speed depending on the frequency of the 3 phase signal applied.
Originally this motor power was supplied by a small 3 phase generator driven by an ancillary shaft of the engine. The motor is magnetically coupled to a sprung pointer to indicate engine RPM in terms of Percentage. As the engine speed increases, so does the generator speed, it's frequency, and the motor in the cockpit indicator rotates faster, pulling the pointer further round against the spring.
So this project is to simulate the variable frequency 3 phase generator, much like a BLDC driver with no feedback.
Indicator:
Original circuit diagram:
Here is an article I wrote on taking apart one of these tachometer indicators:
Problem 1, Very slow operation
I'm using an Arduino Uno R3 board, 16MHz.
I've written a sketch, which runs at full speed - for test, I removed all timing functionality which I previously had implemented by adding a potentiometer and used "micros" to step through the array. The reason I removed this timing functionality is that it was really slow, so I wanted to see how quick it could go - flat out with nothing to slow it down, just executing the program straight.
I use an array to sequence the output pins, which works well.
Using an oscilloscope I have measured the frequency to be just less than 12Hz! Rubbish!! The indicator I'm using does rotate but only achieves 17% RPM indicated, so from that I guess I'll need to achieve somewhere approaching 90 to 100Hz for 100% RPM to be indicated.
My sketch, there's not a lot going on here, so I can't see why it's so very slow:
int outA = 5; // Declare output pin A
int outB = 6; // Declare output pin B
int outC = 7; // Declare output pin C
int arrayLookupA = 1; // Output A array lookup point
int arrayLookupB = 3; // Output B array lookup point
int arrayLookupC = 5; // Output C array lookup point
int arrayIndex = 0; // For stepping through the array
int statusArray[6] = {1,1,1,0,0,0}; // Sequence used for output switching
void setup() {
Serial.begin(9600);
pinMode(outA, OUTPUT);
pinMode(outB, OUTPUT);
pinMode(outC, OUTPUT);
}
void loop() {
Serial.print(" microseconds ");
++arrayIndex;
if (arrayIndex == 6)
{arrayIndex = 0;}
arrayLookupA = arrayIndex;
if (arrayIndex + 2 < 6)
{arrayLookupB = arrayIndex + 2;}
else
{arrayLookupB = arrayIndex - 4;}
if (arrayIndex + 4 < 6)
{arrayLookupC = arrayIndex + 4;}
else
{arrayLookupC = arrayIndex - 2;}
digitalWrite(outA, statusArray[arrayLookupA]);
digitalWrite(outB, statusArray[arrayLookupB]);
digitalWrite(outC, statusArray[arrayLookupC]);
}
I've put together a Triple Half H-Bridge circuit just using NPN and PNP transistors to switch power across the windings, which all looks fairly good.
Problem 2, Can't run without Serial....
When I remove Serial.begin, the code stops working, no output at all. If I take out the word "microseconds" form Serial.print it also stops working. If I take out all Serial stuff, it stops working.... Most strange, any ideas?
Any ideas on my code are welcome!
Many thanks, Scott.