iPad App for PathPilot with custom HAL component - iPendant


Page 1 of 5 1234 ... LastLast
Results 1 to 12 of 57

Thread: iPad App for PathPilot with custom HAL component - iPendant

  1. #1
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default iPad App for PathPilot with custom HAL component - iPendant

    Hi guys,

    Will be great to get some feedback, ideas and suggestions on what to add before I freeze the current code.

    To give you a little background, the board started as an add-on to the back of my Digital Load Meter as the Load Meter board has the USB connection footprint. I needed a remote Stop button to be about 15 feet away next to my workstation rather than keep standing next to the machine. But once I decided to integrate the iPad, this gave this project its own board and USB powered so no need to connect it to the back of the VFD Load Meter.

    This is my take on the ever so popular pendant for PathPilot. Rather than trying to negotiate Bluetooth with Linux, a dedicated controller with Bluetooth that talks to LinuxCNC over USB is extremely reliable.

    I also added a separate RF transceiver as that will be used for any immediate action buttons including the battery operated Stop/Hold seen in the video. This RF transceiver can also be used as a low-cost link/bridge between other panels / buttons / solutions to LinuxCNC HAL or Keyboard.

    Initially, the project started as Keyboard shortcuts, so the USB connection was being used as HID keyboard only. This worked directly with PathPilot with no changes at all. However, this method only allowed the standard X/Y/Z Keyboard Jog (fast) and the Start/Hold/Stop/Coolant commands. I added more keyboard shortcuts.

    Then the Jog Shuttle driver was tested to emulate the Jog Shuttle and that worked perfectly, the board acted as HID consumer device and used the same bytes format as the Shuttle.

    But nothing beats getting feedback and data from PathPilot so i wrote a HAL component for my controller board and that made a huge difference. At this stage, I only added the 4 DROs & the Tool in spindle. Few other pins are available from HAL and can be added but as it is right now is fully usable when my head inside the enclosure.

    So far on the To do list:
    - Remove the Jog Shuttle page. Was a good test but not much usable with the other direct buttons being easier and precise rather than rotating fingers on the screen.
    - Add Step value and indicate which mode is active (continuous or Increment). No direct HAL pin for this but can be added. I think maybe just the Cont/Inc indication would be enough.
    - An option to show machine coordinates briefly (maybe).
    - See what other values of interest to be useful for the Lathe.
    - iPhone screens? Maybe? The iPad Mini is perfect, and used iPads can be found easily and cheaply. I use it laying on the table as shown on the video. Having a dedicated Mini for the workshop makes sense.
    - Add math to the DROs. At least the /2. Either via dedicated button or within the DRO itself.
    - Homing All.

    Here is the video; first two min are the iPad app presentation then the video showing its fully working on my 770 with PP 2.0.1 follows. Enjoy.



    Similar Threads:


  2. #2
    Registered kstrauss's Avatar
    Join Date
    Apr 2013
    Location
    Canada
    Posts
    1196
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Quote Originally Posted by narrobb View Post
    Hi guys,

    Will be great to get some feedback, ideas and suggestions on what to add before I freeze the current code.

    Then the Jog Shuttle driver was tested to emulate the Jog Shuttle and that worked perfectly, the board acted as HID consumer device and used the same bytes format as the Shuttle.
    Very impressive!

    Could you supply further details on your jog shuttle emulator? Does it report the same VID/PID (0b33/0020) as the real ShuttleExpress so that no PathPilot changes are required? Or have I completely misunderstood?



  3. #3
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Quote Originally Posted by kstrauss View Post
    Very impressive!

    Could you supply further details on your jog shuttle emulator? Does it report the same VID/PID (0b33/0020) as the real ShuttleExpress so that no PathPilot changes are required? Or have I completely misunderstood?


    Thanks

    Yes, this is what i tried first, as you can have more than one Shuttle inserted. It worked with some minor intermittent lag which i did not track down as it was a test.

    Then I tried it with my own VID/PID but with the mill pins pointed to my file which worked. I am still new to HAL so don't know if there is a way to 'share' a pin out/in to two userspaces components or not but as I was geared up to get the the DROs values into the iPad so I did not pursue the development for the shuttle replacement.

    A design advantage of removing that page; I can go back to flip between various pages with just swipe left/right. This is much faster compared to current menu buttons to navigate. Had to use buttons to navigate as the Shuttle emulator design uses single touch, dual touches, and rotation movement routines heavily that any swipe action to go to next page could trigger a false-positive for jogging.






  4. #4
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    About changes to PathPilot;

    There are 4 Levels.

    1 - Using Keyboard only (All Axis +/- and Start, Feedhold, Stop, Coolant control): No changes at all (plug and play and the these iPad functions work directly).

    2 - Using HAL component + Standard Keyboard above: Only one line change to tell the system to load the component and 3 new files are copied but these do not override other files. This enables all DROs and Tool number plus any additional new pins/values or functions added to the HAL component.

    3 - All the above + Extra keyboard commands defined to get Step, Continuous/Increment and Zeroing enabled via Keyboard: The above changes plus about 10 lines to be added.

    4 - The above with Probing page; about an extra 50 lines or so and few more new files copied.

    I actually made a script for the above, entire installation is one second then reboot. The script makes backup copies of the files that will be changed first, then it copies over the new files, changes permission and fixes the user/group for the new files & component.

    I may add the Zeroing / Step buttons as HAL pins if available, this way option 3, would still be one line change.

    The same script also prepares the simulator (if running PP on VirtualBox) and hardware/software works fully on the simulator, this how i was developing it and once ironed out there, copied the script to the main machine, run it once, rebooted and it worked directly. Hats off to Tormach for having that option, whether it was meant for end users or just for their own use.



  5. #5
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant


    Are you guys not interested in this development? Is there no wishes, idea, suggestions? Would anyone be interested if i said it will cost less than $20!


    V2 is now complete. Major changes actually, as I have pushed the development way forward compared to beta I showed last video.

    Here are the features of V2 now:


    • No more hardware, the solution is now fully an App only. iPad talks to HAL component via local network.
    • View & change G54->G59 work offsets. Bidirectional of course.
    • Any Zero on the axis or movement is in relationship to current active work offset.
    • View & change Tool in spindle, and view Tool offset.
    • Reference All axis with home-all or Reference individually as usual.
    • Feedback with LED on referenced/homed axis.
    • Change jogging to Step/Continuous.
    • Feedback on current Jog mode and Steps value.
    • Change Step values to one of the four options.
    • Write DRO values directly and perform Math on DRO values before changing.
    • All DRO changes are also G5x aware
    • The HAL component (now called iServer) creates a virtual keyboard to allow for keyboard access from the App.
    • Placeholder to create up to 10 custom keyboard shortcuts for custom/private use. This page allows adding any probing routines needed if you set it up with keyboard shortcut and using the standard built-in keyboard shortcut as well.
    • Create/Call MDI_COMMANDS directly from the App. This allows adding MDI commands (Gx or Mx and so on) to the controller and execute the commands from the custom created button within the App. For example, to send the machine to a predetermined position (X0 Y0 Z2) or so using one button.
    • The usual standard jogging & buttons controls for Coolant/Stop/Start/Hold.


    Will have a video done soon.



    Last edited by narrobb; 02-25-2018 at 12:04 AM.


  6. #6
    Registered kstrauss's Avatar
    Join Date
    Apr 2013
    Location
    Canada
    Posts
    1196
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    The items that you list sound wonderful and I am impressed with how quickly you have gotten everything working!

    My issues include:
    I don't have an iPad and am not thrilled about purchasing one (combination of cost + personal issues resulting from a previous life as a software developer). Considering the cost of an iPad an additional $20-50 is not a significant deterrent.

    I am concerned about the resistance of an iPad to workshop hazards -- chips, coolant, dropping, etc. How well does the touch screen work when the operator's hands are wet with coolant or wearing gloves?

    I am concerned about having to implement patches for every revision to PP. I understand your reasons and I see no way to provide the desired features without changes to PP. However, after the lack of support for favourite VistaCNC pendant, I hesitate to again become dependent on a product that puts me at the mercy of a third party providing timely updates. I just wish that Tormach could be convinced to add the necessary support to PP.



  7. #7
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    All are valid points.

    A refurbished iPad mini can be had for $100 or less. Some $80. Check them out on eBay.

    You only need the WIFI version (not cellular) and 16GB (lowest) is more than enough. As long as the seller confirms its loaded with iOS 10.0 or above (most probably is), that's all is needed.

    Though in reality, you wouldn't add the iPad cost + $20 and call it cost of the Pendant. Once you have the iPad, you can add your speed/feed calculator, add your custom spreadsheet, then you can also have various PDF files for your projects, your Google Drive or DropBox to access the project files, and drawings to get back to, or even build/setup instructions as a reminder.

    All of these Apps (apart from the commercial calculator) are free. And these probably fraction of the apps you can use next to the machine.

    A cheap screen protector and back cover is probably all needed for the iPad, and some providers even sell rigid covers for harsh environments, though is not needed.

    I don't see a situation where I need to change parts or probe a part to set my work offset while the coolant is still running. Once the setup is done and the job started, you don't actually need to use it. I handle the iPad in a worse fashion than an expensive probe that one would have paid $600 or more. With these expensive probes, we make sure hands are dirt-free, oil-free, moist-free, not so much with the iPad. When fingers are wet, I just wipe them on my work shirt, and continue using the iPad. Its tougher that it looks. I only have a back soft plastic cover for my iPad and I dropped it many times, more than I can count.

    About gloves, a Touch screen gloves been available for a while, in all usage, from soft to hard use gloves.

    With the HAL component concept, there are really small changes to PP. In fact, I won't call it changes. None of the stuff "changes" any original code or function in PP. These are all "additions". At least in my approach. The additions are in 3 files, two of these files only one line to tell LinuxCNC to load the HAL component. The third addition is a full (function) addition to the main Python file. Any code written by Tormach is not touched or changed.

    Yes, I agree on the point of 'patches' or maybe I will call it compatibility check. As none of the code written by Tormach is being changed, we are only adding functions, but we call code that is originally there. As long as Tormach do not rename a PIN or a feature, the theory is that the same program that patched this version, should patch the next one without further work. Furthermore, most of the work we are doing is talking to the HAL part of LinuxCNC always there, regardless of the version.

    I am going to actually see what's the steps needed to have Tormach include the driver in their releases. I wrote the code with that exactly in mind. This is why all my functions follow their verification routines.

    In fact, I am deliberately routing my function calls through their original functions so the normal check/permissions are applied. I did this with the sole purpose to give the driver/component a chance to be included as part of the distribution similar to Shuttlexpress driver and such. For example, I can change STEP directly myself by instructing PP of the new STEP to use. But instead, my change STEP routine actually calls their STEP change code from the top. This insures that instructions route via the same verification Tormach intended when they made the function.

    I am happy to send them their own copy to test and check it out and I think they are open minded enough not to object to add drivers. Obviously, much easier if there is interest from their customer base.

    The design is really hardcore LinuxCNC, this code will work on almost all flavors of LinuxCNC.

    The first part of the app is actually free to download, and it will only allow unlocking the rest of the features once it verified it can connect correctly and the three included functions are working normal (X axis DRO, Ref X axis and Coolant control), these three tests all parts of the server code, including the Virtual keyboard as the Coolant function uses the ALT-F built-in shortcut. This way users are sure the driver is installed correctly and will be fully operational from the server side, pickup all data and can test it first.

    Thanks for your input.

    Quote Originally Posted by kstrauss View Post
    The items that you list sound wonderful and I am impressed with how quickly you have gotten everything working!

    My issues include:
    I don't have an iPad and am not thrilled about purchasing one (combination of cost + personal issues resulting from a previous life as a software developer). Considering the cost of an iPad an additional $20-50 is not a significant deterrent.

    I am concerned about the resistance of an iPad to workshop hazards -- chips, coolant, dropping, etc. How well does the touch screen work when the operator's hands are wet with coolant or wearing gloves?

    I am concerned about having to implement patches for every revision to PP. I understand your reasons and I see no way to provide the desired features without changes to PP. However, after the lack of support for favourite VistaCNC pendant, I hesitate to again become dependent on a product that puts me at the mercy of a third party providing timely updates. I just wish that Tormach could be convinced to add the necessary support to PP.


    Last edited by narrobb; 02-25-2018 at 12:09 AM.


  8. #8
    Registered kstrauss's Avatar
    Join Date
    Apr 2013
    Location
    Canada
    Posts
    1196
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Please don't get me wrong; I'm actually quite excited by what you have accomplished. And thank you for the clarifications of the iPad requirements/costs and your implementation strategy. Contact Tormach about inclusion!



  9. #9
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Quote Originally Posted by kstrauss View Post
    Please don't get me wrong; I'm actually quite excited by what you have accomplished. And thank you for the clarifications of the iPad requirements/costs and your implementation strategy. Contact Tormach about inclusion!

    Oh, i did not. It was not my intention to defend my app or disagree with your points. You made valid points and I was just offering my opinion about these concerns. Thank you for your kindness.

    Though I do have a question about a feature; at the moment the Server side (HAL component) is designed to only send data when it changes, so for example, if jogging in X, it keeps firing X points as it changes and no other data about Y or Z. Basically, it keeps a previous reference to the data.

    This is much more efficient compared to other Wired Pendant solutions where the data is being fired all the time continuously several times a second.

    However, as the intention of the iPendant is to be fully usable and useful while setting up the job and head is inside the enclosure; so I decided to limit the data being sent if the machine is cutting something. I included a time restriction on sending the data to the app to once a second, this is only when the machine is cutting. These are of course the DROs & Tools being used.

    I initially thought that seeing the DROs (even though once a sec) could give some hints on where the machine is if i left the workshop but stayed within my WIFI network so i can check the progress on the iPad. The actual impact on the controller is nothing actually, but now I am considering not to even send any data, but just allow STOP/HOLD to be used back from the App,

    What's your take on such features, would you agree is it not much needed and just a gimmick with not much value compared to the options we can set/view/control before the job is run?



  10. #10
    Registered
    Join Date
    May 2015
    Location
    Australia
    Posts
    172
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Very interesting but not something I'd use.You should post this on the LinuxCNC forum and ask any questions there. In answer to your question about controlling pins from multiple sources, generally this is not allowed but it is possible to work around it in the screen handler but that is not real time on the servo thread (but you did mention user space). I'm not sure what language PP uses for its GUI. Is it Python? If so it would be pretty easy. It is my understanding that LinuxCNC's NML commands can be sent across the network so it should be possible to take full control of the machine from your iPad.

    Rod Webster
    www.vehiclemods.net.au


  11. #11
    Registered
    Join Date
    Nov 2017
    Posts
    91
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant


    I was lost for a min there but then thought you maybe referring to an older post on top. I see what you are referring to now.


    Yes, user space code. I covered significant grounds on HAL since then. You can actually hookup two output to single input in real time. loadrt or2. Then put the two out as two IN to OR, and the out of that goes to the single actual IN. So either of the out's true, makes the 'in' true, and realtime XOR/AND and so on logic codes. Perfect functions.

    Was planning to post the development on LinuxCNC once I prepare the video maybe tomorrow or so.


    Quote Originally Posted by rodw View Post
    Very interesting but not something I'd use.You should post this on the LinuxCNC forum and ask any questions there. In answer to your question about controlling pins from multiple sources, generally this is not allowed but it is possible to work around it in the screen handler but that is not real time on the servo thread (but you did mention user space). I'm not sure what language PP uses for its GUI. Is it Python? If so it would be pretty easy. It is my understanding that LinuxCNC's NML commands can be sent across the network so it should be possible to take full control of the machine from your iPad.




  12. #12
    Registered
    Join Date
    May 2015
    Location
    Australia
    Posts
    172
    Downloads
    0
    Uploads
    0

    Default Re: iPad App for PathPilot with custom HAL component - iPendant

    Yeh, I thought you would have learnt a bit...Personally I think HAL's biggest secret is how easy it is to write and install a custom hal component in C. To my mind, this allows a complex modular approach that vastly simplifies the HAL files for future maintenance.

    Rod Webster
    www.vehiclemods.net.au


Page 1 of 5 1234 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

iPad App for PathPilot with custom HAL component - iPendant

iPad App for PathPilot with custom HAL component - iPendant