Monday, 7 October 2013

BHD Logo

Was messing about last week, and decided if writing it all up, the BHD needed a logo, or something recognizable to go on paperwork, PCBs and maybe even stickers/paches. :)

Here it is:

Didnt think about the intel inside thing.  :D


2-3-2, Dome Servos and Arduino Workshop

Building has been fun recently.  Decided to delay the magic panel and DBC installs, I want to look at the base of my code first.  Reduce a few signal lines and replace them with 2 way comms.

But I added the 2 relays to the dome, these control the power to the servos.  One for the 3 HP servos and one for the rest of the doors.  They both prevent any servo twitch as the main power is connected, so connection order is no longer an issue for the dome.  They also power off the door servos 2s after they are all closed.  This allows the doors to be pulled open when on, stops any servo buzz and saves power.  Really good, highly recommended.  These will be included in the BHD write-up.  Will also be adding these to the body servos, and maybe the dome motor for completeness.


I then moved back to the 2-3-2, James had offered to ask Roger to look at the ankles and leg rod fixings in the feet, so I took him up on the offer, hoping to get this finished once and for all.  The play in those areas was causing a lot of wobble in the 2-3-2.  So almost a full day of stripping the legs on the Saturday, then I set off to Roger’s last Sunday.  We remade the JAG push-in inserts for the ankles for a tight fit on the shoulder bolts, and made them a little longer too.  Then we redid the leg rod fixings in the feet, these now cannot move, and the rod more easily rotates on the brass bush and so it looked like it should solve the issues.




I also wanted to show you my ankle bracelet brackets. :) 



So then came 3 evenings of re-assembly!  So much work to get it all back together.  James came over Thursday evening to help as catcher.  So tested it, it looked amazing, so much more solid and reliable.  But all the positions were wrong.  So I uploaded the tweaked code…..then nothing.  Dead.  I spent about 5 hours debugging, thinking initially that I had knocked out a wire and then that I had shorted the Xbee.  Nope, I had accidentally deleted the line Serial.begin(9600);  not clever, obviously the serial wont work without that!  So once id found that I recalibrated all the positions, re did the 2-3-2 code so that the signal to drive the feet stops when the first actuator stops and not both (looks much better).  It is so nice now.  Really smooth and stable.  There is one little detail of the bolts that attach the legs now taking all the force so they undo themselves, but an easy fix with the right washers.

So here is my 2-3-2 as it should be, stable, balanced and reliable.  No face-plants, no wobbles, just 2 legs to 3 legs and back.  Maybe 60 cycles + now, and still running perfectly.  Long may it last.  But if you are doing 2-3-2, it is a nightmare, does require lots of work, it is different on a dressed droid, and just because it does it once, doesn't mean it will do it all year long.  Don’t give up, just keep finding more ways that don’t work till you find one that does.  My whole frame now needs a rebuild to allow more space for the CPU arm and claw, they fit, but not their mechs. :)


Anyone who says they have 2-3-2, unless you have done 100 cycles without issue, you haven't even started. :)

This Sunday we had another Builders day at my local hall.  We had a really nice Dalek, a beautiful B9, 3 complete droids and 2 part droids, oh and a really nice mouse droid.  There are a lot of talented folk in the UK.

The day included (or was taken over by) an Arduino workshop.  I wanted to get a few people working with arduinos and felt that the initial phase was the tough one, so doing an intro and making something fun would be a good start and maybe help others to pick up Arduino and run with it.  It went really well, they seemed to enjoy it, and were showing each other how to solve stuff by the end, which is usually a good sign.



I had planned to do a load of testing in an open space, but didn’t get chance. Next time.

I finally got the Relays for the feet, only a 5 week delivery!  Will be adding those ASAP.

Monday, 16 September 2013

Magic Panel Part 1

My Magic Panel arrived.  It is a pretty thing. :)

So i soldered up the pins (or James did), and powered it up.  Nothing, so read the guide.  It defaults to flash every 8-12 mins.  So i added the jumper to test the other options.  It seemed like it had loads of potential, but some of the default scrolls and patterns seemed jumpy.  So i started over.  :D

The grid layout of LEDs is complex.  The rows of 8 LEDs are actually the first 2 rows of the 1st chip and not in the same positions.  e.g. Row 0 B11110000 and Row 1 B00001111 will turn on all the LEDs in the top row.  So this was going to be fun.

I used a 2 dimensional boolean array (8x8) as what i wanted to see and mapped that to the actual LED layout.  So i simply change the boolean array to say what should be on/off and then map and print that to the LEDs via the chips.  It works beautifully.  I can set rows and columns and work with it very easily now.

So once i got that setup i decided to do the pattern i had my heart set on.  Random in and out so it is almost like a fade.  I really like this one, it took a few goes to get it looking right, and being random it doesn't always look perfect, but im happy with it now. 

Then i looked at shapes, i applied the Logo on the back of the PCB as one option, but when difused the image isnt easily seen, but it isnt horrible. :) 

Here are a couple of videos of what it can currently do:




So it is now ready for me to decide on when it should be used and add in the triggering, i have started working on the spreadsheet, and hope to have the I2C stuff added this week.  Then i need to cut the hole in the dome and im good to go. :)

Tuesday, 3 September 2013

BHD Control BOM Mk1

BHD Control BOM

The following is a list of the parts used in my current electronics setup.  This is subject to change and still work in progress, but I have been asked a few times, and this will be a useful base for a future write up.
Details on wiring to follow.
All Sketches, libraries, sound files etc can be found here:

Dome:

5v Dome battery with Auto Sense (20Ah+)

Slip Ring kit, boards and slip ring – See Astromech.net for details

3A Switch for 5v system

BHD Teeces Logics & PSIs

Controls the Logics and PSIs.  This includes a Arduino Pro Micro or mini etc.  Plus Header pins, resistors for voltage divider, leads crimps and covers etc.  This is setup as a 3 chain setup.

BHD Dome Servos and HPs

Controls 3 HP lights using PWM, 3 HP Servos for random and controlled motion, and 9 door servos (4 pies and 5 lower).

Arduino Uno, Mega or Nano : Recommend Genuine Uno
Uno:
Mega:
Nano:

3 Bright White LEDs 

3 220Ohm Resistors

Servos for dome (4 for pie panels, 5 for lower doors)
I use Ripmax SD200 servos, so something suitable to lift the panes, the specs are as follows:
Dimensions (mm): 25.0 x 29.5 x 13.9     Speed (sec): 0.14     Torque (Kg.cm): 2.50
James recommends these:  £10.00 (cheaper on ebay, but get what you pay for) http://www.hobbytronics.co.uk/hd1800a-micro-servo?keyword=micro%20servo&category_id=0

HP Servos – I have a custom mech, and use Std size servos x 3.  Any servos strong enough to move the HPs will be fine.  Currently the code only does the Y axis, I hope to add code for the X axis too eventually.

Adafruit 16 Servo PWM Controller (+Capacitor and pins), – If servos are added

Relays for servo power – If servos are added

DC/DC converter for servo Power – If servos are added
Plus Header pins, resistors for voltage divider, leads crimps and covers etc.

BHD DBC & Rear PSI

Rear PSI will also run on Teeces code if DBC is not added.  This will allow control of 6 funtions from the dome bumps e.g. random sounds on/off, hi/low volume etc.

Dome bump controller – See Astromech.net for details of the part run
Work in Progress
Also need a few header pins etc.

BHD Magic Panel

Magic Panel – See Astromech.net for details of the part run
This may well become the controlling Arduino for the Dome servos and HP, but needs coding and testing.
Work in Progress



Body and Feet

12v main Battery – LifePo4 Tracer? SLA – Up to you.  Power depends on weight of droid and run time needed.  This only runs the ESCs and the 3 motors, the DC/DC converters, the amplifier and the 2-3-2 system.  The rest runs on the dome or body 5v supplies.  All 12v supplies are fused, and relays are added on the feet drives and on the servo power feeds to prevent rogue start up issues, and improve overall safety.

5v Dome battery with Auto Sense (20Ah+) (see above in dome section)  This powers the Master, relays, MP3 Uno and Shield, the Body Uno, 2-3-2 Uno, Adafruit and all the LEDs

Feet Motors – Up to you, recommend NPCs for alu droid

Dome Motor – Up to you, recommend Pitman

Fuse Holder for 12v Supplies – Recommend RigRunner 4008H + Suitable fuses for each 12v circuit.

3A Switch for 5v system

BHD Master

Master runs the speed controllers, dome positioner etc and communicates with the pad.

Uno (see above)

Xbee

SparkFun XBee Shield

Sabretooth 2x25 – 2 x 25A ESC For Feet Drives if lower powered motors you may get away with less current.

Syren 10 – 10A ESC For Dome Drive

Dome pos Pot (Optional)

Feet Relays
Also need a few header pins etc.

BHD MP3 

MP3 Shield and controller

Uno  (see above)

SparkFun MP3 Shield

Ground Loop Isolator

Amplifier
Any 12v amp, 2 channel, just needs RCA on inputs from GLI connectors (above) and speaker outs, volume control is useful, but not essential.  Recommend a min of approx. 2 x 20W RMS power.

Speakers, cables etc
Suitable speakers for amp, and wires including headphone to RCA adaptor for the Shield to GLI
Also need a few header pins etc.

BHD Body Controller

This will run all Body Servos, CBI, Data Panel and Vegas Kit.

Uno (see above)

CBI Panel – See Astromech.net for details of the part run

Data Panel (Optional) – See Astromech.net for details of the part run.  I am 
not using this on mine so control is basic, but the random mode looks great.

Vegas Kit – RGB LEDs in LDP and Coin Slots

Servos for Utility Arms and Doors (If so add 2nd Adafruit, 2nd DC/DC, Dual 5v 10A relay and more Servos - see above) 
Plus Header pins, resistors for voltage divider, leads crimps and covers etc.
CPU Arm and Claw to follow.

BHD 2-3-2

Optional – But complete and working, please ask for details if needed.  Also feeds back status to master to say if in 2 leg mode.




Pad


BHD Pad

V1 – Changes to follow

Arduino Mega (see above)

Xbee (see above)

SparkFun XBee Shield (see above)

Screen 1604 LCD I2C

PS2 Pad
NOTE:  Must be New and Genuine.  Do not attempt to save £10 on this part, you will regret it.

Box

Battery

Up/Down USB Cables
Header pins, connectors, leads, resistors etc


General list

Solid core wires, lots of colours. :)  For making up shields
Header pins, lots of them, all sorts
10k resistors for pull-ups where needed
Crimps and PCB connector covers in various sizes (details to eventually follow)
Crimpers for above are useful, but not essential
Wires for power and signals, often servo type leads, but also for feet motors (check your stall current values)
Solder
Multi-metre (Essential)

Thursday, 29 August 2013

Decisions, Decisions

Time has come for me to Fish or cut bait.  I have been wanting to write up the BHD control set-up and allow others to use it too.  But i have decided to delay it, and give it another few events testing, add the safety relays and make sure it is totally safe.  But also add the DBC, Magic Panel, Data Panel (for those that want it, im not fitting one in mine), and also make a start on the Touch Screen controller for in the droid and get Mk2 PS2 Pad complete and maybe using custom PCBs for the shields and pad. :)  It will be much easier to support something that is pre-made rather than users making their own shields.  Most of my set up issues (and James') were wiring related, and this would eliminate a lot of that.  I may be able to get the new Twist Paw arms in and working, maybe add an X axis for the HPs, and maybe a few other gadgets before it goes live too. :)

So now refocused, i am tracking my Magic Panel as it is shipped from the US, hope to finish the DBC this weekend, shouldn't be long till i have the Data Panel and that will be an easy job to add and code up.   I will start all 4 relays this weekend (2 for the feet and 2 for the DC converters that power the servos).  So in a few weeks time i will be ready to start on my touch screen.  But should have an all singing all dancing R2 for the upcoming events. :)

The plan for the touch screen is to have a touch LCD screen (ideally 5") fitted in portrait behind the big door on the front, so instead of having the Data Panel, i will have my touch screen.  Id like to be able to do almost anything i can do on the pad via the screen, this may mean a menu system, but should be fun to do.  I need this screen to send the scripts to the master via I2C, currently the Uno i use as the master is using all 20 pins, so I2C is the only option left. :)  So i hope that the Screen will talk to the master using 2 way, and the master will talk to the end units, need to get the screen and start playing. :)  This one should be a really nice addition and make the BHD system not just a very functional system, but a cool one too. :)

I need a free graphics app to create the images i will use on the LCD, does anyone have any recommendations?

Saturday, 24 August 2013

Dome Bump Controller - Part 2

So i got the code working, but soon discovered lots of tweaks to make it more usable. this is a list of what i added and changed.
1.  Removed flash after button change to make lights more responsive and not turn off.
2.  Added PSI Confirm Flash pattern to more easily see when activated.
3.  Refined all the Get Out commands to reset more easily if wrong code added.  Any bad combo, or too short or long will error it out.  These only apply depending on conditions to allow it to be played without activating.
4.  Added PSI Get Out Flash to see when it crashes out (it looks like an X on the PSI, may tweak this when diffused to more easily see the shape).
5.  Added de-bouncing to the 2nd confirm to make it easier to trigger.
6.  Added a boot up combo to see if it reboots more easily.
7.  Added the combo entered in the end confirmation flash. :)
8.  Changed all the delays to take out flashes during get out and make it more sensitive but still usable, it now times out in 1s, so it has to be done as a combo, and all the flashes are much shorter to make it quicker to use, but still recognizable.

So the steps to use it successfully are:

1.   Hold both until flashing starts (1.5s).
2.   Release buttons during flash.
3.   Button A or Button B until Flash (0.5s).
4.   Release button during Flash.
5.   Repeat 3 and 4 for the Same button, only one button should be use and from 1 to 3 times.
6.   Hold both buttons until flash starts (1s, then combos are sent on signal lines).
7.   Release buttons during flash.
8.   Flash pattern will confirm the code received.

Resulting in 6 combos, A, 2A, 3A, B, 2B, 3B, or 1-6. :)  These output on 3 signal lines to the master.

The BHD I2C stuff is in, i just need to do the spreadsheet of the scripts that use the rear PSI, then do the timings and the scripts themselves, but all easy to do, just a case of getting on with it.  Once that is all done and in tune with the main setup, i then need to add the reading of the signal lines to the master, then i will be able to upload the code to the DBC and see it working in the dome.  :)

Im really pleased with it, from where it started this morning (i had thought it was almost done) it has come a long way, it is really usable but you need to know what to do, so its spot on.  I havent had any bad signals, and i love that it confirms what it read. :)

Here's a vis of it so far:

Monday, 19 August 2013

Dome Bump Controller - Part 1

The DBC arrived the other day.  It is a pretty piece.  I followed the PDF and soldered it up.  Then went to look at fitting it.  The dome has 2 bigger holes so that the buttons sit under the outer layer, this was perfect for the DBC, and didnt need any work at all.  But i had no way to add screws, and didnt want to add the the steampunk look by bolting through both layers.  But the fit on the dome is so nice.  So much so that i just cleaned the dome and the housing and used superglue powerflex to stick it in place.  Its not perfectly square, but the buttons seem to work fine, so good enough, and it's not coming out without a fight, and if it does i can straighten it next time. :)

So with it fitted i needed to decide how to use it.  The default code controls the rear PSI and outputs different signal lines depending on the combo used.  But i need the rear PSI able to be triggered to run the same as the front PSI during things like the Cantina and Leia message, so it needed to be able to receive I2C commands.  So after a lot of bad ideas i went for a simple setup that will work with my current setup, but that wont be required, so can be left out.  This is the plan:

I2C triggers using the same as the teeces, run the rear PSI options, e.g. flash one colour
Rear PSI will flash in the default way while inactive, so std sweep unless set by the user in code or by pad.
Buttons will flash the rear PSI when pressed, so A is one colour, B is the other and Both is all LEDs on
The code will look out for the following:
If both held for 1.5s then flash the Rear PSI in a pattern, then either press A for .5s up to 3 times, or B up to 3 times.  The corresponding colour will flash for each press registered.
Then press both again for 1.5s  (any alternate combos or held far too long etc will reset combo seek)
Rear PSI will flash a fattern
Using 3 output lines signal out the chosen on the 6 options  e.g. for 1 use B001 for 6 use B110
The signal will go high on all three lines to signal a new command is due, then it will set the output lines for long enough to be read.

This gives the option for change and growth, by adding more lines and combos if needed.

So far i have the following planned for the options:
1 x A = Random Sounds On/Off
2 x A = Random Delay Long/Short
3 x A = High Low Volume
1 x B = Random Dome Motion On/Off
2 x B = Feet Drives On/Off
3 x B = 2-3-2 ?  Maybe add extra combo for this one to make sure

So i made a start this weekend, but working with 2 buttons was more of a pain than i expected. :) I didnt work hard on it, just popped in and out, maybe why it wasn't happening.  But i got there.  I have coded all the button combo stuff and PSI default running stuff in, added the I2C base, i just need to add in the Teeces script alternatives and get the timing right on those. :)  Im pleased with it so far, it should be easy to use but not easy to accidentally trigger. :) Just needs testing to death now. :)

I have a test setup with 2 buttons, and a rear PSI, then 3 LEDs setup as the output pins and will test the code on that Uno.  Then i will need to update the master to read those pins, assuming i have enough spare. :)  Then get all the timings right for the teeces scripts and then once all that is done i will upload to the DBC.  All this fuss for 2 buttons and 6 options, i must be mad.  But that DBC is too tarty to leave out. :)