Mesa 5i20 servo configuration

More
22 Jun 2010 07:20 #3195 by cmorley
ok heres the trick!

notice that even if you have configured hostmot2 to have step generators pwm gens
that all the GPIO pins are still there for these components.

notice that the GPIO pins have parameter called .invert_output.

The trick is that you must find the GPIO pin that corresponds to the same position the PWM generator output is then

setp hm2_5i20.gpio.007.invert_output true

running dmesg after loading hostmot 2 will give you the IO pin numbers plus a discription.
look for the PWMGEN [ # what ever number you want ] out0 (PWM or up) output and note the three digit I/O number.
that three digit number is the number of the GPIO which you need to invert_output.

You probably could negate the scale setting and get the same effect.

Chris M

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

More
22 Jun 2010 07:33 #3196 by Zig
Chris,

Much obliged.

I had had a look at the pin assignments and had in fact tried to

.invert_output true of the actual PWM0.0 pin but was getting responses along the lines of pin requires only two parameters not three ( I paraphrase)

Did not realise I coud go to gpio pins directly in the above fashion.


Thanks again

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

More
22 Jun 2010 10:02 #3197 by andypugh
cmorley wrote:

You probably could negate the scale setting and get the same effect.


I think that is normally the way it is done, as it happens.

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

More
22 Jun 2010 23:18 #3200 by Zig
I tried inversion of the output pin.

The net outcome was an unstable loop. I guess I would have to go about retuning the loop or trying to figure out why the loop has become unstable. ( probably would need to alter wiring to accomodate phasing of the quadrature signal. So i restored the pin to original setting.

I tried changing the polarity of output scaling. Same problem. I then decided to alter polarity of both input and output scalin in the .INI file and lo and behold the waters parted.

The loop stability retained but the direction of movement reversed and the origin position on the work table as it needs to be.

Thank You all.

I am sure there will be more "thank You all"s to follow :)

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

More
05 Jul 2010 04:38 #3270 by Zig
Ladies and Gentlemen,


It is almost done. I had had some problms with controlling one of the linear motors. It is still not as well behaved as the other motor. It is a higher force motor, longer and a bit coggier.

I had played with the air gap between the forcer and magnet track and contrary to my expectations reducing the gap had improved the performance ( closed loop performance). My expectation was that increasing the gap might reduce coupling and therefore cogging.

In any case final configuration two linear motors with linear glass scales ( RSF Electronic or better known nowadays as Heidenhain ).

Axes home on index markeron the scale.

The third axis configured as stepper motor. It will not move however i do need the Z axis in order to be able to read in XYZ coordinates where Z will be used to enable the the cutting process.

So far so good.

I do need some further assistance in the form of hal file additions.

I need to connect some GPIO pins to the same signal. This is to say same signal appearing on a number of GPIO pins.

Reason for this is my break out card does not connect to the stepper motor IO pins and i would like to connect some of the IO pins on the breakout card to the fimeware assigned stepgen io pins.


Additionally I would also like to bring the encoder signals ( two ecoders , quadrature signals= four GPIO pins) for further signal processing in external hardware.

Could someone put up a line showing how to

take an arbitrary free IO pin..make it an output pin... and connect an existing IO pin to it


Much obliged.

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

More
05 Jul 2010 05:13 #3272 by cmorley
if you want to duplicate stepgen output pins to other GPIO pins that cannot be done (as far as I can tell)
the 'signal' from the stepgen to it's GPIO pin is done directly in the hostmot2 driver - it can not be changed by HAL

what you could do if you have an extra stepgen is connect the signal running the first stepgen to a second then you would have two step gens
outputting the same signals and could connect what ever to the second set of output pins.
not ideal but possible.

if you want to duplicate GPIO output pins that is possible.
just add the signal supplying the first GPIO to the second (...third...etc)

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

More
05 Jul 2010 05:28 #3273 by Zig
CMORLEY,

Reason for redirecting stepgen output is to be able to get the signal at a screw terminal on a breakout board connected to P2 on the 5I20 card.

A second scenario... wanted signal is on P4. I can use a shorting link on 0.1" pitch to connect the stepgen signal to adjacent pin in P4. Define that pin as input. Define an unused pin on P2 as output and link the two new pins with a signal.

Would that work?

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

More
05 Jul 2010 08:05 #3275 by cmorley
tthis would work except there would be a phase shift of one thread period between the stepgen pin and the gpio pin I Think.
meaning it would be the next period before HAL noticed the input GPIO changed so it could set the output GPIO .
There mayne a way around that by putting the gpio updates on a faster thread but lately it has been found that hostmot2 steppers seem not to work well if there is a base thread present....

Chris M

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

More
05 Jul 2010 10:00 #3276 by andypugh
Zig wrote:

Ladies and Gentlemen,
It is almost done. I had had some problms with controlling one of the linear motors. It is still not as well behaved as the other motor. It is a higher force motor, longer and a bit coggier.

You could probably get over the cogging with a sinusoidal driver. The components might well already exist.

The third axis configured as stepper motor. It will not move however i do need the Z axis in order to be able to read in XYZ coordinates where Z will be used to enable the the cutting process.

Are you saying you just have a dummy Z/AXIS_2 entry in the INI file for a phantom Z? If so then there is no need to have a corresponding stepgen on the 5i20. You can intercept the axis.2.**** pins in HAL to do with as you see fit. You need a reference in the INI so that the pins get created and the G-code is allowed to use Z words, but the signals in HAL can be connected anywhere you like.

I need to connect some GPIO pins to the same signal. This is to say same signal appearing on a number of GPIO pins.

That is fairly easy. The HAL will be something like:
net yourchoiceofsignalname random.hal.output-pin => hm2_5i20.0.gpio.001.out hm2_5i20.0.gpio.007.out
You would need to have a line earlier in the HAL saying
setp hm2_5i20.0.gpio.001.is-output true
for each output pin. And possibly ......is-opendrain too. See www.linuxcnc.org/docview/html//drivers_hostmot2.html

Reason for this is my break out card does not connect to the stepper motor IO pins and i would like to connect some of the IO pins on the breakout card to the fimeware assigned stepgen io pins.

The best way by far to do this would be with actual, physical, wires.
You could make a "plugboard" to reconfigure the pinouts with some stripboard, box headers and socket headers then take the signals where you want with jumper wires (this is pretty much what I do with my machine, as it happens)
I don't think a software relocation would work too well as it would rely on the servo thread polling the pins often enough to not miss a change. However, it could be done fairly easily as the firmware-allocated output pins are still readable as GPIO input pins in HAL. (At least I am pretty sure they are, have a look with Halscope before comitting)

Additionally I would also like to bring the encoder signals ( two ecoders , quadrature signals= four GPIO pins) for further signal processing in external hardware.

Why not do that at the point before the signal enters the Mesa card?

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

More
05 Jul 2010 21:52 #3281 by Zig
The reasoning behind the dummy Z axis is as follows.

The machine is a laser based unit .

Conventional XYZ G code file can then be used to move the laser beam while direction change in Z axis ( think of this as an engraving machine ) would control laser state.

The Z axis is a dummy axis to the extent that there is no physical Z axis actually taking place. This way the entire proces is within established G code generation process abd laser satus is controlled by G code without a need for any other inputs.


The reason for the four encoder signals is that once the Z axis direction psignal enables the laser the quadrature signals from X and Y are them further processed to modulate the laser power in an attempt to deliver constant energy to the work piece irrespective of cutting speed.

I had tried to set up HAL last night and will have to revisit it this morning in light of the comments over the past 12 or so hours.

Last night i was getting reports that some of the pins did not exist. Obviously something was not done correctly.

Will keep You informed of developments ( how could I not, without You all tis wouldbe progressing a lot slower.)

Thank You all

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

Moderators: PCWjmelson
Time to create page: 0.090 seconds
Powered by Kunena Forum