Hello,
I am new to electronics and I am currently working on configuring a rig that has a platform travelling along the Y axis. I am using buttons to control the travel.
Here is my hardware:
Nema 17 17HS19-1684S stepper Step Motor, Stepping Motors, Stepper Motors, Brushless Dc ...
Arduino UNO Rev3
Big Easy Driver http://www.hobbytronics.co.uk/big-easy-stepper-driver
DC Power supply HY3003D set to 8V and it draws approx 1A while running the motor.
I am also using parts from other old rigs I didn't build, like a remote control with 10 buttons. For my program, I am trying to use one button (red, pin 2) to stop the stepper, one button (green, pin 3) to make the platform travel up and down until the stop button is pressed, one button (yellow, pin 4) to go down while the button is pressed and one button (orange, pin 5) to move down while the button is pressed.
I got the basic code working from Easy Driver examples patched together (Easy Driver Examples).
Please see for_blog in attachments.
I have commented out the AccelStepper in the above example, and this works and lets me do what I want for now. However, I would like to change to using AccelStepper to be able to ramp hold. Even the most basic sections I am trying do not work as I would like them to. I realise it's a coding issue, because right now I am telling it to move to a certain position on pressing green, then it reaches it, then when I press it again I should re-initialise it but I don't really know how. I would like it to oscillate until I press the red button.
Please see for_blog_accel in attachments.
To be more clear, I want my platform to move up while I hold a button, down when I hold another button. I want it to oscillate on the press of another button until I stop it by pressing another (alternatively on a second press, to stop it from oscillating). Four buttons in total. I always want it to move downwards first when the green is being pressed, and to start the movement from scratch.
On the final rig, I want it all automatically timed, so I can tell it to oscillate by travelling a certain distance up and down for a fixed amount of time. I also want it to run 2 steppers on each side of the platform with exactly the same settings for symmetry, so a group command would be helpful. Including a switch will be how I am planning to initialise the platform (so I can tell it to go down till it hits the switch, then run the oscillating part), but I am clearly out of my depth here.
Best regards,
A.
for_blog.ino (4.14 KB)
for_blog_accel.ino (4.21 KB)