Usage of "Standard Servo Read" block

1 visualizzazione (ultimi 30 giorni)
SK
SK il 3 Ago 2012
I have my Mega2560 board connected to Simulink and have successfully run the simple servo control example with saw tooth sweep. Now my intention is to connect a radio control model receiver (RX) to arduino, take the PWM signal from it, and use this signal as the input to the arduino. If I understand correctly, I would use "Standard Servo Read" block to read PWM signal from the RX. I am having trouble making this work. Can you show an example how would one use this block? Or how would I be able to read PWM signal from RX? Maybe I misunderstood the usage of this block.

Risposte (1)

Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer il 10 Ago 2012
Hi SK. Thanks for asking. For more information about the Arduino blocks, see http://www.mathworks.com/help/toolbox/simulink/slref/f3-4889.html#Z.
The purpose of the "Standard Servo Read" block is to get the position of a standard servo motor shaft in degrees.
Instead, I believe you would: # Ensure that the RX output voltage and current are safe for the Mega. # Connect the RX servo output to an digital input pin on the Arduino. # Use an Arduino Digital Input block to sample the the digital input. Set the value of the Sample time parameter short enough to determine the duty cycle of the PWM. (This might be difficult if the PWM has a very short period.)

Categorie

Scopri di più su Arduino Hardware in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by