• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

who can give me an example of homing code of step motor?

Not open for further replies.


New Member
my system works like this: after the power of the microcontroller is on, the step motor will home itself, and set the homing position as the absolute zero.


I hope OP will not mind partial hijack ..
any "proven" good solutions for "homing" .. or to say more precisely "setting the motor to predefined initial position" ....

Looking back in time I used micro switch to detect "initial position" that was pretty inaccurate, then some micro switch with hw debouncing that was bit better but still inaccurate, tried the reed relay - worse, and finally got the best results from opto coupler with air gap in combination with micro switch....

The "final" product was pretty accurate but toooo bulky (I made only one for a friend) as I used micro switch to mark the "close to home" position and then the disk with a notch was to get the "fine tuning" but to increase precision you need either big disk (what I used) or gears (that I did not have) ...

so .. any ideas other that what I already tried :D that are proven to work? .. I'm talking about "high" precission .. the micro switch can get within ±2mm .. the opto alone will get ±1mm or even ±.5mm ...
Not open for further replies.

EE World Online Articles