As my eyes began to light up thinking that the circuit board that I had built and script that goes along with it, will fast-track the logged flight, I was brought back to earth. Every time the OpenLog board was activated for logging, excessive jitter was experienced by the servos making a successful flight (and landing) impossible.
So although the logging was successful (all data was recorded as expected), the jitter in the servos was not. After trying to debug for a few days, I read on the internet above the possible conflict of interrupts of the Arduino when the SoftwareSerial library (for the OpenLog) and the Servo library (Receiver, Transmitter and Servos).
One way to solve the problem is to not use the Servo library for servo control and transmit the transmitter signal via digitalWrite command and wait for the next turn to do repeat the process. The problem with this approach though is that if the loop takes too long to come around, the servo will loose holding power and can have catastrophic results.
Until then, the first (safe) logged flight is not possible. #sadface.
16/10/13 Update:
I fixed the jitter issues on the servos by updating the jitter algorithm and moving the OpenLog board unto the hardware serial of the microprocessor. This way I will not have to modify the SoftwareSerial library to be harmonised with the servo library since logged flight is only required for controller design.
The jitter algorithm basically rejects any variation of transmitter pulse less than a certain number. This code is only active when the transmitter is used with the Autopilot is ONLINE mode.
Technically speaking I can still use the hardware serial to connect a GPS device as it only requires the Rx input to transmit location data. This approach will be tested as soon as I have the GPS device.
Now it's moving forward to setup for logged flight. Yeah!
So although the logging was successful (all data was recorded as expected), the jitter in the servos was not. After trying to debug for a few days, I read on the internet above the possible conflict of interrupts of the Arduino when the SoftwareSerial library (for the OpenLog) and the Servo library (Receiver, Transmitter and Servos).
One way to solve the problem is to not use the Servo library for servo control and transmit the transmitter signal via digitalWrite command and wait for the next turn to do repeat the process. The problem with this approach though is that if the loop takes too long to come around, the servo will loose holding power and can have catastrophic results.
Until then, the first (safe) logged flight is not possible. #sadface.
16/10/13 Update:
I fixed the jitter issues on the servos by updating the jitter algorithm and moving the OpenLog board unto the hardware serial of the microprocessor. This way I will not have to modify the SoftwareSerial library to be harmonised with the servo library since logged flight is only required for controller design.
The jitter algorithm basically rejects any variation of transmitter pulse less than a certain number. This code is only active when the transmitter is used with the Autopilot is ONLINE mode.
Technically speaking I can still use the hardware serial to connect a GPS device as it only requires the Rx input to transmit location data. This approach will be tested as soon as I have the GPS device.
Now it's moving forward to setup for logged flight. Yeah!
Comments
Post a Comment