FongEye

Pages

  • FongToy

Wednesday, March 13, 2013

Tower Pro SG90 Micro Servo - refreshing memory notes

I read RPIO.PWM and found it difficult.  I know very roughly what is DMA.  I only remember that it is Direct Memory Access which means a peripheral can read or write sequential memory locations without the help of  CPU between accesses.  The CPU only initiates the job, and the DMA controller will take up the job of memory accesses and let CPU know after the whole memory accesses is completed.

I also forgot the details of how to control the servo.  I only remember that in late 2008 when Lehman Brothers collapsed, I got nothing to do and wandered to the toy street in Monkok and bought some cheap servos to play with.  I still remember that the shops sells very expensive servo over 400 dollars.  I only bought the cheapest servos I could find because I read that even experts burn their servos.  I programmed a servo for the first time in my hobbist's life and posted a blog about it in TaoBao My Space.   But My Space is closed down.  So I googled "tlfong01 servo" and found my old servo program.

I have the feeling that I am doing sort of pair programming, the "new me" (re) learning things from the "old me".


About 11,200 results (0.34 seconds) 
Problema con cotrol de servos y 16F84A (SOLUCIONADO)
  1. www.todopic.com.ar/.../index.php?... - Cached - Translate this page
    Pues ocurren varias cosas, no le estas metiendo la señal al servo por la patilla adecuda... "Tower Pro SG90 Micro Servo" ... Author - TL Fong (tlfong01, TaoBao) ...
    You've visited this page 2 times. Last visit: 3/28/12

http://www.todopic.com.ar/foros/index.php?topic=24768.5;wap2

c4_esp_VR:

Pues ocurren varias cosas, no le estas metiendo la señal al servo por la patilla adecuda, por norma el cable blanco y por supuesto tener la alimentación 5V al rojo y la masa al negro, además de tener conectadas entre sí las masas del pic y del servo sino vamos mal.

El servo esté roto, con lo que la única manera de asegurarte es con un osciloscopio para mirar si la señal es la adecuada, por otro lado mira el datasheet del servo a ver si va a tener un rango de tiempos distintos.

Vamos que no debería de darte tantos quebraderos de cabeza algo tan sencillo.

Ya me comentarás haciendo todo lo que te comento.

chacruna:
Los cables estan bien conectados (Naranja = Datos, Rojo = Vcc, Marron = Gnd)

Quizas los servos esten rotos, hoy voy a probar con un servo nuevo.



Citar

"
Tower Pro SG90 Micro Servo"

It fit for most brands of radio equipment including Hitec, Futaba, GWS, JR, Sanwa ….

Specification :

* Weight : 9 g

* Size : 22 x 11.5 x 27 mm

* Operating Speed (4.8V no load): 0.12sec/60 degrees
* Stall Torque (4.8V): 17.5oz/in (1.2 kg/cm)

* Temperature Range: -30 to +60 Degree C
* Dead Band Width: 7usec
Operating Voltage:3.0-7.2 Volts


Encontre estos "TowerPro SG90 Test Programs" y por lo que veo las señales son las correctas.


Código:

*** Seeeduino & Towerpro SG90 Test Program - TL Fong 2009jan08

/******************************************************************************
* Hello Servo - Turn TowerPro SG90 servo to middle position
* Created - 2009jan07, Last update - 2008jan07
* Function - Turn servo to middle position
* MPU/Programming language - Seeeduino v1.1/Arduino v12.0
* Author - TL Fong (tlfong01, TaoBao)
* Copyright - Creative Commons Attribution - ShareAlike 3.0 Licence
*
* Test procedure
* (1) FIRST run the program,
* (2) Manually turn servo clockwise or counterclock to limit,
* (3) Connect 5V power and MPU signal to servo,
* (4) WARNING - Disconnect 5V power before stopping program,

*
* TowerPro SG90 Spec
* CCW end 900uS, CW end 2100uS, middle 1500uS, 3.0 to 6.0V,
* 9g, 22 * 11.5 * 27mm, 0.12sec/60 degrees (4.8V no load),
* stall torque 17.5ozin/1.2 kgcm) (4.8V), dead band 7usec,
* coreless motor, all nylon gear, RMB30 (TaoBao).
*
* Notes
* 1. To turn counter clockwise limit, change pulse width from 1500 to 900.
* 2. To turn clockwise limit, change pulse width from to 2100.

******************************************************************************/

int signalPin = 8; //servo signal pin

void setup()
{
 pinMode(signalPin, OUTPUT); 
}

void loop()
{
   digitalWrite(signalPin, HIGH);  // control signal high
   delayMicroseconds(1500);        //   for 1500 uS
   digitalWrite(signalPin, LOW);   // control signal low
   delay(20);                      // wait 20mS
 }

/* End of program */



Código:


/******************************************************************************
* Hello Servo - v2.0
* Created - 2009jan07, Last update - 2008jan07
* Function - Repeatedly position servo to one end, middle, and the other end
* Servo - Towerpro SG90
* MPU/Programming language - Seeeduino v1.1/Arduino v12.0
* Author - TL Fong (tlfong01, TaoBao)
* Copyright - Creative Commons Attribution - ShareAlike 3.0 Licence
*
* Test procedure 
* (1) FIRST run the program,
* (2) Manually turn servo clockwise or counterclock to limit,
* (3) Connect 5V power and MPU signal to servo,
* (4) WARNING - Disconnect 5V power before stopping program.
*
* TowerPro SG90 Spec
* CCW end 900uS, CW end 2100uS, middle 1500uS, 3.0 to 6.0V,
* 9g, 22 * 11.5 * 27mm, 0.12sec/60 degrees (4.8V no load),
* stall torque 17.5ozin/1.2 kgcm) (4.8V), dead band 7usec,
* coreless motor, all nylon gear, RMB30 (TaoBao).
*
* Notes
  * Hold time = 100 * 20mS = 2 seconds
*
* Disclaimer
* Use the program at your own risk.  This program is written by a servo newie.
* There is no guarantee that the program will not damage your servo.
******************************************************************************/

int signalPin = 8; //servo signal pin

void setup()
{
 pinMode(signalPin, OUTPUT); 
}

void loop()
{
  for (int i=0; i <= 100; i++)     // turn to CCW end, hold 2 seconds
   {
   digitalWrite(signalPin, HIGH);  // control signal high
   delayMicroseconds(900);        //   for 900 uS
   digitalWrite(signalPin, LOW);   // control signal low
   delay(20);                      // wait 20mS
   }

  for (int i=0; i <= 100; i++)     // turn to middle, hold 2 seconds
   {
   digitalWrite(signalPin, HIGH);  // control signal high
   delayMicroseconds(1500);        //   for 1500 uS
   digitalWrite(signalPin, LOW);   // control signal low
   delay(20);                      // wait 20mS
   }

  for (int i=0; i <= 100; i++)     // turn to CW end, hold 2 seconds
   {
   digitalWrite(signalPin, HIGH);  // control signal high
   delayMicroseconds(2100);        //   for 1500 uS [typo here, should read 2100 - tlfong01 2013mar13]
   digitalWrite(signalPin, LOW);   // control signal low
   delay(20);                      // wait 20mS
   }
  
   for (int i=0; i <= 100; i++)     // turn to middle, hold 2 seconds
   {
   digitalWrite(signalPin, HIGH);  // control signal high
   delayMicroseconds(1500);        //   for 1500 uS
   digitalWrite(signalPin, LOW);   // control signal low
   delay(20);                      // wait 20mS
   }
 }

/* End of program */

[ENDS]

c4_esp_VR:
Emmm porqué tiene tanto cable en la foto....

En vez de ponerle un periodo de 20ms ponselo de 30ms y sino de 40 y sino de 50 y nada más porque de ahí nunca he visto que funcione bien ningún servo. Aunque arriba usa 20 ms.

Tambien prueba a poner delay_ms(20) en vez de delay_us(20000), por si acaso en us es mucho delay aunque he visto en el compilador que debería de funcionar pero nunca se sabe.

Un saludete.
chacruna:
Pfff tenes razon, no se porque tantos cables :S


Una foto mas acertada.


chacruna:
Acabo de probar con un servo nuevo, varios codigos diferentes, pero nada.

Cuando lo prendo el servo se va a una posicion determinada, si lo muevo (desenchufado) cuando lo vuelvo a conectar vuelve a la posicion anterior.

Pero todavia no responde a ninguna de las 3 señales.


Alguien alguna idea???
Navegación
[0] Índice de Mensajes
[#] Página Siguiente
[*] Página Anterior

.END
Posted by tlfong01 at 10:23 am
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home

Blog Archive

  • ▼  2013 (818)
    • ►  July (3)
    • ►  June (113)
    • ►  May (150)
    • ►  April (150)
    • ▼  March (180)
      • Free MIT OCW online course on Python state machine...
      • Robot Arm and robot nect state vectors notes
      • Testing arm and neck together
      • Guzunty Pi robot neck / head assembly notes
      • Guzunty Pi robot neck making rotes
      • Python newbie mistakes corrected
      • Adding more servos for sensors
      • Guzunty Pi Robot Arm Basic Move Function tested OK
      • Robot arm function debugging notes
      • Installing Python enum package notes
      • Installing a python package - learning notes
      • Guzunty Pi robot arm move function testing notes
      • Guzunty Pi robot arm PWM duty cycle tuning notes
      • 7 segment LED learning notes
      • Robot arm middle Position trembling problem
      • Guzunty Pi robot arm testing notes
      • Guzunty Pi PWM core testing notes
      • Guzunty Pi 8p8i core PWM testing notes
      • Guzunty Pi 8p8i PWM logic level up shifter making ...
      • Guzunty Pi Servo PWM calibration notes
      • GPi PWM clock using RPi and external clock
      • Guzunty Pi PWM frequency for servo control
      • Guzunty Pi PWM calibration function tested OK
      • GuzuntyPi core 8p8i testing notes
      • Guzunty Pi 8p8i core PWM clock frequency selection
      • RPIO.PWM fequency setting restriction problem
      • Guzunty Pi 8p8i waveform studying notes
      • Guzunty Pi 8p8i core testing notes
      • GPi 8p8i core testing notes
      • GP adapter pair troubleshooting notes
      • Guzunty Pi 8p8i core test failed
      • Guzunty Pi 16o8i/8p8i dual core testing notes
      • Guzunty Pi SPI nSelect problem notes
      • GuzuntyPi JTAG jumper setting notes
      • RPi & GuzuntyPi hardware refactoring notes
      • Now I am reading my old files on guzuntypi to rpi ...
      • Now I am googling "tlfong01 guzunty" to look back ...
      • Guzunty Pi adaptor board assembly notes
      • GuzuntyPi core 8p8i PWM code study notes
      • GuzuntyPi 8p8i Core study notes
      • RPIO GPCLK0 and GPPWM driving sevro OK
      • Test RPIO servo signals
      • Robot grip power/signal routing board assembly notes
      • Robot arm servo PSU refactoring notes
      • Servo 6V PSU refactoring notes
      • Robot arm servo 6V PSU refactoring notes
      • Robot Arm 6V servo PSU refactoring notes
      • MG995 memory refreshing old blog posts
      • Robot grip mounting notes
      • Roibot arm assembly notes
      • Robot Grip assembly notes
      • Robot grip assembly notes
      • Robot Grip assembly notes
      • FongLab Program v20.03 refactoring notes
      • Choy suet code refactoring notes
      • LCD hardware careless mistake found!
      • Robot grip playing notes
      • Robot grip playing notes
      • 24 channel inverter testing notes
      • Robot grip playing notes
      • Tri-T TMBC16465B 16x4 LCD testing notes
      • LCD 1604 Modules Testing  2009-08-21 08:49:44   ...
      • Tri-T TMBC16465B LCD module testing http://blog.y...
      • RPi shoe racks
      • TaoBao robot claw order
      • Python Debugger learning notes
      • Guzunty Pi LCD function incremental testing notes
      • Guzunty Pi LCD function testing notes
      • Guzunty Pi LCD functions writing notes
      • Robot grip prices
      • Guzunty Pi keypad function testing notes
      • Guzunty Pi LCD1602 testing notes
      • Guzunty Pi keypad function testing notes
      • GPi keypad test setup notes
      • GZP keypad function testing notes
      • GZP SPI 16o8i keypad function notes
      • Stepping motor parameter passing problem solved
      • GZP 16o8i input byte test OK
      • spidev_module.c (Python SPI binding) notes
      • GZP spi xfer2 debugging notes
      • GZP spi bug notes
      • Core16o8i debugging
      • GZ 16o8i logic level shifter board testing OK
      • Guzunty Pi 16o8i test function in Python
      • Guzunty Pi downward logic level shifter
      • GZ 16o8i testing notes
      • GZ 16o8i core studying notes
      • GZ logic level shifter testing notes
      • GZ logic level shifter assembly notes
      • GZ logic level up shifter
      • Guzunty Pi pair/swap testing notes
      • Guzunty Pi gz_test offline mode
      • Guzunty Pi - Testing fast clock for gz_test
      • Guzunty Pi P1 P2 header pin out
      • RPIO.PCM learning notes
      • RPIO.PWM experiment notes
      • Guzunty Pi connection tidying up notes
      • Tower Pro SG90 Micro Servo - refreshing memory notes
      • RPIO.PWM learning notes
      • Guzunty Pi, hardwiring PWM and GCLK0 signals
    • ►  February (87)
    • ►  January (135)
  • ►  2012 (1)
    • ►  October (1)

About Me

My photo
tlfong01
Hong Kong
View my complete profile
Powered By Blogger

Search This Blog

Pageviews last month

Translate

Simple theme. Theme images by gaffera. Powered by Blogger.

Subscribe To Electronics DIY

Labels

  • biscuit (1)
  • Camera (2)
  • fongtoy (3)
  • Raspberry Pi (2)

Popular Posts

  • Logitec C920 WebCam Review by JAMIE LENDINO
    I am wondering if I should update my webcam.  So I googled and read the following review, about HK$700 Logitec C920. Webcam Logitech c920 ...
  • Setting GPCLK0 clock frequency in Python not OK
    I am trying to set the frequency of pin 7 GPCLK0 to frequencies like 9.6MHz, 4.8MHz, 2.4MHz etc. I first tried to change the code of gz_c...
  • Webcam pair hung on a lamp post
    Now I have hung a pair of webcams on a lamp post for LED lamps. .END
  • Atten EasyScop[X installation problem
    This evening I tried to install Aeen's EasyScopX, and found it not easy at all. I could install the EasyScopX but could not connect th...
  • MCP4151 Datasheet reading notes
    Microchip MCP413X/415X/423X/425X  7/8-Bit Single/Dual SPI Digital POT with Volatile Memory Features • Single or ...
  • Dual RFM12B board testing notes
    Now I am using a bread board to make aSPI signal routing board for both RFM12Bs.  Previously I was using jumper wires to jump between tw...
  • MG996R Servo calibration notes
    Some 4+ years ago when I decided to play with electronics DIY, I bought my first servo, for ...
  • Motion configuration file studying notes
    Now I am studying the motion configuration file motion.conf, to get a feeling of how complicated is the program.   # Rename this distribu...
  • Raspberry Pi Web Cam Server Tutorial by Tom, PingBin
    I read the GNOME's Cheese reference manual and found it very difficult, and I gave up after 15 minutes. ...
  • pygame.transform learning notes
    pygame.transform - pygame module to transform surfaces http://www.pygame.org/docs/ref/transform.html pygame.transform.flip — flip vert...