Wednesday 4 July 2012

PWM Servo Control

Another short blog post, but I have drank almost an entire bottle of wine and I have a stack of papers to read about CFD analysis on ship air wakes. Haven't started the PhD yet, and although PhD's don't officially start till October, I'm needed to start as soon as possible. So rather than spend the first week trying to play catch up, I have been reading everything and anything on the subject so that I can hit the ground running. In other news, I have also bitten the bullet and ordered a second µChameleon DAQ, so that means I have up to 16 analogue channels, which means I can add other sensors in time as I'd like to take more pressure readings, especially the combustion chamber pressure loss and the pressure drop across the turbine stage.

I have been playing with the µChameleon DAQ to try and control an RC servo by providing a PWM output. The µChameleon has two 5V outputs, allowing me to power the servo directly, while channels 9 to 12 are the PWM output channels. It didn't take as long as I expected. Some to the examples provided by Labview looked complex and where composed of lots of sub vi's. I have no doubt that these would work, but since I don't have access to an National Instruments DAQ I couldn't find out. So I played with the VISA functions and managed to get a simple PWM servo controller to work in about an hour. I only needed to mimic a PWM signal given by a radio control receiver from a full throttle input signal. Once again the trusty oscilloscope came in handy. The pulse width values I have used, (the two constants on the left in the diagram), corresponded to maximum and minimum values I found for one of my radio control system. This value doesn't really need to be specific as the gas turbine ECU can be adjusted to read the max/min values of any radio control system and set the throttle range accordingly. I then convert the range between the two values into a percentage and multiply that with the throttle input value. Although a hundred steps seems a bit coarse, the average radio control transmitter may only have twenty five steps, (if using a ratchet system on the stick), so a discrete range of a hundred steps should be more than adequate.
Most ECU's are also started by moving the throttle trim to max and cycling the throttle from idle to max and back to idle, once the ECU see's these throttle movements it initiates the start up procedure. I intend to replicate this by having the start button on the dashboard input a 10% throttle input into the ECU replicating the maximum trim position.