Toma/Proma HAL for Mesa Board -Basics

More
25 Jul 2018 21:50 - 25 Jul 2018 21:55 #114839 by Grotius
@Tommylight,

If you want to experiment you can try this module i wrote in 5 minutes : position.comp
To install it copy into directory src / hal / components and then open terminal and type: sudo halcompile --install position.comp
Check the output file in : /usr/lib/linuxcnc/modules/ the name there will be position.so
If you have run in place, copy the position.so file also into your run in place version path : rtlib

File Attachment:

File Name: position.comp
File Size:0 KB


To test you can set variable with halcommand : setp offset 50.
I will try this also if it works tommorrow, this code is not tested, compiling was okey !! :evil:

in your postgui.hal file : loadrt position.comp
Attachments:
Last edit: 25 Jul 2018 21:55 by Grotius.
The following user(s) said Thank You: tommylight, snugglylovemuffin

Please Log in or Create an account to join the conversation.

More
25 Jul 2018 22:21 #114842 by tommylight
@Grotius
Thank you, i will give it a try as soon as i can, to busy pulling 18 hour work days.

@PCW
It works on 2.8 without any changes, the wizard just asks if i want to modify it and it does, it works always.
Latest machine i retrofitted uses servo motors on all axis ( industrial ESAB 4X2.5 meters work area ), i just changed the Z axis to a stepper and added a drive wired to the parallel port. It works perfectly with 6i25/7i77 driving servos. It has been two weeks without a single issue, working from 8AM to 6 PM (some days till 11 PM ). Last time i visited it was doing over 300 small parts per sheet, 3mm thick.
I would call that reliable.
B.th.w. what is the equivalent of those stepper signals on a servo system ? I did start working on it but life gets on the way a lot.
Oh and thank you for the good quality products, i have plenty of them all over the places ( bedroom, workshop, office at the factory i am managing etc ), but not enough time to put them to good use.

Please Log in or Create an account to join the conversation.

More
25 Jul 2018 22:52 - 25 Jul 2018 22:53 #114844 by PCW
Basically on pretty much _any_ system those will be the hardware pins connected to motions commanded and feedback positions

On a servo system the commanded and feedback positions (from an encoder) are connected to motion and the PID component

On a Mesa (or Pico Systems) stepgen they connect similarly except the feedback comes from the stepgen instead of the encoder
Last edit: 25 Jul 2018 22:53 by PCW.

Please Log in or Create an account to join the conversation.

More
25 Jul 2018 23:38 - 26 Jul 2018 13:36 #114846 by Grotius
@Hi Tommy,

It works. I forgot to make the component coupled to a timer. I was searching some time before i knew the qlue... :woohoo:
So now you know how to make your own thc function. Add some stuff to it and give it a go !!

In custom postgui.hal :
loadrt position
addf position servo-thread
It is recommended to make your z axis signals in the same file, i used the postgui file for this.


File Attachment:

File Name: position_2...-25.comp
File Size:0 KB


Okey motor z-axis is tested today. Here the motor connections to extract the offset :
net 1 joint.3.motor-pos-cmd position.in 
net 2 position.out stepgen.3.position-cmd 
net 3 stepgen.3.position-fb => joint.3.motor-pos-fb

so if we set the offset parameter in halshow with : setp position.offset 5
The motor is turning 5mm, and the screen dro is still the same. The offset is working !!
Attachments:
Last edit: 26 Jul 2018 13:36 by Grotius.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
26 Jul 2018 15:21 #114895 by Grotius
Hi this code works very smooth on proma thc, the thc speed is about 10% during testing with motors.
I will try to adapt a 0-100% speed and auto configure this speed on 35% wich is perfect.

component position "offset control between commanded position and postion feedback";

description 
"""

Postgui.hal connections

net 1 joint.3.motor-pos-cmd position.in 
net 2 position.out stepgen.3.position-cmd 
net 3 stepgen.3.position-fb => joint.3.motor-pos-fb

""";
 
author "Grotius CNC Machines";

license "GPLv2 or greater";

option singleton yes;

// Input Pins
pin in float in "input value connected to joint.3.motor-pos-cmd";
pin in bit torch_up "Connect to Proma up signal";
pin in bit torch_down "Connect to Proma down signal";
pin in bit arc_ok "Connect to Proma arc-ok signal";

// Output Pins
pin out float out "output value connected to stepgen.3.position-cmd ";

// Parameter 
//param rw float speed;

// Global Variables
variable float loop;

function _;

;;

#include "rtapi_math.h"

FUNCTION(_) {

   
   if(!arc_ok){ out = in; loop = 0;}

   if(arc_ok){
    
         if(arc_ok && torch_up){ out = in + loop; loop = loop + 0.001; }    // substract value 
      
         if(arc_ok && torch_down){ out = in + loop; loop = loop - 0.001;}   // extract value
  

   }
}
The following user(s) said Thank You: tommylight, snugglylovemuffin

Please Log in or Create an account to join the conversation.

More
26 Jul 2018 18:09 - 26 Jul 2018 18:13 #114903 by Grotius
Hi,

This THC component works good.

it works on a real time calculation instead of calculating the deviation percent from planned velocity and velocity to move Z to correct.
Some times you see on forums double value's are confusing. This is clear value !!

So one parameter for thc speed in milliseconds servo thread, super easy to understand !

File Attachment:

File Name: position_2...-26.comp
File Size:1 KB


I tested this within the position.time 0.001 and 0.01 milliseconds. It works super good. In future it must have a time limiter, but that is not the fact at this moment. :woohoo:
Attachments:
Last edit: 26 Jul 2018 18:13 by Grotius.
The following user(s) said Thank You: snugglylovemuffin

Please Log in or Create an account to join the conversation.

More
26 Jul 2018 18:55 #114905 by snugglylovemuffin
Linuxcnc opens right up but won't let me jog the machine to test my motors out. I'm using the Axis gui and I can't seems to enable the jog function. Neither can I load and run a simple gcode file. I swear, it's just one thing after another...

I can't verify that my config works; so I can't begin adding in the Toma HAL components.

@PCW the CR11 (INIT) led is red and won't turn off, I posted on the previous "boards" thread.

Please Log in or Create an account to join the conversation.

More
26 Jul 2018 19:33 #114906 by Grotius
The following user(s) said Thank You: snugglylovemuffin

Please Log in or Create an account to join the conversation.

More
26 Jul 2018 22:19 #114917 by snugglylovemuffin
Gave Mesa a call and PCW answered the phone; that's awesome but perhaps speaks to the size of the community. I'd like to donate to the cause but haven't found a way in which to do that, not that I looked hard.

Red light issue isn't actually an issue, goes away when I start up linuxcnc.

However, I've go through and commented out the estop lines in the machine HAL and still can't disengage the estop in axis... Suggestions?

Please Log in or Create an account to join the conversation.

More
27 Jul 2018 06:01 - 27 Jul 2018 06:20 #114935 by snugglylovemuffin
I must be doing something wrong. I rebuilt my config and was able to remedy the problem of not being able to disengage the estop, but now I can't toggle it at all; on top of this I still haven't solved the problem of how to jog my machine. What am I doing wrong?

error pops up "hm2/hm2_7i96.0: Error finishing write! 58288 (89,90,91,92)

It's past midnight, I may need to home the machine before I can start jogging like PCW and I talked about.
Attachments:
Last edit: 27 Jul 2018 06:20 by snugglylovemuffin.

Please Log in or Create an account to join the conversation.

Time to create page: 0.098 seconds
Powered by Kunena Forum