Servo tester
Has a setting to change the input to the servo in millisecond units.
You have to give the servo you want to test the name SERVO_TEST, and don't use it in the command laws.
Additionally, you can make the servo do a series of step maneuvers, with increasing amplitude. Tip: Open up the servo and measure the voltage on the potmeter with a high speed recorder device (like a saleae Logic analyzer with analog inputs). This will let you model the response of the servo.
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
1 <module name="servo_tester">
2 <define name="TIME_PER_DEFLECTION" value="0.8" />
Module configuration options
Define Options
- name:
TIME_PER_DEFLECTION
value: 0.8
Description: Time between servo steps for the 'servo_run' feature
Module functions
Init Functions
These initialization functions are called once on startup.
Periodic Functions
These functions are called periodically at the specified frequency from the module periodic loop.
- servo_tester_periodic()
- Frequency in Hz: 512
- Autorun: LOCK
Periodic function automatically starts after init and can't be stopped.
Files
Header Files
The following headers are automatically included in modules.h
Source Files
Raw servo_tester.xml file:
<!DOCTYPE module SYSTEM "module.dtd">
<module name="servo_tester" dir="servo_tester">
<doc>
<description>
Servo tester
Has a setting to change the input to the servo in millisecond units.
You have to give the servo you want to test the name SERVO_TEST, and don't use
it in the command laws.
Additionally, you can make the servo do a series of step maneuvers, with increasing
amplitude. Tip: Open up the servo and measure the voltage on the potmeter with
a high speed recorder device (like a saleae Logic analyzer with analog inputs). This
will let you model the response of the servo.
</description>
<define name="TIME_PER_DEFLECTION" value="0.8" description="Time between servo steps for the 'servo_run' feature"/>
</doc>
<settings>
<dl_settings NAME="Servo test">
<dl_settings NAME="Servo tester">
<dl_setting var="servo_test_val" min="1000" step="1" max="2000" module="modules/servo_tester/servo_tester" shortname="servo_input"/>
<dl_setting var="do_servo_run" min="0" step="1" max="1" module="modules/servo_tester/servo_tester" values="Off|On" shortname="servo_run"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="servo_tester.h"/>
</header>
<init fun="servo_tester_init()"/>
<periodic fun="servo_tester_periodic()" freq="512"/>
<makefile>
<file name="servo_tester.c"/>
</makefile>
</module>