|
From: | Przemek Klosowski |
Subject: | Re: Octave-Arduino- Slow Velocity Stepper Motor |
Date: | Thu, 5 Sep 2019 14:20:11 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 9/5/19 1:23 PM, Vicent wrote:
The problem is the slow velocity I get in the steppers (using Octave and arduino toguether) because to get one complete turn (200 steps ) it last almost 11 seconds whereas only with arduino (without Octave) it goes really fast but I prefer use Octave to be able to do the trajectory calculations. ... function runMotor(ar, MotorStep, MotorDir, direction, steps, time ) ... pause(time); ... endfunction ...# Alfa Motor Down; runMotor (ar, alfaStep, alfaDir, 1, 200, 0.00001);
You put far too much trust into pause()'s ability to execute short delays. 10 microsecond pause is just not practical in the interpreted environment: on my 3GHz Linux box I see a factor of 67 discrepancy:
tic; pause(.00001);toc Elapsed time is 0.000674963 seconds.Since that delayed delay happens in your step loop i'ts going to slow things down significantly.
[Prev in Thread] | Current Thread | [Next in Thread] |