Set stepper motor distance back and forth


#1

Dear all,

I have a question regarding the programming of my stepper motor in the mBlock software.
Hopefully you can help me out on this. I am using the following:

42BYG Stepper Motor > Me Stepper Motor Driver > Me Orion(Base on Arduino UNO)

What I would like the stepper motor to do is:

  1. Go 1000 steps distance
  2. Then go back -1000 steps distance
  3. Repeat this x - times

For me it seems as an easy to program action but I can not make it work.
Is this actually possible?

Many thanks for your input!

Best,

Philip


#2

Hi Phillus,

I think the mBlock program for the stepper motor cannot achieve this since the optional speed values for the stepper motor are all positive number no negative, so it will only move forward.

May I know why do you want it to action as this way, you may need program yourself by Arduino program.


#3

Thank you for this and too bad this won’t work with mBlock.
I am building a maquette, in there I would like to move an object 5cm to the right and then 5cm left quite fast.

It seems to me like quite an easy motion to program.
You have any idea on how to achieve this in mBlock? Maybe with other components, motors / drivers / boards from Makeblock?
Otherwise I will find someone who can program this for me then.

Best,

Philip


#4

Hi phillus,

Correction for previous reply: I have tested it again and this is possible to achieve forward and backward by settings the distance value to positive and negative. Sorry for the mistake before.
Please try refer to following steps:

  1. Upgrade firmware for Orion Board.
  2. Upload the following program with USB cable connection:
  3. Unplug the USB cable and Power on the oRion board (make sure the battery or external power adapter can provide enough power to the oRion board)