Its Ok, i have testing for active potenciometer (potenciometro) its Ok, 0º, a position 30º … I have very fun, befor test:
===== #include <Servo.h>
Servo myservo; // create servo object to control a servo
//int potpin = 0; // analog pin used to connect the potentiometer
//int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
myservo.write(0); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
myservo.write(30); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
myservo.write(90); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
myservo.write(120); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
myservo.write(150); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
myservo.write(180); // sets the servo position according to the scaled value
delay(9000); // waits for the servo to get there
}
====
Very tks
Ps. I have use circuit micro servo (9g)
Ps2. I have make circuit for service:
HI
I got a doubt. When assembling the circuit, used the micro-servo 9gr, but when I fixed the circuit MS9gr in a perforated plate by rotating it clockwise vai pulsing when back to 0, go linear. Anyone know what can be?
Once we get home I record the video.
The error occurs as follows:
0 ° -> 30 °
30 -> 60 º
60th -> 90th
90 -> 180 º
Any movement from 0 ° + go chattering it will engine.
When he 180 ° -> 0 ° it will continuously without getting skipping / giving little punch in the engine.
Looks like this is a custom setup - your microcontroller should always be reading the value of the potentiometer and if it reaches the desired position, it needs to stop. Instead of troubleshooting the complete setup, try to troubleshoot each section:
Assign a desired position, and slowly rotate the motor’s shaft by hand until it reaches that position - have the LED next to pin 13 light up when the position is reached.
Next, include direction - the microcontroller should read the current value and then the desired value and know which way to turn the motor
Have the microcontroller operate the motor controller
Hi fredos16 and welcome to the RobotShop Community forum.
We are not sure to understand what you are exactly trying to achieve. In any case, the DC motor controller is used to power the brushed DC motors and the servo controller controls the servos.
Also, know that you can ask you question in French or in Spanish as well, should you be more comfortable in those languages.
This is a very common question that we will try to address here once and for all.
How to convert a DC motor into a servo motor?
A servo motor is a motor that has a controller and positional feedback. The controller uses this feedback to turn the motor shaft a certain number of times and keep it in a certain position.
If you want to convert a large DC motor into a servo motor, you will need to have positional feedback to the output shaft and use a control algorithm. Making a PID control system, for instance, can be complex.
There is a way of avoiding this by using the control algorithm already present in a servomotor internal controller. The picture below summarizes the method. Of course this method is not as flexible and as elegant as devising a PID control system.
Version française:
Il s’agit d’une question très fréquente que nous allons tenter de répondre ici une fois pour toutes.
Comment convertir un moteur à courant continu en un servomoteur?
Un servomoteur est un moteur qui a un contrôleur et de la rétroaction de position. Le contrôleur utilise cette rétroaction pour faire tourner l’arbre moteur d’un certain nombre de fois et de le conserver dans une certaine position.
Si vous voulez convertir un gros moteur DC en un servomoteur, vous aurez besoin d’avoir un retour de position de l’arbre de sortie et d’utiliser un algorithme de contrôle. Faire un système de régulation PID, par exemple, peut être complexe.
Il y a une façon d’éviter cela en utilisant l’algorithme de contrôle déjà présent dans un contrôleur de servomoteur interne. L’image ci-haut résume la méthode. Bien sûr, cette méthode n’est pas aussi flexible et aussi élégant que l’élaboration d’un système de de contrôle PID.
La méthode que vous décrivez devrait fonctionner, cependant, il faut noter que le potentiomètre du servomoteur ne permettra pas une rotation continue de l’arbre des moteurs.
Il faudra brancher les bornes qui allaient anciennement au petit moteur DC à l’entrée PWM du grand contrôleur de moteur. Il faudra aussi vous assurer que les signaux PWM n’excèdent pas le voltage accepté par l’entre du grand contrôleur de moteurs.
Votre diagramme est très bon et semble correct. En effet, votre utilisation des diodes est très ingénieuse et devrait faire marcher le gros contrôleur tel que vous le désirez.
Dommage que ça n’ai pas marché. Ce dont vous avez besoin est un détecteur de polarité. Vous pouvez voir ici comment en créer un simple: www.aaroncake.net/circuits/polarity.asp
Si votre circuit marche bien avec les relais, alors vous pourriez utiliser des relais solides qui ne devraient pas avoir de problème à s’activer plusieurs fois très rapidement: Module à Double Relais SSR Phidgets
Glad it could help Ross! It is also important to note that, as fredos16 found out, you might need a polarity detector in order to set the rotation to CW or CCW. You can find instructions on how to make one here: www.aaroncake.net/circuits/polarity.asp
He also improved the circuit diagram by adding diodes that prevent back flowing current into the electronic components.
Well, only fredos16 knows it the setup worked for him.
You are indeed right about my drawing, it only works in the forward direction. In order to make it work in both directions , you need to connect the motor signals from the servo to the same PWM input on the motor controller (like it is done in attachment 227) trough opposed diodes. Also, the text explaining what the signals do is more reliable that the positioning of the wires in the picture, the main controller image might have shifted.
The only thing missing in the drawing 227 is the polarity detector that would feed the CW and CCW input.
Before remaking a diagram we will need to test it in our own setup in order to make it 100% accurate.
I think the confusion arose when I said "…we will need to test it in our own setup …". What I really meant was "…we **would **need to test it in our own setup …"
AFAWK, the setup should work although it is subject to your choices or motors, motor controller and controlling signals. This will require some experimentation on your part. For the moment we will not make our own super powerful servo although there are plans to release a tutorial in the coming moths. We do not have a Specific ETA though.
In the meantime, you can consult with other forums users that completed this project.