collapse

Author Topic: 10 K potentiometer  (Read 2631 times)

jinx

  • calling from free Europe
  • Sr. Member
  • *****
  • Posts: 469
10 K potentiometer
« on: November 11, 2015, 03:33:12 AM »
10k main.PNG
*10k main.PNG (169.46 kB . 703x257 - viewed 295 times)
  potentiometers come in all shapes and sizes and the 10k is the defacto pot for controlling servo's once you conquered the scaling, it's easy to identify it have the  value written on it which means that we can vary its resistance from 10 to 0 Ohm . A movable wiper is rotated clockwise or anticlockwise direction that changes the resistance of the potentiometer. .

  wiring:
pot wiring.PNG
*pot wiring.PNG (40.14 kB . 323x444 - viewed 314 times)

example #1 nothing more than what's in the manual except here am displaying data in the terminal window
Code: [Select]
'10K pot scaling
'3.3V
#picaxe 28x2
#no_data
#no_table
#freq m4

'########## pots #############################
symbol pot1   = S.A1             'center pin of the pot to picaxe
symbol potval = w0               'place the reading into a word variable
symbol delay    = 100

 main:
    do
  readadc10  S.A1,potval                  ' reads and places the pot value 
  pause 10
  sertxd(" Pot value",#potval,13,10)
  pause delay
 
       loop

example #2 replace the main section of code from example one  give the pot  31 steps, turns one input into thirty and possibly  used in conjunction with the case select  command
Code: [Select]
main:
  do
  readadc10  S.A1,potval                    ' reads and places the pot value 
   potval = potval / 5 * 23 / 150                 '
  pause 10
  sertxd(" Pot value",#potval,13,10)
  pause delay
 
loop

example #3 scales the pot for servo control through the range 80-219 should prevent you hitting the endstops.
Code: [Select]

'10K servo control
'3.3V shield
#picaxe 28x2
#no_data
#no_table
#freq m4



symbol pot1   = S.A1             'center pin of the pot to picaxe
symbol potval = w0               'place the reading into a word variable


symbol pan = b.7
symbol lft = 80
symbol rgt = 200
symbol cen = 130

symbol MINS   = 80               '-+ minium travel
symbol MaxS   = 22               '-+ for max travel

int:
    servo pan,cen
    pause 30
 main:
  do
  readadc10  S.A1,potval                  ' reads and places the pot value 
  potval= potval*3/MaxS+MINS                  ' scales the pot range between 219-80
  servopos pan,potval
  pause 30
  sertxd(" Pot value",#potval,13,10)
  loop

  but I need more servo control not a problem just duplicate what you done  and remember to add the symbols for the second servo.
Code: [Select]
do
  readadc10  S.A1,potval                  ' reads and places the pot value 
  readadc10  S.A2,potval1                  ' reads and places the pot value 
  potval= potval*3/MaxS+MINS                  ' scales the pot range between 219-80
  potval1= potval1*3/MaxS+MINS                  ' scales the pot range between 219-80
  servopos pan,potval
  servopos tilt,potval1
  pause 30
  sertxd(" Potpan ",#potval," pottilt ",#potval1,13,10)
  loop


 test vid:

links:
erco fun :http://www.picaxeforum.co.uk/showthread.php?27489-Servo-Record-amp-Playback&highlight=servopos

http://www.geofex.com/article_folders/potsecrets/potscret.htm
« Last Edit: November 12, 2015, 04:30:55 AM by jinx »
I build bots

erco

  • Member
  • *
  • e
  • Posts: 204
Re: 10 K potentiometer
« Reply #1 on: November 12, 2015, 11:23:10 AM »
Beautimous pan/tilt, jinx!

I posted this video on pots & servo control last month.



erco

  • Member
  • *
  • e
  • Posts: 204
Re: 10 K potentiometer
« Reply #2 on: November 12, 2015, 01:32:18 PM »
Another fun fact about servos & pots. Having hacked numerous servos for continuous rotation, I can say that all or most of them use 5K pots internally for position feedback. I normally replace the pot electrically with a voltage divider made from a pair of 2.7K fixed resistors, keeping the overall value around 5K. But I used 100K resistors in the last pair of HXT900 servos I modified, and they worked just the same. In fact, they were the best-matched pair of servos I have ever seen, in terms of null point, which is obviously not adjustable using fixed resistors.


 

* Search


* Recent Topics

Time of Flight >>> Rounded Corners !!! by BaldwinK
[December 04, 2019, 05:46:08 PM]


Investigating the VL53L0X Laser Rangefinder by BaldwinK
[December 04, 2019, 05:35:57 PM]


The unnamed (yet) quatruped spider project by maelh
[December 04, 2019, 08:38:58 AM]


American Civil War Robot by kingart3
[November 27, 2019, 06:39:47 PM]


2D Side Scroller Cyberpunk themed by Killer Angel
[November 12, 2019, 07:56:15 AM]


Ebot SL by erco
[October 31, 2019, 04:27:36 PM]


Discord anyone? by tinhead
[October 20, 2019, 05:35:59 AM]


MKS Gen L 1.0 by lllloydo
[October 06, 2019, 01:24:26 AM]


Saturn pics anyone by viswesh
[September 28, 2019, 11:55:53 PM]


Hello Robot Rebels by Passixs
[September 15, 2019, 10:19:10 PM]


All Ya'll. And me. by James
[September 09, 2019, 10:35:19 PM]


MSD - Motorized solder dispenser (Work in progress) by James
[September 09, 2019, 08:45:29 PM]


It may be dangerous to work in the virtual realm by ZeroMax
[September 05, 2019, 05:55:16 PM]


"1984 Nixie Time" by Gareth
[August 25, 2019, 12:21:58 PM]


Just wanted to say Hi. by ErwinCanto
[August 18, 2019, 10:11:28 PM]

* Recent Posts

Re: Time of Flight >>> Rounded Corners !!! by BaldwinK
[December 04, 2019, 05:46:08 PM]


Investigating the VL53L0X Laser Rangefinder by BaldwinK
[December 04, 2019, 05:35:57 PM]


Re: The unnamed (yet) quatruped spider project by maelh
[December 04, 2019, 08:38:58 AM]


Re: The unnamed (yet) quatruped spider project by Nemesis
[November 28, 2019, 12:58:18 PM]


Re: The unnamed (yet) quatruped spider project by tinhead
[November 28, 2019, 10:09:46 AM]


Re: The unnamed (yet) quatruped spider project by Bajdi
[November 28, 2019, 08:44:38 AM]


Re: The unnamed (yet) quatruped spider project by Nemesis
[November 28, 2019, 05:17:04 AM]


American Civil War Robot by kingart3
[November 27, 2019, 06:39:47 PM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[November 12, 2019, 07:56:15 AM]


Re: The unnamed (yet) quatruped spider project by tinhead
[November 09, 2019, 05:58:16 AM]


Re: The unnamed (yet) quatruped spider project by Nemesis
[November 09, 2019, 03:29:02 AM]


Re: Ebot SL by erco
[October 31, 2019, 04:27:36 PM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 31, 2019, 09:57:48 AM]


Re: 2D Side Scroller Cyberpunk themed by Killer Angel
[October 31, 2019, 06:01:53 AM]


Re: 2D Side Scroller Cyberpunk themed by maelh
[October 30, 2019, 03:06:28 AM]