<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RC Servo PWM control.]]></title><description><![CDATA[<p dir="auto">Hello.</p>
<p dir="auto">Please, I need to control a common RC servo to operate a valve. These servos uses 50Hz cycle and the the width of pulses vary from 1ms to 2ms  - the center being 1.5ms.</p>
<p dir="auto">How can I configure a digital output to control it? The example file from the software does not uses the PWM block and I could not figure out how to use it.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.rexygen.com/topic/162/rc-servo-pwm-control</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 13:43:57 GMT</lastBuildDate><atom:link href="https://forum.rexygen.com/topic/162.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Nov 2020 11:20:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RC Servo PWM control. on Sun, 10 Jan 2021 07:56:34 GMT]]></title><description><![CDATA[<p dir="auto">You are welcome <img src="https://forum.rexygen.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=rfreqd0ultg" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.rexygen.com/post/692</link><guid isPermaLink="true">https://forum.rexygen.com/post/692</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Sun, 10 Jan 2021 07:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Fri, 08 Jan 2021 21:24:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> With the "Duty_cycle = 1 - Calculated_duty_cycle" it worked like a charm. THANK YOU!</p>
]]></description><link>https://forum.rexygen.com/post/688</link><guid isPermaLink="true">https://forum.rexygen.com/post/688</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Fri, 08 Jan 2021 21:24:16 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Fri, 08 Jan 2021 20:34:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> said in <a href="/post/623">RC Servo PWM control.</a>:</p>
<blockquote>
<p dir="auto">Can you send a wiring diagram to your RC servo?</p>
</blockquote>
<p dir="auto">The signal wire of the servo is connect to the DOUT1. The servo is powered by a dedicated BEC to provide 6v that have a common ground with the Monarco.</p>
]]></description><link>https://forum.rexygen.com/post/687</link><guid isPermaLink="true">https://forum.rexygen.com/post/687</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Fri, 08 Jan 2021 20:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Mon, 23 Nov 2020 09:11:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> To be more specific, for an open-drain digital output you will need to subtract the calculated duty cycle value from 1:</p>
<pre><code>Duty_cycle = 1 - Calculated_duty_cycle
</code></pre>
<p dir="auto">For 1 ms width pulse and frequency 50 Hz:</p>
<pre><code>Duty_cycle = 1 - 0.05 = 0.95
</code></pre>
<p dir="auto">For 2ms width pulse and frequency 50 Hz:</p>
<pre><code>Duty_cycle = 1 - 0.1 = 0.90
</code></pre>
<p dir="auto">If you are using a DO as an 5V voltage source, see the <strong>Using digital outputs in 5V logic circuits</strong> chapter here:<br />
<a href="https://support.monarco.io/help/digital-outputs-of-the-monarco-hat">https://support.monarco.io/help/digital-outputs-of-the-monarco-hat</a><br />
The logic is "reversed":<br />
<em>If DOUT=OFF, no connection to ground exists and you will measure 5V at the output. If DOUT=ON, connection to ground is made and there will be 0V at the output. That's how you can control devices which use 5V logic.</em></p>
<p dir="auto">I apologize for the mystification in previous posts.</p>
]]></description><link>https://forum.rexygen.com/post/628</link><guid isPermaLink="true">https://forum.rexygen.com/post/628</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Mon, 23 Nov 2020 09:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Fri, 20 Nov 2020 12:39:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi Bruno,<br />
I have connected my Monarco HAT to the oscilloscope and the PWM behaves as expected. I set the frequency to 50 Hz and on the first measurement I set the duty cycle to 0.5 (Figure 1). Figure 2 shows the measurement at a duty cycle = 0.1. Please note that Monarco HAT has open-drain outputs, as shown in Figure 2.<br />
<img src="/assets/uploads/files/1605874529787-pwm_fig1_dc_0_5-resized.jpg" alt="PWM_fig1_DC_0_5.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1605874529780-pwm_fig2_dc_0_1-resized.jpg" alt="PWM_fig2_DC_0_1.jpg" class=" img-fluid img-markdown" /><br />
Can you send a wiring diagram to your RC servo?</p>
]]></description><link>https://forum.rexygen.com/post/623</link><guid isPermaLink="true">https://forum.rexygen.com/post/623</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Fri, 20 Nov 2020 12:39:34 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Thu, 19 Nov 2020 10:26:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> And I am not sure...</p>
<p dir="auto">At 50hz the servo just ignores the DOUT signal. It started working at 500Hz up to 5000Hz.</p>
<p dir="auto">And the Duty cycle calculation does not create the expected response from the servo at all. The width I am sure (but it is around 0.8 to 2.2ms)</p>
<p dir="auto">So I am confused. I could make the servo works but this formula for the duty cycle  and pulse width does not works.</p>
]]></description><link>https://forum.rexygen.com/post/620</link><guid isPermaLink="true">https://forum.rexygen.com/post/620</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Thu, 19 Nov 2020 10:26:59 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Thu, 19 Nov 2020 10:23:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> Yes but these values of duty cycle does not work as calculated.</p>
]]></description><link>https://forum.rexygen.com/post/619</link><guid isPermaLink="true">https://forum.rexygen.com/post/619</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Thu, 19 Nov 2020 10:23:57 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Wed, 18 Nov 2020 20:48:16 GMT]]></title><description><![CDATA[<p dir="auto">The length of the period for 50 Hz is 0.02 s.<br />
For pulse width 0.001 s:<br />
Duty cycle = 0.001/0.02 = 0.05<br />
Pulse width 0.002 s:<br />
Duty cycle = 0.002/0:02 = 0.1</p>
<p dir="auto">Are you sure about the frequency and width of the pulses? I would expect a duty cycle range from 0 to 1.</p>
]]></description><link>https://forum.rexygen.com/post/617</link><guid isPermaLink="true">https://forum.rexygen.com/post/617</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Wed, 18 Nov 2020 20:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Wed, 18 Nov 2020 17:46:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> said in <a href="/post/614">RC Servo PWM control.</a>:</p>
<blockquote>
<p dir="auto">Duty_cycle = pulse_width/period_length</p>
</blockquote>
<p dir="auto">Period length? 1s/Hz?</p>
]]></description><link>https://forum.rexygen.com/post/616</link><guid isPermaLink="true">https://forum.rexygen.com/post/616</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Wed, 18 Nov 2020 17:46:08 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Wed, 18 Nov 2020 17:23:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/133">@reitinge</a> Thank you.</p>
<p dir="auto">So, the duty cycle value for 50hz would be from 0.1 to 0.05 (1ms to 2ms pulse width) and for 100Hz would be from 0.2 to 0.1 for example.</p>
<p dir="auto"><img src="/assets/uploads/files/1605718833037-06be03f1-ccc8-43f4-9f65-af646fb00cde-image.png" alt="06be03f1-ccc8-43f4-9f65-af646fb00cde-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">But I could not make it work...</p>
<p dir="auto">Edit: With 500Hz it moved so... Ok <img src="https://forum.rexygen.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=rfreqd0ultg" class="not-responsive emoji emoji-android emoji--smile" style="height:23px;width:auto;vertical-align:middle" title=":D" alt="😄" /></p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.rexygen.com/post/615</link><guid isPermaLink="true">https://forum.rexygen.com/post/615</guid><dc:creator><![CDATA[brunofporto]]></dc:creator><pubDate>Wed, 18 Nov 2020 17:23:59 GMT</pubDate></item><item><title><![CDATA[Reply to RC Servo PWM control. on Wed, 18 Nov 2020 08:58:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi Bruno,<br />
the Monarco HAT has <strong>hardware</strong> PWM and therefore does not need to create PWM in software using a <em>PWM block</em>. Documentation to the PWM on Monarco HAT can be found on page 16 in Monarco technical specification <a href="https://www.monarco.io/docs/Monarco-HAT-Hardware-Reference-Manual.pdf">https://www.monarco.io/docs/Monarco-HAT-Hardware-Reference-Manual.pdf</a>.<br />
All you need to do is set the PWM frequency (in your case to 50 Hz) and calculate the actual duty cycle for one channel according to the equation:</p>
<pre><code>Duty_cycle = pulse_width/period_length
</code></pre>
<p dir="auto">Take a look at example <em>0121-05_Monarco_HAT_PWM_output</em> to find out how to set the frequency and duty cycle for PWM1 (for example).</p>
<p dir="auto">Hope, this will be helpfull.<br />
Cheers<br />
Jan.</p>
]]></description><link>https://forum.rexygen.com/post/614</link><guid isPermaLink="true">https://forum.rexygen.com/post/614</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Wed, 18 Nov 2020 08:58:03 GMT</pubDate></item></channel></rss>