Difference between revisions of "Talk:Cheesoid"

From Nottinghack Wiki
Jump to navigation Jump to search
Line 78: Line 78:
 
*** My own custom motor shield for 2 DC motors
 
*** My own custom motor shield for 2 DC motors
  
* motor mountings
 
** simple aluminium angle mountings - might make some more of these with greater accuracy!
 
* motor to axle couplings
 
** http://uk.rs-online.com/web/c/mechanical-components/power-transmission-components/oldham-style-couplings-accessories/
 
** simple, cheap
 
* building the wheels/axles/bearing hubs: nearly done - some tweaking and securing to do
 
 
* building the plastic chassis
 
** what's that display board plastic material called?
 
** is it http://www.foamcore.com/ultra-board.html
 
** milling the plastic - is nicely cut with a fine jigsaw blade - try router table!
 
** can it be laser cut? may contain chlorine or other nasties: see http://www.nycresistor.com/2008/08/28/how-to-identify-polymers-with-burnination/
 
 
* battery regulation: http://letsmakerobots.com/node/3880
 
* battery mounting - where?
 
** chassis strong enough to carry those batteries? !!!!
 
** aluminium cross bracing?
 
** perhaps move to 2x 6V - keep it flexible
 
  
 
OK, motors tested with a two motor circuit...
 
OK, motors tested with a two motor circuit...
Line 232: Line 214:
 
This sketch is a munge of http://letsmakerobots.com/node/2074 and http://itp.nyu.edu/physcomp/Labs/DCMotorControl
 
This sketch is a munge of http://letsmakerobots.com/node/2074 and http://itp.nyu.edu/physcomp/Labs/DCMotorControl
  
I want to have motor enable based on digital logic as this will be controlled by bumper and cliff sensors
+
== Bodywork ==
 +
* building the plastic chassis
 +
** what's that display board plastic material called?
 +
** is it http://www.foamcore.com/ultra-board.html
 +
** milling the plastic - is nicely cut with a fine jigsaw blade - try router table!
 +
** can it be laser cut? may contain chlorine or other nasties: see http://www.nycresistor.com/2008/08/28/how-to-identify-polymers-with-burnination/
 +
 
 +
* battery regulation: http://letsmakerobots.com/node/3880
 +
* battery mounting - where?
 +
** chassis strong enough to carry those batteries? !!!!
 +
** aluminium cross bracing?
 +
** perhaps move to 2x 6V - keep it flexible
  
Range Sensors
+
* cylinder case mods
* SRF05 by Devantech Ltd
+
** speakers in mouth plate/grill
** http://robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html
+
** side mount for MCU1 and support boards (temporary?)
** http://www.robot-electronics.co.uk/htm/srf05tech.htm
+
** top for beacon - keep on side for now
 +
** mounting of cylinder on chassis
 +
 
 +
* motor mountings
 +
** simple aluminium angle mountings - might make some more of these with greater accuracy!
 +
* motor to axle couplings
 +
** http://uk.rs-online.com/web/c/mechanical-components/power-transmission-components/oldham-style-couplings-accessories/
 +
** simple, cheap
 +
* building the wheels/axles/bearing hubs: nearly done - some tweaking and securing to do
 +
 
 +
Motor shaft couplings being the most annoying thing right now
 +
* I really need some well made couplings like [http://www.fscoupling.com/635mm-to-8mm-flexible-shaft-coupling-635x8mm-set-screw-motor-shaft-coupler-connector-diameter-20mm-length-25mm-p-49.html these]
 +
Small hose clips may be the thing.
  
Xino upgrades
+
== MCU1 and MCU2 ==
 +
Xino devices
 
* power screw terminal blocks: http://uk.rs-online.com/web/p/products/4258720/
 
* power screw terminal blocks: http://uk.rs-online.com/web/p/products/4258720/
 
* smt caps for smt regulators!
 
* smt caps for smt regulators!
  
PIN usage on main Xino
+
PIN usage on MCU1
 +
 
 +
MCU1 PIN usage summary table on Google Docs
  
* PWM capable pins: 3,5,6,9,10,11
+
* PWM capable pins on the 328/Xino: 3,5,6,9,10,11
 
* Dig out x2 for eyes
 
* Dig out x2 for eyes
 
* Dig in for mode switch
 
* Dig in for mode switch
* dig out for beacon on pin 13
+
* dig out for beacon (preferably on pin 13)
 
* motor enable dig out
 
* motor enable dig out
 
* PWM x4 for motor logic control - can it be reduced?
 
* PWM x4 for motor logic control - can it be reduced?
Line 254: Line 262:
 
* others!
 
* others!
  
PIN usage summary table...
+
MCU1 software
 +
* TODO motor drive code and motor drive commands from PC
  
TODO
+
== eeePC mods ==
 
+
Hardware and system mods to support "isolated usage".
=== goal/job list ===
+
* soldered in an external power button cable
HS:
+
** PWR button sub-assembly with safety keyswitch - mount on side panel
* backup multimeter and hook probes - label it and solder plugs onto probe wires
+
** TODO LED in "Micro" and other nice illuminated buttons
 
+
** Monostable/bistable startup flasher circuit for "Micro" switch?
 
+
* "pizza box" container
* pizza box mods
 
 
** power port extension
 
** power port extension
** USB extension - USB hub
+
** USB extension - USB hub - still powering MCU1 from USB - much drain?
** PWR switch extension - LED in "Micro", PWR switch? Monostable/bistable startup flasher circuit for "Micro" switch
 
  
* eeePC mods
 
 
** Lid switch: do not suspend when lid closed - instead just switch to external monitor output
 
** Lid switch: do not suspend when lid closed - instead just switch to external monitor output
 
*** http://forum.eeeuser.com/viewtopic.php?pid=20450#p20450
 
*** http://forum.eeeuser.com/viewtopic.php?pid=20450#p20450
Line 288: Line 294:
 
</div>
 
</div>
  
** clean up and test external monitor output
+
This is not enough: the eeePC will not power on with the lid closed so I had to disable the lid closed sensor by removing the magnet from screen section of the case
** remove easymode
+
 
** better power switch functionality
+
** clean up and test external monitor output - not fully working with some of my external monitors
 +
** removed EasyMode which "mostly" fixes the "are you sure" dialog for shutdown via power switch
 
** http://wiki.eeeuser.com/howto:useicewm#configuration_of_icewm
 
** http://wiki.eeeuser.com/howto:useicewm#configuration_of_icewm
 +
<div>
 +
<pre>
 +
# minimal brightness
 +
echo 0 > /sys/devices/platform/eeepc/backlight/eeepc/brightness"
 +
# screen off after 2 minutes
 +
xset dpms 0 0 120
 +
</pre>
 +
</div>
 +
 +
=== eeePC problems ===
 +
* unionfs inode depletion causing "No space left on device" but df shows plenty of space!
 +
** http://forum.eeeuser.com/viewtopic.php?pid=537876#p537876
 +
** mount /dev/sda2 elsewhere and remove the '.wh*' files
 +
* running out of space due to other errors ~/.Xsession-errors
 +
* firefox won't start - oh well!
  
 +
=== eeePC Software ===
 +
* console read and process
 +
* speech module
 +
** speech commands from stdin
 +
** speech thread - busy flag and job queue management
 +
* motor module
 +
** motor control input from STDIN
 +
* sensor module
 +
** camera module - look at Java interaction with V4L or whatever is in use
 +
** mic input - and speech recognition
 +
** GUI interface port and GUI app
  
  
* cylinder case mods
 
** speakers in mouth plate/grill
 
** side mount for Xino and boards
 
** top for beacon - keep on side for now
 
** mounting of cylinder on pizza box
 
  
* Xino/UNO main sketch code
 
** motor drive code and motor drive commands from PC
 
** speech commands from
 
  
* PC app code
 
** console read and process
 
** speech module
 
*** speech commands from stdin
 
*** speech thread - busy flag and job queue management
 
** motor module
 
*** motor control input from STDIN
 
** sensor module
 
** camera module - look at Java interaction with V4L or whatever is in use
 
** mic input - and speech recognition
 
** GUI interface port and GUI app
 
  
--[[User:Msemtd|Michael Erskine]] 11:38, 28 September 2011 (EST)
+
= Additional =
 +
== Range Sensors ==
 +
* SRF05 by Devantech Ltd
 +
** http://robot-electronics.co.uk/acatalog/Ultrasonic_Rangers.html
 +
** http://www.robot-electronics.co.uk/htm/srf05tech.htm
  
 
== Rotary Encoders for wheels ==
 
== Rotary Encoders for wheels ==
Line 325: Line 343:
 
* encoder usage in daylight
 
* encoder usage in daylight
 
* mounting encoder wheel to axle
 
* mounting encoder wheel to axle
 
 
 
== eeePC problems ==
 
* unionfs inode depletion causing "No space left on device" but df shows plenty of space!
 
** http://forum.eeeuser.com/viewtopic.php?pid=537876#p537876
 
** mount /dev/sda2 elsewhere and remove the '.wh*' files
 
* running out of space due to other errors ~/.Xsession-errors
 
* firefox won't start - oh well!
 
 
 
== work! ==
 
Motor shaft couplings being the most annoying thing right now
 
* I really need some well made couplings like [http://www.fscoupling.com/635mm-to-8mm-flexible-shaft-coupling-635x8mm-set-screw-motor-shaft-coupler-connector-diameter-20mm-length-25mm-p-49.html these]
 

Revision as of 16:34, 4 October 2011

Interaction Goals

Cheesoid is intended to be a fully autonomous robot that interacts with people and objects in its environment. Human-Robot interaction is a massive subject but I intend to get some rudimentary (and comedic) speech and general input features in place as soon as possible. The environment interactions will develop as I learn more about sensing and mapping. Since the robot will live at Hackspace I have two basic goals for comedy value: -

  • interact with the fridge for cheese status
  • interact with the petrol pump for petrol status

So...

  • it needs to know where they are to go and talk to them
  • the status needs to be stored and needs to be set - Xino at each? Via IRC bot? Some web interface?
  • it need to be able to read the status from the fridge and the petrol pump - what sort of interface? IR remote control?

Petrol status

  • just a number!

Cheese status

  • many cheese types - each with use by date
  • Primula status is "in tube"

Human - Robot Interactions: speech

With the eeePC I have a very capable processor on board and I'm taking full advantage of that: -

  • using espeak for text to speech
  • using sphinx for speech recognition


speech recognition with sphinx

http://cmusphinx.sourceforge.net/wiki/tutorialconcepts

The sphinx packages

p    --\ sphinx2-bin                                                                                                                    <none>     0.6-2.1
  Description: speech recognition utilities
    Sphinx 2 is a real-time, speaker-independent speech recognition system.

    This package contains examples and utilities that use Sphinx. It also includes a sample language model that is capable of recognizing simple commands
    like "go forward ten meters" and other commands one might use to tell a robot where to move.
  Priority: optional
  Section: universe/sound
  Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
  Compressed size: 129k
  Uncompressed size: 500k
  Source Package: sphinx2
  --\ Depends (3)
    --- libc6 (>= 2.4)
    --- libsphinx2g0 (>= 0.6) (UNSATISFIED)
    --- sphinx2-hmm-6k (UNSATISFIED)
  --\ Packages which depend on sphinx2-bin (0)
  --\ Versions of sphinx2-bin (1)
p    0.6-2.1

Good examples of the use of sphinx: -

Mobility

  • motors
  • wheels
  • chassis
  • motor power
  • motor control circuitry
  • big battery

Drive motors: I now have my 12V 150RPM gearmotors from China


OK, motors tested with a two motor circuit...

Motor Test sketch (non-PWM)

  1 int motor_left[] = {
  2   2, 3};
  3 int motor_right[] = {
  4   7, 8};
  5 const int ledPin = 13;      // LED 
  6 const int switchPin = 10;    // switch input
  7 const int enablePin = 9;    // H-bridge enable pin
  8 
  9 
 10 // ————————————————————————— Setup
 11 void setup() {
 12   Serial.begin(9600);
 13   pinMode(ledPin, OUTPUT);
 14   pinMode(switchPin, INPUT); 
 15   pinMode(enablePin, OUTPUT);
 16 
 17 
 18   // Setup motors
 19   int i;
 20   for(i = 0; i < 2; i++){
 21     pinMode(motor_left[i], OUTPUT);
 22     pinMode(motor_right[i], OUTPUT);
 23   }
 24   check_enable();
 25   // blink the LED 3 times. This should happen only once.
 26   // if you see the LED blink three times, it means that the module
 27   // reset itself,. probably because the motor caused a brownout
 28   // or a short.
 29   blink(ledPin, 3, 100);
 30 
 31 }
 32 
 33 
 34 void check_enable(){
 35   digitalWrite(enablePin, digitalRead(switchPin));
 36 }
 37 // ————————————————————————— Loop
 38 void loop() {
 39 
 40   drive_forward();
 41   delay(1000);
 42   motor_stop();
 43   Serial.println("1");
 44 
 45   drive_backward();
 46   delay(1000);
 47   motor_stop();
 48   Serial.println("2");
 49 
 50   turn_left();
 51   delay(1000);
 52   motor_stop();
 53   Serial.println("3");
 54 
 55   turn_right();
 56   delay(1000);
 57   motor_stop();
 58   Serial.println("4");
 59 
 60   motor_stop();
 61   delay(1000);
 62   motor_stop();
 63   Serial.println("5");
 64 }
 65 
 66 // ————————————————————————— Drive
 67 
 68 void motor_stop(){
 69   check_enable();
 70   digitalWrite(motor_left[0], LOW);
 71   digitalWrite(motor_left[1], LOW);
 72 
 73   digitalWrite(motor_right[0], LOW);
 74   digitalWrite(motor_right[1], LOW);
 75   delay(25);
 76 }
 77 
 78 void drive_forward(){
 79   check_enable();
 80   digitalWrite(motor_left[0], HIGH);
 81   digitalWrite(motor_left[1], LOW);
 82 
 83   digitalWrite(motor_right[0], HIGH);
 84   digitalWrite(motor_right[1], LOW);
 85 }
 86 
 87 void drive_backward(){
 88   check_enable();
 89   digitalWrite(motor_left[0], LOW);
 90   digitalWrite(motor_left[1], HIGH);
 91 
 92   digitalWrite(motor_right[0], LOW);
 93   digitalWrite(motor_right[1], HIGH);
 94 }
 95 
 96 void turn_left(){
 97   check_enable();
 98   digitalWrite(motor_left[0], LOW);
 99   digitalWrite(motor_left[1], HIGH);
100 
101   digitalWrite(motor_right[0], HIGH);
102   digitalWrite(motor_right[1], LOW);
103 }
104 
105 void turn_right(){
106   check_enable();
107   digitalWrite(motor_left[0], HIGH);
108   digitalWrite(motor_left[1], LOW);
109 
110   digitalWrite(motor_right[0], LOW);
111   digitalWrite(motor_right[1], HIGH);
112 }
113 
114 /*
115     blinks an LED
116  */
117 void blink(int whatPin, int howManyTimes, int milliSecs) {
118   int i = 0;
119   for ( i = 0; i < howManyTimes; i++) {
120     digitalWrite(whatPin, HIGH);
121     delay(milliSecs/2);
122     digitalWrite(whatPin, LOW);
123     delay(milliSecs/2);
124   }
125 }

This sketch is a munge of http://letsmakerobots.com/node/2074 and http://itp.nyu.edu/physcomp/Labs/DCMotorControl

Bodywork

  • battery regulation: http://letsmakerobots.com/node/3880
  • battery mounting - where?
    • chassis strong enough to carry those batteries? !!!!
    • aluminium cross bracing?
    • perhaps move to 2x 6V - keep it flexible
  • cylinder case mods
    • speakers in mouth plate/grill
    • side mount for MCU1 and support boards (temporary?)
    • top for beacon - keep on side for now
    • mounting of cylinder on chassis

Motor shaft couplings being the most annoying thing right now

  • I really need some well made couplings like these

Small hose clips may be the thing.

MCU1 and MCU2

Xino devices

PIN usage on MCU1

MCU1 PIN usage summary table on Google Docs

  • PWM capable pins on the 328/Xino: 3,5,6,9,10,11
  • Dig out x2 for eyes
  • Dig in for mode switch
  • dig out for beacon (preferably on pin 13)
  • motor enable dig out
  • PWM x4 for motor logic control - can it be reduced?
  • bumper and cliff inputs - use serial mux?
  • others!

MCU1 software

  • TODO motor drive code and motor drive commands from PC

eeePC mods

Hardware and system mods to support "isolated usage".

  • soldered in an external power button cable
    • PWR button sub-assembly with safety keyswitch - mount on side panel
    • TODO LED in "Micro" and other nice illuminated buttons
    • Monostable/bistable startup flasher circuit for "Micro" switch?
  • "pizza box" container
    • power port extension
    • USB extension - USB hub - still powering MCU1 from USB - much drain?
#!/bin/sh
LID_STATE=`cat /proc/acpi/button/lid/LID/state | awk '{print $2 }'`

if [ $LID_STATE = "closed" ] ; then
#    /etc/acpi/suspend2ram.sh
        /bin/su user -c "/usr/bin/xrandr --output VGA --mode 800x600 --output LVDS --off"
fi
if [ $LID_STATE = "open" ] ; then
        /bin/su user -c "/usr/bin/xrandr --output LVDS --preferred --output VGA --off"
fi
exit 0

This is not enough: the eeePC will not power on with the lid closed so I had to disable the lid closed sensor by removing the magnet from screen section of the case

# minimal brightness
echo 0 > /sys/devices/platform/eeepc/backlight/eeepc/brightness"
# screen off after 2 minutes
xset dpms 0 0 120

eeePC problems

  • unionfs inode depletion causing "No space left on device" but df shows plenty of space!
  • running out of space due to other errors ~/.Xsession-errors
  • firefox won't start - oh well!

eeePC Software

  • console read and process
  • speech module
    • speech commands from stdin
    • speech thread - busy flag and job queue management
  • motor module
    • motor control input from STDIN
  • sensor module
    • camera module - look at Java interaction with V4L or whatever is in use
    • mic input - and speech recognition
    • GUI interface port and GUI app



Additional

Range Sensors

Rotary Encoders for wheels

  • an easily available "obsolete" ball type PS/2 mouse
  • Microsoft "Mouse Port Compatible Mouse 2.0A"
  • using the serial output from the mouse circuitry
  • encoder usage in daylight
  • mounting encoder wheel to axle