Show Posts
Pages: [1] 2 3
1  Using Arduino / General Electronics / Re: Dual potentiometer, getting a clear reading of the end states on: October 01, 2013, 03:28:35 pm
I haven't have time to take this project further right now but when I do I will come back to tell if it worked or not.


I wouldn't use potentiometer to control speed/direction

Is there a better way? Any other electromechanical device I don't know of (totally possible)? I want around 10 different settings for a knob and don't have 10 input connections on the arduino to spare for this.
2  Using Arduino / General Electronics / Re: Dual potentiometer, getting a clear reading of the end states on: September 19, 2013, 05:52:25 pm
Thanks MarkT, I used a 330 Ohm resistor (what I had). With that the analog value differed by ~150 so clearly distinguishable. On the other end of the pot it didn't change so much though. But I was only testing with some simple code. I soldered new cables to all 6 pins on the pot. As the ground and output (to analog in) is shifted I hope to have work by selecting to which analog I read when the pot is at either end.
3  Using Arduino / General Electronics / Re: Dual potentiometer, getting a clear reading of the end states on: September 18, 2013, 01:19:12 pm
You should definitely confirm with your multimeter whether the pot is linear or log taper, especially if this is a grab-bag pot. I have found inconsistencies in the labeling depending on country of origin.
That is what I did when I measured the middle step (6th out of 11) to be 50% of the maximum resistance?
4  Using Arduino / General Electronics / Re: more than one Motor Driver on Arduino Uno? on: September 18, 2013, 01:14:42 pm
I'm no expert in this but as I understand one should have a fly-back diode when driving inductive loads. Reading the comments to that IC on sparkfun I saw someone mentioning that it, in contrast with the L293D, lacks internal fly-back diodes.
If you're not too interesting in doing it from the ground up I would recommend looking for a shield that manages it all for you. E.g. http://learn.adafruit.com/adafruit-motor-shield
(I have a copy of that, but haven't gotten around to use it). You can also go with breakout boards and connect them to different pins on the arduino. There are many such with the L298N chip that can drive bigger loads. I haven't seen a shield with two L298N though.
5  Using Arduino / General Electronics / Re: Dual potentiometer, getting a clear reading of the end states on: September 18, 2013, 12:57:46 pm
Here is a photo of it. The knob is from another potentiometer. I bought a bunch of new unsorted potentiometer and this was one of them.


As you can see I found the stamped text B100K, so now we know that (linear taper). And as predicted, the middle step measured 49,9 kOhm (but max was ~96 kOhm).

On one side I had 0.4 Ohm and 2.9 Ohm for the next step. Measured from the other way, with the lower part of the pot (the one that I've soldered wires to, but I measured directly on the pot) I had the same 0.4 but ~230 Ohm on the next step.

It is possible to detect this inexpensively? Obviously as my cheap multimeter can measure the difference it ought to be possible. But for the application I can't afford buying some expensive multimeter that can connect to a computer which in turn can tell an arduino on which step the pot is.
But the arduino isn't measuring the resistance, it measures the voltage, and as a voltage divider the pot makes the difference between 0.4 and 230 Ohm small compared to the next 96 kOhm.
6  Using Arduino / General Electronics / Dual potentiometer, getting a clear reading of the end states on: September 15, 2013, 01:03:15 pm
I have a dual potentiometer (i.e. 2 potentiometer of equal resistance controlled by the same pin).
One nice thing is that it has 11 steps (but the resistance varies continuously between the steps, so it is not a bunch of different resistors).

I hooked it up to my arduino and used analogRead to get see what values I got for different steps. Turned out that the first two steps resulted both in 0 and the last two both in 1023.
Hooked it up the multimeter and there are only a few ohms difference between the steps.
Well, I want to use all 11 steps, not 9!

Question: Is there any way I can scale up the difference of the resistance? What do I need and how do I connect it?

My idea is that the difference of ~0.7 ohms and 3 ohms (not exactly these values, but something like that) is easier to tackle than the small difference at the other end, where the multimeter read something like 86k ohm.
So I could use two analog input on the arduino and connect them on opposite sides so the voltage drop moves inversely on the different analog inputs.

It is okay if it has to switch on some circuit to get the precise reading. Like if the input value is less then 3 (out of 1023) it can turn on some digital output pin connected to 'something' to change the scale and make it possible to differentiate.


And I know people like to know what they are helping others to accomplish so a brief description comes here of the project (I will do post a thread when I get the project finished with all the tuning needed):
I'm modifying my dad's lawn mower tractor. Instead of the right pedal for speed (and direction) it will have this potentiometer on the dashboard to control the direction. I had planned to use 3 steps for reverse, 1 neutral and 7 forward. Knowing that the pedal needs some extra adjustment to maintain speed when pulling load changes (i.e. going uphill, downhill or on flat ground) I don't want to loose 2 steps on the potentiometer. In the long run I plan to measure the speed of the lawn tractor and have it compensate for this problem.
The actual control of the speed to the transmission unit is a linear actuator with feedback (in which the analog read value doesn't have the above problems with dead zones) to know the position.
7  Using Arduino / Project Guidance / Re: Use arduino to convert the PS2 controller OUTPUT to USB on: December 31, 2012, 04:53:16 am
I don't think it is possible, not straight through. Yes, you might get the arduino to understand the PS2 controller. But you can't get arduino to register as a USB gamepad (right?) with the desktop/laptop computer.
A workaround for this that might make is usable is to write some kind of "software device", a driver that acts as a gamepad but listens on a COM-port, where your Arduino in turns sends data in your own format that you need to decode in the software device on the main computer and translate to how gamepads outputs information.

So it is hard and I don't think it worth the effort. Althrough I haven't done any big Arduino project (I'm onto my first) I like to think that it is more fun to use Arduino in project where there doesn't exist any of-the-shelf hardware that is just to plug in (like the PS2->PC gamepad converter).
8  Using Arduino / Programming Questions / Re: What is the URL of my buttons? on: December 29, 2012, 05:03:59 am
I haven\t done any of this programming on arduino but when I look at the code the problem I think you have is that when you type the exact URL for a button in the web browser the web browser (as it should) sends a HTTP GET message. The buttons on the page makes the browser send a HTTP POST message (as it should). The code for switching the light is only run when a HTTP POST message is received.

If you don't understand this about GET and POST I suggest you google for some HTTP protocol description. And if you do, see if the code for the GET message can retrieve the same parameters as in the POST message. So if there are no parameters in the URL it displays the page, if there is any (valid) parameters it executes the requested function.
9  Using Arduino / General Electronics / Re: Connecting strange wiper motor, help selecting diodes (or other suggestion) on: December 26, 2012, 01:36:57 pm
I thought maybe a video showed it better smiley
Using the servo library I got it to work. I hooked it up to read input from the Y axis of the joystick shield.
I measured the amperage between the PSU +12V and HB25 controller's positive connector, when the motor runs at full speed with no load it uses ~2.5A. Peaks higher, especially if changing direction suddenly.

So thanks everyone for the help, the objective I needed help with by starting this thread has been archived.

10  Using Arduino / General Electronics / Re: Connecting strange wiper motor, help selecting diodes (or other suggestion) on: December 25, 2012, 06:11:09 pm
So it is Christmas time and I have a chance to experiment with the motor again. And the connection works as intended!
So now the two input cables, when reversed polarity also reverses direction of the motor. Those 4 diodes was the key.
I will post pictures of the whole thing when I also get the arduino to drive it via the HB-25 controller. What I've done now to test the motor is to connect it to my modded computer PSU (banana sockets on top of it for easy access).
I don't know if I'm doing it wrong with the HB-25 but I will experiment on a small DC motor I have tomorrow.
11  Using Arduino / Programming Questions / Re: How to use Timer to exit LoopA,then run LoopB? on: November 29, 2012, 07:45:05 am
Code:
    quitTime = millis () + 10000;
Adding unsigned longs is not a good idea in robust code.

Code:
    do {
        // Do stuff
    } while (millis () - startTime < diddleTime);
is guaranteed to work. Though I suspect that a do/while is NOT the construct you want to use. While probably is. Look up the differences.
I had to think about it but I understand the part about adding unsigned longs. In the corrected version millis() - startTime will never result in a wrap around because startTime can not be larger than millis() result. Except after those 50 days when result of millis() wraps around. But that is more esoteric, if the machine isn't expected to stay on for such long time.

But the part about while instead of do/while?
The difference I know is that do/while will execute at least once. My thinking was that it will save one loop condition check in this particular application, if setting the startTime (or as I had written, the quitTime) just before the loop and we want to interrupt after several seconds it till definitely don't have time to become false for that first iteration (using interrupts and having a lot of heavy code in the interrupt could cause this if the interrupts occurs exactly after the variable assignment). Also the code could be / probably would be written that the second loop expects to run after the first one, not that one time the first loop will be skipped.
Because of this reasons I thought that having the loop condition check after the first run was the most economical and effective one.
Am I wrong in my intention why to use do/while or is it some other side effect that I'm unaware of?
12  Using Arduino / Programming Questions / Re: How to use Timer to exit LoopA,then run LoopB? on: November 28, 2012, 06:42:55 am
Yes that one only works the first iteration. I haven't compiled this code to test (to the Arduino C++ variant have do...while... loops?).
Code:
long quitTime;
void loop () {
    quitTime = millis () + 10000;
    do {
        // Do stuff
    } while (millis () < quitTime);

    quitTime = millis () + 2000;
    do {
        // Do other stuff
    } while (millis() < quitTime);
}

Remember that it won't interrupt the execution and jump out of a loop, so to make it work you can't have too much code (execution time wise "much") in there.
Say that in the second step you have code which takes 1.5 second to run. Then it will exit the loop 3 seconds after it started.
But if you have code that only takes 10 ms to run, well you may overshoot with a few ms but that is probably okay.
13  Using Arduino / General Electronics / Re: Connecting strange wiper motor, help selecting diodes (or other suggestion) on: November 28, 2012, 06:33:46 am
[...]
[...] It could still be a wiper motor but, if that is the case, it obviously has a large and vital part missing, the reciprocating gear. Fortunately it is not too vital for you, but the bit that connects to the spline would probably be useful. [...]
As I don't have this piece my idea use the bicycle gear, somehow centered and then use the welding machine to permanently attach it.
14  Using Arduino / General Electronics / Re: Connecting strange wiper motor, help selecting diodes (or other suggestion) on: November 28, 2012, 03:59:41 am
That they moved in different speeds makes me think that there isn't any "low" and "high" connections, changing direction makes the high and low.

That's as good an explanation as any, but it may be reversing just to park.

The reason why I asked the question is that I'm sure the bit of cable  isn't wrapped round an "output  gear", it's a spline. It looks exactly like the spline for a screenwiper arm, hence my question.  If the shaft rotated about a thirty degrees and then reversed, the motor is almost certainly a windscreen wiper motor but not off a car. It's off a train or a bus, hence the size. You often see buses with the wipers going but obviously not connected and thus must have a motor for each.  It could still be a wiper motor but, if that is the case, it obviously has a large and vital part missing, the reciprocating gear. Fortunately it is not too vital for you, but the bit that connects to the spline would probably be useful. It could have been that the motor originally drove a hydraulic pump, which might have been nice for your purpose(!)
That's an interesting thought. Wiper motors for tractors work similar to how you describe it for other bigger machines (the arm is connected to the wiper motor directly and the motor changes direction).

Well the lack of speed makes me doubt it would be used to drive a hydraulic pump. The tractor hasn't hydrostatic steering (orbitrol). First I was thinking of affected the hydraulic valve on the servocylinder but gave up that. I think it is tightly built together so connecting some electronic valve (which I don't have and they are expensive) may not be possible. Bicycle gears of appropriate size and chain connecting the steering wheel and the electric motor is a way I think this will work, thanks to the power steering. An older tractor we have is without that I know that for such task this little motor wouldn't be enough.


But to sum it up we are waiting for me to take another look it with multimeter and wires, having a printed copy of the wiring diagram I got and see if it corresponds or not. And after that I think I will build it together as I thought with 4 diodes, smaller fuse on the motor controller and an Arduino for a bench test run. I know for sure I will visit the parents around Christmas, we'll see if I go earlier. So don't hold your breath until then! smiley-wink
15  Using Arduino / General Electronics / Re: Connecting strange wiper motor, help selecting diodes (or other suggestion) on: November 27, 2012, 06:16:57 am
OK. The penultimate, or possibly ultimate question:

Looking at pic028, you have a bit of white cable to estimate the rpm. Did you just see that cable move momentarily, or did you see it rotate continuously in both directions?
It moved continuously (no stuttering) for as long as I wanted it to be by having the wires in contact with the connection points. By shifting connection points I could make it go the other way. But they moved in different speed. Lets say 80 rpm and 150 rpm. That they moved in different speeds makes me think that there isn't any "low" and "high" connections, changing direction makes the high and low.
Pages: [1] 2 3