Trying to use a MPCNC with my cub scout den (Tigers, 7 year olds) for our one foot hike next month.
The basic premise is to explore the life that exists in a 1foot x 1foot square. Rather than do the typical backyard project I decided to mix my interests and try and use a MPCNC as a flight simulator by hooking up a USB microscope to the machine and allowing them to move the machine around exploring the area. The image is projected onto a 100inch screen for them to see the bugs in huge scale.
Going to assign the scouts 4 roles.
Commander - Tells the others what to do
Pilot Steers the “Ship”
Dive Officer handles “Z” Moves
Sensor Operator - Focuses and takes pics with the camera.
I’ve got the basics of the project done and it works ok on my 3d printer
Camera is hooked up to a separate laptop running OpenCV and is working good too.
Need an easy way for them to smoothly control the CNC. Ideal would be with a bluetooth controller for the pilot and some kind of knob for the dive controls (Think Atari 2600 paddle) but I want it to smoothly accel/deccel since we will be zoomed in so close.
What a cool idea! I’d love a post after the event.
I’m assuming Marlin as the firmware. Assuming your control board has extra pins for serial input, then you can feed g-code to Marlin from a separate microcontroller. The interface is up to you and your abilities. Personally, I’d wire up two joysticks, one for X & Y, and the other for Z. The trick with feeding g-code to Marlin from the outside is getting smooth movement along with a responsive stop at the end of the movement. I wrote some MPCNC pendant code and struggled with this issue and therefore have some ideas. If you go this route, I’d be glad to assist.
Marlin does have a joystick interface for X and Y you can use to directly wire a joystick to the control board. You would still need something for Z.
Great idea. You could give them missions like things to find. Sounds super fun.
How to solve this kind of depends on your skill level.
Octoprint can use keyboard shortcuts and has a camera stream. I bet two keyboards would work. But there would be no restriction to the kids pressing the other’s buttons (figuratively and literally). Maybe there is some software that can convert “joystick” (which includes game pad) controls to keyboard presses.
You could buy an arcade button kit and program those to be the key presses that octoprint expects.
Cncjs had a plugin for a controller. But it was PS3, IIRC. And it needed some work when I checked it out a few years ago.
As robert suggested, any microcontroller can send gcode. So if you know some electronics, that is very custom solution.
You can and should adjust the max speeds and accelerations in Marlin. You can turn these way down to get some serious periscope impressions. Any controller has to work inside those specs.
Could pull the keys off their respective keyboard?
Adafruit make Neat MacroPads, that light up, are space themed, you could use one or two and each with their own different key shortcut mappings (edit Python file on USB drive that appears when connected) to jog via Octoprint/ESP3D or whatever…
Macropads have one push button knob, could use for your zoom? You comfortable coding Python? fwiw Macro scripts I use are shared here, code.py (forked from Adafruit sample code) handle keypresses, encoder knob turns/presses, setting light colors and such…
Pretty sure Adafruit would get a kick out of hearing about this use case. I haven’t tried connecting multiple Macropads to a single computer, should be a quick test, will try out if this is interesting option to you?
It never hurts to ask. But almost every one of their customers has a cool project in mind.
You can also 3D print macro pads. There are a lot of options available. The controllers that run qmk firmware are pretty cheap. You can buy a box of gateron switches for $20.
Sorry, slightly off topic… Just me, or would other folks here find it fun to hunt for creatures/treasure like this?
Maybe a “Find the Diamond in the Rough challenge” - as in Diamond bit.
Imagine turning up at some public event with a modified Primo/LR/MP3DP. Challengers try to fish around for local Colorado soil/sawdust buried 1/8" bits, nozzles, or something, time limited?
Spotter directs the Blind Pilot (potentially helping/encouraging strangers to interact/meet/connect) using a pendant to control a hyper accelerating/rapid configured enclosed Primo/LR/MP3DP (showing off their speed and precision). If you have an IDEX, then could add Role for soil/chips core drilling (not router, something slow/quiet, e.g. vertical stepper on the router mount.
An Arduino Leonardo is inexpensive and can enumerate as a USB keyboard when connected via USB. That way each keyboard will only have the keys that you designate valid. The number of pins is limited, but you can have buttons mapped to full progeammable sequences. I did a project to put some pushbutton macros for a WoW gamer friend. You can also use analog inputs to have variable responses.
Ok some good ideas here. I don’t want to go too far down the rabbit hole for a 1 hour payoff but you got me thinking. I’ve got a couple of adafruit circuit playgrounds that can act as HID controllers (ie keyboards) . Maybe I could even use the gyroscope in them and do a tilt controller.
May not be the smoothest working but should serve the purpose and won’t take forever to implement.
Love this idea. So engaging. While it may be a lot of up front work for “only an hour” of payoff, I bet this is something you could pull out from time to time for other events. Or revamp for fun. I’m immediately thinking of a death star trench run.
Makey Makey might be a great way to build engaging and quick inputs. You still need to code the interface and have something to plug it into, but it might fit your need.
This reminded me of a documentary of the Swiss military using exactly this type of setup to train their tank drivers in the 1970’s, long before computer simulations. The trainee sat in a complete replica of the cockpit that was on hydraulics and drove a tiny camera across a model if a town. It was amazing to watch.
Too funny I got the idea from an old game called chutes away which had a rotating disk with terrain and you looked through a periscope to target and dropped the chutes.