Hallo, ich möchte ein Brustkorbphaton bauen, und das mit einem Stepper-Motor betreiben, der Hub wird über eine Kurbelwelle realisiert (siehe Bild im Anhang), wie beim Kolben vom Motor. Dienen soll das ganze um Atemmuster zu simulieren, die mit einer MPU9250 dann detektiert werden sollen. Jetzt ist das Problem, dass wenn ich 10 Schritte auf den Stepper (Pololu 1209) gebe der IMU jeden einzelen Schritt detektiert. Das ist ja nicht so wie es sein soll. Also läuft der Motor irgendwie "unruhig" geht das vielleicht mit einer anderen Ansteuerung/ Bibliothek besser
Als H-Brücke nehme ich die L293D, mit der Standart stepper Bibliothek
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 9,8,7,6;
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(3);
// initialize the serial port:
//Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
//Serial.println("clockwise");
myStepper.step(10);
//delay(500);
// step one revolution in the other direction:
//Serial.println("counterclockwise");
myStepper.step(-10);
//delay(500);
}
Vielen dank für eure Hilfe