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.
If you set the boolean "is_servo" to False, the programm will NOT use negative deflections.
Example for airframe file
Add to your firmware section: This example contains all possible configuration options, not all of them are mandatory!
<module name="servo_tester">
b'<define name="TIME_PER_DEFLECTION" value="0.8" />\n '
</module>
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ó½pvøU
ñZesøU
é\esøU
yËÒ_␅
é\esøU
À¡$×
ó½p
é\esøU
ó½pvøU
<define name="TIME_PER_DEFLECTION" value="0.8" description="Time between servo steps for the 'servo_run' featureó½p
ó½pvøU
ó½pvøU
<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ó½p
<dl_setting var="is_servo" min="0" step="1" max="1" module="modules/servo_tester/servo_tester" values="False|True" shortname="is_servoó½p
<dl_setting var="do_servo_run" min="0" step="1" max="1" module="modules/servo_tester/servo_tester" values="Off|On" shortname="servo_runó½p
ó½pvøU
ó½pvøU
ó½pvøU
ó½pvøU
<file name="servo_tester.hó½p
ó½pvøU
<init fun="servo_tester_init()ó½p
<periodic fun="servo_tester_periodic()" freq="512ó½p
ó½pvøU
<file name="servo_tester.c"/>
</makefile>
</module>