Go Down

Topic: question re' controlling stepper with potentiometer (easy driver) (Read 3337 times) previous topic - next topic

Robin2


Will the the pot cause an issue being wired in still?


There is a very simple practical solution that removes that doubt.

...R

Cretster

#16
Jul 12, 2014, 08:36 pm Last Edit: Jul 12, 2014, 08:54 pm by Cretster Reason: 1
Well, there's probably 2:

Leave it in and see/Remove it and not worry.  But with the latter then I'm changing the circuit from the intended use of course.


Anyway, I've set vref at 0.16v as the stepper is rated 0.4A, so I 'think' that's correct for it.

Not yet tried your code (am about to) but with the arduino powered and pololu connected, but without the battery for the steppers connected the pololu gets too hot to touch after it's on for around a minute.  This might be ok since all the blurb on the pololu site says it gets hot enough to burn in normal use, but it doesn't reassure me much....

Anyway, I've pulled the analogue input from the pot, and am going to try your code.....

Cretster

#17
Jul 12, 2014, 08:59 pm Last Edit: Jul 12, 2014, 09:33 pm by Cretster Reason: 1
Nothing apparently happening after I upload the code and hook it all up (sans potentiometer), other than the driver chip getting very hot and the LED flashing as per the code.  No movement of the stepper that I could see. :(

I'm going to go and study a ton of other threads and tutorials and see if I can spot what I'm doing wrong.  Clearly something is screwy with this setup.

Robin2


Nothing apparently happening after I upload the code and hook it all up (sans potentiometer), other than the driver chip getting very hot and the LED flashing as per the code.  No movement of the stepper that I could see. :(



When I connect my Pololu A4988 driver to a stepper motor that requires 0.33amps using the Pololu wiring diagram and the sketch I posted "it just works".

If yours is not working either your driver is different from the Pololu driver or it is broken.

Where did you get your stepper driver?

...R

Cretster

These are the ones I bought Robin:
http://www.ebay.co.uk/itm/131037851916?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Bought 2 of them so on the offchance that one is faulty or I've damaged it, I'm trying the other.

Going to try the exact same setup as this youtube video:
https://www.youtube.com/watch?v=PrV-SLxIIFE

I've found a 220uf 16v capacitor so I'll add that to the equation as I didn't previously have one wired in.
My stepper power is coming from a lead acid 12v battery (a small 7ah one like a burglar alarm might use), so I can't see how it would spike, but nonetheless I'll add the capacitor as a precaution anyway.

Will advise what the outcome is shortly (if any!)...

Cretster

YESS!  Finally, some success (of sorts).

Used the other driver and copied exactly the setup in that video and using the code they linked to.
It worked first time. 
The stepper is not behaving the same as theirs, and for a lot of the time the motor shaft is simply vibrating at different intensities rather than spinning (it did briefly turn a little before doing this), but I'm sure that must be down to the motor spec being different to the one in the video, or potentially the driver output as I've only roughly set it on this second driver.

Anyway, I then substituted the driver board for the original one and it did absolutely nothing. :(
So it's possible it was faulty, or it's possible (likely I suspect) that I killed it with earlier attempts.  Either way, I'm glad these things are so cheap!  Might order a couple more in case of further errors of judgement and since I ultimately want more than one stepper in use anyway.  I still have an easy driver en route too.

I think next, I will do the following:
1) Check then set the vref correctly and try again to see if the motor turns better.
2) Possibly mess with the code a little to see what the motor does
3) Run your code again to see how it behaves now.
4) Possibly revert add the potentiometer back and revert to the original code, although I'm slightly hesitant to do this in case this is what could have killed the original driver?

Can you see any issue with the original code and potentiometer setup, other than the lack of capacitor and the sleep/reset not being jumpered together?

Feel a lot happier anyway now I've got some snifter of progress at least.  And I appreciate your input, thanks.

Cretster

Tried with your code again now, and what it does is two 'bursts' of the motor shaft oscillating back & forth very rapidly by a tiny amount.  So not really moving so much that you can see the shaft rotate one way then the other, but going back & forth by a few degrees perhaps extremely fast.

Will have to leave it there for tonight.  i have a few hours of soldering to do for a friend...

Robin2

#22
Jul 13, 2014, 09:58 am Last Edit: Jul 13, 2014, 10:08 am by Robin2 Reason: 1
Just in case I had mucked something up I tried my code again just before writing this and it works fine. It slowly rotates the motor 100 steps in one direction followed by 100 steps in the other direction back to the original position.

And my stepper is also powered by a 12v lead-acid battery - just a little larger than yours at 200Ah  :)

You said you are following some video instructions. Why not keep things simple and just use the instructions on the Pololu webpage that I am using?

I don't think there is any value in trying anything else until my code works for you. It is the most basic possible stepper motor code.

Maybe you should buy 1 real Pololu A4988 as a benchmark? The Sparkfun BigEasydriver is similar but it defaults to microstepping whereas the Pololu A4988 defaults to single stepping.  Which raises the question, what is the default for your board? If it defaults to 1/16th microstepping it would only turn the equivalent of 100/16 full steps with my code.

...R

Cretster

Right, I can't get the stepper to behave smoothly or to turn without vibrating a lot, and I've a suspicion it's to do with the spec of the motor.

On the reprap forum I discovered after buying a half built printer from a friend that he'd bought unsuitable motors.
These are the ones I have that I'm trying to use here:
http://www.aliexpress.com/store/product/4-pcs-4-lead-Nema-17HS3404N-Stepper-Motor-37-oz-in-CNC-longs-motor-CNC-engraving/813631_613839605.html

I've a feeling the phase inductance or resistance made it an awkward motor for some reason?

Cretster

#24
Jul 13, 2014, 10:36 am Last Edit: Jul 13, 2014, 11:05 am by Cretster Reason: 1
Sorry, I hadn't seen your latest post.

I'd only tried the video example as it was an easy to see physical setup whereby I could see the physical layout etc and copy it in every respect sa start point. It worked with the second chip so I'll revert back to your code and take things from there plus check the step defaults etc.

As far as I can tell mine defaults to full steps as it's a pololu chip.  I can't find any info to the contrary through the ebay auction anyway.  Not that this is conclusive of course!

The motor is 1.8 degree per step, so I changed your code from 100 to 200 steps and uploaded it.
The motor turns slowly with the code refreshed, but is very jittery.  I've still got it set at 0.16v as it's a 0.4a motor.
I'm tempted to take a motor from my printer temporarily to try as I know they work well with the A4988 chip but it's a bit of a nuisance.  It would at least rule out if the motor is being awkward though.  There's a reason I didn't keep them on the printer when I bought it but I forget the intricate details.

TomGeorge

Hi, just a quick check, if you are using batteries, 200Ah, have you got a switch and  A FUSE in the positive line, say 5A at least.
The minute someone says Lead Acid, Lipo or Nickle-Metal Hydride then no matter what size, they can provide a hell of a short circuit current.
If you have an arc over or short its gunna be a decent one.
I'd prefer to use a variable power supply with current limiting, if available.

If you don't have either a fuse or current limit supply, I'd STOP and not do anymore experimenting until a fuse is fitted.

Tom....... :)
Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Robin2

The spec of your motor seems very similar to the ones I have.

I guess it's possible the motor is the problem but it seems unlikely to me.

...R

Robin2


Hi, just a quick check, if you are using batteries, 200Ah, have you got a switch and  A FUSE in the positive line, say 5A at least.


Don't worry. It's the domestic electric system on a boat and is well protected.

...R

TomGeorge

Hi, its not the protection of the batteries I'm talking about, its the devices that are being supplied, if the battery supply has a 30 or 50A fuse, it will be of little use to an electronics-low power circuit.

Tom....... :)
Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Cretster


The spec of your motor seems very similar to the ones I have.

I guess it's possible the motor is the problem but it seems unlikely to me.

...R


Hmmm, I agree if the spec of yours is pretty similar (and they are from the look of it) then they ought to behave pretty much the same.

Do you know what vref your driver is set as?  Presume slightly less than mine if yours are .33A rated as opposed to mine being 0.4, but when I've varied the adjustment pot it changes the behaviour a bit, but I can't seem to find a 'sweet spot' like I'd kind of expect.  Not sure why that might be unfortunately on account of complete lack of experience with arduino in this respect.

Might have to try a servo for my project temporarily until I get this figured out as I want to get something built as a motor system  for my timelapse dolly/rail (ie what this project is for).

Go Up