Offline
Newbie
Karma: 0
Posts: 7
|
 |
« on: January 28, 2013, 04:18:20 pm » |
Hi All Here's the problem: I want to control a potentiometer with a foot pedal. Pot is read by Uno analog input. If I connect the potentiometer direct to the foot pedal axis, I will get a a range of about 40 degrees movement on the pot. This is actually 20 degrees forward and 20 degrees backwards with center off (for forward and backward speed control). I know there are commercial products out there such as actuators and foot pedals as well as means to extent the range of the pot mechanically, but this is a hobby project and I want to keep cost low and mechanically simple. 40 degrees on a standard 270 degree pot translates to a value of about 152 in the ADC register. This is too small for me, I would like to use as near to full range of the register as I need presision (well 70-80% will still be good). My other idea is to electronically amplify this with opamps but I must have been sleeping when we studied opamps in class all those years ago. I can not come up with a circuit. So, anybody got any ideas? With opamps, I want to input say 2.5V-3.5V and want to circuit to output about 0-5V which I then use as analog input. Upper and lower limit must be adjustable. What would you call a opamp circuit like that (since just about all opamp circuits got names  ) Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25461
Solder is electric glue
|
 |
« Reply #1 on: January 28, 2013, 04:23:40 pm » |
Why not use a reduced referance voltage to get the full swing from your reduced angle of movement.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #2 on: January 28, 2013, 04:42:18 pm » |
Thought about that, but that would mean that I have to start from the one end of the pot which is near mechanical stop. I need to allow room for adjustment, electrically and mechanically. But I won't rule this idea out completely.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25461
Solder is electric glue
|
 |
« Reply #3 on: January 28, 2013, 04:50:12 pm » |
Ok, how about using a rotory shaft encoder and just counting pulses.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #4 on: January 28, 2013, 04:56:41 pm » |
Cost. Plus I would need 6 digital pins (3 per pedal for A,B and Z signals), which I don't have.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 24
|
 |
« Reply #5 on: January 28, 2013, 04:57:27 pm » |
For an opamp you would need an inverting circuit where you replace the virtual ground at the (+) input with a reference (pot) to remove the offset. The gain should be 5 but you could make it adjustable, too. Some other factors to consider are the power supply, most op amps do not like 5V single supply power, so you need probably one of those fancy cmos ones. Then there is the output swing, that depends on your choice of power supply and op amp. You want to make sure it can swing to zero and it can reach 5V.
Another option would be to use a higher power supply for the potentiometer and use some diodes (or a zener diode) to remove the offset. The higher supply would act as an amplifier. But that could break the arduino if it gets in the analog pin, so this also presents problems.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 272
Posts: 25461
Solder is electric glue
|
 |
« Reply #6 on: January 28, 2013, 05:01:10 pm » |
Cost. Plus I would need 6 digital pins (3 per pedal for A,B and Z signals), which I don't have.
Any other vital information you are withholding?
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #7 on: January 28, 2013, 07:44:06 pm » |
Why don't you use the "map" function? analogRead the footpedal when you aren't stepping on it, write it down, the analogRead it when you press it all the way down, then val=analogRead(A0); val=map(val, reading_when_not pressed, reading_when_pressed_all_the_way_down, 0, 1023);
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #8 on: January 28, 2013, 08:20:01 pm » |
That won't increase the accuracy of the reading.
|
|
|
|
|
Logged
|
|
|
|
|
Beijing
Offline
Full Member
Karma: 3
Posts: 181
Skype name habib.derbyshire
|
 |
« Reply #9 on: January 28, 2013, 09:01:53 pm » |
Then an op amp, I guess
|
|
|
|
|
Logged
|
What is man's best friend? The breadboard!
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #11 on: January 29, 2013, 02:19:12 am » |
Thanks guys for the replies sofar. @Grumpy_Mike: Not sure what other vital information I'm with holding  I just don't have spare pins and want to stick to using the analog input. Another consideration is that encoders needs to be reset every time to find reference and the absolute one might be low cost, bust still expensive in time spend building and setting it up. @silverxxx: You right about wanting to swing to close to the supply rails and use a low supply voltage. I remember something that the output becomes too erratic? hmmm  I've been looking for a solution for this for a while now. Looks like I then have to either get an actuator made for this, or go the mechanical way of increasing the travel of the pot. Another idea I'm working on is using a slider pot, it has a shorter travel.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 218
Posts: 13896
Lua rocks!
|
 |
« Reply #12 on: January 29, 2013, 04:48:44 am » |
Your original figures give you quite a bit of precision (1 in 152). Is that not enough?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #13 on: January 29, 2013, 05:19:46 am » |
Your original figures give you quite a bit of precision (1 in 152). Is that not enough?
Consider that this is a forward backward control with center off, so in fact I have then only 0-76 each way. Then, I set some dead band around the center, reducing it even more. I also have a quick calibrate function for the maximum ends where I store the center point and maximums in EEPROM, this must be within the range. There must also be some leeway for the center point calibration. It is getting a bit skinny now  Only then do I int speed = map(potValue, centre+deadBand, maxTravel, minSpeed, maxSpeed) for forward speed and Speed is within 0-255 for the PWM
|
|
|
|
« Last Edit: January 29, 2013, 05:33:56 am by MaxHeadroom »
|
Logged
|
|
|
|
|
Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2237
|
 |
« Reply #14 on: January 29, 2013, 07:34:33 am » |
Gearbox?
|
|
|
|
|
Logged
|
|
|
|
|
|