Open source SpaceMouse - Space Mushroom remix
prusaprinters
Update: V2 is much smaller!V1, named ‘Bigfoot’ by those commenting here, had the majority of its development dedicated to troubleshooting code, with the CAD being a first attempt.V2, which I'm calling ‘Mini-ish’, inverts the joysticks and as a result is a lot more more compact, coming in at 102mm at the widest point compared to the 77mm diameter of the smallest SpaceMouse. Still bulkier, but much improved. Mini-ish. This updated design also has a greater emphasis on aesthetics, packaging and cable management. The code has been tweaked to suit and has changes to require a smaller range of motion. OverviewI attempted to build Shiura's fantastic Space Mushroom design, as well as several of the remixes. The movement for each was distorted and unreliable. I ended up jumping down the rabbit hole and combining pieces of code and geometry to create something that I understood and worked as hoped. During development, I placed a big emphasis on adding comments, debugging and remodelling parts so that others can customise and troubleshoot if attempting this project.The project is covered step by step in this video: FunctionThis emulates a real SpaceMouse. In fact the 3DConnexion software thinks it is one. We have six degrees of freedom controlled with analogue movements. This allows us full and dynamic camera control in any CAD software that a regular SpaceMouse supports. My sketch introduces easily altered speed and direction inversion code so you can get the input/output exactly as you wish. CreditsThis remix and all others are based on the original Space Mushroom design by Shiura.I based my design on the four joystick design by fdmakara as I thought it would be easier to understand the maths (it was). fdmakara's ‘shaft’ piece is used unmodified and included here for convenient download.The exterior parts of my design are insired by the UFO style remix by 3Dtombud.In terms of code, I started with fdmakara's version to suit the four joysticks, then mixed in jfedor's SpaceMouse HID emulation and BennyBWalker's Space Mushroom additions. CAD SourceA step file of the assembly is included. My source CAD can also be accessed on Onshape, even without an account. You can right click on any part and export in a format of your choice.https://cad.onshape.com/documents/a538848b86fe27e2c917d961/w/65788fed2d843546a07fb278/e/99241d3a2797091fea09756f?renderMode=0&uiState=6632d64c15d33e77e344fffa Required HardwareArduino compatible analogue joystick x 4I recommend the Arduino compatible joystick with four mounting holes in the PCB:Amazon (affiliate): https://amzn.to/3QmPAubeBay Australia: https://www.ebay.com.au/itm/324603929771?var=513643383708I originally ended up with a two mounting hole variant from Keyestudio which I do not recommend, as they will require remixing of CAD and code: https://wiki.keyestudio.com/Ks0008_keyestudio_Joystick_ModuleArduino Pro MicroThese are very cheap and easy to get. Ensure your version has an ATmega32U4.Amazon (affiliate): https://amzn.to/4bkg87zFastneners - Original ‘Bigfoot’M3 x 16mm x 12 (you can use slightly shorter if that's what you have on hand.)¼ inch UNC ‘tripod’ bolt x 1‘4 gauge’ self tapping screw x 6mm x 8 (~2.9mm width)Fastneners - V2 ‘Mini-ish’M3 x 12mm x 12 (if using a thicker spacer, four of these may need to be longer.‘4 gauge’ self tapping screw x 6mm x 12 (~2.9mm width)Small cable ties.Stick on rubber feetAmazon (affiliate): https://amzn.to/3JJUj5wDupont wiring kitYou may already have this, but in you don't, this kit has plenty of parts and wire.Amazon (affiliate): https://amzn.to/4b5mvfuUSB cableTo match the Arduino Pro Micro board, most likely USB-A to micro-USB.LED strip (optional)Approximately 38cm strip length is required to cover the inner shroud.Amazon (affiliate): https://amzn.to/49WKU5v Printed parts - Original ‘Bigfoot’Quantities and print settings for each part are provided in the file section. Each file is already correctly oriented. Filament type doesn't really matter.Three categories are provided:CoreThese are mandatory and needed for the attachment of the joysticks.Space Mushroom - Option 1I found the original part by fdmakara internally a little small, which limited the range of travel for the joysticks. I remodelled the part to make it larger, as well as split it into an upper and lower half to avoid the need for support material. The four holes in the lower mushroom will need cleaning out with a 3mm drill bit.Going this way should mean you can use the other parts from fdmakara to mount the mouse. I haven't printed and tested these.Dome - Option 2This is the configuration as seen in the video. It is way bigger than I envisiged but it is fairly comfortable and conceals the wiring nicely. Bigger is not so bad, because you want some weight to stop the mouse lifting and moving on the table when in use. The four holes in the lower dome will need cleaning out with a 3mm drill bit. Printed parts - V2 ‘Mini-ish’Quantities and print settings for each part are provided in the file section. Each file is already correctly oriented. Filament type doesn't really matter.No support needed for any parts, although the four holes in the lower dome and four holes inside the frame will need cleaning out with a 3mm drill bit.‘Spacer’ parts are optional, depending on the height you are after. You may omit this part, or use a thinner or thicker spacer to match your taste. If necessary, spacers can give additional space for wiring. WiringYou will need a soldering iron, crimping tool, coloured wire and dupont connectors. Wiring id identical for V1 and V2. V2 dos not have a core to match the image in the top left, but instead embosses A, B, C & D inside the part.The following diagram is available in the download section too.I have a video on crimping tools and techniques that may assist: Assembly - Original ‘Bigfoot’This is covered step by step in the video at the top of the page. Assembly - V2 ‘Mini-ish’Please use these images until a dedicated video is made.Prepare the ball joints as per the original design: using a 2mm drill aligned with the smaller opening to make a hole, then inserting a self tapping screw from the large hole side until it sits flush.Screw the four joysticks onto the frame using a self tapping screw in each corner.Plug into the connectors for the joysticks. The inner housing has embossed ‘A’, ‘B’, ‘C’ & ‘D’ labels embossed to assist. Now use cable ties to secure each part of the loom against the perimeter of the inner frame.The upper and lower dome can then be assembled over the joystick ball joints, same as in the original.The top cover is attached by adding M3 bolts from the underside of the frame.Cable tie the Arduino Pro Micro on its side as pictured. The USB port should face the centre. Additional cable tie holes are provided to attach ballast. The heavier this ends up, the better.If you are using a spacer, place it now, BEFORE plugging in the loom to the Arduino. When you do connect the loom, the wiring is exactly the same as the original version.Bolt on the base and attach adhesive backed rubber feet.Done! Arduino CodeMy sketch is included in the files section. However, before you flash it, it is important to setup a custom board. Please make sure to use the V2 sketch if you are building V2.Spacemouse emulationMore detail is shown in the video. I followed the instructions here from nebhead: https://gist.github.com/nebhead/c92da8f1a8b476f7c36c032a0ac2592awith two key differences:1. I changed the word 'DaemonBite' to 'Spacemouse' in all references.2. I changed the VID and PID values as per jfedor's instructions: vid=0x256f, pid=0xc631 (SpaceMouse Pro Wireless (cabled))When compiling and uploading, I select Arduino AVR boards (in Sketchbook) > Spacemouse and then the serial port.You will also need to download and install the 3DConnexion software: https://3dconnexion.com/us/drivers-application/3dxware-10/Now flash the sketch to the Arduino.If all goes well, the 3DConnexion software will show a SpaceMouse Pro wireless when the Arduino is connected.DebuggingFive levels of debugging are provided to make sure everything is connected and working properly. It will help identify wiring problems. This is covered in the video.CustomisationNear the top of the sketch, variables are provided to alter the deadzone, speed/sensitivity and invert the six degrees of freedom individually to suit your taste. Each of these are commented with explanations.Adding ButtonsI have seen in the comments of the other remixes that many peole want buttons. I can see that provision for this has been placed into the HID protocol written by jfedor, but I have not explored it further. My expection would be that you would import a debouncing library, add a listener for a button press in the loop, and then have that trigger another HID().SendReport() to report the button press. In the future I may explore this but I have not at this stage. OperationFor me, using this is as simple as plugging in the mouse, which is automatically detected by the 3DConnexion software:It will detect what software you are using and apply motion based on your inputs. I have tested this with Onshape, Fusion360, Photoshop and OrcaSlicer. It can also be used to scroll webpages up and down.
With this file you will be able to print Open source SpaceMouse - Space Mushroom remix with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Open source SpaceMouse - Space Mushroom remix.