<?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[Issues w&#x2F; 4EncoderMotor]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am struggling to get the 4EncodorMotor running. I'm working w/ UiFlow2. I'm pasting screenshots + Python snippets below:</p>
<p dir="auto">1/ In normal mode, the motor speed is low fluctuates a lot. It accelerates. Then decelerates. Then decelerates more, etc. The pattern seems random to me.</p>
<p dir="auto"><img src="/assets/uploads/files/1739025951298-b96854b5-909c-402a-ba50-7a78aa9f0945-image.png" alt="b96854b5-909c-402a-ba50-7a78aa9f0945-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-python">encoder4_motor_0 = Encoder4MotorModule(address=0x24)
encoder4_motor_0.set_all_motors_mode(0x00)
encoder4_motor_0.set_motor_pwm_dutycycle(0x01, 50)
</code></pre>
<p dir="auto">2/ For speed mode. For a value of 50, the motor turns smooth. If I increase it, nothing happens. If I decrease it, it does the pattern: stopped; then shock/move a bit; then stop again; then shock again; etc.</p>
<p dir="auto"><img src="/assets/uploads/files/1739026333077-e195a8ea-c779-4a80-aad0-8f3147c6facb-image.png" alt="e195a8ea-c779-4a80-aad0-8f3147c6facb-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-python">  i = 50
  encoder4_motor_0 = Encoder4MotorModule(address=0x24)
  encoder4_motor_0.set_all_motors_mode(0x02)
  encoder4_motor_0.set_speed_point_value(0x01, i)
</code></pre>
<p dir="auto">Initially I connected only the motor pins; I thought that maybe it (either the firmware or the lib) has a "adjust after feedback" algorithm. And because the lack of the feedback =&gt; malfunction. Actually seeing that the "speed" and "position" mode have functions to control PID - in these cases feedback is mandatory.<br />
But then I connected the encoder, and I see the same behavior. The encoder works correctly; tested with:</p>
<p dir="auto"><img src="/assets/uploads/files/1739026734585-dfcd041d-a1cf-443d-ba0b-dfeaaaa2f8b5-image.png" alt="dfcd041d-a1cf-443d-ba0b-dfeaaaa2f8b5-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-python">print(encoder4_motor_0.get_motor_encoder_value(0x01))
</code></pre>
<p dir="auto">It updates correctly both when I turn by hand, and when the motor turns (badly, cf. above).</p>
<p dir="auto">I mention that I have a worm gear motor like this:</p>
<p dir="auto"><img src="/assets/uploads/files/1739026847366-2fe4c444-1e24-4acf-90b2-3c577f9741fe-image.png" alt="2fe4c444-1e24-4acf-90b2-3c577f9741fe-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I tested it w/ the lab PSU, suplying variable voltage. It runs smooth. So I exclude a malfunction of the motor.</p>
<p dir="auto">Any hints?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.m5stack.com/topic/7275/issues-w-4encodermotor</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 10:22:44 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7275.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 08 Feb 2025 15:01:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Issues w&#x2F; 4EncoderMotor on Thu, 13 Feb 2025 21:26:21 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the tips <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> 🙂.</p>
<p dir="auto">I think I found a working recipe. My conclusions would be the following:</p>
<p dir="auto">1/ For my motor, I am using P, I, D = 1, 0, 0. I think an even lower P coef would have worked, but the API doesn't accept it.<br />
2/ W/ this values, I reach the maximum speed w/ speed =~30. Then if I decrease the wanted speed, the actual speed decreases as well. When I arrive at -14, the actual spin is 0. Decreasing more will make the motor turn the opposite direction.<br />
3/ I find this negative value odd. I don't understand why it's offseted from 0.<br />
4/ If I go the opposite direction, i.e. -50 and increase, the stop point is not -14 any more. It's about -3. So there is some kind of hysteresis effect.<br />
5/ I'd say that the reduction of my gearbox (1:50) corroborated w/ the resolution of the encoder, pushes the PID params to the low limit.<br />
6/ The position mode works similar to the position. However, when arriving at the set point, the motor oscillates (a lot if high speed; a bit, if low speed). So for me is no go to use this, although my use case does involve stopping at position. I'll use the speed + control it via the program; i.e. decrease it when approaching the target.<br />
7/ I don't understand why the PWM mode oscillates. In my opinion it's a bug. I don't think the PWM mode should have used the feedback of the encoder.</p>
<p dir="auto">So all in all, I'll be able to continue my project now. 🙂</p>
]]></description><link>https://community.m5stack.com/post/28218</link><guid isPermaLink="true">https://community.m5stack.com/post/28218</guid><dc:creator><![CDATA[cristian.spiescu]]></dc:creator><pubDate>Thu, 13 Feb 2025 21:26:21 GMT</pubDate></item><item><title><![CDATA[Reply to Issues w&#x2F; 4EncoderMotor on Thu, 13 Feb 2025 21:11:33 GMT]]></title><description><![CDATA[<p dir="auto">Hello @cristian-spiescu</p>
<p dir="auto">I am sorry to hear about your troubles. The forum in mainly users helping other users. That said, there a a few M5Stack people in here as well from time to time. (BTW I am not one of them.)</p>
<p dir="auto">Unfortunately I do not have the necessary hardware to try and help you out. Sorry.</p>
<p dir="auto">May I suggest you try sending an email to M5Stack support - I cannot guarantee any better outcome but I think it probably doesn't hurt to try.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/28217</link><guid isPermaLink="true">https://community.m5stack.com/post/28217</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 13 Feb 2025 21:11:33 GMT</pubDate></item><item><title><![CDATA[Reply to Issues w&#x2F; 4EncoderMotor on Thu, 13 Feb 2025 20:13:59 GMT]]></title><description><![CDATA[<p dir="auto">I bought another similar board; thinking that maybe the first one is broken. But it behaves the same way.</p>
<p dir="auto">Playing w/ the various params, I started to observe a bit of response at my commands. For the moment it's still erratic. I observe some persistence of the board. I.e. if I run the program twice, the second time it keeps the params of the first run. I'm under the impression that a reset of the main board, doesn't reset the 4EncoderMotor board.</p>
<p dir="auto">The joy of an IoT project is now transformed in an ugly and frustrating process of guesswork and reverse engineer of the API. ☹️ A while ago, I thought I saw people from M5stack on the forum, providing help here and there. Either I was wrong, or it's not the case any more.</p>
]]></description><link>https://community.m5stack.com/post/28214</link><guid isPermaLink="true">https://community.m5stack.com/post/28214</guid><dc:creator><![CDATA[cristian.spiescu]]></dc:creator><pubDate>Thu, 13 Feb 2025 20:13:59 GMT</pubDate></item></channel></rss>