Proteus Servo Motor Library

704 views
Skip to first unread message

Analisa Wack

unread,
Jul 21, 2024, 10:40:11 AM7/21/24
to glycliimiju

.the PWM signal from the pro mini IC ATMEGA-328 has to send to servo motor through serial communication.Ihvae two questions .
1)how PWM signal value is 0-255 ?if it is that,that data transmitted is 8-bit so it makes 256 combinations.it is alright.i agree!! but why when we connect the serial port we have to use only 1 pin of IC to transmit PWM signal to the servo ? is that 1 pin of the IC transmits 8 bit data??

proteus servo motor library


DOWNLOAD » https://urlin.us/2zwhWz



2)how should i connect the servo motor to the IC.which pin should be connected so that serial PWM signal goes ..i mean which pin of IC has to be connected to which serial port pin for PWM transmission and why .

If so they only need a single signal connection from the Arduino (plus a ground connection) and you use the Servo library to control it. The signal for controlling these servos is not really the same as the PWM signal that is used (for example) to control the speed of dc motors.

i want to control the servo motor through the pro mini.obviously in proteus design i would make the IC atmega 328 that will send the PWM signals to control the motor.i am confused that there are 5,6,9,10,11 pins of the IC that can generate PWM signals.but which one should be used to send and how it will be send ?

Servo control signal is a form of Pulse Width Modulation, but not the sort (as best I know) that the PWM timers on the Arduino generate. It therefore does not matter which output pin you use because you need to generate the pulses - continuously, in software - with the "Servo" library code (or your own code to do the same) and in doing so, you specify which output to use.

If you are asking about the Proteus, its very easy. Most components come with the program, and if some specific ones, like an arduino, are missing, you can just add it as a separate file in some special library folder.

Sorry, I should have been more specific. I was asking @alto777 how hard that it is to add a component to the Wokwi sim that the sim does not currently support. I have had cause to try the Wokwi sim a couple of times but the component that I wanted to use was not present in the sim.

I can say that Urish, the fearless leader at wokwi, is open to suggestions - recently I asked for a 74HC595 8-bit parallel output shift register to complement the existing 74HC165 8-bit parallel input shift register (or was it the other way 'round?) and it appeared a short time later.

wokwi is a bit ahead of the documentation, but diligence will be rewarded and I advise anyone to fearlessly look into the diagram.json file that holds all the components and wiring. Although very 20th century, some work can be done by editing this file.

There are two main variants of servos. They look identical, but one isn't really a servo - you can't control it's position, only speed and direction. That isn't what you want, but it's what you have in your simulation.

Yes, it can export, but I'm not used to it. Is there a problem with the quality of the pictures? They look well for me. The servo motor only rotates a certain degree depending on the control pulse and stops.

I still think there is some confusion here. I want to repeat something @wildbill said: there are two types of servo, which look the same. The first type operates over a limited range of angles, and has internal end-stops to limit the range of movement. These cannot rotate continuously.

Yes, that's exactly what I'm simulating. From the picture in post 17 from OP it is the same - the other motor is similar in Proteus but instead of 3 pins there are 5 pins. That's why I said that the OP seems to have chosen the right servo in the simulation.

Hello friends, hope you all are fine and having fun with your lives. Today's post is about the Controlling of Servo Motor with Arduino in Proteus ISIS. Servo Motor is a common motor used in engineering projects for precise circular motion. We can move the servo motor at any desired angle, which is not possible in the case of other motors i.e. Stepper or DC.

For example, suppose I want to move an antenna at a precise angle of 47.5 degrees then if I use DC Motor, I have to use an encoder. So, in such cases instead of using a DC motor, I will prefer Servo Motor.

I have already posted Angle Control of Servo Motor using 555 Timer in which I have controlled servo motor using 555 timer and another tutorial about Controlling of Servo Motor using PIC Microcontroller in which I have controlled it with PIC16F877a. And today we are going to Control Servo Motor with Arduino and will design the simulation in Proteus ISIS.

First of all, we will have a look at simple control of servo motor with Arduino in Proteus ISIS and then we will check the control of the servo motor with Arduino using buttons in which we will move the servo motor to precise angles using buttons. So, let's get started with it. :)

It was quite simple and hope I explained it properly. If you still have any questions then ask in the comments and I will try to resolve them. That's all for today, will see you guys in the next tutorial. Take care !!! :)

What is a servo motor and how it works?
A servo motor is a type of electric motor that is designed for precise control of position, velocity, and acceleration. It is commonly used in applications that require accurate and controlled motion, such as robotics, CNC machines, and industrial automation.
The most used hobby servo motors are: SG90 Micro Servo and MG996R Servo.
The SG90 micro servo motor is the one used in this tutorial, it is the one shown below with horns and screws:

The SG90 servo motor usually comes with a 3-pin connector that makes it easy to connect to a control circuit or microcontroller.The pins typically include ground (Brown wire), power supply (Red wire), and the control signal (Orange wire).

When servo motor control circuit receives a signal from the microcontroller system, it compares target position with actual position and generates an Error. The Error signal is sent to a Controller Circuit that controls the DC motor through H-Bridge circuit. The H-Bridge circuit allows the rotation of DC motor in both directions according to a control signals (sent by the controller circuit).
The Gear System (or gearbox) reduces the speed of the motor and increases its torque. This allows the motor to move a load with high precision and accuracy.

Servo motors are typically controlled using a series pulses or simply a PWM (Pulse-Width Modulation) signal.
The PWM signal is a square wave signal that varies in duration (pulse width) but has a fixed frequency. The duty cycle, which is the percentage of time the signal is high (on) during each period, determines the position of the servo motor.

A typical PWM signal for a servo motor has a frequency of 50 Hz and a pulse width range of 1 to 2 milliseconds, with a pulse width of 1.5 milliseconds representing the center position. By adjusting the duty cycle of the PWM signal, we can control the position of the servo motor very precisely.
The image below shows a simple relationship between pulse width and servo motor position:

As shown above, a zero degrees is represented by a pulse width of 1 milliseconds,
A 90 degrees is the center position of the servo motor, it is represented by a pulse width of 1.5 milliseconds,
A 180 degrees is represented by a pulse width of 2 milliseconds.

This means servo motor angle position is directly proportional to the pulse width.
The following simple animation shows the relationship between servo motor angle and pulse width where pulse width varies between 1ms & 2ms.

Servo Motor Control with Arduino Proteus Simulation Video:
This project can be easily simulated using Proteus simulation software as shown in the given below video.
Proteus provides a simulation environment that allows us to visualize and test the behavior of our circuit virtually.

Arduino with servo motor Proteus simulation file download:
Proteus simulation file of this project can be downloaded from the below Google Drive link. Use Proteus version 8.15 or higher to open it.
DOWNLOAD

Thanks for sharing this informative blog post on controlling the SG90 servo motor with Arduino and Proteus simulation. As an electronics enthusiast, I found your article well-written and easy to follow, making it an excellent resource for beginners and hobbyists.

In this post, I will share a Servo driver model library for Proteus. With this driver, you can control multiple servos using only two pins on your Arduino board. This servo driver is based on the PCA9685 LED controller, which is already provided in Proteus under their Microprocessor Category.

The PCA9685 can function as a servo controller, as servos are typically controlled using PWM signals, which the PCA9685 can generate. In Proteus, this PWM controller is already utilized as a servo controller. Additionally, various servo driver boards from different brands incorporate this PWM controller. Therefore, based on these boards, I have enhanced the graphics to provide a more appealing and realistic user interaction experience.

The Adafruit PCA9685 PWM Servo Driver library is a popular choice for controlling servos and other PWM (Pulse Width Modulation) devices using the PCA9685 chip. This library provides an easy-to-use interface for Arduino microcontrollers to communicate with the PCA9685 chip, allowing precise control of servo motors and other PWM-driven components.

To install the library, you can use the Arduino Library Manager or manually download the library and add it to your Arduino IDE. Next, open the example file Program (Servo) in an IDE window. Compile this sketch and copy the hex file location into the Arduino model in Proteus. Make sure you have connected the Driver board with Arduino via I2C Pins.

e59dfda104
Reply all
Reply to author
Forward
0 new messages