LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem controlling stepper motors

Solved!
Go to solution

Hi, i am new.

 

I am working on an arm with stepper motors for a school class
I have used LINX and arduino to control the motor by taking the steps with a know / dial, to know the location at an angle and used some equations, this works well, I keep the position with it.
Now I am trying to move it and save the number of steps for the position and thus create an array to create a cycle of movement, that is to say put in several positions and keep saving to repeat them only a given number of times.

I think the hardest thing I already did but in this I don't know how, any help?

0 Kudos
Message 1 of 2
(2,099 Views)
Solution
Accepted by topic author Rene9529

The technique you're missing is probably shift registers.

 

Put the positions (also known as "setpoints") in an array.

Give your loop a shift register.

Wire the array with setpoint to the left side of the shift register.

Get the first element, and use it to set the motor position.

When the setpoint is reached, delete the element.

Wire the resulting array (with or without the deleted element) to the inside right side of the shift register.

 

An image will probably be more useful:

Positions.PNG

Keep in mind that I don't know your program as well as you do.

 

Lots of variations are possible. Some are probably better. You can for instance keep the position index in a shift register, in stead of the array itself. Or you can rotate the positions in stead of deleting the elements, if you want an infinite loop.

 

You've done a good job so far. But do try to use CTRL + ALT+ mouse drag to remove some of that empty space. A big diagram means less overview, and more work to get things done. You can always insert the space with CTRL + mouse drag if you really need it.

Message 2 of 2
(2,041 Views)