First of all many many thanks to the creators of chilipeppr for providing such a great interface for motion controllers !
I personally dont have any hands on experience with using it yet but i do know to converse my lpt Mach3 Mill i need two things;
M6 gcode scripts for semi automatic tool changes ( which are possible )
And a fully working Xbox controller ( not implemented afaik ) The xbox controller has become an integral part of how i use my cnc over the years, imo it beats any other pendant in both usability and features.
I had a quick look on how to implement it ( I dont have any experience in coding at all unfortunately ) and found this: PxGamepad ( https://gamedevelopment.tutsplus.com/tutorials/simple-xbox-controller-input-in-html5-with-pxgamepad--cms-24585 )
Would that be an approach worth pursuing ?
Why don’t you do it just like my recently posted video on the esp32 joystick for chilipeppr
@jlauer You mean software wise ? I need all buttons and all anologue axes ( beside right stick horizontal ) from the Xbox controller, actually there are not enough really.
Yeah, meaning, just have the controller talk direct to SPJS via websocket. On the high end, stick an ESP32 inside an Xbox controller. On the low end, use an old USB Xbox controller into a Raspberry Pi and have that talk direct. Or, you could always just write a macro in ChiliPeppr and have your XBox controller talk via the OS and have the ChiliPeppr macro translate the commands.
I’m curious when you say there aren’t enough buttons. I’ve been thinking about doing a custom circuit board for a ChiliPeppr CNC controller with an ESP32 at the heart. I of course want one joystick for XY and one for Z, but what are the other buttons/joysticks/sliders you find useful?
Ill do a picture with description whats needed for basic cncing asap ! I think its easier than me trying to explain it.
These are the basic functions needed when milling, they make it extremely easy to dial in new work space coordinates and enable a range of functionalities which are ideally used directly operating the machine, not from a remote desktop.
missing/deleted image from Google+
This is a really old video of mine where the features are partly seen in use, especially a typical o probe is demonstrated. https://www.youtube.com/watch?v=GEZ4pLNmf7U
One thing i observed is that people use alligator clips for probing with chilipeppr, typically router bits / spindles are grounded to the machine, is that not the case for these smaller chinese mills ?
Because everyone uses different machines it’s hard to say. I’ve had decent success on probing, but I’ve always wanted to up the voltage to 12 or 24v for probing because at the 3.3v right from TinyG I find there can be noise sometimes and in smaller end mills I don’t get conductivity and break end mills. The probing from TinyG does bring the system to ground, I believe.
This looks pretty awesome. From looking at your Xbox controller diagram, most of that is achievable if the controller is directly talking via websocket. The part that wouldn’t be is cycle start as that would have to tell the browser to start sending Gcode. However, there is a way to do that by using broadcast commands in SPJS where the controller fires off an SPJS command of “broadcast cycle-start” and then you’d have to make the browser listen to that incoming broadcast command to then trigger the start. It could just be a startup macro that runs to start listening for that.
It seems like to get the best performance on jogging, you could just have your Xbox controller direct to a Raspberry Pi 3. Have SPJS running on the Rpi 3 and have TinyG plugged direct into Rpi 3. This is the way I run my TinyG.
Then, you’d need a daemon running that can talk to Xbox controller and just does websocket to localhost. This is how the ShuttleXpress pendant code works that’s already part of ChiliPeppr and has a front-end widget in the Widgets pulldown menu.
My ESP32 joystick uses the same approach except the websocket client is on the ESP32 and it just finds SPJS on the network and makes its own websocket to send in Gcode commands for jogging.
I will say from your video you have very good responsiveness on your jogging. In my ESP32 video you’ll see I have maybe an extra 100 or 200ms lag than you do. This is because the latency of getting the Gcode sent into SPJS, which then sends it immediately to TinyG, but TinyG has to put it in its planner buffer.
I got a due bob with “signal conditioning” and 5v logic for the due, mach 3 bobs are very similar and i didnt have a probing failure once, whole machine incl spindle is on ground, the o probe puck +5v. If your spindle is not perfectly isolated it can happen that the spindle bearings close ground on probing and that might be why it fails.
The Gamepad API looks really cool. I have never programmed for that, but that could be a really easy way to get going on this. My only concern is that you may be adding a bit of latency to the mix because you have the Xbox controller talking to the browser and the browser talking to SPJS. However, it’s probably not that big of a deal given the browser is running on a powerful machine. It looks like it’s in all modern browsers now, especially Chrome, which is the best experience for ChiliPeppr. So, doing this as just a ChiliPeppr widget is very feasible and then you’d have all the control you could ever want for all of those features you’re after in your Xbox controller diagram.
The Mach3 implementation is also more in the 200ms range but one gets used to it pretty quickly, i usually back of the triggers a bit to slow down approaches by muscle memory.
I hope ive woken your interest enough to have a closer look at it, as i am great with machines and mechanics but know nothing about java etc
For your individual pendant idea, this has been explored by the mach3 community back in the day aswell and resulted in many individually crafted dial pendant style hand controllers ( which sometimes saw manufacturing and releases aswell https://www.google.de/search?q=mach3+pendant&rlz=1C1CHWL_deDE762DE762&tbm=isch&source=iu&ictx=1&fir=iMKKM2tYBmRuzM%3A%2CrS8yZMZpiMTQ5M%2C_&usg=__76Zl6ONtnMvZSYwfcS-FILDfs_w%3D&sa=X&ved=0ahUKEwjJ-7GS0bLYAhXFy6QKHbllAKEQ9QEILzAB#imgrc=iMKKM2tYBmRuzM: ) but i personally never saw the point of it in direct comparison to an Xbox controller, maybe theres more use if you are a die hard metal worker needing 1/1000mm precision for a shiny new ti part but then again your probably not using a diy cnc.
One more thing, did you implement the “mesh bed leveling” by yourself ? Thats a complete killer feature as it eliminates the need for sometimes very expensive engraving bits, or even enables completely new approaches a seen from the youtube comment were a guy straight up sucessfully engraved a cylinder without even accounting in gcode for it.
Yes, I did the initial auto-level feature but lots of folks have contributed to it over time. It was one of the main goals for building ChiliPeppr in the first place. No other CNC software allows the type of extensibility that ChiliPeppr allows for, so something like the auto-level couldn’t be implemented in another app easily or at all.
Im gonna have a look at it and fail miserably Would be great if someone with atleast some experience could help. Anyhow, thank you again for the great work youve done with chilipeppr, im really looking forward to the conversion and how itll all work out !
Well, I think the first step would be to create a widget. To do that watch the 3 videos on the homepage. This gets you a quick start with a template widget that can then be used to watch for thost Gamepad API events. So, you’d essentially be forking the template widget on Github to a widget called something like xbox-widget. Then you’d fork the tinyg workspace to your own version and add your xbox-widget to it.
Hmm. I just tried out connecting my Xbox One controller to my Windows 10 PC and it worked like a charm. I went to Gamepad Tester and that too worked great. http://html5gamepad.com/
This seems very workable.
Lets put it this way, the time invested writing the macro is easily regained on the next 5 cnc jobs ( I know im a filthy beggar )
Ok, you inspired me. New Github repo at https://github.com/chilipeppr/widget-xbox and my Cloud9 workspace for that widget https://ide.c9.io/chilipeppr/widget-xbox