Tuesday, October 26, 2010

Potential design for track wheels

Yesterday I was looking @ Linxmotion.com . I found some good tracks (3" wide x 21 links ~ 23") for our robot (found here http://www.lynxmotion.com/c-94-tracks.aspx). I like the overall design of the chassis, but I want to make some personal modifications on the body. Linxmotion does sell the entire chassis kit (without electronics; found here-- http://www.lynxmotion.com/p-577-tri-track-chassis-kit-no-electronics.aspx) for a whopping $220.95. I would like to attempt to make my own version of the chassis in a metal shop.

The three potential modifications are as follows. First, our robot needs room for a camera to turn and motherboard's motor control wires need to have a quick line-of-sight to the cameras pan/tilt servo motor.
Second, I am considering placing two servo motors per track to multiply the speed for the wheels to turn. I am not sure if this is a good idea, but hey where is the fun in that... I'll eventually test this hypothesis (faster speed = more servos per track). Third, does our robot really need the triangle track-wheel shape? I need to consider other track shapes and placements for the servos. I'll attempt to post those trials.

The information below is how to construct the Linxmotion chassis without electronics (website can be found here: http://www.lynxmotion.com/images/html/build115.htm).

Tracked Vehicle Assembly Instructions Ver. 1.Updated 07/16/2008.
Safety first! Wear eye protection and never touch a powered robot!
Note: Do not use Loctite or thread locks on the assembly. They are not necessary and may cause damage to the Lexan.

Image of the chassis.
Step 1.Attach four 3" aluminum bars to the inside pair of lexan panels as shown. Use 4-40 x .375" hex screws.
 

8 x4 x

Figure 1.
Step 2.Attach 1.5" hex standoffs to the lexan panels as shown. Use 4-40 x .375" screws.
 

12 x12 x

Figure 2.

Step 3.Attach the motors as shown, using four 3mm x 8mm screws. Make sure the motor shafts and the hex standoffs are on the same side of the lexan panels.
 

4 x

Figure 3.
Step 4.Install the hubs onto the motor shafts as shown. Align the hub to be flush with the end of the motor shaft. Tighten the set screw down firmly.
Figure 4.
Step 5.Install the sprockets onto the hubs as shown. Take care to make the teeth on the sprockets line up as shown! Use two 4-40 x .625" screws per side.
 

4 xSprocket Alignment:

Figure 5.

Step 6.Prepare the idler sprockets. Install the two sprocket halves back-to-back on the long end of the idler hub. Take care to make the teeth on the sprockets line up as shown! Attach them with two 3mm x 8mm screws. Make four idler sprocket assemblies.

 Figure 6-1.

Figure 6-2.
Step 7.Attach ball bearings to the idler sprockets as directed in either Figure 7-1A or Figure 7-1B, depending on which version of the idler hub you have. Install the idler sprockets into the side panel as shown in Figure 7-2. Slide twelve nylon bushings over the nylon standoffs.
 


Figure 7-1A.
Figure 7-1B.

Figure 7-2.
Step 8.Install the outer lexan panels as shown to close up the assemblies. Use twelve 4-40 x .375" screws.
 

12 x

Figure 8.

Step 9.Wrap the 21-segment track assembly around the sprockets, push the axel in and secure with two nylon snap rivet fasteners. These parts are included with the track kit, not the chassis kit.
 

2 x4 x

Figure 9.
Step 10.You should now have two assemblies that look something like this.
Figure 10.
Step 11.Attach 1.5" hex standoffs to the bottom panel as shown. Use 4-40 x .375" screws.
 

6 x6 x

Figure 11.

Step 12.Attach the top panel as shown. Use six 4-40 x .375" screws.
 

6 x

Figure 12.
Step 15.Attach the track assemblies to the chassis as shown. Use eight 4-40 x .375" screws.
 

8 x

Figure 15.
Step 16.You can install the optional base rotate using the top screws from the standoffs.
Figure 16.

Step 17.Push the capacitor legs through the holes in the motor terminals. Bend the capacitor legs down onto the terminals as shown.
Figure 17.
Step 18.Push the motor wire connectors onto the motor terminals. Make sure to put the red wires on (+) and the yellow wires on (-).
Figure 18.
Step 19.Install the wiring harness as shown. This switch will be for the 7.2vdc battery that powers the Sabertooth motor controller. Additional mounting holes allow adding separate power switches for accessories you add to the mobile platform, such as an arm, Johnny 5 torso, etc.
Figure 19.

Step 20.Refer to Table 19 for Sabertooth connection information. We've included the switch settings we used for Johnny 5 - you may need to use different settings for your application. You can find which direction to flip the switches on the card included with the Sabertooth. Route the motor wires through the holes in the chassis as shown! When the Sabertooth is properly connected and set up, use some double-sided foam tape to secure it inside the chassis.
 




Sabertooth ConnectionsSabertooth Switch Settings
M1ARobot's right motor,
red wire
1Independent Control
M1BRobot's right motor,
yellow wire
2Disable Exponential
M2ARobot's left motor,
red wire
3Non-lithium mode
M2BRobot's left motor,
yellow wire
4R/C Flip Mode
B+Battery (+), red wire5Enable Auto-Calibrate
B-Battery (-), black wire6Disable Timeout
Table 19

Figure 20.
Step 21.
The Sabertooth has a battery elimination feature (BEC). This is useful when connecting the Sabertooth to an R/C receiver as it provides 5vdc at 500mA. This BEC can power the receiver itself and a couple of servos in low power applications, such as a pan-and-tilt. However, when more powerful servos are connected to the R/C receiver, you must disable the BEC and provide a separate battery to the R/C receiver and its servos. It is also necessary to disable the BEC if you are connecting the Sabertooth to an SSC-32.
To disable the BEC, pull the red wire out of the black housings of the CH1 and CH2 wires as shown in Figure 21. Be sure to cover the exposed wire with heat shrink to prevent accidental short circuits!

Figure 21.
Step 22.This wiring harness is not included in the Tri-Track Chassis kit. We are illustrating what is necessary to install an SSC-32 to control an arm, Johnny 5 torso, or other servo-based addition. This switch will be used for a 6vdc battery.
Figure 22.

Step 23.
If you are using both an SSC-32 and a Bot Board, you will install them as shown in Figure 23. If you are only using the SSC-32, you will secure it with the four screws and standoffs.

Figure 23.

Monday, October 25, 2010

H-bridge for servo motor control (beginning design)

  • Why an H-bridge? Because the DC motor needs voltage to be applied across a load in multiple directions to change motor rotation (to move forward and backward).

  • What does an H-bridge consist of? H-bridges can be built from both discrete or bought as an integrated circuit (from companies such as Texas Instruments or Analog Devices).

  •  What does the schematic look like?

BOM consists of: 
4 bipolar or FET transistors
4 schottky diodes (to keep current flowing in a particular direction, preventing back EMF)
1 motor in between the four diodes

  • How does it work?


If Q2 and Q3 are turned on, the left lead of the motor will be connected to ground, while the right lead is connected to the power supply. Current starts flowing through the motor which energizes the motor in (let's say) the forward direction and the motor shaft starts spinning. If Q1 and Q4 are turned on, the converse will happen, the motor gets energized in the reverse direction, and the shaft will start spinning in that way. If less than full-speed (or torqe) operation is intended one of the switches are controlled in a PWM fashion. The average voltage seen by the motor will be determined by the ratio between the 'on' and 'off' time of the PWM signal.
Current flow in the forward directionCurrent flow in the backward direction

The example provided on this page features:
    • TTL/CMOS compatible Microchip/Maxim 4424/4427A or IXYS IXDN404 MOSFET driver chips that protect the logic chips, isolate electrical noise, and prevent potential short-circuits inherently possible in a discrete H-bridge.
    • Schottky diodes to protect against overvoltage or undervoltage from the motor.
    • Capacitors to reduce electrical noise and provide peak power to the driver chip.
    • Pull-up resistors that prevent unwanted motor movement while the microcontroller powers up or powers down.
A diode-less version of this circuit successfully drove Bugdozer to mini-sumo victory. The more robust (diode protected) version is used on Sweet and Roundabout.
Hmm. It doesn't look like the letter 'H'.
Warning: Direct motor driving with this chip is only possible for motors that draw less than 100 mA (TC4427A), 150 mA (TC4424), or 340 mA (IXDN404) under load. To determine if your motors qualify, use a multimeter to measure how much current your motor uses under load (for example, when actually driving your robot around) when the motors are connected directly to the battery (not through these chips).This chip is not really supposed to drive a motor by itself. If you find the chip gets very hot and the motor doesn't spin (or barely spins or stalls when loaded) then you need to have the chip drive some real power MOSFETs like it is supposed to. It's not that much more difficult and it really makes a huge difference in performance.

Attempting to hack the PS3 controller for robot control

**Information obtained from http://sophiateam.undrgnd.free.fr/psx/#protocole ***

My senior design group wants to use a game controller to direct the robot's speed, direction, and camera angle. Here is my research that is helping me along in my search to use a game controller via USB connection to a computer.




Serial interface for Playstation pad

Introduction
Playstation pad protocol
Electronic - The board
Software
Download

PSX pad Introduction

The playstation pad is fantastic to control anything you want because there are 14 buttons and 2 analogic joystics !
I made this interface to controle my webcam and also the robot which participate to the French Robotic Cup (E=m6).
I used the serial port because usual interface I found used the parallele port, but the robot already use it for something else and it had a free serial port. More, with a microcontroller it is easy to have all the psx pad protocole decoded outside the PC. The only negative point is that you have to made a board...



Playstation pad protocol

The Playstation Controller Pinouts


  
PSX PAD PLUG

LOOKING AT THE PLUG
        -------------------------------
 PIN 1->| o  o  o | o  o  o | o  o  o |
        \_____________________________/
    
PIN # USAGE
  1. DATA
  2. COMMAND
  3. N/C (9 Volts unused)
  4. GND
  5. VCC
  6. ATT
  7. CLOCK
  8. N/C
  9. ACK
DATA
Signal from Controller to PSX. This signal is an 8 bit serial transmission synchronous to the falling edge of clock (That is both the incoming and outgoing signals change on a high to low transition of clock. All the reading of signals is done on the leading edge to allow settling time.)
COMMAND
Signal from PSX to Controller. This signal is the counter part of DATA. It is again an 8 bit serial transmission on the falling edge of clock.
VCC
VCC can vary from 5V down to 3V and the official SONY Controllers will still operate.
ATT
ATT is used to get the attention of the controller. This signal will go low for the duration of a transmission. I have also seen this pin called Select, DTR and Command.
CLOCK
Signal from PSX to Controller. Used to keep units in sync.
ACK
Acknowledge signal from Controller to PSX. This signal should go low for at least one clock period after each 8 bits are sent and ATT is still held low. If the ACK signal does not go low within about 60 us the PSX will then start interogating other devices.
It should also be noted that this is a bus of sorts. This means that the wires are all tied together (except select which is seperate for each device). For the CLK, ATT, and CMD pins this does not matter as the PSX is always the originator. The DATA and ACK pins however can be driven from any one of four devices. To avoid contentions on these lines they are open collectors and can only be driven low.

The PSX Controller Signals

All transmissions are eight bit serial LSB first. All timing in the PSX controller bus is syncronous to the falling edge of the clock. One byte of the transmissions will look kinda like this.
|BIT 0|BIT 1|BIT 2|BIT 3|BIT 4|BIT 5|BIT 6|BIT 7|
    CLOCK -----___---___---___---___---___---___---___---___-----------

    DATA  -----000000111111222222333333444444555555666666777777--------
                  *     *     *     *     *     *     *     *
    CMND  -----000000111111222222333333444444555555666666777777--------

    ACK   ----------------------------------------------------------__-
    
The logic level on the data lines is changed by the transmitting device on the falling edge of clock. This is then read by the receiving device on the leading edge (at the points marked *) allowing time for the signal to settle. After each COMMAND is recieved by a selected controller, that controller needs to pull ACK low for at least one clock tick. If a selected controller does not ACK the PSX will assume that there is no controller present.
When the PSX wants to read information from a controller it pulls that devices ATT line low and issues a start command (0x01). The Controller Will then reply with its ID (0x41=Digital, 0x23=NegCon, 0x73=Analogue Red LED, 0x53=Analogue Green LED). At the same time as the controller is sending this ID byte the PSX is transmitting 0x42 to request the data. Following this the COMMAND line goes idle and the controller transmits 0x5A to say "here comes the data".
This would look like this for a digital controller
ATT    -______________________________________________________________
              |   Byte 1     |    |   Byte 2     |    |   Byte 3     |
    CLOCK  ---_-_-_-_-_-_-_-_-----_-_-_-_-_-_-_-_-----_-_-_-_-_-_-_-_-----
                   0xFF                0x41                0x5A 
    DATA   -------------------------__________--__----__--__----__--__----
                   0x01                0x42
    CMND   -----_____________-----__--________--__------------------------

    ACK    --------------------__-------------------__-----------------__-
    
After this command initiation proccess the controller then sends all its data bytes (in the case of a digital controller there is only two). After the last byte is sent ATT will go high and the controller does not need to ACK.
The data transmision for a digital controller would look like this (where A0,A1,A2...B6,B7 are the data bits in the two bytes).
ATT    _______________________________________-------
              |   Byte 4     |    |   Byte 5     |  
    CLOCK  ---_-_-_-_-_-_-_-_-----_-_-_-_-_-_-_-_--------

    DATA   ---D0D1D2D3D4D5D6D7----E0E1E2E3E4E5E6E7-------

    CMND   ----------------------------------------------
                                                    ***
    ACK    --------------------__------------------------

    NOTE: No ACK.
    

The PSX Controller Data

Below are five tables that show the actual bytes sent by the controllers
Standard Digital Pad

    BYTE    CMND    DATA

     01     0x01    idle
     02     0x42    0x41
     03     idle    0x5A    Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
     04     idle    data    SLCT           STRT UP   RGHT DOWN LEFT
     05     idle    data    L2   R2    L1  R1   /\   O    X    []
   
    All Buttons active low.
    
Analogue Controller in Red Mode

    BYTE    CMND    DATA

     01     0x01    idle
     02     0x42    0x73
     03     idle    0x5A    Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7
     04     idle    data    SLCT JOYR JOYL STRT UP   RGHT DOWN LEFT
     05     idle    data    L2   R2   L1   R1   /\   O    X    []
     06     idle    data    Right Joy 0x00 = Left  0xFF = Right
     07     idle    data    Right Joy 0x00 = Up    0xFF = Down
     08     idle    data    Left Joy  0x00 = Left  0xFF = Right
     09     idle    data    Left Joy  0x00 = Up    0xFF = Down

    All Buttons active low.
    



Electronic - The board

I used a Motorola 68HC11A1FN (the only microcontroller I had to make a new board) which is almost directly connected to the PAD; there are only two pull up resitances on 'Data' and 'Ack' pins (68hc11 inputs)). And it is interfaced with the PC's serial port using a MAX232.



Software

Embedded software for 68HC11A1FN (loaded at $B600). Note that the microcontroller E0 pin is set to +5V so that Buffalo is not run when the board is reset but the program directly start at $B600 : psxpad.asc.

To assembly the program and download it, set the 68hc11 pin MODB to GND and you may use the flowwing programs :68hc11_psx.zip

The embedded proggram continously send requests to the pad and save the results in its 7bytes of its RAM. Then when it received a byte (not $FF) on the serial port, it sends 7 bytes corresponding to the data to the PC.
Here is a sample in C++ (for Visual C++) which continuously sends request and display data from the psx pad : cpp_psx.zip



Download

Download all necessary files : psx_all.zip