Manual Servo

From DiyLightAnimation
Jump to: navigation, search

Notice

The PIC does NOT come pre-programmed from Microchip or any supplier. If you do not have a programmer then please see the PIC Programming Wiki page for a list of DLA users who can program the PIC for you. If you are programming the PIC yourself, download the hex file from the Wiki and program the PIC chip using the appropriate steps for your programmer setup. Check out this post for a helpful pdf on PIC programming. Some helpful tips on PIC programming can also be found on this You Tube video.



Introduction

This is the manual to guide you through the build process of the DMX Servo Controller.


WARNING! As with all equipment associated with DLA, this device has been designed for personal use as a means of education and entertainment. As such it is not rated, tested, or approved for use in commercial environments and such use is forbidden by the designer. Improper use of this equipment could be hazardous to life and property and the suitability of use is your responsibility. DLA and/or the designers of this device assume no responsibility in the use or operation of this equipment or for the accuracy of any information made on part of itself. This device has been designed for non-commercial, hobbyist use only. No warranties are written or otherwise made. It should be considered an experimental device with possible unknown characteristics.


Before you start the build, use the Mouser Direct link on the wiki page to verify you have the correct parts and quantity of parts before we go any further. Please use static electricity precautions in the handling of these parts (ground straps, etc.). If you are not familiar with them please research on the Internet prior to handling them. You can damage your parts with improper handling!


Ensure you are using the correct DMX Servo Controller PCB for this build.


Thumb



Preparing to Build (Advice from RJ)

The next thing we want is to make sure you are up to speed on soldering and electrostatic protection of the components in your kit. If you are not an experienced printed circuit builder, visit the Curious Inventor website and review the How to Solder guides just below the video. The video on soldering correctly at the top of the page is extremely good to watch even if you are experienced at soldering.


Another issue you must be aware of is that some electronic components can be damaged easily by electrostatic charges that can build up in you or your equipment. We have all been shocked by walking on carpet and grabbing a doorknob. This is electrostatic charge in action. It takes much less than this to hurt some of the parts. If you are unfamiliar with procedures to protect from this, please use the Internet to research it before opening your parts up. You can damage your parts with improper handling!


You will need a few tools to build the DMX Servo Controller. You will need a good soldering iron. I cannot stress enough that a good soldering iron makes a big difference in these projects. The little 15w cheap irons are more apt to hurt your parts by taking too long to get the parts up to soldering temperature than a good iron which can bring it up to temp very fast. Remember, damage is a factor more in how long you keep the part hot than it is how hot you get it (within reasonable soldering temperatures). A good soldering iron is reasonable: You can purchase one for $30 to $60. Most any product that calls itself a soldering station that includes a temperature control separate from the iron itself will more than likely be fine, but make sure it is rated for more than 15 watts. I use a cheap Weller like this: Weller Soldering Station. It works fine and is very inexpensive. I even saw this model on sale at Sears. Radio Shack has a very nice looking digital model on sale but be careful: it does not allow you to replace the tip. Tips are a part that wear out and need to replace them from time to time. While we are on the topic of tips, get some. I recommend you get the smaller chisel shape as this works very well for all-around board building.


You need solder, so buy some. I recommend .032 size as the larger sizes tend to cause you to put too much solder on. How much? Go ahead and get a 1 lb spool as it’s cheaper in large volume and you will go through it faster than you think. Make sure you are getting rosin core for electronics; they make some solder for plumbing that has acid as the core and this is a bad mistake to make.


You need some work area to work with good lighting. Do not attempt to solder circuit boards in poorly lighted areas. If you wear reading glasses, go get them: you will want them I promise you. I also recommend getting a helping hands tool similar to this: Helping Hands Tool.



PCB Assembly

If this is your first build we have laid out the order for soldering the components to the board in a step by step procedure for you to follow. Components are outlined in red for each step as they are soldered to the board. Ensure that you orient the parts as shown on the PCB and in the assembly pictures.




Component Identification (for the ones not labeled on the PCB):


  • C1: .1uf ceramic (for logic bus monitor)
  • C2: .1uf ceramic (for servo bus monitor - currently not used)
  • C3: 10uf ceramic
  • C4: 470uf electrolytic
  • C5: .1uf ceramic
  • C6: .1uf ceramic
  • C7: .1uf ceramic
  • C8: 100uf electrolytic
  • C10: .1uf ceramic
  • C11: .1uf ceramic
  • C12: .1uf ceramic
  • C13: .1uf ceramic
  • C14: .1uf ceramic
  • U7: MCP100_315_D (for logic bus monitor)
  • U8: MCP100_450_D (for servo bus monitor - currently not used)
  • F1-F8: 60R030XU Fuse

Also note that .1uf is the same as 100n. The PCB may be labeled as "100n" instead of ".1uf".



  • Install the R1 and R4 (10k ohm - brown,black,orange) resistors at upper left.
  • Install the R2 and R3 (330 ohm - orange,orange,brown) resistors at middle left.
  • Install the R6 (120 ohm - brown,red,brown) resistor at lower left.
  • Install the R7 (1k ohm - brown,black,red) resistor at lower right.

Resistors can be installed in either direction. There is no polarity to worry about. However, it looks more professional to have the color bands all in the same orientation.

Special Note Regarding R7: The default 1k ohm resistor will produce 20mA output current for each LED channel. Please see notes towards the bottom of this manual for more details on customizing this output current.

(Please note that your component color and/or size may not exactly match what you see in these photos. Please verify component characteristics before installing.)


Thumb




Special Note: The photos in this manual show some capacitor locations to have 3 holes. The release version of the PCB will only have 2 holes.


There will also be times when you have an axial format capacitor, but the holes in the PCB are close together. In that case, you can stand the cap up on end to get it to fit. See the photo below for an example.


Thumb


  • Install all .1uf ceramic capacitors (C1,C5,C6,C7,C10,C11,C12,C13,C14)

(NOTE: C2 is not currently used)

  • Install the 10uf ceramic capacitor (C3)

Ceramic capacitors can be installed either way. There is no set polarity.


(Please note that your component color and/or size may not exactly match what you see in these photos. Please verify component characteristics before installing.)


Thumb




  • Install sockets

Be sure to orient the sockets so that the notch is at the correct end. Please note the printing on the PCB for correct orientation.


Thumb




  • Install headers
  • Install power connector
  • Install RJ45 sockets
  • Install electrolytic caps (C4 = 470uf, C8 = 100uf)

Electrolytic capacitors are polarity dependent. Please note the printing on the PCB for correct orientation.

Thumb


(Please note that your component color and/or size may not exactly match what you see in these photos. Please verify component characteristics before installing.)


Thumb




  • Install supervisory chip at U7 (U8 is currently not used)
  • Install regulator with printed side facing towards the power and RJ45 connectors
  • Install red and green LEDs

LEDs are polarity dependent. Please note the printing on the PCB for correct orientation.

Thumb


(Please note that your component color and/or size may not exactly match what you see in these photos. Please verify component characteristics before installing.)


Thumb




  • Install Ex/Rx headers
  • Install Diode (Note: final release version will have only one diode placement option at D1. This photo will be updated.)

Diodes are polarity dependent. Please note the printing on the PCB for correct orientation.


Thumb




  • Install fuses

Fuses can be installed either way. There is no set polarity.


(Please note that your component color and/or size may not exactly match what you see in these photos. Please verify component characteristics before installing.)


Thumb




  • Install ICs

Be sure to orient the chips correctly. Please note the printing on the PCB for correct orientation. Chips will either have a "notch" at one end that corresponds to the notch in the socket. Or they'll have a small dot near pin one, which also corresponds to the notched end of the socket.

Thumb



Getting Up and Running

Program the PIC and you're ready to roll. Please see the top of this manual for PIC programming tips.


Steps to get up and running:

  • Load firmware to PIC using your Pickit or whatever programmer you have.
  • Test the servo controller with Vixen or any other source of DMX data to make sure the firmware is loaded and functioning correctly.
  • Figure out your end point limits, directions and channel assignments.
  • Use the config tool to send the parameters from the above step to the servo controller.


Please note, by default the DMX channel assignments are 1-8 for the servos and 9-16 for the LED outputs.



Configuration Tool

Instructions for using the Servo Controller Configuration Tool


Thumb


  • Make sure dongle is connected to computer
  • Put the “programming” jumper in place on the servo controller
  • Power up the servo controller
  • Start the “Bobcat DMX Servo Controller Configuration” tool
  • Click the “Settings…” button and select the COM port of your dongle (click OK)
  • Specify the DMX channel assignments for the servo output channels
  • Specify the servo direction as either “Std” (standard) or “Rev” (reverse).
  • Specify any custom end point adjustments (default is max range). This will most likely require trial and error with whatever decoration you’re driving with servos.
  • Specify the DMX channel assignments for the LED output channels
  • Click the “Program Controller…” button. A message box will display reminding you to make sure the programming jumper is in place on the controller board. Clicking “OK” on the message box will send the programming information to the servo controller. You should see a fast series of flashes on the green LED if successful.
  • If you want to save your configuration settings, click the “Save Configuration…” button and specify location and file name.
  • If you want to recall a previously saved configuration, click on the “Load Configuration…” button and locate the file to be loaded. (Note, this device in uni-directional. You cannot read the configuration from the controller.)


End Point Adjustments

This is a tough one to describe in simple terms. I apologize for the complex nature of this section, but I thought it needs to be addressed in order to help users understand how the configuration tool is used to set end points.

First some general servo theory. Servos are motor-driven actuators where the position is dependent on the duration of a pulse on the signal line. The term for this pulse control is "pulse width modulation" or "PWM". The frequency of this PWM signal occurs once approximately every 20 milliseconds. It's a rather high frequency and produces a smooth control. The width (duration) of the pulse determines the position of the servo's output shaft/arm. The length or duration of this pulse signal is called the "pulse width". The generally accepted "standard" pulse width for R/C servos is 1ms to 2ms logic high or on, with the rest of the 20ms PWM frame being considered logic low or off. Although different servo manufacturers allow for pulse widths that can go beyond this "standard" range of 1ms - 2ms.


Thumb


The DMX servo controller (by default) takes a conservative approach. It uses the "standard" by equating the DMX intensity value of "0" to 1ms and the DMX intensity value of "255" to 2ms. It also scales the intermediate DMX values proportionally to a pulse width somewhere in between. However, we have designed in plenty of flexibility to alter the mapping between DMX values and pulse width. This allows us to either extend the servo travel limits or to shorten them while still accepting the full DMX intensity value range of 0-255. Once the controller is configured for your application, you won't have to worry about an errant DMX value sending your servo or the decoration it's driving beyond their limits. Each end of the travel range is also independently adjustable. So when specifying custom start and end values using the configuration tool, the servo travel range is re-scaled across the 256 DMX intensity values to produce a custom mapping. All calculations for configuring custom servo travel end points is always based on the premise that DMX 0 = 1ms and DMX 255 = 2ms. The configuration tool takes your "Start Value" and "End Value" for each servo channel and calculates a scaled travel range relative to the default (DMX 0 = 1ms and DMX 255 = 2ms).


Let's walk through a simple example where we'll set the start and end points at 1/4 (start value = 63) and 3/4 (end value = 191) of the default servo travel range. The first illustration shows where we would like to have our servo travel start and end (see where 63 and 191 fall on the travel range). We want the low end point to start at the position associated with intensity value 63 (based on default full range). We want the upper end point to be equivalent to the intensity value 191 (also based on the default full range). So we set the start and end values in the config tool to 63 and 191 respectively. The second illustration shows how the servo would behave after sending that configuration to the servo controller.


(servo travel distances are for example purposes only)


Thumb


As mentioned, the servo controller configuration tool will also allow you to extend the servo travel range beyond the standard 1ms - 2ms pulse width. The extended range limits are approximately .5ms - 2.5ms. This is done by setting the start values to negative numbers and/or the end values greater than 255. As you can see in the screenshot below, the value box will turn red when you specify a value outside the standard range. That's done as a warning to you that you may cause damage your servos if not careful. My advice is to "sneak up" on any extended end points by trial and error. Listen carefully to the servo to see if it's hitting the stop. It will growl and hum like it's straining.


Thumb


BE WARNED: SENDING A SERVO BEYOND IT'S MECHANICAL LIMITS MAY DAMAGE IT. USE THIS CAPABILITY AT YOUR OWN RISK.



Additonal Notes and Tips

  • You can gang multiple servos on the same DMX channel. This will allow you to drive heavier items that might be too much for a single servo.
  • The endpoint adjustments will automatically scale to the full 256 DMX “intensity” values. So the resolution will always be 256 steps.
  • The LED outputs can drive RGB LEDs for color changing effects (requires "common-anode" RGB LED). Use one channel for each lead on the RGB node. This provides for two full RGB nodes and two additional LED channels. This might be useful for glowing eyes on skulls, etc.
  • The “R7” resistor on the board can be altered to allow for different output LED current. The range can be anywhere between 3mA and 120mA. The formula for calculating the R7 resistor is [mA =(1.25/R) x 15]. Set the value of R (R7 ohms) until you get the output current you want. Valid range for R7 is 157 Ω thru 6000 Ω. The default R7 value (1k Ω) in the BOM is designed to give approximately 20mA on the LED output channels.
  • Be sure to use a power supply that provides enough current to drive the servos without any “dips” that might cause a “brown-out” for the PIC. The 8 servos I'm testing with (2 mini, 3 high-torque analog, 3 high-torque digitals) are pulling an average of 1.3 amps running continuously with no load (using Vixen). Stalling one of the digitals takes the current up to almost 3 amps. It would be a good idea to consider larger power supplies if you can.
  • The design of the PCB allows you to split the power bus for the logic circuitry from the servo power bus thus eliminating the effects of brown-outs on the PIC. However, you still need to consider providing enough power for the servos to do their job efficiently. Under-powering servos will most likely shorten their life. I originally designed this for a single power-supply, but we added the “split” option for extra flexibility. My testing with a single power supply for both buses works just fine as long as you have a capable power supply. I would recommend at lease a 2 amp supply. Certainly larger if you’re running all 8 channels or heavy loads. The larger, the better. Buy once and grow into it rather than going small up front.


NOTE: To use a single power supply, place a jumper at JP3 and connect power to “S+” at P1 block. For dual power supply input, remove the jumper at JP3 and connect two separate power supplies to “S+” and “L+” at P1 block. "S+" = Servo Power positive. The hole to the left of it is the ground. "L+" = Logic Power postive. The hole to the left of that is the ground. Don’t use the same power supply for dual input. It’s redundant and would be the same as setting up the board for single power input.


Separate Logic Power Bus Supply Requirements:

  • 6VDC
  • 30mA in wired mode (without Ex/Rx)
  • 120mA in wireless mode (with Ex/Rx)

(these are absolute measurements, power supply current should be rated at least 2 times these numbers)


Separate Servo Power Bus Supply Requirements:

  • 4.8VDC - 6VDC
  • Dependent on servo size, use, and loads
  • Recommend at least 2A, larger for heavy loads


Combined (Single Power Supply Configuration)

  • 6VDC
  • Recommend at least 2A, larger for heavy loads


DMX Communications

  • The wired DMX out port can be either a “pass-through” or a “re-broadcast”. The option is yours based on the topology of your DMX chain. However, the BOM includes the parts to build as a re-broadcast. This is the most flexible and the cost is minimal.
  • The wireless option uses a standard build of the Ex/Rx board. Simply plug one into the headers and put the Wired/Radio jumper in the “Radio” position. The DMX out (RJ45) will still transmit even if you’re receiving via wireless. This allows for multiple DMX devices to "share" a single wireless receiver. See other areas of the DLA wiki for more information on wired DMX daisy-chaining.


Servo Protection

  • We’ve designed in resettable fuses for each servo channel. I felt it might be a good idea rather than let a stalled servo just sit there and burn itself out. The default BOM fuses are rated at 300mA continuous load with a trip current of 600mA. If you end up driving some monster servos, you might consider a larger fuse. However, don’t forget that you can gang small servos together to drive heavier items. So the electrical load would be spread over multiple channels instead of one. Food for thought.


Enclosure

  • We have not done anything with enclosures for this device. If anyone finds something that works well, please share with the group.


Optional Power Bus Monitoring

  • Components U8/C2 are intended for servo power bus monitoring. U7/C1 are for logic power bus monitoring. You can decide to monitor one or the other, but not both. We feel that the logic bus is more important to monitor to help prevent continuous PIC reboots due to brown-outs.