Show Posts
Pages: [1] 2
1  Using Arduino / Motors, Mechanics, and Power / Re: Stopping a Motor with a Current Sensor... on: November 15, 2013, 12:11:30 pm
I'm using a Board from Pololu http://www.pololu.com/product/1220

The Driver on it is a: Toshiba TB6612FNG
Data Sheet: http://www.pololu.com/file/0J86/TB6612FNG.pdf
2  Using Arduino / Sensors / Re: ACS712 - 30A vs 5A.... on: November 12, 2013, 08:22:19 am
Chagrin, Thanks for the response!
What would be a good sensor to use? Would you have any suggestions?

I was thinking of getting one of these. It looks like it would have other uses in the longterm.
INA219 High Side DC Current Sensor Breakout - 26V ±3.2A Max
http://www.adafruit.com/products/904
3  Using Arduino / Motors, Mechanics, and Power / Re: Stopping a Motor with a Current Sensor... on: November 11, 2013, 06:36:29 pm
Okay, so I think I made a mistake....
I bought an ACS712-30A board. I think I needed to buy a ACS712-5A. My project pulls about 140mA max. When I run a simple analogRead it get the half voltage read of the VCC. as shown on other people project... about 512. Good that's normal.

The stink is I don't see any change on the reading when I run my motor and other parts. I can see the current being pulled on my desktop power supply. But no change on the ACS712-30A.

Do think the reason why is that it's not sensitive enough? the -30a or -5a stands for the max amp it can handle...


Thanks again for all of the help!

link to what I bought:
http://www.amazon.com/Amico-Electrical-Current-Sensor-Module/dp/B00BNQXAIY/

Data Sheet: http://www.allegromicro.com/~/media/Files/Datasheets/ACS712-Datasheet.ashx
4  Using Arduino / Sensors / ACS712 - 30A vs 5A.... on: November 11, 2013, 01:50:19 pm
Can I use a ACS712-30A to read currents from devices that are bellow 1A? I have a 30A version. But I know that what I'm trying to measure around 150mA, and I'm not getting any fluctuation in the read. 

Thanks, Dan!

Code:
int curRead;
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  curRead = analogRead(A0);
   delay(1);
  Serial.println(curRead); 
}
5  Using Arduino / Sensors / Find a Knob's Speed and Direction... Math! on: November 09, 2013, 06:54:27 pm
I'm want to find out he speed and direction a person is turning a simple knob / potentiometer. My knob have the read value from 0 - 1025... So with the user spins the knob, I need to detect the rate at which he is spinning and also the direction... Is there a builtin math function I could use?

Example code would be amazing!!!
thanks for the help!
dan.
6  Using Arduino / Motors, Mechanics, and Power / Re: Stopping a Motor with a Current Sensor... on: November 07, 2013, 04:21:37 pm
I'm only running one motor on my driver. Do you think it would be possible to use a sensor at the voltage into the driver? That way I can watch the current draw no matter the direction of the motor spin?
7  Using Arduino / Motors, Mechanics, and Power / Re: Stopping a Motor with a Current Sensor... on: November 07, 2013, 02:00:08 pm
That's what I'm screaming MrBear! What are you using for the sensor? Would you be willing to share some code, or point me where I can look at other code like it?

Thanks guys for all of the help! Best forum on the internet!
8  Using Arduino / Motors, Mechanics, and Power / Re: Stopping a Motor with a Current Sensor... on: November 07, 2013, 08:47:11 am
But Trum! what about my Ford? Does it use this advanced stalling technique? just kidding.... Thanks for the fast reply! To be honest, I have never seen it done before.. It was one of those late night ideas and didn't know if I was crazy.

Basically my project uses a large wheel and will very on the position, so the end of the move will never be the same. Or I would be all over the switch. I'm ordering a ACS712 today.... hopefully that will work like a champ...
9  Using Arduino / Motors, Mechanics, and Power / Stopping a Motor with a Current Sensor... on: November 07, 2013, 08:31:32 am
I need to stop a motor from turning when it hits the end of it's move. I'm wanting to do it when the motor hits a higher then average torque. I'm wanting to catch it just as it almost hits a stall.

I was thinking of putting a Current Sensor on the power lines, and build a function that would check the current. If it hit an abnormally higher then average current then stop the motor.

Is this a good way to do this? Is there a smarter simpler way of watching for the higher then normal / just about to stall the motor? Is it possible to do this with out a current sensor, and just use one of the io pins on the arduino?

Thanks for any feed back!
dan.
10  Using Arduino / Motors, Mechanics, and Power / Re: DC Motors and the Noise they Make! on: November 04, 2013, 07:22:01 pm
Never Mind!

There is an option in the library for Arduino. For anyone else looking for this later

File Name: OrangutanMotors.cpp

Code:
#ifndef ARDUINO
    // use the system clock/8 (=2.5 MHz) as the timer clock,
// which will produce a PWM frequency of 10 kHz
// Arduino uses Timer0 for timing functions like micros() and delay() so we can't change it
    //TCCR0B = TCCR2B = 0x02;  //<-- Comment Out
#endif

// use the system clock (=20 MHz) as the timer clock,
// which will produce a PWM frequency of 78 kHz.  The Baby Orangutan B
// and 3Pi can support PWM frequencies this high.  The
// Orangutan LV-168 cannot support frequencies above 10 kHz.
    TCCR0B = TCCR2B = 0x01; //<-- Uncomment

11  Using Arduino / Motors, Mechanics, and Power / Re: DC Motors and the Noise they Make! on: November 04, 2013, 07:04:34 pm
So I uncommented TCCR2B = 0x01; and commented TCCR2B = 0x02; in the library provided by pololu.

I still get the whine.. Should I be trying to change the PWM Freq in the motor library of in the setup of the project? Am I going about this all wrong?
12  Using Arduino / Motors, Mechanics, and Power / Re: DC Motors and the Noise they Make! on: November 04, 2013, 01:13:40 pm
Thanks guys for all of the responses!

Just an FYI: The MicroMo motors. When just sending them different voltages, changing the speed from a desktop power supply. They are as quite as a church mouse who just had his nails clipped, running a cross carpet... I'm from the south.....

So would changing the PWM to 16kHz fix the whine? If so, how would I do something like that? I'm open to using other drivers. But it's nice that this is a nice and neat little package.

Here is a link to a data sheet for the driver on the board: https://www.sparkfun.com/datasheets/Robotics/TB6612FNG.pdf

Here are some notes out of the library that I'm using to drive the motor. The library comes from Pololu for that board. After reading them, does this mean I can change the PWM for the arduino and have it talk to the driver at that speed forcing the driver to run at 16kHz? The board I'm using is the "Baby Orangutan B"

Code:
// initialize timers 0 and 2 to generate the proper PWM ouputs
// to the motor drivers
void OrangutanMotors::init2()
{
#ifdef _ORANGUTAN_SVP

// Configure for non-inverted fast PWM output on motor PWM pins:  
    //  Normal port operation, OC2x disconnected (changes later when a non-zero speed is set)
    //  Timer2 counts up from 0 to 255 and then overflows directly to 0.
    TCCR2A = 0x03;
  
    // use the system clock/8 (=2.5 MHz) as the timer clock,
// which will produce a PWM frequency of 10 kHz
    TCCR2B = 0x02;

// use the system clock (=20 MHz) as the timer clock,
// which will produce a PWM frequency of 78 kHz.  The Baby Orangutan B,
// Orangutan SVP, and 3Pi can support PWM frequencies this high.  The
// Orangutan LV-168 cannot support frequencies above 10 kHz.
    //TCCR2B = 0x01;
13  Using Arduino / Motors, Mechanics, and Power / Re: DC Motors and the Noise they Make! on: November 02, 2013, 09:41:20 pm
Here is what I'm using.
http://www.pololu.com/product/1220/

Thanks for the fast response!
14  Using Arduino / Motors, Mechanics, and Power / DC Motors and the Noise they Make! on: November 02, 2013, 08:57:31 pm
So I'm referring two whining noise, not electrical noise. When you change the speed of a DC motor to less then the max speed they seem to make a high pitch whining noise. But for my project I ramp in and out of speed changes with my motor. I have a few $$$ motors from micomo, and even those make high pitch wining noise....

Does anyone have any suggestions, or out of the box ideas for change the speed of motors without the whining noise when you run them at lower rpms?


Thanks for the thoughts!
dan.
15  Using Arduino / Programming Questions / Re: Burning bootloader to Atmega328p-AU with Uno on: October 13, 2013, 06:25:03 pm
Mr. Nick! Thank you for the quick response! I uploaded your sketch to my Uno using Arduino. Then try to burn the bootloader with Ardunio... Am I supposed to be using some kind of command line?


Thanks again for the help Mr. Nick!

I get an error :

Arduino: 1.5.4 (Mac OS X), Board: "Arduino Duemilanove or Diecimila, ATmega328"

        Using Port                    : /dev/tty.usbmodem1411
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

processing.app.debug.RunnerException
   at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:129)
   at processing.app.Sketch.upload(Sketch.java:1692)
   at processing.app.Sketch.exportApplet(Sketch.java:1605)
   at processing.app.Sketch.exportApplet(Sketch.java:1577)
   at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
   at java.lang.Thread.run(Thread.java:680)
Caused by: processing.app.debug.RunnerException: Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
   at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:113)
   at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:127)
   ... 5 more


  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Pages: [1] 2