Go Down

Topic: Stepper Motor Speed Issues When Using PS2 Controller and LCD Screen (Read 427 times) previous topic - next topic

tjred

I am working on a project that uses a PS2 controller (with the PS2X library) to control a x-axis stepper motor and y-axis stepper motor independently.  Each joystick proportionally moves the steppers either clockwise or counter-clockwise.  I have a LCD screen that displays if each stepper motor is locked or unlocked (able to move or not move when the joystick is moved away from the center dead zone) as well as changes the "sensitivity" or speed range that the stepper motor speed can be mapped between.

I have all the functions of the program working correctly.  My problem is that the stepper motors do not rotate fast enough in any of the sensitivity ranges.  When I first got the code working without the PS2 controller and just a simple joystick and 1 stepper motor, I could control the single stepper motor at the speeds that I wanted to.  When I started to add a second motor, things slowed down but it was still acceptable.  With the PS2 controller and LCD screen, I'm getting maybe 4 or 5 steps per second from each motor at the fastest.  I am desiring 2 or 3 rev/sec (120-180 rpm) for the fastest speed.

Is this an Arduino hardware limitation or are there things that I could do differently in my program to make get commands faster to the stepper motors to make them run faster?  I believe this is the case because when I comment out the LCD screen update section, the stepper motors fun faster, but when I try to run them both together at the same time, they both slow down.

Any suggestions would be greatly appreciated as I am learning as I go with Arduino and programming. The code is below.

Hardware:

Arduino Uno
(2) Nema 17 Stepper Motors
(2) TB6600 Stepper Drivers
24 VDC Battery To Power Drivers
PS2 Controller
I2C 2004 LCD Screen



vinceherman

Quote
Is this an Arduino hardware limitation or are there things that I could do differently in my program to make get commands faster to the stepper motors to make them run faster
It is hard to say if your code is causing the problem if we cannot see your code.  :)

tjred

I agree, seeing the code would help.  I couldn't fit it in the original post, and then did not have access to it at the time of posting.  Sorry for the delay.  The code is attached.  It's too big to add as code in the post.

Go Up