Where to start with Mesa 7i92 + 7i85S

More
09 Jan 2016 15:08 #68110 by PCW
The 7i85spx2 config has standard pwmgens. The direction outputs are not useful for the locked antiphase
PWM mode that you need so will not be used with this configuration. As far as has been determined, the
Prototrac drives use a single PWM signal per drive, but the signal is transmitted differentially so requires
a differential pair (2 wires that carry the same PWM signal but with opposite polarities)

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

More
10 Apr 2016 01:57 #73027 by techrat
I am attempting to do pretty much the same exact thing as Jrjones except I am using the 5i25/7i85s combination. I was on the fence about starting a new thread or jumping in on this one. In the end, I decided to jump in here as I am at about the same progress point and I think that answers to our respective questions will likely help one another.

Basics:
Same machine/servos/amps that JrJones is using.
5i25/7i85s boards
5i25 installed in PC running LINUXCNC - 2.7.0
7i85 not currently connected to 5i25 (just not connecting until I am sure I am ready)
5i25 flashed with 5i25_7i85spx2.bit downloaded from Mesa Website

OUTPUT FROM mesaflash -verify
sudo mesaflash --device 5I25 --verify ../configs/hostmot2/5i25_7i85spx2.bit 
Checking file... OK
  File type: BIT file
Boot sector OK
Verifying EEPROM sectors starting from 0x100000...
  |VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Board configuration verified successfully.

OUTPUT FROM halcmd: show pin
halcmd: loadrt hm2_pci 
halcmd: show pin
Component Pins:
Owner   Type  Dir         Value  Name
     5  s32   OUT             0  hm2_5i25.0.encoder.00.count
     5  s32   OUT             0  hm2_5i25.0.encoder.00.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.00.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.00.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.00.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.00.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.00.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.00.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.00.position
     5  float OUT             0  hm2_5i25.0.encoder.00.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.00.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.00.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.00.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.00.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.00.reset
     5  float OUT             0  hm2_5i25.0.encoder.00.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.01.count
     5  s32   OUT             0  hm2_5i25.0.encoder.01.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.01.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.01.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.01.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.01.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.01.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.01.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.01.position
     5  float OUT             0  hm2_5i25.0.encoder.01.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.01.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.01.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.01.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.01.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.01.reset
     5  float OUT             0  hm2_5i25.0.encoder.01.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.02.count
     5  s32   OUT             0  hm2_5i25.0.encoder.02.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.02.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.02.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.02.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.02.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.02.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.02.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.02.position
     5  float OUT             0  hm2_5i25.0.encoder.02.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.02.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.02.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.02.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.02.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.02.reset
     5  float OUT             0  hm2_5i25.0.encoder.02.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.03.count
     5  s32   OUT             0  hm2_5i25.0.encoder.03.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.03.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.03.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.03.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.03.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.03.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.03.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.03.position
     5  float OUT             0  hm2_5i25.0.encoder.03.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.03.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.03.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.03.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.03.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.03.reset
     5  float OUT             0  hm2_5i25.0.encoder.03.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.04.count
     5  s32   OUT             0  hm2_5i25.0.encoder.04.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.04.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.04.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.04.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.04.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.04.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.04.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.04.position
     5  float OUT             0  hm2_5i25.0.encoder.04.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.04.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.04.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.04.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.04.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.04.reset
     5  float OUT             0  hm2_5i25.0.encoder.04.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.05.count
     5  s32   OUT             0  hm2_5i25.0.encoder.05.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.05.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.05.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.05.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.05.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.05.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.05.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.05.position
     5  float OUT             0  hm2_5i25.0.encoder.05.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.05.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.05.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.05.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.05.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.05.reset
     5  float OUT             0  hm2_5i25.0.encoder.05.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.06.count
     5  s32   OUT             0  hm2_5i25.0.encoder.06.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.06.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.06.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.06.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.06.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.06.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.06.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.06.position
     5  float OUT             0  hm2_5i25.0.encoder.06.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.06.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.06.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.06.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.06.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.06.reset
     5  float OUT             0  hm2_5i25.0.encoder.06.velocity
     5  s32   OUT             0  hm2_5i25.0.encoder.07.count
     5  s32   OUT             0  hm2_5i25.0.encoder.07.count-latched
     5  bit   I/O         FALSE  hm2_5i25.0.encoder.07.index-enable
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.07.input-a
     5  bit   OUT          TRUE  hm2_5i25.0.encoder.07.input-b
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.07.input-index
     5  bit   IN          FALSE  hm2_5i25.0.encoder.07.latch-enable
     5  bit   IN          FALSE  hm2_5i25.0.encoder.07.latch-polarity
     5  float OUT             0  hm2_5i25.0.encoder.07.position
     5  float OUT             0  hm2_5i25.0.encoder.07.position-latched
     5  bit   OUT         FALSE  hm2_5i25.0.encoder.07.quad-error
     5  bit   IN          FALSE  hm2_5i25.0.encoder.07.quad-error-enable
     5  s32   OUT             0  hm2_5i25.0.encoder.07.rawcounts
     5  s32   OUT             0  hm2_5i25.0.encoder.07.rawlatch
     5  bit   IN          FALSE  hm2_5i25.0.encoder.07.reset
     5  float OUT             0  hm2_5i25.0.encoder.07.velocity
     5  u32   IN     0x007F2815  hm2_5i25.0.encoder.muxed-sample-frequency
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.000.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.000.in_not
     5  bit   IN          FALSE  hm2_5i25.0.gpio.000.out
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.001.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.001.in_not
     5  bit   IN          FALSE  hm2_5i25.0.gpio.001.out
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.002.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.002.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.003.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.003.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.004.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.004.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.005.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.005.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.006.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.006.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.007.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.007.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.008.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.008.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.009.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.009.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.010.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.010.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.011.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.011.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.012.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.012.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.013.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.013.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.014.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.014.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.015.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.015.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.016.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.016.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.017.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.017.in_not
     5  bit   IN          FALSE  hm2_5i25.0.gpio.017.out
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.018.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.018.in_not
     5  bit   IN          FALSE  hm2_5i25.0.gpio.018.out
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.019.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.019.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.020.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.020.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.021.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.021.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.022.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.022.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.023.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.023.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.024.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.024.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.025.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.025.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.026.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.026.in_not
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.027.in
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.027.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.028.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.028.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.029.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.029.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.030.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.030.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.031.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.031.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.032.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.032.in_not
     5  bit   OUT          TRUE  hm2_5i25.0.gpio.033.in
     5  bit   OUT         FALSE  hm2_5i25.0.gpio.033.in_not
     5  bit   IN          FALSE  hm2_5i25.0.led.CR01
     5  bit   IN          FALSE  hm2_5i25.0.led.CR02
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.00.enable
     5  float IN              0  hm2_5i25.0.pwmgen.00.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.01.enable
     5  float IN              0  hm2_5i25.0.pwmgen.01.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.02.enable
     5  float IN              0  hm2_5i25.0.pwmgen.02.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.03.enable
     5  float IN              0  hm2_5i25.0.pwmgen.03.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.04.enable
     5  float IN              0  hm2_5i25.0.pwmgen.04.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.05.enable
     5  float IN              0  hm2_5i25.0.pwmgen.05.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.06.enable
     5  float IN              0  hm2_5i25.0.pwmgen.06.value
     5  bit   IN          FALSE  hm2_5i25.0.pwmgen.07.enable
     5  float IN              0  hm2_5i25.0.pwmgen.07.value
     5  s32   OUT             0  hm2_5i25.0.read.time
     5  s32   OUT             0  hm2_5i25.0.read_gpio.time
     5  bit   I/O         FALSE  hm2_5i25.0.watchdog.has_bit
     5  s32   OUT             0  hm2_5i25.0.write.time
     5  s32   OUT             0  hm2_5i25.0.write_gpio.time

With that information out of the way, I am unsure of next steps.

It appears that I can use PNCConf to create a configuration but it appears from previous posts in this thread, this would not be useful for what I need to accomplish. Or is the PNCConf only an issue for jrjones as he is using the 7i92 instead of the 5i25?

Also with regard to the differential signal, does a set of pins already exist using the standard 5i25-7i85spx2 firmware/config. i.e. are TX0 and /TX0 the same pwm with opposite polarity?

I did read through the HAL manual and the HOSTMOT2 documentation and have a reasonable grasp of the information presented in these documents. It appears as though most of the basics of what I need to get started are already available through the firmware/config that I downloaded from MESA. I just want to be sure that I am taking the correct steps.

Please advise on the recommended next actions and/or other documentation that I should be reading.

Thanks - Jeff

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

More
10 Apr 2016 02:54 #73033 by PCW
I suspect you may be better of starting with a generic servo config (say hm2-servo)
and editing the hal file.

The 7I85S outputs differential signals already (this is a hardware feature and cannot be changed)
whether these differential outputs are step+dir, PWM, serial, etc are a function of the firmware

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

More
10 Apr 2016 16:15 #73056 by techrat
Looking at the folder created by pncconf here:
~/linuxcnc/configs/my_LinuxCNC_machine
and keeping in mind the advice to start with the generic servo configuration, it appears as though I could keep all of the files except the my_LinuxCNC_machine.hal and replace that file with the hm2-servo.hal from the samples located at
/usr/share/doc/linuxcnc/examples/sample-configs/by_interface/mesa/
Is there any reason to replace the .ini file created by pncconf? Or can I just go in and rename the hal file listed in the .ini to match the hm2-servo from the sample folder? If I am better off using one of the generic .ini files from the sample folder, which should I use? There does not seem to be an .ini specific to the 5i25.

I am sure I could scratch and crawl my way through this but if you all don't mind giving me a sanity check on my assumptions along the way, I will appreciate it.

Thanks! Jeff

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

More
10 Apr 2016 16:29 #73057 by BigJohnT
I would not mix the configuration files because the naming conventions in the ini are most likely different. For example one may use MAXACCEL and the other one might use MAX_ACCEL. Any custom name can be used for things read in the hal file.

JT

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

More
16 Apr 2016 03:28 #73388 by techrat
I am continuing forward using one of the sample .ini files and hand editing as suggested. I also decided to pull one of the motors/encoders/drives to work out the bugs on the bench.

With this in mind, I imagine that I will want to update the .ini file to reflect a single axis. Does this sound correct. Will the hal file need to be updated as well.
Also wondering if, for bench testing, there is anything I should do with regard to limit switches.

Lastly, I understand that tuning the PID settings in a no-load bench scenario is not typically recommended however I imagine that I should be able to get a hello world/proof of concept/ verification of cabling on the bench. Anything I am missing?

Thanks

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

More
16 Apr 2016 12:17 #73398 by BigJohnT
You can have as many axes as you want just don't jog and axis you don't have hooked up. You can make a simple pyvcp tab with some buttons to simulate limit switches.

JT

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

More
21 Apr 2016 02:27 #73669 by techrat
I have had some success; I have connected up my motor drive and encoder and can now see the XAxis DRO move when manually turning the axis motor. I also connected the PWM to the servo amp but was unable to get any activity out of the drive/motor. I feel as though I should be able to manually set the PWM via halcmd and view the resulting signals in the halscope or with an actual scope at the7i85 but how to do this is escaping me.

Any pointers on where to go next to output a PWM signal that I can verify with halscope or actual scope will be appreciated.

Thanks,
Jeff

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

More
21 Apr 2016 03:14 #73673 by PCW
The PWM outputs need a bit of setup
You need to set the frequency and mode
also the PWM enables must be set true

You will not be able to get a good picture of the PWM via halscope
due to the low sampling rate (but a regular scope should work)

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

More
22 Apr 2016 01:00 #73704 by techrat
Thank you for the input! I believe that I did the necessary updates to the hal and ini file (see below). I have read through the hostmot2 and hal manual both a few times but am still feeling pretty ignorant.

I have the following questions:

1.) How would I go about commanding the system to output a signal through the 7i85 for the X-Axis using halcmd? (Note when trying to simply jog through the Axis GUI i get a follow error almost immediately. Once the signal is confirmed with a scope, I can connect to the drive and work to further configure.

2.) How do I configure the PWM duty cycle to 50% = No Movement, 50-100% = Positive movement, 50%-0% = Negative Movement?

3.) From the Hal file and .ini below what might I be missing that will prevent me from getting to the point of being able to test a single axis?

I thank that once I get a single proof of concept, I will be able to fill in the blanks.

Sorry if these questions seem as though I am totally lost, I did read through the manuals at least twice. I am just having a mental block on next steps. Feeling a little dense to be honest.

Thanks for any assistance.

HM2-Servo.hal
# #######################################
#
# HAL file for HostMot2 with 3 servos
#
# Derived from Ted Hyde's original hm2-servo config
#
# Based up work and discussion with Seb & Peter & Jeff
# GNU license references - insert here. www.linuxcnc.org
#
#
# ########################################
# Firmware files are in /lib/firmware/hm2/7i43/
# Must symlink the hostmot2 firmware directory of sanbox to
# /lib/firmware before running EMC2...
# sudo ln -s $HOME/emc2-sandbox/src/hal/drivers/mesa-hostmot2/firmware /lib/firmware/hm2
#
# See also:
# <http://www.linuxcnc.org/docs/devel/html/man/man9/hostmot2.9.html#config%20modparam>
# and http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?HostMot2
#
# #####################################################################


# ###################################
# Core EMC/HAL Loads
# ###################################

# kinematics
loadrt trivkins

# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

# standard components
loadrt pid num_chan=3 

# hostmot2 driver
# if you have any firmware trouble, enable the debug flags here and see what's going on in the syslog
#loadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1
loadrt hostmot2

# load low-level driver
#loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)

loadrt hm2_pci config=" num_encoders=8 num_pwmgens=8 num_stepgens=0 sserial_port_0=00xxxx"

setp hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_frequency 15000


# ################################################
# THREADS
# ################################################

addf hm2_[HOSTMOT2](BOARD).0.read          servo-thread

addf motion-command-handler                servo-thread
addf motion-controller                     servo-thread

addf pid.0.do-pid-calcs                    servo-thread
addf pid.1.do-pid-calcs                    servo-thread
addf pid.2.do-pid-calcs                    servo-thread

addf hm2_[HOSTMOT2](BOARD).0.write         servo-thread
       

# ######################################################
# Axis-of-motion Specific Configs (not the GUI)
# ######################################################


# ################
# X [0] Axis
# ################

# axis enable chain
newsig emcmot.00.enable bit
sets emcmot.00.enable FALSE
net emcmot.00.enable => pid.0.enable
net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
net emcmot.00.enable <= axis.0.amp-enable-out 

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.00.index-mask-invert 0

setp  hm2_[HOSTMOT2](BOARD).0.encoder.00.scale  [AXIS_0]INPUT_SCALE
net motor.00.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.00.position => pid.0.feedback
net motor.00.pos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI

# set PID loop gains from inifile
setp pid.0.Pgain [AXIS_0]P
setp pid.0.Igain [AXIS_0]I
setp pid.0.Dgain [AXIS_0]D
setp pid.0.bias [AXIS_0]BIAS
setp pid.0.FF0 [AXIS_0]FF0
setp pid.0.FF1 [AXIS_0]FF1
setp pid.0.FF2 [AXIS_0]FF2
setp pid.0.deadband [AXIS_0]DEADBAND
setp pid.0.maxoutput [AXIS_0]MAX_OUTPUT

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type 4 #Direction on Out0 and PWM on Out1, "for locked antiphase"
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale  [AXIS_0]OUTPUT_SCALE

net emcmot.00.pos-cmd axis.0.motor-pos-cmd => pid.0.command
net motor.00.command  pid.0.output  =>  hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value


# ################
# Y [1] Axis
# ################

# axis enable chain
newsig emcmot.01.enable bit
sets emcmot.01.enable FALSE
net emcmot.01.enable => pid.1.enable
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
net emcmot.01.enable <= axis.1.amp-enable-out 

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask-invert 0

setp  hm2_[HOSTMOT2](BOARD).0.encoder.01.scale  [AXIS_1]INPUT_SCALE
net motor.01.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.01.position => pid.1.feedback
net motor.01.pos-fb => axis.1.motor-pos-fb #push copy back to Axis GUI

# set PID loop gains from inifile
setp pid.1.Pgain [AXIS_1]P
setp pid.1.Igain [AXIS_1]I
setp pid.1.Dgain [AXIS_1]D
setp pid.1.bias [AXIS_1]BIAS
setp pid.1.FF0 [AXIS_1]FF0
setp pid.1.FF1 [AXIS_1]FF1
setp pid.1.FF2 [AXIS_1]FF2
setp pid.1.deadband [AXIS_1]DEADBAND
setp pid.1.maxoutput [AXIS_1]MAX_OUTPUT

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.output-type 1 #pwm on pin1, dir on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE

net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
net motor.01.command  pid.1.output  =>  hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value


# ################
# Z [2] Axis
# ################

# axis enable chain
newsig emcmot.02.enable bit
sets emcmot.02.enable FALSE
net emcmot.02.enable => pid.2.enable
net emcmot.02.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.02.enable
net emcmot.02.enable <= axis.2.amp-enable-out 

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.02.index-mask-invert 0

setp  hm2_[HOSTMOT2](BOARD).0.encoder.02.scale  [AXIS_2]INPUT_SCALE
net motor.02.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.02.position => pid.2.feedback
net motor.02.pos-fb => axis.2.motor-pos-fb #push copy back to Axis GUI

# set PID loop gains from inifile
setp pid.2.Pgain [AXIS_2]P
setp pid.2.Igain [AXIS_2]I
setp pid.2.Dgain [AXIS_2]D
setp pid.2.bias [AXIS_2]BIAS
setp pid.2.FF0 [AXIS_2]FF0
setp pid.2.FF1 [AXIS_2]FF1
setp pid.2.FF2 [AXIS_2]FF2
setp pid.2.deadband [AXIS_2]DEADBAND
setp pid.2.maxoutput [AXIS_2]MAX_OUTPUT

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.output-type 1 #pwm on pin1, dir on pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE

net emcmot.02.pos-cmd axis.2.motor-pos-cmd => pid.2.command
net motor.02.command  pid.2.output  =>  hm2_[HOSTMOT2](BOARD).0.pwmgen.02.value


# ##################################################
# Standard I/O Block - EStop, Etc
# ##################################################

# create a signal for the estop loopback
net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in

# create signals for tool loading loopback
net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed


#
# homing
#

#
# In this example, each of the three axes have their own home switch.  All
# home switches are connected to GPIO 25, though hostmot2 boards generally
# have enough GPIO pins to put each axis' home switch on its own pin.
#
# Each switch is normally open, momentarily closed.  When the switch is open,
# GPIO 25 floats high (because that is the hostmot2 way).  When the switch is
# closed, it shorts GPIO 25 to ground.
#
# EMC expects the value on the .home-sw-in HAL pin to be active high, ie
# True when the switch is closed and False when the switch is open.
# We get this behavior by linking the GPIO .in_not pin instead of the .in
# pin.
#

net home-switch <= hm2_[HOSTMOT2](BOARD).0.gpio.025.in_not
net home-switch => axis.0.home-sw-in
net home-switch => axis.1.home-sw-in
net home-switch => axis.2.home-sw-in

# only the Y servo has an index, X and Z home without using the index
net y-index-enable hm2_[HOSTMOT2](BOARD).0.encoder.01.index-enable <=> axis.1.index-enable


5i25.ini
[HOSTMOT2]
DRIVER=hm2_pci
BOARD=5i25
#CONFIG= No config file needed 5i25"




[EMC]

# Name of machine, for use with display, etc.
MACHINE =               Altlas Mill

# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
#DEBUG =                0x00000003
#DEBUG =                0x00000007
DEBUG = 0




[DISPLAY]

# Name of display program, e.g., tkemc
DISPLAY =              axis

# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME =            0.0500

# Path to help file
HELP_FILE =             tklinucnc.txt

# Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET =       RELATIVE

# Initial display setting for position, COMMANDED or ACTUAL
POSITION_FEEDBACK =     ACTUAL

# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE =     1.5

# Prefix to be used
PROGRAM_PREFIX = /home/jmyer/linuxcnc/nc_files

# Introductory graphic
INTRO_GRAPHIC =         linuxcnc.gif
INTRO_TIME =            5


[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python


[TASK]

# Name of task controller program, e.g., milltask
TASK =                  milltask

# Cycle time, in seconds, that task controller will sleep between polls
CYCLE_TIME =            0.010




[RS274NGC]

# File containing interpreter variables
PARAMETER_FILE = hm2-servo.var




[EMCMOT]

EMCMOT =                motmod

# Timeout for comm to emcmot, in seconds
COMM_TIMEOUT =          1.0

# Interval between tries to emcmot, in seconds
COMM_WAIT =             0.010

# Servo task period, in nanoseconds
SERVO_PERIOD =          1000000




[HAL]

# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.

# list of hal config files to run through halcmd
# files are executed in the order in which they appear

HALFILE = hm2-servo.hal

# list of halcmd commands to execute
# commands are executed in the order in which they appear
#HALCMD =               save neta




[TRAJ]

AXES =                  3
# COORDINATES =         X Y Z R P W
COORDINATES =           X Y Z
HOME =                  0 0 0 0
LINEAR_UNITS =          inch
ANGULAR_UNITS =         degree
CYCLE_TIME =            0.010
DEFAULT_VELOCITY =      3.0
MAX_VELOCITY =          4.0
DEFAULT_ACCELERATION =  6.0
MAX_ACCELERATION =      7.0
#!!!!!!!!!!!!!  Comment out NO_FORCE_HOMING  as soon as connected to actual machine !!!!!!!!!!!!!!

NO_FORCE_HOMING =	1 

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


[AXIS_0] # X Axis

TYPE =                  LINEAR
MAX_VELOCITY =          1.0
MAX_ACCELERATION =      4.0
BACKLASH =              0.000
FERROR =                0.010
MIN_FERROR =            0.002

INPUT_SCALE =           81920

OUTPUT_SCALE =          -1.000
OUTPUT_OFFSET =         0.0
MAX_OUTPUT =            1.0

MIN_LIMIT =             -3.0
MAX_LIMIT =             10.0
HOME =                  0.000
HOME_OFFSET =           -2.9
HOME_SEARCH_VEL =       -0.50
HOME_LATCH_VEL =        0.10
# the X axis servo's encoder does not have an index channel, so we have to home without index
HOME_USE_INDEX =        NO
HOME_IGNORE_LIMITS =    YES
HOME_SEQUENCE =         1

# PID tuning params
DEADBAND =              0.000015
P =                     100.0
I =                     0.000
D =                     0.000
FF0 =                   0.000
FF1 =                   1.000
FF2 =			0.0
BIAS =                  0.000




[AXIS_1] # Y Axis

TYPE =                  LINEAR
MAX_VELOCITY =          1.0
MAX_ACCELERATION =      4.0
BACKLASH =              0.000
FERROR =                0.010
MIN_FERROR =            0.002

INPUT_SCALE =           -81920

OUTPUT_SCALE =          1.000
OUTPUT_OFFSET =         0.0
MAX_OUTPUT =            1.0

MIN_LIMIT =             -3.0
MAX_LIMIT =             10.0
HOME =                  0.000
HOME_OFFSET =           -2.9
HOME_SEARCH_VEL =       -0.50
HOME_LATCH_VEL =        0.10
# the Y axis servo's encoder has an index channel, so we use it to improve the home accuracy
HOME_USE_INDEX =        YES
HOME_IGNORE_LIMITS =    YES
HOME_SEQUENCE =         1

# PID tuning params
DEADBAND =              0.000015
P =                     100.0
I =                     0.000
D =                     0.000
FF0 =                   0.000
FF1 =                   1.000
FF2 =			0.0
BIAS =                  0.000




[AXIS_2] #Z Axis

TYPE =                  LINEAR
MAX_VELOCITY =          1.0
MAX_ACCELERATION =      4.0
BACKLASH =              0.000
FERROR =                0.010
MIN_FERROR =            0.002

INPUT_SCALE =           81920

OUTPUT_SCALE =          -1.000
OUTPUT_OFFSET =         0.0
MAX_OUTPUT =            1.0

MIN_LIMIT =             -3.0
MAX_LIMIT =             3.0
HOME =                  0.0
HOME_OFFSET =           -2.9
HOME_SEARCH_VEL =       -0.50
HOME_LATCH_VEL =        0.10
# the Z axis servo's encoder does not have an index channel, so we have to home without index
HOME_USE_INDEX =        NO
HOME_IGNORE_LIMITS =    YES
HOME_SEQUENCE =         0

# PID tuning params
DEADBAND =              0.000015
P =                     100.0
I =                     0.000
D =                     0.000
FF0 =                   0.000
FF1 =                   1.000
FF2 =			0.0
BIAS =                  0.000




[EMCIO]

# Name of IO controller program, e.g., io
EMCIO =                 io

# cycle time, in seconds
CYCLE_TIME =            0.100

# tool table file
TOOL_TABLE = tool.tbl

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

Time to create page: 0.097 seconds
Powered by Kunena Forum