Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Motors, Mechanics, and Power / Re: Help identifying some salvaged motors, wiring, voltage, etc ? on: April 15, 2013, 07:05:02 am
Managed to find a page that details the typical stepper found in old 5.25" drives here http://homepage.cs.uiowa.edu/~jones/step/example.html  -  It even has the wiring colour codes and typical current.

That's one of them sorted smiley
2  Using Arduino / Motors, Mechanics, and Power / Re: Help identifying some salvaged motors, wiring, voltage, etc ? on: April 15, 2013, 01:42:36 am
The parts coming from the floppy are likely to use 12V or 5V, minus the driver drop.

So they don't usually regulate the 12V down to something lower?  OK, good.

The way I guesstimate the voltage of unknown steppers is apply a voltage to 2 windings out of the 4 available and wait for the temperature rise. Then I slowly increase voltage until the temperature stabilizes around 70C (some steppers can take more but without a datasheet it's best to keep a safety margin).
You can probably use this technique for the solenoid/dc motor, maybe with lower temperature rise.

Good idea to test via temperature, thanks. I am confused about the stepper, I thought they had 2 windings, not 4 - also the big one has 5 wires to add to the confusion.
3  Using Arduino / Motors, Mechanics, and Power / Help identifying some salvaged motors, wiring, voltage, etc ? on: April 11, 2013, 08:41:56 pm
I would appreciate an help you may be able to give me on making use of these bits and pieces, particularly wiring and voltage identification.

From an old 5.25" floppy drive...

1. Minebea Co.Ltd Stepper motor (head positioning) 17PS-C006-01, 5 wires white/brown/red/black/green
2. Beuhler DC motor (main drive), 2 wires from top blue/red, 2 wires from bottom (near the pulley) green/yellow
3. Solenoid (head clamp) (made in mexico) 371-30, wiring is easy - just 2 metal tags, but what voltage?

From a CDROM drive...

1. Small unbranded stepper with worm drive from laser positioning in CD rom drive (04X17R290), wiring is flex. cct strip, 4 conductors

from junk box...

1. Small unbranded DC motor   VD 030Y22
4  Using Arduino / Motors, Mechanics, and Power / Re: Motor shaft sizes - do standard sizes exist? on: April 05, 2013, 07:17:06 pm
You can get gears/pulleys for a smaller shaft and drill/ream them out.   4.1mm sounds unlikely - micrometer or calliper guage is
the way to measure.

They measure 4.18 to 4.2 with a digital calliper (depending on where on the shaft I put it).  Must be a weird size.

Good idea on drilling/reaming smaller sizes - thanks.
5  Using Arduino / Motors, Mechanics, and Power / Re: Motor shaft sizes - do standard sizes exist? on: April 05, 2013, 06:09:21 pm
Those Pitman motors are probably 1/8inch.

There are standard motor shaft sizes, There problem is, there are many standards... Metric sizes will probably be either a whole or half millimeter and under 1/8 inch they will probably be in 1/32 inch increments (or 1/64) over 1/8 they will  generally go by 1/8ths with a couple 1/6ths thrown in (we seem to like 7/16 and 9/16)

Ah, sounds messy smiley .  Sounds like you just have to adapt where you can't get the exact right size.   Thanks for the help.
6  Using Arduino / Motors, Mechanics, and Power / Motor shaft sizes - do standard sizes exist? on: April 05, 2013, 04:30:39 am
Just starting out using a few DC motors, and some servos, stepper motors etc.,  and I was wondering if there is any standard sizes for the motor shafts so that standard size gears/pulleys etc can be purchased off the shelf to fit.

For example, I have 3 very nice 12VDC Pittman motors from an old computer data storage device.  Their shafts measure about 4.1 or 4.2mm.  Am I going to be able to find any pulleys/gears, etc to fit them?

Related question, how do you couple mechanics to your motors usually - a flexible coupling, belt/pulley drive, direct? Do you make them yourself?   I had a suggestion from a guy who sells Lego gears and stuff, that people often use a piece of tubing, such as used for air hose in  the aquarium trade.
7  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 14, 2013, 12:59:22 am
Yes, was just writing this when you posted - now the M2TKLIB Hello World example works, modified as below. Changes are to include <Wire.h>, to include <LiquidCrystal_I2C.h> instead of <LiquidCrystal.h>, and to set it up using "LiquidCrystal_I2C lcd ( 0x3F,2,1,0, 4,5,6,7,3,POSITIVE);"

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "M2tk.h"
#include "utility/m2ghnlc.h"

LiquidCrystal_I2C lcd ( 0x3F,2,1,0, 4,5,6,7,3,POSITIVE);

M2_LABEL(hello_world_label, NULL, "Hello World!");
M2tk m2(&hello_world_label, NULL, NULL, m2_gh_nlc);

void setup() {
  m2_SetNewLiquidCrystal(&lcd, 16, 2);
}

void loop() {
  m2.draw();
  delay(500);
}

Thanks for ALL the help !  
8  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 14, 2013, 12:41:23 am
Another step forward  !      Figured out the constructor numbers are bit numbers, so I had to follow traces on the backpack board to see where the pfc8574 pins were wired to on the LCD display proper.  Then translate those to bit numbers.

For anyone else with a sainsmart LCD display with their "lcd2004" I2C adapter, the following seems to work.

Code:
LiquidCrystal_I2C lcd ( 0x3F,2,1,0, 4,5,6,7,3,POSITIVE);

9  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 13, 2013, 11:26:47 pm
I found this data on the connections of my display

Quote
③PIN  CONNECTIONS       
Pin     Symbol   Function
1   VSS   Ground for Logic(0V)
2   VDD   Power supply for Logic(+5V)
3   V0   Power supply for LCD Driver
4   RS   H: Data;L: Instruction Code
5   R/W   H: Read;  L: Write
6   E   Enable signal
7~14   DB0~DB7   Data Bus Line
15   A   Backlight Power(+5V)
16   K   Backlight Power(0V)

and tried to write a 'constructor' as follows (based on the library code I have copied at the bottom of this post

Code:
LiquidCrystal_I2C lcd ( 0x3F, 6, 5,4 ,
                        7, 8, 9, 10,
                         15,POSITIVE);

All I am getting at the moment is the backlight turns off and nothing is displayed (although there seems to be 2 lines of faint characters (this is a 4 line display)

One thing I thought was odd is that it only has 4 data pins in the constructor, but the table above talks about 8.  I did try pins 11 to 14 instead of 7 to 10, but it doesn't seem to make any difference.

Code:
   /*!
    @method     
    @abstract   Class constructor.
    @discussion Initializes class variables and defines the I2C address of the
    LCD. The constructor does not initialize the LCD.
   
    @param      lcd_Addr[in] I2C address of the IO expansion module. For I2CLCDextraIO,
    the address can be configured using the on board jumpers.
    @param      En[in] LCD En (Enable) pin connected to the IO extender module
    @param      Rw[in] LCD Rw (Read/write) pin connected to the IO extender module
    @param      Rs[in] LCD Rs (Reset) pin connected to the IO extender module
    @param      d4[in] LCD data 0 pin map on IO extender module
    @param      d5[in] LCD data 1 pin map on IO extender module
    @param      d6[in] LCD data 2 pin map on IO extender module
    @param      d7[in] LCD data 3 pin map on IO extender module
    */
   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 );
   // Constructor with backlight control
   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs,
                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
                     uint8_t backlighPin, t_backlighPol pol);
10  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 13, 2013, 10:54:05 pm
There is varying i2c to hd44780 hardware out there.
Some librarys are hard coded for a particular wiring/pin mapping and
some libraries like fm's allow the pin mapping to be configured.
So, In the case of fm's library the library is not the actual problem
but rather the problem comes down to the user properly filling in the constructor which configures the pin mappings
for the library.
fm's library has a default output pin mapping for how the wires/traces are connected
between the pcf8574 chip and the hd44780 interface.
It is unwise not to fill in the full constructor and use the default mappings since
different PCF8574 based boards wire up the connections differently.
The default pin mapping in the library is for fm's lcd i/o expander board
and many of the i2c based boards are not wired up the same way.

When the pin mapping is wrong/incorrect, the library will compile just fine,
but since it has been told the incorrect pin mappings, it will not be able to properly
initialize and drive the lcd.

Unfortunately, There is no way to have the library automatically detect the wiring
and automatically set up the pin mappings.

To ensure that i2c interface works with fm's library, it is best
to always properly fill in the full constructor which includes all the pin mappings rather than only fill
in the i2c address, which will cause the library use the pin mappings of fm's lcdio board, which is
different from many of the other i2c to hd44780 boards out there.
Plus, the default pin mappings do not include backlight control over the i2c interface since
fm's lcd i/o board does not support this.

If you fill in the full constructor, you can not only ensure that the pin mappings are correct,but
also configure the library for how to control the backlight over the i2c interface.


Well, thanks for filling me in on all that.  I know nothing about constructors, and I really feel I have jumped in the deep end here.   Still, it looks like there's hope of making it work, and I'm game to try.

I need to find out where and how to set up the pin mappings, and what they really should be.  I'll try looking the code and google, but if anyone can lead me in the right direction, that would help smiley .
11  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 13, 2013, 05:17:48 pm
My fault.  I was sure they all worked when I first tried them, maybe I had an earlier version, or a modified one. When I googled for examples for my previous post, that one came up and I assumed it was the same. I am currently using the DFRobot one at the moment and it definitely works.  I don't really understand how some can work, and others fail.  Must be varying hardware out there too.   Hopefully they will all eventually work as they iron out the bugs and add support for all the variations.
12  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 13, 2013, 01:58:53 am
I got it to compile thanks. 

Unfortunately, that library just doesn't work with my display.  Even their own HelloWorld_i2c example that comes with the Liquidcrystal library just produces a  flashing backlight.  The DFRobot library (and other libraries that I mentioned)  does work with my display, so they've done something different. However they  won't work with M2TKLIB because they lack things like LCD.h (I think). So I am stuck.
13  Using Arduino / Displays / Re: M2TKLIB Hello World with LiquidCrystal_I2C on: February 12, 2013, 08:16:02 pm
I added the New LiquidCrystal Library (https://bitbucket.org/fmalpartida/new-liquidcrystal/) as output engine to M2tklib.
A first beta release for the New LiquidCrystal Library is available for download: http://code.google.com/p/m2tklib/downloads/list

Oliver

Thanks.  I just downloaded it and am trying to understand how to make the Hello World example work with my I2C display.  Firstly I had to include Wire.h to get it to compile.   

Then I tried to convert it to I2C by including the different library and changing how the lcd object was created (and changing the setup to 20x4 from 16x2)

Code:
#include <Wire.h>
//#include <LiquidCrystal.h>
#include <LiquidCrystal_I2C.h>
#include "M2tk.h"
#include "utility/m2ghnlc.h"


LiquidCrystal_I2C lcd(0x3F);

M2_LABEL(hello_world_label, NULL, "Hello World!");
M2tk m2(&hello_world_label, NULL, NULL, m2_gh_nlc);

void setup() {
  m2_SetNewLiquidCrystal(&lcd, 20, 4);
}

void loop() {
  m2.draw();
  delay(500);
}

This is producing these errors

Quote
In file included from HelloWorld.pde:42:
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: variable or field ‘m2_SetNewLiquidCrystal’ declared void
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: ‘LCD’ was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: ‘lc_ptr’ was not declared in this scope
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: expected primary-expression before ‘cols’
/home/myhome/sketchbook/libraries/M2tklib/utility/m2ghnlc.h:32: error: expected primary-expression before ‘rows’
HelloWorld:45: error: no matching function for call to ‘LiquidCrystal_I2C::LiquidCrystal_I2C(int)’
/home/myhome/sketchbook/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:57: note: candidates are: LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, uint8_t)
/home/myhome/sketchbook/libraries/LiquidCrystal_I2C/LiquidCrystal_I2C.h:55: note:                 LiquidCrystal_I2C::LiquidCrystal_I2C(const LiquidCrystal_I2C&)
HelloWorld.pde: In function ‘void setup()’:
HelloWorld:51: error: ‘m2_SetNewLiquidCrystal’ was not declared in this scope


So assuming I just don't understand smiley  I thought it was time to ask advice.
14  Using Arduino / Programming Questions / Re: Documentation for special/system variables/constants? on: February 10, 2013, 10:32:24 pm
The definitions are scattered through the Arduino installation, but for example the register addresses you asked about used are defined under board-specific files under hardware\tools\avr\avr\include\avr\.

They aren't documented as part of the Arduino runtime environment, I suppose on the basis that they aren't part of the API - they are part of the implementation. It's possible to bypass the Arduino library and access the hardware directly, and obviously various clever people have done that - and some of them have documented what they did and how it works - but those definitions are not documented as part of the API.

I see.   So, if I read you correctly, the example I read on setting the timer to execute an interrupt is bypassing a normal way to do it.     Obviously so did I smiley.    So I should look for a library the makes it easier to set up an interrupt routine then?

You mentioned the __DATE__ and __TIME__ preprocessor directives. There are some macros and directives which are defined by the C++ language, and others that are added by the GCC compiler that Arduino uses. These are also not part of the Arduino API and so are not covered by the Arduino documentation, but you're free to look up the language specification and compiler behaviour for yourself if it interests you.

Ah, so I will look up some references on C++ and GCC then.  I guess it never occurred to me, being new to how it all works, that I could use native C++ stuff inside a sketch.
15  Using Arduino / Programming Questions / Re: Documentation for system variables/constants? on: February 10, 2013, 09:59:30 pm
  I am not looking for the documentation on the atmel chip.  I am looking for the documentation of the language used to write sketches.  It seems this language has special variables to access things - like the register example I gave, and also things like the PC system time (useful for setting RTC's at compile time). Another example would be the name of the routine it looks for when it encounters an interrupt.

I just haven't found where they are documented.  I looked here file:///usr/share/arduino/reference/index.html, but can't see it.

This page has examples of special variables for many languages so you can see what I mean http://rosettacode.org/wiki/Special_variables
Pages: [1] 2 3 4