Usage of "Standard Servo Read" block

1 次查看(过去 30 天)
SK
SK 2012-8-3
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.

回答(1 个)

Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer 2012-8-10
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.)

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by