Mesa 7I80 max_velocity parameter change to a pin possible?

More
18 Jan 2018 08:22 #104658 by auto-mation-assist
I'm working on the program changes required to install a newly designed 4th axis on my mill that allows it be used as both a indexer and spindle running up to 550 rpm. All the pins required to do this are available for the required switching of the 7I80 stepgen except for the max_vel which is a parameter and not a pin. To switch between the normal mode and spindle mode I want to simply raise the value of max_vel from around 1 to 18.33333333 to give me my desired 1100 rpm limit on the forth axis drive motor which has a 2:1 belt drive to the spindle.

Is there a way to change this parameter to a pin which would make things a lot easier. I wanted to add a button on gmoccapy to switch between the normal 4th axis mode and spindle mode. I was also wondering if I convert the hal file to use tcl if that would allow it to enter the values desired into the parameter instead of being limited by having to include this one in the ini file..

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

More
18 Jan 2018 13:09 #104662 by skunkworks
wouldn't the max velocity for the rotory axis cap the max velocity at 1 for 4th axis motion. Then just keep the max velocity of the stepgen set always at 18.3333 for when it gets switched to a spindle?

sa
The following user(s) said Thank You: auto-mation-assist

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

More
18 Jan 2018 19:59 #104689 by auto-mation-assist
sa

I had overlooked that the hostmot stepgen is really independent and that its velocity limit can be set higher without effecting normal operations. I now have it set for my desired maximum velocity needed to be able to get the 4th axis motor to run up to 1100 rpm. However I thought that the position scale was a pin and unfortunately it is also a parameter and thus its value cannot be changed programmatically in hal via a mux2 output. Under normal operating conditions it is set to 4096 but needs to be changed to a higher value to reach motor speeds greater than 60 rpm. For me to be able to program rpm value the scaling value must be able to be changed programmatically. A value of 75000 will allow motor rotation of 1100 rpm with my present stepgen timing parameters.

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

More
18 Jan 2018 20:00 - 18 Jan 2018 20:00 #104690 by auto-mation-assist
I'm wondering if the the determination of parameter or pin selection determination a function of the hostmot2 driver or is it handled somewhere within the linuxcnc code? I think that changing these two to pins would allow much greater flexibility.
Last edit: 18 Jan 2018 20:00 by auto-mation-assist.

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

More
18 Jan 2018 20:08 - 18 Jan 2018 20:09 #104692 by PCW
You should be able to use the scale component to scale the RPM command to steps/turn when using spindle mode
Last edit: 18 Jan 2018 20:09 by PCW.
The following user(s) said Thank You: auto-mation-assist

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

More
19 Jan 2018 20:17 - 19 Jan 2018 20:19 #104728 by auto-mation-assist
I will try all the suggestions on how to best control the stepgen settings for hostmot2 when spindle mode is desired for the 4th axis. But pins instead of param's are really what i'm after and thus my questions likely need a code expert to provide a little guidance.

In doing research the two parameters that I wish to use as pins instead of param's are defined in src/hal/drivers/mesa-hostmot2/hostmot2.c and hostmot2.h. the variables are hal.param.position_scale and hal.param.maxvel. My further research shows that within the machinekit version of the above mentioned files that all params have been changed to pins. Thus it should be possible to change these to pins in linuxcnc.

I have made the required changes that I think are needed to do this but this causes an issue with the code in lines 61 to 66 in stepgen.c. After recompiling RTAPI_INT32_MAX, RTAPI_UINT32_MAX and RTAPI_INT32_MIN are reported as undeclared in stepgen.c and compiling stops.

It appears that machinekit folks also has a problem with trying to figure out where these three items are initially declared as stated by a comment in their hostmot2.h. file. They worked around around this by removing the RTAPI declaring these in their hostmot2.h file as show below. I'm thinking that making such a change is to drastic and likely undesirable for me and thus the location of where the declaration of RTAPI_INT32_MAX, RTAPI_UINT32_MAX and RTAPI_INT32_MIN is desired. Unfortunately my search results have turned up nothing so far.

#define INT32_MIN (-2147483647-1)
#define INT32_MAX (2147483647)
#define UINT32_MAX (4294967295U)
Last edit: 19 Jan 2018 20:19 by auto-mation-assist.

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

More
20 Jan 2018 07:34 - 20 Jan 2018 07:35 #104739 by auto-mation-assist
I have completed making the changes required to make the stepgen "maxvel" and "position-scale" that sets the mesa 7I80 board I use scale as pins instead of ini params. I recompiled linuxcnc which completed successfully. This will make it a lot easier to obtain constant lathe like rotation of the 4th axis spindle for me. I still need to make some changes to my ini and hall file before I can fully check the new functionality. I have attached a picture of the hall configuration watch page that shows the two new "maxvel" and "position-scale"pins.
Attachments:
Last edit: 20 Jan 2018 07:35 by auto-mation-assist.

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

More
18 Feb 2018 10:22 #106118 by andypugh
Changing the position_scale on-the-fly is more complicated than simply changing the parameter to a pin.
Consider what the current position feedback should be when the scale changes. It is based on accumulated steps and the scale.
Checking if the scale has changed and responding appropriately every iteration of the servo thread adds a certain amount of overhead too. (I don't know for sure if the Machinekit implementation does this)

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

Time to create page: 0.086 seconds
Powered by Kunena Forum