How To Make Closeloop stepper with Magneticsensor AS5600

Hi all.
I want to ask how to make closeloop stepper with as5600 magnetic sensor.
Because i want to control stepper like a servo motor.

Hi @Arta_botak333 !

It is quite easy to do this with SimpleFOC.

But you may want to choose a different sensor. The AS5600 is not very precise, and most steppers have quite high pole counts. Also I2C is very slow. So it can be hard to keep the stepper under control with this sensor…

In general terms, to make a closed loop servo you can just take a look at our “position control” examples. That’s what you would normally use to make a closed loop position control like a servo…

1 Like

Thanks sir, yes i will change the encorder when i can make this first sir, because i just want tu run stepper mybe 2 until 5rpm sir, mybe do u have recomend encorder for this?? And how about encorder printer sir?? Like encorder printer cannon etc, because in my village plenty ex printer broken sir.

And one more for the stepper.move() its mean for run the stepper to the target right??
Because i still waiting for my driver stepper, now i just have driver stepper l293D shield arduino unu, and i dont see how to wiring it. Thankyou🙏


2-5RPM is not so fast actually, so you could try first with the AS5600 and see if it works for you…

Try it out :grinning: I don’t think anyone has tried before… I think for the stepper motor you probably want 12bits accuracy or more… so if the printer encoder can do this, it is definitely worth trying out. Please let us know how it goes if you do try it

Yes, you can call motor.move(target) to set a new target value.

Take a look at our documentation here: Stepper Motor Control Nucleo | Arduino-FOC

It’s not exactly the same hardware you are using but it should give you an idea…

Yess i think i will try when i have free time, for now still lokking for data sheet how many ppr encorder printer using. Because somebody say 800ppr. And for that simple foc used ppr or cpr sir…?.

Like control stepper with potensio is posible sir??
Because i want like a mini dc servo, you can control angle by write the angle on servo.write() sir. For the stepper.move it for angle or step sir.?