ENCODER_RATIO function implementation.

More
1 year 6 months ago #325698 by Boogie
Wasn't expect that:/ Any practical use for ENCODER_RATIO then? I believe this is the point related to is in documentation:
"
encoder-ratio.sample

Read all input pins. Must be called at twice the maximum desired count rate."

Why can't we use encoder.0.position? Or it is just the way this component is coded? Anyway why would it be a problem? Is it because of the encoder-ratio.sample call frequency required?

ZIP download was ok. Trying to wrap my head around it.

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

More
1 year 6 months ago #325707 by andypugh
Encoder_ratio is coded to count A/B phases (in software) from two encoders and to output a difference to drive a PID.
It would potentially be rather useful for a parallel port based machine, or maybe a Pi using GPIO. I expect it is fast and efficient, as it needs to do very little calculation.
But on systems where the positions are already calculated, you really can do it more simply with HAL maths functions (or the custom comp that my hobber uses)
The following user(s) said Thank You: Boogie

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

More
1 year 6 months ago #325975 by Boogie
I'm trying to mix pwm servos configuration i managed to work finally with your hobbing Andy. I thought there is two options to add something to AXIS - gladeVCP and pyVCP made panels. When i saw you don't have an XML file in the folder you shared with us i thought it is made with gladeVCP. But the i saw some tutorials on yt and 'they' say that for glade-made-panels there should be panel.glade file along with panel.py (plus panel.pyc created by AXIS once is it first time started).
Here is your files and my assumptions on them:
- hobbing.py  (looks like the panel fils, defining its features, making cals on user inputs, is it a stand alone program or is attached to AXIS?)
- hobbing.ui (looks like the graphical axpect of the panel, using XML formatting - similar to XLM file in pyVCP)
- hobbing_gui.hal (connection file between panel and HAL)
- hobbing.ngc (actual NC file containing hobbing cycle, controlling all the axes involved, speciffic to your setup).

Are those files a separate "hobbing software"? I mean standalone panel using linuxcnc started in the background but not using AXIS? I can see in hybbing.py that you are importing linuxcnc, hal and other mysterious modules and see some linuxcnc.start(), linuxcnc.command() ocmmands inside. This is givimg me the impression is it not connected to AXIS gui but rather standalone "module"/interface.

I can see on wiki, you say "...the only other things needed are a Pyvcp panel with a spinbox in it for tooth count...". But, based on the tutorials i saw, why there is hobbing.ui instead of hobbing.xml?

I'll try some iterations with those files but i need to made more changes to my configuration due to the fact that all the toys i have on my test bench are 7i95t, 3 servos, 3 h-bridges and 7 microswitches, so adding my "inexperience" is giving me a headache. Will turn Z axis into A axis and Y servo will turn into a spindle with encoder so in the end i will have a system with X axis only, spindle with encoder and A-slave-axis.

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

More
1 year 6 months ago #325992 by andypugh
The info on that Wiki page is possibly a bit confusing as it combines a HAL config that I used initially, with the GUI that I use with a more developed version.

The .ui file is a GladeVCP and would be loaded by a line in the INI like:
Code:
[DISPLAY] ... EMBED_TAB_COMMAND=gladevcp -c hobbing_gui -x {XID} -H ./hobbing_gui.hal -u hobbing.py ./hobbing.ui

I also seem to have fogotten to mention the custom "hobbing" HAL component. This is installed from the attached file with the command "sudo halcompile --install hobbing.comp"

This is then loaded in the main HAL file with:
Code:
loadrt hobbing addf hobbing.0 servo-thread

(It looks like I need to re-write that Wiki page)
The following user(s) said Thank You: Boogie

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

More
1 year 6 months ago #325998 by Boogie
Confusing? For me for sure:):) 
I'm now surprised by this hobbing.comp and its installation as i don't see you used "loadrt hobbing"+"addf hobbing.0" in the previously attached files.
 

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

More
1 year 6 months ago #326056 by andypugh
The whole thing has evolved over time, and I have failed to update the wiki page. (its been about 13 years...)

I have attached the whole config folder.  But be aware that this machine has many configurations and so has several INI files. 
If you start with the hobbing.ini and look to see which HAL files it uses, you should be able to identify all the used files. 
The following user(s) said Thank You: Boogie, timo

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

Time to create page: 0.432 seconds
Powered by Kunena Forum