shoutchen's blog
Archive for October, 2008
Posted by shoutchen | Oct 31, 2008 @ 05:22 PM | 6,417 Views
The drawing below is intended to be a representation of what
the computer thinks is the state of the servo actuator
at any point in time. The computer updates all the information
on a fixed interval and runs the PID computations.

As you can see, a lot of the information is based solely
on mechanical aspects of how the servo actuator was built,
and other measurements you can take on the physical system.
Other parts of the information is spec'ed out, like the dead band
tolerance. The rest of the information is ascertained prior to
the PID computation, like the angle and the set point.
Remember, the drawing represents a somewhat ideal example
, so a real world version may need to be adjusted to incorporate "as built"
values for some of the information.

The computational aspect of the PID routine generally
follows this algorithm (At least this is what I have come up with, based on my
research and experimentation... ), using the state information of the
servo actuator:

Determine the PID Gains. These are fixed once the system is
"tuned". More on tuning PID gains in a later episode...

Then, on a "timer basis" do the following steps:

1. If the angle is outside the soft stops, halt PID processing
because something is broken. Skip all the following steps
and don't drive the output arm. Don't allow PID processing the
next time around.
2. Retrieve the set point and angle of the output arm

# Images

Posted by shoutchen | Oct 30, 2008 @ 08:46 AM | 7,408 Views
Lets build one !! Or at least think about what is required...

Refer to the drawing to help you visualize the ideas I am attempting to convey here.

Here is somewhat ideal but still practical example of a practical
servo actuator system: All this should be described
(from actual measurements) to "model" how the system will act.
The CPU uses an 8 bit ADC determine the position of the
servo actuator arm, and the set point is determined by the
width of the 1 - 2 msec pulse from the system driving the servo
actuator.

the servo is at neutral position. At the mechanical stops
on each side, the ADC reads 0x50 when the arm is at one end
of its travel (-30 degrees from neutral) and 0xb0 at the
other end (+ 30 degrees) from neutral) of its travel.
Here you can see the range of the movement is
0x50 to 0xb0 == 0x60 == 96 steps.
We will remember the range of movement so if the arm falls outside of it
we assume the system failed mechanically, and we will
quit driving the output arm. We have to add in some tolerance there,
so we accidentally dont assume it is broken when it is not...

need to have more steps between the limits of the servo actuator
travel. That would make the lower and upper values for the ADC
reading closer to the rails for the same positions..

# Images

Posted by shoutchen | Oct 29, 2008 @ 08:32 PM | 6,816 Views
This scope capture shows the output of a linear hall effect sensor as a radially magnetized magnet is "spun" next to the sensor, which repeatly moves the magnets south pole closer to the sensor, then the north pole, and so on...

Channel 2 shows the positive rail to be around 2.64 volts, while the output of the hall effect sensor is about .2 volts to 2.4 volts.

From the picture you should realize the following:

1. The position of the arm gives you a sensor readinig that is unambuguous "between" the poles, but is ambiguous on either side of a pole.

2. Over that operating region between the poles the output seems pretty much linear...

3. You may need some gain from the hall effect sensor to the ADC of the CPU to get rail to rail operation if you need it. Another solution to this is to use a
more sensitive sensor, or move the sensor closer to the magnet...

4. The mechanical design of a servoactuator system needs to make the operating limits of the output arm fall so the magnet causes the hall effect sensors output to be between the poles of the magnet.

5. the physical limitis (mechanical stops) , if any of the output arm of your actuator, may cause the sensor output to be in a certain range, which could be a useful piece of inoformation in your control algoritm.. any readings outside the stops are either noise to be disregarded, or a sign of failure, which may cause you to...Continue Reading

# Images

Posted by shoutchen | Oct 28, 2008 @ 11:35 PM | 6,933 Views
If you wanted to learn something about control systems used all over the place in the real world,. then you ought to invest some time learning about PID (proportional, integral, derivative ) control systems. One popular use of this control system is in positioning servos, like the ones we use in our models. The basic concept is that there are 3 things that play a part in deciding what to to tell your servo at any point in time to reduce the differnce between the current servo position and where you want to be.

The first is how far are is the servos current position from the desired position. The further away it id, the bigger the "shove" you give to it to get it to go to the right place. This piece of the puzzle of referred to as the "P" or proportional part.

The second is determining if you are getting closer to the desired position, or further away from it. If you go further away instead of closer, or even if you did not move at all, you would give it and even bigger shove... The way you do this is to keep track of a running total of the error and see if it gets bigger or smaller. This piece of the puzzle is referred to as the "I" or integral part.

The third component determines how far you moved since the last time you looked. If you made a really big move, you may want to not give as big a shove the next time, so you dont do past the spot you want to go to.
(overshoot) This piece of the puzzle is referred to as the "D...Continue Reading
Posted by shoutchen | Oct 25, 2008 @ 05:26 PM | 4,299 Views
A rcgrups member asked about this, so I just put together a quick drawing and came to the concusion the basic 4 channel project can be modified to do a full up system ( i.e. areobatic ).... This is not under active development.. for now

# Files

Posted by shoutchen | Oct 23, 2008 @ 01:53 PM | 5,497 Views
Diy ServoActuator Project Tools

Based on Silabs C8051F300 CPU
Using Silabs ToolStick Development Tools

C Compiler is SDCC...(free)

The sofware "super loop" runs a time slice scheduler based on timer interrupts. This scheduler lets each of 8 tasks run for .5 msec at a time.

2. Running the PID loop to determine how to program the hbridge to move the
actuator output arm to the requsted position,

3. Sendng the information about the PID gains, the PWM settings, the pulse width, and the angle of the output arm in the backbround over the TXD rs232 pin.

Progress so far,,,

Analyzed the hall effect sensor output from
a radiially polarized magnet spinning over the sensor

Can initialize the chip I/O

Can send bytes over the rs232 H/W

Can determine the servo pulse width using the PCA capture compare hardware
This was tested using my gws servo tester..

Can generate the PWM in H/W for the hbridge using the PCA hardware.

Verified the pwm changes with a scope and the LEDS changing brightness

Added the hbridge and verifed the 4 mm pager spins in both directions with some simple code to change the pwm outputs driving the hbridge. and the leds

Finished the code to run the actuators in open loop mode. The actuator respond to a 1 -2 msec pulse. I tested this with my servo tester in...Continue Reading

# Files

Posted by shoutchen | Oct 23, 2008 @ 11:58 AM | 5,227 Views
Diy 72 Mhz 4 Channel Fm Rx Project Tools
Based on Silabs C8051F411 CPU
Using Silabs ToolStick Development Tools

C Compiler is SDCC...

Progress so far,,,

Analyzed the hall effect sensor output from
a radiially polarized magnet spinning over the sensor

Can initialize the chip I/O

Can initialize the radio chip an any channel.

Set up the data amp/slicer for negative shift TXes.

Can decode the PPM pulse train into the separate channel components

Implemented glitch detection on the frames,

Implemeneted failsafe for the channels.

Implemented throttle soft start

Can set the frequency and duty cycle for all 6 pwm channels.

wrote code to drive the a3901 hbridge ( finished this
in servoactuator project)

There are other rcgroups members involved in developing a prototype
PCB for this. That effort is being documented in the indoor and micro
model forum...

The sofware "super loop" runs a time slice scheduler based on timer interrupts. This scheduler lets each of 8 tasks run for .5 msec at a time.