Controlling a hybrid stepper motor

Hi !

Im trying to control a ‘hybrid’ closed loop stepper motor the HB860H specifically this one:
http://www.sah.co.rs/media/sah/techdocs/hb860h_manual.pdf

This hybrid stepper motor has feedback control to read how many steps it took thus to know the position.

I ran this demo code which worked fine:

// for stepper motor 1

const int stepPin = 5;

const int dirPin = 2;

const int enPin = 9;

char data;

#define potmeterPin A0

int p;
float delay_time=500;


void setup() {
pinMode(stepPin,OUTPUT);

pinMode(dirPin,OUTPUT);

pinMode(enPin,OUTPUT);

digitalWrite(enPin,LOW); //motor1 is enabled
Serial.begin(9600);


}

void loop() {

    
if(Serial.available()>0) // we give commands through serial monitor

{
  

data=Serial.read(); //command from monitor

if(data=='a') //stepper 1 right

{

 
digitalWrite(enPin,LOW);

digitalWrite(dirPin,HIGH); //motor will rotate write

for(int x = 0; x < 48000; x++)

{

digitalWrite(stepPin,HIGH);

delayMicroseconds(500);

digitalWrite(stepPin,LOW);

delayMicroseconds(500);

Serial.print("*");

if(Serial.read()=='e') //to stop

{

digitalWrite(enPin,HIGH);

Serial.print("stop");

break;

}

}

}

if(data=='b') //stepper motor1 left

{

digitalWrite(enPin,LOW);

digitalWrite(dirPin,LOW);

for(int x = 0; x < 48000; x++)

{

digitalWrite(stepPin,HIGH);

delayMicroseconds(500);

digitalWrite(stepPin,LOW);

delayMicroseconds(500);

Serial.print("$");

if(Serial.read()=='e') //to stop

{ digitalWrite(enPin,HIGH);

Serial.print("stop");

break;

}

}

}


}

}

I though I could control the speed of the motor by varying the delay time between stepPin(HIGH) and stepPin(LOW). However this doesn’t seem to affect the speed. The only thing that did effect the speed was the Pulse/rev setting of the driver itself.

Surely it much be possible to make the speed variable with a potmeter as in this example, but how?:
http://www.arduinotutorialonline.com/2017/12/stepper-motor-speed-control-with.html

The data sheet is very brief and unclear, but does mention:

See Hybrid servo software operational manual for more detail.

I would try to locate that manual.

Tomassi:
This hybrid stepper motor has feedback control to read how many steps it took thus to know the position.

I don't see an absolute encoder or so on it; wonder how it knows its position upon power on.

Here is the definition in the manual of the “Pulse signal”:

Pulse signal: In single pulse (pulse/direction) mode, this input represents pulse signal, each rising or falling edge active (software configurable, see hybrid servo software operational manual for more detail); In double pulse mode (software configurable), this input represents clockwise (CW) pulse, active both at high level and low level.

This library has examples for acceleration and decelleration but somehow I get the idea that it only works with simple stepper motor shields like the adafruit or arduino motor shield rev3 in combination with a normal bipolar stepper motor instead of a hybrid one.

http://www.airspayce.com/mikem/arduino/AccelStepper/index.html

Come back when you have found the software and software manual for that motor.

@Tomassi, you sent me a PM about this. I have nothing to add to the advice you have already been given here.

...R

Found my answers via this superb article https://www.makerguides.com/tb6600-stepper-motor-driver-arduino-tutorial/

Tomassi:
Found my answers via this superb article https://www.makerguides.com/tb6600-stepper-motor-driver-arduino-tutorial/

We did not know you are using a TB6600 stepper driver.

…R