This project provides a design for protecting unprogrammable servos from overload risk caused by mechanical problems or other failure. If an overload is neglected the servo may burn, become damaged, or malfunction. Therefore, it is necessary to detect the overload indicators and perform a preventative action before the servo becomes damaged. Throughout this document this action is referred to as the failsafe mode.
The GreenPAK SLG46140 IC is used within this system as a pulse width modulation (PWM) modifier to make sure the servo works properly, and it accomplishes this by measuring current through the servo motor’s ground connection. By default, the system just passes through the PWM signal from input to output. When improper current flow from the servo is detected for a few seconds the system enters failsafe mode, whereupon the PWM output is changed.
Within this project there are two options to generate a PWM signal output in failsafe mode:
1. Decrease or increase the width of the PWM input with a rising or falling delay. This stops the servo from undergoing a fault when a PWM signal is attempting to push a servo beyond its actual range of rotation, like when an automatic door does not have the full range of motion theoretically available to the servo motor.
2. Generate a predetermined PWM by using a PWM generator from an internal GreenPAK clock. This option moves the servo motor to a predefined position that is assumed to be safe, such as the midpoint of the servo’s range of motion.
The system reads a feedback voltage from a simple low pass filter which is placed between the servo ground and system ground. If overload occurs, the voltage should increase significantly. Overload detection sensitivity is made configurable by adding a voltage reference input with a simple voltage divider.
The key advantages to using a GreenPAK are that they are small, low-cost, simple, and customizable. Another typical solution would be to use a microcontroller, which would be overkill for this system when only a small, low power, and configurable solution is required. A power-hungry device that is anywhere near the size of the servo motor is impractical and not industry-feasible. Furthermore, due to the variety of servos available on the market the solution must have some capacity to be tailored to most use-cases, which prevents a dedicated IC solution from being favorable.
The complete design file is available here. It was created in the GreenPAK Designer software, a part of the Go Configure Software Hub.
1. Designed SolutionThe designed solution can be shown as a block diagram, see Figure 1. There are four states to describe how this system works:
In state A the servo system runs normally. In this state, the PWM output matches the PWM input. When overcurrent is detected from the feedback pin’s input (i = 1) the system transitions to state B and switches to overload mode.
In state B the PWM output is still the same as the PWM input. This state begins to increment a counter. If the overcurrent is resolved before the counter finishes the state transitions back to state A, otherwise the state transitions to C.
In state C, the system enters failsafe mode and turns on the failsafe signal. The failsafe signal manipulates the input PWM before sending it as an output, or it generates a predesigned PWM signal using an internal clock and PWM block. If, while still in failsafe mode, the feedback input still reads an overload condition, the system outputs an interrupt signal and triggers state D.
State D, also known as critical mode, is used to send an interrupt signal to cut off servo power, either by switching a relay or pinging the main servo controller to request a shutdown point. This state is necessary for situations where the servo is blocked from movement in both directions, such as during a mechanical failure or when the servo arm is locked in place by a hand, vise or similar object.
1.1. Feedback InputThe feedback input for this system comes from an analog comparator output (ACMP). ACMP has two sources; an overload reference voltage and a feedback voltage.
Rather than use one of the GreenPAK’s internal voltage references, this design uses an adjustable voltage for the overload reference voltage by using a simple voltage divider circuit. Different types of servos may have different overload levels. Therefore, this approach allows a sensitivity level for overload to be set as required, without the need for programming a different IC for each type of servo.
Feedback voltage is obtained from a small current sense resistor that is inserted between the GND of the system and GND of the servo. However, this signal cannot be used directly because the current of the servo may exhibit some ripple. Firstly, the signal needs converting to a constant analog voltage by use of a low pass filter, see Figure 3.
The resistor and capacitor value can be determined depending upon the signal frequency. For this implementation, the feedback signal is set at approximately 50 Hz (almost like the PWM input frequency), R8 = 1 kOhm and C1 = 100 µF.
This LPF design will have a frequency cutoff of about 1.5 Hz.
Feedback voltage signal: The 1st channel is filtered signal at point B and the 2nd is from a small resistor inserted between GND of IC and GND of servo.
To generate the feedback logic the ACMP compares the overload reference voltage to the feedback voltage. If the feedback voltage is more than the overload reference voltage the ACMP sets the feedback input to HIGH (i = 1). The system then enters overload mode. The simulation is set to a constant voltage of 200 mV on pin 4.
1.2. PWM-out for Failsafe ModeThere are two designs that can be implemented to set the PWM for failsafe mode.
For design A, when in failsafe mode, the PWM output will come from an internal PWM generator. The signal width can be adjusted by the analog voltage reference.
Design A uses the analog to PWM module referenced in AN-1057 [6]. The PWM output from this module is used when the system is in failsafe mode. The PWM can be configured by changing the voltage reference originating from pin 6. However, before using this design, make sure that PWM-out is a safe value for servo operation. For this simulation, the benchmark of 254 mV is used to generate a pulse width of about 1500 µs, (the midpoint of a typical servo). The frequency of this output can be configured by changing the counter data in CNT1. This example uses a typical frequency of 50 Hz, which is the standard period for most servo motors.
For design B, when in failsafe mode, PWM-out comes from PWM-in, modified by a defined delay. A delay block can be used to increase or decrease the width of PWM-in. Therefore, PWM-out will be relative to PWM-in. By setting Falling as edge select in the delay block, it increases the width of PWM-in. Otherwise, by setting Rising as edge select in the delay block, it decreases the width of PWM-in. This design is simpler than design A.
The delay block is only used to increase or decrease the pulse by a set amount. PWM width can be increased by setting Edge Select in DLY1 to Falling and Counter Data as the extra time desired to add to the pulse. Alternatively, PWM width can be decreased by setting Edge Select to Rising. Unfortunately, in this design, servos only have one direction protected via failsafe mode, either clockwise or counter clockwise. Therefore, it is necessary to decide the edge select needed for the application before programming this design.
1.3. GreenPAK Design ComponentAs shown in Figure 6, Figure 7, and Figure 8 the GreenPAK Design is very similar. There are some components, such as a digital multiplexer, a counter for the wait time, delay for PWM-out (design B only), analog comparator, PWM generator (design A only), and some logic blocks.
The digital multiplexer acts as a mode switcher. When the system is in the normal mode (state A and B) it selects PWM-in as PWM-out. When not in normal operation it selects the failsafe PWM as PWM‑out.
CNT0 is the latency counter for the failsafe mode after overcurrent has been detected. It can be set as required for whichever servo is used. The failsafe point should be a point where the overcurrent is confirmed to be a consistent problem but not yet enough to cause burning. This example uses 4.8 s.
The delay for the PWM-out can be configured as shown in Figure 10. Counter data can be set as needed. For this example, to increase PWM value by 500 µs (left) and decrease PWM value by 500 µs (right).
For simulation purposes, an RC oscillator was used to generate a 1100 µs PWM signal. According to Design B, set pin 4 and pin 6 as a signal generator with constant voltage via the GreenPAK Designer Emulator Tool software. Feedback goes through the low pass filter circuit to pin 10. The results of the LPF can be seen in Figure 4. The overload reference voltage is set to 200 mV. With this configuration, the PWM is chosen to increase when in failsafe mode.
In normal mode there is no overload, so the PWM output is the test input of 1100 µs. When feedback voltage is greater than the overload reference voltage it switches to overload mode. The output does not match the PWM input during the failsafe mode and instead is set at the PWM “safe spot” at 1.5 ms.
After the system has remained in overload mode for approximately 4.8 s, the system automatically switches to failsafe mode. Figure 11 shows, in this mode, there is a difference of pulse width between PWM-in and PWM-out by 500 µs. If overload still occurs in failsafe mode, the system enters critical mode and emits an interrupt signal through pin 13. For this simulation the LED on the development board is activated.
There is no difference between design A and design B when in normal and overload mode. However, in failsafe mode the system generates a PWM by using an internal clock and PWM generator. For this simulation, to set failsafe PWM to 1500 µs, the voltage reference of the PWM needs to be set as 254.7 mV.
Based on the results shown in Figure 12, this design can protect the servo motor from overloading.
ConclusionServo overload protection using the GreenPAK SLG46140 is an effective and compact way to prevent servos from overloading. The GreenPAK Design modifies the PWM used to control the servo based upon feedback voltage. If overload occurs, the system can set the servo to a safe position. If the servo is found to not be able to move to a safe position an interrupt is sent to disable the servo and prevent damage. Other more complicated and application-specific schemes can be created using this application as a starting point. Beyond functionality, using this integrated circuit has several advantages compared to competing solutions, such as its small size, lower power consumption, simplicity, and lower price.
Comments