aide sur la cinfiguration un scanner 3d

bonjour

je suis débutant sur le sujet mes je désire faire mon propre scanner 3d
en suivant se tuto (Arduino 3D scanner DIY - Customized FabScan Project - Ardumotive Arduino Greek Playground) qui et pas complet :confused:

le matériel

1 - Arduino
2 - moteur 4 broche (17hd34008-22b)
3 - l298n

se que je veut faire c'est un simple

le faire faire tourné

je pense avoir tout bien branché

2 fil sur le out1 out2 rouge bleu
2 fil sur le out3 out4 noir vert

une alimentation 12 volt

in1 sur pin11
in2 sur pin10
in3 sur pin9
in4 sur pin8

les laser sur le GND du l298n

et sur le pin A4

je suis avec je code mes sa ne tourne pas

// FabScan - http://hci.rwth-aachen.de/fabscan
//
//  Created by Francis Engelmann on 7/1/11.
//  Copyright 2011 Media Computing Group, RWTH Aachen University. All rights reserved.
//  
//  Chngelog:
//  R. Bohne 29.01.2013: changed pin mapping to Watterott FabScan Arduino Shield
//  R. Bohne 30.12.2013: added pin definitions for stepper 4 --> this firmware supports the new FabScan Shield V1.1, minor syntax changes. Steppers are now disabled at startup.
//  R. Bohne 12.03.2014: renamed the pins 14..19 to A0..A5 (better abstraction for people who use Arduino MEGA, etc.)

#define LIGHT_PIN A3
#define LASER_PIN A4
#define MS_PIN    A5

//Stepper 1 comme indiqué sur Shield, Turntable
#define ENABLE_PIN_0  2
#define STEP_PIN_0    3
#define DIR_PIN_0     4

//Stepper 2, Laser Stepper
#define ENABLE_PIN_1  5
#define STEP_PIN_1    6
#define DIR_PIN_1     7

//Stepper 3, actuellement inutilisé
#define ENABLE_PIN_2  11
#define STEP_PIN_2    12
#define DIR_PIN_2     13

//Stepper 4, actuellement inutilisé
#define ENABLE_PIN_3  A0
#define STEP_PIN_3    A1
#define DIR_PIN_3     A2
  
#define TURN_LASER_OFF      200
#define TURN_LASER_ON       201
#define PERFORM_STEP        202
#define SET_DIRECTION_CW    203
#define SET_DIRECTION_CCW   204
#define TURN_STEPPER_ON     205
#define TURN_STEPPER_OFF    206
#define TURN_LIGHT_ON       207
#define TURN_LIGHT_OFF      208
#define ROTATE_LASER        209
#define FABSCAN_PING        210
#define FABSCAN_PONG        211
#define SELECT_STEPPER      212
#define LASER_STEPPER       11
#define TURNTABLE_STEPPER   10

// le protocole: nous envoyons un octet pour définir l'action à faire.
// Si l'action est unaire (comme éteint la lumière), nous avons besoin d'un seul octet, donc nous allons bien.
// Si nous voulons dire au stepper de tourner, un second octet est utilisé pour spécifier le nombre d'étapes.
// Ces deux octets sont définis ci-dessous.


#define ACTION_BYTE         1    //normal byte, première action nouvelle
#define LIGHT_INTENSITY     2
#define TURN_TABLE_STEPS    3
#define LASER1_STEPS        4
#define LASER2_STEPS        5
#define LASER_ROTATION      6
#define STEPPER_ID          7

int incomingByte = 0;
int byteType = 1;
int currStepper;

#include <Stepper.h>

const int stepsPerRevolution = 24;


// Inizializzare la libreria passo-passo su pin da 2 a 5:
Stepper myStepper(stepsPerRevolution, 10,11,8,9);      


//Moteur actuel: tournez un seul pas
void step()
{
  myStepper.setSpeed(1);
  myStepper.step(1);
}

//le moteur actuel pour <count> times
void step(int count)
{
  for(int i=0; i<count; i++){
    step();
  }
}

void setup() 
{ 
  // initialiser le port série
   Serial.begin(9600);
   pinMode(LASER_PIN, OUTPUT);
   pinMode(LIGHT_PIN, OUTPUT);
 
   pinMode(MS_PIN, OUTPUT);
   digitalWrite(MS_PIN, HIGH);  //HIGH for 16microstepping, LOW for no microstepping

  pinMode(ENABLE_PIN_0, OUTPUT);
  pinMode(DIR_PIN_0, OUTPUT);
  pinMode(STEP_PIN_0, OUTPUT);

  pinMode(ENABLE_PIN_1, OUTPUT);
  pinMode(DIR_PIN_1, OUTPUT);
  pinMode(STEP_PIN_1, OUTPUT);
 
  pinMode(ENABLE_PIN_2, OUTPUT);
  pinMode(DIR_PIN_2, OUTPUT);
  pinMode(STEP_PIN_2, OUTPUT);

  pinMode(ENABLE_PIN_3, OUTPUT);
  pinMode(DIR_PIN_3, OUTPUT);
  pinMode(STEP_PIN_3, OUTPUT);
 
 //disable all steppers at startup
 digitalWrite(ENABLE_PIN_0, HIGH);  //HIGH to turn off
 digitalWrite(ENABLE_PIN_1, HIGH);  //HIGH to turn off
 digitalWrite(ENABLE_PIN_2, HIGH);  //LOW to turn on
 digitalWrite(ENABLE_PIN_3, HIGH);  //LOW to turn on 
 
 digitalWrite(LIGHT_PIN, LOW); //turn light off

 digitalWrite(LASER_PIN, HIGH); //turn laser on
 Serial.write(FABSCAN_PONG); //send a pong back to the computer so we know setup is done and that we are actually dealing with a FabScan
 
 currStepper = TURNTABLE_STEPPER;  //turntable is default stepper
} 

void loop() 
{

  if(Serial.available() > 0){

    incomingByte = Serial.read();
    
    switch(byteType){
      case ACTION_BYTE:
      
          switch(incomingByte){    //ce commutateur gère toujours le premier octet
            //Laser
            case TURN_LASER_OFF:
              digitalWrite(LASER_PIN, LOW);    // turn the LASER off
              break;
            case TURN_LASER_ON:
              digitalWrite(LASER_PIN, HIGH);   // turn the LASER on
              break;
            case ROTATE_LASER: //unused
              byteType = LASER_ROTATION;
              break;
            //TurnTable
            case PERFORM_STEP:
              byteType = TURN_TABLE_STEPS;
              break;
            case SET_DIRECTION_CW:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(DIR_PIN_0, HIGH);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(DIR_PIN_1, HIGH);
              }
              break;
            case SET_DIRECTION_CCW:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(DIR_PIN_0, LOW);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(DIR_PIN_1, LOW);
              }
              break;
            case TURN_STEPPER_ON:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(ENABLE_PIN_0, LOW);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(ENABLE_PIN_1, LOW);
              }
              break;
            case TURN_STEPPER_OFF:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(ENABLE_PIN_0, HIGH);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(ENABLE_PIN_1, HIGH);
              }
              break;
            case TURN_LIGHT_ON:
              byteType = LIGHT_INTENSITY;
              break;
            case TURN_LIGHT_OFF:
              digitalWrite(LIGHT_PIN, LOW);
              break;
            case FABSCAN_PING:
              delay(1);
              Serial.write(FABSCAN_PONG);
              break;
            case SELECT_STEPPER:
              byteType = STEPPER_ID;
              break;
            }
      
          break;
       case LIGHT_INTENSITY:       //Après ce point, nous prenons soin du second octet si l'on envoie un
          analogWrite(LIGHT_PIN, incomingByte);
          byteType = ACTION_BYTE;  //reset byteType
          break;
        case TURN_TABLE_STEPS:
          step(incomingByte);
          byteType = ACTION_BYTE;
          break;
        case STEPPER_ID:
          Serial.write(incomingByte);
          currStepper = incomingByte;
          byteType = ACTION_BYTE;
          break;
    }
  } 
}

merci de l'aide que vous pourriez m’apporter

Vous avez déjà essayé de faire simplement fonctionner votre moteur ? c'est un gros projet pour un débutant

déjà un petit effort sur le francais ne serait pas un luxe.
5 lectures pour comprendre ce que tu écris.

c'est quoi ca?

in1 sur pin11
in2 sur pin10
in3 sur pin9
in4 sur pin8

si les pins ne sont pas bonnes dans le code ou sur l'arduino, ca ne risque pas de fonctionner.

l'alim est connectée où, sur l'arduino ou le L298n?

infobarquee:
déjà un petit effort sur le francais ne serait pas un luxe.
5 lectures pour comprendre ce que tu écris.

c'est quoi ca?
si les pins ne sont pas bonnes dans le code ou sur l'arduino, ca ne risque pas de fonctionner.

l'alim est connectée où, sur l'arduino ou le L298n?

allez, regardes ce lien ICI

tu verras qu'il manque des trucs dans le code

If you decided to make this with my hardware parts, click the Edit button and:

    Add lines

    #include
    const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
    // for your motor
    Stepper myStepper(stepsPerRevolution, 10, 11,8,9);

    Replace step() function with:

    void step() {
    myStepper.setSpeed(1);
    myStepper.step(1);

    }

bonjour

j'ai rajouté les ligne

#include
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
Stepper myStepper(stepsPerRevolution, 10, 11,8,9);

et remplacé

void step() {
myStepper.setSpeed(1);
myStepper.step(1);

}

oui j'ai déjà fait un branchement simple

mes la si vous regardé la photo

il y a pas de plans de montage pour les pin

je suis alimenté en 12v et pour les LED en USB via l’Arduino

je pense que mon problème vient des branchement car mon code a pas erreur

entre les pin (Arduino) 11/10/9/8 et ( l298n) int1 /int2 / int3/ int4

// FabScan - http://hci.rwth-aachen.de/fabscan
//
//  Created by Francis Engelmann on 7/1/11.
//  Copyright 2011 Media Computing Group, RWTH Aachen University. All rights reserved.
// 
//  Chngelog:
//  R. Bohne 29.01.2013: changed pin mapping to Watterott FabScan Arduino Shield
//  R. Bohne 30.12.2013: added pin definitions for stepper 4 --> this firmware supports the new FabScan Shield V1.1, minor syntax changes. Steppers are now disabled at startup.
//  R. Bohne 12.03.2014: renamed the pins 14..19 to A0..A5 (better abstraction for people who use Arduino MEGA, etc.)

#define LIGHT_PIN A3
#define LASER_PIN A4
#define MS_PIN    A5

//Stepper 1 comme indiqué sur Shield, Turntable
#define ENABLE_PIN_0  2
#define STEP_PIN_0    3
#define DIR_PIN_0     4

//Stepper 2, Laser Stepper
#define ENABLE_PIN_1  5
#define STEP_PIN_1    6
#define DIR_PIN_1     7

//Stepper 3, actuellement inutilisé
#define ENABLE_PIN_2  11
#define STEP_PIN_2    12
#define DIR_PIN_2     13

//Stepper 4, actuellement inutilisé
#define ENABLE_PIN_3  A0
#define STEP_PIN_3    A1
#define DIR_PIN_3     A2
 
#define TURN_LASER_OFF      200
#define TURN_LASER_ON       201
#define PERFORM_STEP        202
#define SET_DIRECTION_CW    203
#define SET_DIRECTION_CCW   204
#define TURN_STEPPER_ON     205
#define TURN_STEPPER_OFF    206
#define TURN_LIGHT_ON       207
#define TURN_LIGHT_OFF      208
#define ROTATE_LASER        209
#define FABSCAN_PING        210
#define FABSCAN_PONG        211
#define SELECT_STEPPER      212
#define LASER_STEPPER       11
#define TURNTABLE_STEPPER   10

// le protocole: nous envoyons un octet pour définir l'action à faire.
// Si l'action est unaire (comme éteint la lumière), nous avons besoin d'un seul octet, donc nous allons bien.
// Si nous voulons dire au stepper de tourner, un second octet est utilisé pour spécifier le nombre d'étapes.
// Ces deux octets sont définis ci-dessous.


#define ACTION_BYTE         1    //normal byte, première action nouvelle
#define LIGHT_INTENSITY     2
#define TURN_TABLE_STEPS    3
#define LASER1_STEPS        4
#define LASER2_STEPS        5
#define LASER_ROTATION      6
#define STEPPER_ID          7

int incomingByte = 0;
int byteType = 1;
int currStepper;


#include
    const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
    // for your motor
    Stepper myStepper(stepsPerRevolution, 10, 11,8,9);



//Moteur actuel: tournez un seul pas
void step()
{
  myStepper.setSpeed(1);
  myStepper.step(1);
}

//le moteur actuel pour <count> times
void step(int count)
{
  for(int i=0; i<count; i++){
    step();
  }
}

void setup()
{
  // initialiser le port série
   Serial.begin(9600);
   pinMode(LASER_PIN, OUTPUT);
   pinMode(LIGHT_PIN, OUTPUT);
 
   pinMode(MS_PIN, OUTPUT);
   digitalWrite(MS_PIN, HIGH);  //HIGH for 16microstepping, LOW for no microstepping

  pinMode(ENABLE_PIN_0, OUTPUT);
  pinMode(DIR_PIN_0, OUTPUT);
  pinMode(STEP_PIN_0, OUTPUT);

  pinMode(ENABLE_PIN_1, OUTPUT);
  pinMode(DIR_PIN_1, OUTPUT);
  pinMode(STEP_PIN_1, OUTPUT);
 
  pinMode(ENABLE_PIN_2, OUTPUT);
  pinMode(DIR_PIN_2, OUTPUT);
  pinMode(STEP_PIN_2, OUTPUT);

  pinMode(ENABLE_PIN_3, OUTPUT);
  pinMode(DIR_PIN_3, OUTPUT);
  pinMode(STEP_PIN_3, OUTPUT);
 
 //disable all steppers at startup
 digitalWrite(ENABLE_PIN_0, HIGH);  //HIGH to turn off
 digitalWrite(ENABLE_PIN_1, HIGH);  //HIGH to turn off
 digitalWrite(ENABLE_PIN_2, HIGH);  //LOW to turn on
 digitalWrite(ENABLE_PIN_3, HIGH);  //LOW to turn on
 
 digitalWrite(LIGHT_PIN, LOW); //turn light off

 digitalWrite(LASER_PIN, HIGH); //turn laser on
 Serial.write(FABSCAN_PONG); //send a pong back to the computer so we know setup is done and that we are actually dealing with a FabScan
 
 currStepper = TURNTABLE_STEPPER;  //turntable is default stepper
}

void loop()
{

  if(Serial.available() > 0){

    incomingByte = Serial.read();
   
    switch(byteType){
      case ACTION_BYTE:
     
          switch(incomingByte){    //ce commutateur gère toujours le premier octet
            //Laser
            case TURN_LASER_OFF:
              digitalWrite(LASER_PIN, LOW);    // turn the LASER off
              break;
            case TURN_LASER_ON:
              digitalWrite(LASER_PIN, HIGH);   // turn the LASER on
              break;
            case ROTATE_LASER: //unused
              byteType = LASER_ROTATION;
              break;
            //TurnTable
            case PERFORM_STEP:
              byteType = TURN_TABLE_STEPS;
              break;
            case SET_DIRECTION_CW:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(DIR_PIN_0, HIGH);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(DIR_PIN_1, HIGH);
              }
              break;
            case SET_DIRECTION_CCW:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(DIR_PIN_0, LOW);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(DIR_PIN_1, LOW);
              }
              break;
            case TURN_STEPPER_ON:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(ENABLE_PIN_0, LOW);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(ENABLE_PIN_1, LOW);
              }
              break;
            case TURN_STEPPER_OFF:
              if(currStepper == TURNTABLE_STEPPER){
                digitalWrite(ENABLE_PIN_0, HIGH);
              }else if(currStepper == LASER_STEPPER){
                digitalWrite(ENABLE_PIN_1, HIGH);
              }
              break;
            case TURN_LIGHT_ON:
              byteType = LIGHT_INTENSITY;
              break;
            case TURN_LIGHT_OFF:
              digitalWrite(LIGHT_PIN, LOW);
              break;
            case FABSCAN_PING:
              delay(1);
              Serial.write(FABSCAN_PONG);
              break;
            case SELECT_STEPPER:
              byteType = STEPPER_ID;
              break;
            }
     
          break;
       case LIGHT_INTENSITY:       //Après ce point, nous prenons soin du second octet si l'on envoie un
          analogWrite(LIGHT_PIN, incomingByte);
          byteType = ACTION_BYTE;  //reset byteType
          break;
        case TURN_TABLE_STEPS:
          step(incomingByte);
          byteType = ACTION_BYTE;
          break;
        case STEPPER_ID:
          Serial.write(incomingByte);
          currStepper = incomingByte;
          byteType = ACTION_BYTE;
          break;
    }
  }
}

j'ai rajouté les ligne

#include
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
Stepper myStepper(stepsPerRevolution, 10, 11,8,9);

et remplacé

void step() {
myStepper.setSpeed(1);
myStepper.step(1);

}

heuuuu comment dire, c'est pas rajouter le tout et ca m'étonnerait que ca compile comme tu as fait.

Add lines

    #include
    const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
    // for your motor
    Stepper myStepper(stepsPerRevolution, 10, 11,8,9);
  Replace step() function with:

    void step() {
    myStepper.setSpeed(1);
    myStepper.step(1);

    }

toi, tu nous fait ceci

//Moteur actuel: tournez un seul pas
void step()
{
  myStepper.setSpeed(1);
  myStepper.step(1);
}

//le moteur actuel pour <count> times
void step(int count)
{
  for(int i=0; i<count; i++){
    step();
  }
}

mes la si vous regardé la photo

il y a pas de plans de montage pour les pin

tu sais suivre un fil sur une photo, non?
4 fils a suivre, c'est pas la mort.

je suis alimenté en 12v et pour les LED en USB via l'Arduino

quelles leds?

quelles leds? pardon laser

les fils je les ai branché int 1 au pin 11 et la suite

j'ai essayé l'inverse et marche pas non plus

adrien38:
quelles leds? pardon laser

les fils je les ai branché int 1 au pin 11 et la suite

j'ai essayé l'inverse et marche pas non plus

Stepper myStepper(stepsPerRevolution, 10, 11,8,9);

je te conseille de regarder ce tuto

et surtout de faire les tests
sinon, on va pas avancer d'un pas