Advertisement

Dr. Iguanas Vivarium

Not rated 31,278

#servo #battery voltage #control pulse #robot #drift
Dr. Iguanas Vivarium
Dr. Iguanas Vivarium

Description: As the robot's battery voltage gradually decreases, the servo's center point begins to drift. Eventually, one or both servo motors may start to move even when they should be stationary. Additionally, servos are designed to maintain a position rather than a specific speed. Typically, the position is determined by the length of the control pulse, where 1.0 ms represents one extreme and 2.0 ms the other; 1.5 ms is the midpoint. After modification for continuous rotation, any pulse length shorter than 1.5 ms prompts the servo to rotate in one direction, while longer pulses induce rotation in the opposite direction. The extent of the pulse width deviation from 1.5 ms influences the rotation speed, albeit in a non-linear and somewhat variable manner. For this project, 1:100 gear head motors sourced from Pololu.com were selected. Feedback was deemed necessary to accurately monitor the actual rotation speed of the wheels. A viable solution involves using optical sensors that detect a pattern attached to the wheel. By positioning two sensors correctly, quadrature detection can be implemented, similar to mechanisms used in older wheeled mice. This allows for tracking both the amount of rotation through pulse counting and the direction by observing the phase difference between the two sensors. The MicroChip dsPIC33FJ64MC804 serves as the main controller, featuring dual built-in quadrature encoders suitable for translating optical sensor pulses into direction and distance data. Mechanical design is acknowledged as a less proficient area, leading to initial placement of the motors on the PCB without a definitive attachment strategy. In reflective sensors, an assembly consists of an LED and a phototransistor aligned in the same direction. When a reflective surface approaches, the LED's light reflects onto the phototransistor, generating a detectable signal. The OP609 Reflective Object Sensor was chosen, with the LED appearing blue due to the camera's sensitivity to infrared light, while being invisible to the human eye. A significant challenge arose from the sub-millimeter variations in distance between the sensor and target, which caused substantial fluctuations in the detected signal. Issues with motor and wheel mounting resulted in wobbling, rendering the signals unusable. To address this, a coarser pattern was employed, but the initial motor and sensor mounting proved too cumbersome. Given limited mechanical skills, an alternative approach was deemed necessary to reduce wobble sources. The second type of sensor utilized is transmissive, where the LED and phototransistor face each other. A signal is detected when an opaque object obstructs the LED. To minimize positioning errors, the sensors and motors were mounted on the same PCB. The gear-head motors feature a brass plate suitable for soldering to a PCB, with the selected part being the RPI-125 from Rohm Semiconductor. Due to challenges in sourcing reasonably priced side-mount components, a vertical mount part was adapted for sideways installation. An issue arose concerning the optical encoder disk; initial attempts to print a disk on a photocopier transparency yielded insufficiently dark patterns. After several unsuccessful alternatives, the decision was made to laminate two printed encoder disks together using a clear five-minute epoxy, enhancing the pattern's visibility.

The described robotic system employs a combination of continuous rotation servos and optical sensors to achieve precise control and feedback for wheel rotation. The servo motors, modified for continuous operation, rely on pulse width modulation (PWM) to dictate their rotational direction and speed. The integration of optical sensors allows for real-time feedback on wheel movement, essential for maintaining accurate navigation and control. The use of quadrature encoding enables the system to discern both the speed and direction of rotation, enhancing the robot's responsiveness to environmental changes.

The mechanical design considerations highlight the importance of minimizing wobble and ensuring stable sensor readings. By mounting the motors and sensors on the same printed circuit board (PCB), potential mechanical misalignments are reduced, leading to improved performance. The choice of reflective and transmissive sensors allows for flexibility in detecting wheel movement, with each type offering distinct advantages depending on the application scenario.

Overall, the integration of these components, along with the selected microcontroller, forms a cohesive system capable of precise movement and control, essential for the successful operation of the robotic platform. The challenges encountered during the design process underscore the iterative nature of engineering, where solutions evolve through testing and adaptation to meet functional requirements.As the robot`s battery voltage would slowly drop, the servo`s centre point would drift. After a while, one or both servo motors would begin to creep even though they should have been stopped. Secondly, servos are designed to hold a position and not a set speed. Normally the position would be set by the length of the control pulse. 1. 0mS wou ld be one extreme and 2. 0mS the other. Normally 1. 5mS would be in the middle. After being modified for continous rotation, any pulse length shorter than 1. 5mS causes the servo to rotate one direction, and anything longer causes the servo to rotate in the other direction. The magnitude of the pulse width deviation from 1. 5mS has an affect on the rotation speed, but it`s a bit variable and not linear. For this project I decided to use some 1:100 gear head motors I bought from Pololu. com. I also decided that I needed feedback so I could accurately know how fast the wheels were actually rotating.

One way to do this is to use optical sensors that detect a pattern attached to the wheel. If there are two sensors and they are positioned correctly then you can implement something called quadrature detection (like was used in the old wheeled mice). Then you can tell not only the amount of rotation by counting pulses but also its direction by observed the phase between the two sensors.

Fitzy and Carraldo are using the MicroChip dsPIC33FJ64MC804 as their brain. The MC variant includes dual built in quadrature encoders that are just what I need to turn pulses from optical sensors into direction and distance. Now I`ll be the first to admit that mechanical design is not my strongest skill. When designing the PCB I had only located the position of the motors but I hadn`t really decided exactly how I would attach them.

Caught up in the excitement of making the boards I assumed that something clever would present itself. In reflective sensors an assembly contains an LED and a phototransistor both facing in the same direction.

If a reflective surface comes in front of the assembly, the LED`s light is reflected onto the phototransistor and a signal is detected. Here you can see the OP609 Reflective Object Sensor that I chose. The LED is glowing blue because my camera is slightly sensitive in the IR region. With the human eye, there`s nothing to see. The major problem I hadn`t anticipated is that sub millimeter changes in the distance from the sensor to the target result is huge changes in the detected signal.

Problems with mounting the motors and the wheels caused the wheels to wobble slightly and this made the detected signals completely unusuable. Because of the wobbling I had to use a coarse pattern. Although I eventually got it working, the method of mounting the motors and sensors was just too clumbsy.

Because of my limited mechanical skills I decided an alternate approach was required. One that would minimize sources of wobble. The second kind of sensor is transmissive. The LED and phototransistor are mounted facing each other. When an opaque object blocks the LED an signal is detected. I decided to minimize physical positioning errors by mounting the sensors and the motor onto the same PCB. Fortunately the gear-head motors have a brass plate that can be soldered to a PCB. The part I chose is the RPI-125 from Rohm Semiconductor. Finding a side mount component that was reasonably priced proved impossible so I used a vertical mount part and just mounted it sideways.

A bit of a kludge but that`s life. One problem I did have related to the optical encoder disk. I thought that just printing a disk onto a photocopier transparency would do the trick. The pattern was disappointly light. I wasted a lot of time trying to come up with alternate types of encoder disks. After a lot of failed attempts I returned to the photocopier transparency. I laminated two printed encoder disks together using a clear 5-minute epoxy. Not only did this give

Related Circuits