Micro Maestro - One servo output, two linear inputs

Newbie just wondering if the following concept would be possible with a Maestro:

Output: One servo output (actually an ESC)
Variable input #1: Potentiometer (“Pot1”)
Variable input#2: Force Sensing Resistor (“FSR1”)

Sequence and control:

1/ Startup delay to allow everything to settle
2/ Maestro looks at the reading of Pot1 (which is the master input)
3/ If Pot1 is above a threshold value -> then Pot1’s value is used to drive the ESC
4/ If Pot1’s value is below a threshold value -> then FSR1’s value is used to drive the ESC
5/ Back to 2/ while always using the value of Pot1 or FSR1 to maintain ESC control.

The complexity I imagine is for the script to be monitoring Pot1 and controlling the ESC simultaneously.

Any advice would be much appreciated!

Hello.

From your description, it sounds like the Maestro can be programmed to do what you want. You will need to configure the Maestro channels that the inputs are connected to as “Input” channels in the “Channel Settings” tab of the Maestro Configuration Utility. Then, in the script, you can use the GET_POSITION command to read the analog signal on the specified channel. You might find the “Using an analog input to control servos” example in the “Example Scripts” section of the Maestro User’s Guide helpful as a starting point.

If you try writing a script and run into problems or questions, you can post what you have so far, and I would be glad to take a look.

Brandon

Thanks Brandon.

Since writing that post I’ve found the 3-Step (Servo move) Analogue Input with Hysteresis example a great place to start.

Just a question thought. When a script is running in say a loop, does an output that the script drives stay constant? In other words an output (say to a servo) won’t change its PWM ratio until the script tells it to? If this is correct is there a time limit? Ie: If a loop is infinite without commanding an output change, will the servo stay in exactly the same position forever?

The reason for this question is that if I have various loops using GET_POSITION, it might be awhile (in MCU relative timeframes) before the loop needs to make a change to the output.

When you send a target position command to a Maestro servo channel, the output on that channel will go to the specified pulse width and stay there until it is commanded to change again (or the Maestro is power cycled).

Brandon