Stepper Motor Linear Acceleration Python (raspberry pi)

LuukS
  • Stepper Motor Linear Acceleration Python (raspberry pi) LuukS

    I am working on a Python code (below) that accelerates a stepper motor until it reaches a specific amount of steps.

    for s in range (steps):
    if s < accelerationsteps:
        lateststep = self.onestep(direction, stepstyle)
        time.sleep(s_per_s)
        s_per_s = s_per_s - ((astart - aend) / accelerationsteps)
    

    s_per_s = time in between each step

    astart = starting speed in second/step (for example 0.5)

    aend = speed at which the acceleration should stop (for example 0.05)

    accelerationsteps = amount of steps over which the acceleration should happen

    The problem is that the velocity increases in step per second per step instead of step per second per second, and is therefore increased exponentially instead of linear. I have found this article that explains in mathematical terms how one can achieve a linear increase with a stepper motor but I have not managed to translate that into my python code.

    I would highly appreciate it if someone could help me with this and I think it would be very useful for people using steppers on the Raspberry Pi in general (I have only found a solution for the Arduino here

    Thank you very much in advance.

Tags
stepper motor acceleration python raspberry-pi
Related questions and answers
  • for the exact same amount of time every time. For example, if it is supposed to move 10000 steps, it will move 100 steps smoothly, then skip for 9800 steps, and finish with another 100 steps smoothly.... For the record, maybe I'm missing something obvious, so please let me know. I measured the voltage on my A4988 stepper drivers on the RAMPS 1.4 board, sitting on the Arduino Mega2560 R3, and it is reading... settings, I cannot seem to fix the problem. It accelerates slower, but the overall effect is the same. #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,3840,90} #define DEFAULT_MAX_FEEDRATE {500

  • I have been using a software called OctoPrint that allows you to control your printer in your Browser. For sake of simplicity I have used Octopi, a preinstalled image with OctoPrint, but now I would like to make some changes, and I decided to build OctroPrint by myself, the instructions for building it are here: https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian... - octoprint.plugin.core - INFO - Found 6 plugin(s) providing 6 mixin implementations, 3 hook handlers 2016-07-11 03:09:20,533 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi

  • I have a RAMPS 1.4 and an Arduino Mega 2560. The problem is with 100k NTC thermistor. I've tested it with a multimeter, it results in ~122kΩ. I am using Marlin 1.0.2 (latest stable). I am... of the options, but found "1" is the best one for me. Executing m105 on Marlin, I get following result: ok T:0.0 /0.0 B:0.0 /0.0 T0:0.0 /0.0 @:0 [email protected]:0 On APrinter, the result is different: ok B:-inf /nan T:25.2076 /nan I have not connected bed thermistor yet. pins.h #define TEMP_0_PIN 1 // Extruder / Analog pin numbering #define TEMP_BED_PIN 0 // Bed / Analog pin

  • . Is there any way to achieve this on Windows? I also have the option of using Raspberry Pi + LabVIEW using LINX (http://www.labviewmakerhub.com/). I looked at nanoDLP (http://www.nanodlp.com/), which... if desired. I have a TI DLP Lightcrafter 4500 module connected to my laptop using the HDMI. The DLP shows up as a second monitor on my laptop. I am using LabVIEW to control all components... instead of PNG/JPG/BMP? If not, how do I know which resolution to use when converting SVG to PNG/JPG/BMP?

  • if the motor moves for 5 seconds. Now my question is, if I'm going to do this to test out a single NEMA 17 motor, do I need to comment out the rest of the test code before loading the firmware? ... You may want to use this code to test all the electronics before installing any of the suggested firmwares. I'm planning on: Flashing the test firmware onto the Arduino Mega 2560, then unplugging it from the USB. Connecting RAMPS 1.4 Connecting all 3 jumpers under the X-Axis (leaving the other jumpers disconnected). Connecting a stepper driver to the X-Axis on the board. Turning

  • I'm trying to find the correct way to read and understand the dimensions of a 3D printer. For example, if I read the following dimensions for the Robo 3D R1 Plus as 10x9x8 Inch - I want to know what 10 stands for (does it mean print height?), 9 (depth?), and 8 (width?); etc. I'm not sure if I'm assuming correctly. I know this should be simple, but I'm not sure where to reference the proper ordering, respective to each aforementioned dimension. UPDATE While looking at Makerbot's Replicator technical specifications, I see them listing their dimensions as follows: Build Volume 29.5 L X

  • Z axis length for my printer equals 120 mm. When I manually pass this length, from display controller menu, it's about few millimeters. Then I set the resolution (ZAXIS_STEPS_PER_MM) at 1600 steps per mm. And nothing changed, step still very small. I use Repetier-Firmware, Arduino Mega+RAMPS 1.4, standard Nema 17 steppers and Prusa i3 like cartesian printer. This is hardware or software problem? I checked the steppers, they're fine.

  • screws are 2cm long and 3mm wide. The stepper motor is a Wantai Stepper Motor Model 42BYGHW811 . I have e-mailed the company where I bought my kit and am awaiting their answer. Meanwhile I'm hoping to get some advice here. Apparently the usual stepper motor for a Kossel Mini is Nema 17. Searching on "42BYGHW811" I mostly find datasheets. Using "Nema 17 mount" or "Nema 17 mounting screws" as search... the stepper motor should be connected to the big black components (labeled (1) and (4) in the picture). The 4 holes in these components correspond to openings in the stepper motor; and the stepper motors

  • interpretations for? #ifdef ADVANCE #define EXTRUDER_ADVANCE_K .0 #define D_FILAMENT 2.85 #define STEPS_MM_E 836 #define EXTRUTION_AREA (0.25 * D_FILAMENT * D_FILAMENT * 3.14159) #define STEPS_PER_CUBIC_MM_E (axis_steps_per_unit[E_AXIS]/ EXTRUTION_AREA) #endif // ADVANCE // Arc interpretation settings: #define MM_PER_ARC_SEGMENT 1 #define N_ARC_CORRECTION 25 ...I not sure what this code does..... I recently bought a titan extruded that needs to be calibrated with my printer (417 microsteps http://wiki.e3d-online.com/wiki/Titan_Assembly#Firmware_Calibration

Data information