Go Down

Topic: Urgent Assistance Need: Arduino Uno (Read 1 time) previous topic - next topic

amishra

I am planning to use the Arduino uno board in combination with an easy big drive for controlling a stepper motor.

This set-up was in use with a different device where it was rotating at the speed of 100 RPM with the help of the following code. 

int ledPin = 13;                 // LED connected to digital pin 13
 
void setup() {
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}
 
void loop() {
  digitalWrite(3, HIGH);
  digitalWrite(ledPin, HIGH);   // sets the LED on
  //delay(1);
  delayMicroseconds(60);
  digitalWrite(3, LOW);
  digitalWrite(ledPin, LOW);    // sets the LED off
  //delay(1);
  delayMicroseconds(60);
}

I would now like to run it at 120 RPM for a different set-up. Can I use the same components and simply change the "delaymicroseconds" to a smaller value until I get the desired RPM? Is there anything else I should consider? Please advise.

Akanksha Mishra

DrAzzy

I can't see why that wouldn't work, though your information is rather sparse. Why not test it out?

Also, this does not belong in installation and troubleshooting, as the topic heading clearly says, it is not for questions about your project, only troubleshooting the IDE and hardware.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

wvmarle

Can I use the same components and simply change the "delaymicroseconds" to a smaller value until I get the desired RPM? Is there anything else I should consider?
Yes.
The maximum torque your motor can provide, and whether it is enough for your project. Also whether the motor can speed up fast enough to follow your stepping at the new, higher speed.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

robtillaart

#4
Jan 23, 2018, 05:30 pm Last Edit: Jan 24, 2018, 09:57 pm by Coding Badly
Please use code tags when posting...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

TomGeorge

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

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

Robin2

After all that it really wasn't urgent after all :)

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

wvmarle

I think it's just that we're so good that all the help OP needed is in the messages above :)
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

amishra

Haha, well thank you so much! I am overwhelmed by all these responses and comments.

I am so sorry, I thought I would get an email notification whenever I got a response. This whole time I was thinking I had not been getting any help. I so glad to say I stand corrected.

Basically, I am a Ph.D. student in the field of Environmental Biotechnology in Germany. We recently discarded a magnetic stirring unit in a bioreactor I am going to operate in early April.  I am building this set up with the help of an electrical workshop to replace that.

This set up consists of a (1) stepper motor 57BYGH420 from Wantai motors (holding torque: 9 kg/cm).

http://www.wantmotor.com/product/57bygh.html

(2) A big easy driver and (3) an Arduino UNO microcontroller board. The Arduino UNO had the code I have shown in my query and I did a test run by lowering the value for the delaymicroseconds to 55. It worked really well at 55, with a new voltage of 19 V. Then, I tested it at 50, and tried increasing the voltage until it had enough power (I was not going to cross 30 V given that is the upper limit of the board). At this point, everything stopped working and it didn't even work with my old code anymore.

In the last couple of days while I was reading the manual for the easy big driver I realized my DC voltage supplier had a current limiting feature. So while I was increasing the voltage, it did not give the appropriate amount of current and damaged the driver.

I just bought a new Arduino board now. Once it's here, I will do another test run and keep you all updated if it works.

This is the first time I am working with an Arduino product. I am sorry if I couldn't present my query properly the first time. I will need all the help I can get and I am really happy to find this active forum. Let me know if something still remains unclear.

Akanksha


TomGeorge

#9
Jan 24, 2018, 10:59 am Last Edit: Jan 24, 2018, 11:04 am by TomGeorge
Hi,
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

When you come back can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Don't expect email notifications, the system that does it seems more unreliable than reliable.
Hint: check when ever you can.

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

Robin2

#10
Jan 24, 2018, 11:13 am Last Edit: Jan 24, 2018, 11:14 am by Robin2
Your stepper motor requires 2 amps and the BigEasydriver will not be able to provide that without a heatsink and an aggressive cooling fan. I suggest you get a stepper driver that can supply 3 or 4 amps so you are not running the driver close to its limit.

I think you will better understand how to control the speed if you look at the example code I linked to in Reply #3. Start with very slow speeds and increase them gradually to find what is possible.

Also, you can't expect any motor to jump from stationary to high speed instantly. You need to accelerate the motor, and decelerate when stopping to avoid missing steps. Maybe look up the AccelStepper library

...R

PS..  Writing "Urgent" in your title is not nice. You are not getting any special treatment on account of it.
Two or three hours spent thinking and reading documentation solves most programming problems.

boolrules

Quote
magnetic stirring unit in a bioreactor
Seems an odd application for a stepper. Can you describe what this thing does?

amishra

@Robin2: My driver has a heat sink, however, this is still good advice and something I will definitely look into right now. It would be better to have the driver replaced to avoid problems during long-term operation. I apologize for using the using "Urgent" in my title. I was unsure about how this forum worked and under which topic does my query belong to. I know better now. Additionally, I will look into the links you have directed me to.

@Tom: I'll post a copy of my circuit as soon as possible and in the future, upload codes according to the instructions.

@boolrules: My bioreactor is stirred by a shaft that has a circular magnetic base. Now this stirring unit, has a magnet attached to the motor that rotates it. When the reactor vessel is placed on this unit, the rotation of the magnet cause rotation of the stirring rod in the reactor through its magnetic pull.

I have attached a video to this response to show you all how it worked before I started playing around with the code to increase the RPM value.




wvmarle

The magnetic stirring is quite common; used that a lot in the lab (little magnet in a beaker).
The real question is: why is that a stepper motor? Indeed it's a bit odd, a regular motor sounds more appropriate as you don't seem to care about control of how much exactly that magnet is rotated.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

amishra

I could not attach the files in the quick reply mode. Here's a new response.

Akanksha

Go Up