Spinx1 to 7i85
- andypugh
- Offline
- Moderator
- Posts: 23559
- Thank you received: 4858
I'm having trouble with the net spindle-pwm line and the enable out to the gpio.018 below it.
You can only connect one thing to hm2_5i25.0.pwmgen.00.value and you have already connected it to spindle-cmd-abs in the line above.
"net spindle-pwmgen.00.enable => hm2_5i25.0.gpio.018.out"
That HAL line will create a signal called "spindle-pwmgen.00.enable " which might not be what you want, but shouldn't be an error.
There isn't an enable in the original HAL file. You probably need to add an OR component to enable the SPINX1 if either orient-mode or velocity-mode is active:
Don't just blindly add this, it is a modification of some existing code:
# this switches modes
loadrt or2 count=1
addf or2.0 servo-thread
net orient-mode motion.spindle-orient orient.0.enable pid.1.enable mux2.0.sel or2.0.in0
net velocity-mode motion.spindle-on pid.0.enable or2.0.in1
net spindle-enable or2.0.out => hm2_5i20.0.pwmgen.00.enable hm2_5i20.0.gpio.018.out
Please Log in or Create an account to join the conversation.
- OT-CNC
- Offline
- Platinum Member
- Posts: 623
- Thank you received: 75
The gpio.018.out , I just added it to the net velocity-mode line and the spinx enables now. The invert pin stuff is all good, and it enables now. I get rotation now but only CW dir, regardless of M03 or M04.
Peter,
Thanks for catching my rps error. I'm having a senior moment lol
The spindle right now has a super slow ramp up. so I need to look at the pid?
The M19 mode is not working yet
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23559
- Thank you received: 4858
The gpio.018.out , I just added it to the net velocity-mode line and the spinx enables now. The invert pin stuff is all good, and it enables now. I get rotation now but only CW dir, regardless of M03 or M04.
if you look at the original code there was this:
# net spindle-fwd abs.0.is-positive parport.0.pin-NN-out
# net spindle-rev abs.0.is-negative parport.0.pin-NN-out
You need to connect those to the direction pins of the Spinx1
Yes, start by modifying the FF0 term. You might be able to do this "live" from the machine-calibration menu item.The spindle right now has a super slow ramp up. so I need to look at the pid?
Once FF0 gives you the right speed, then look at the Igain.
[/quote]The M19 mode is not working yet[/quote]
That is because you are only enabling the SPINX1 in velocity-mode. That is why you need the or2 component.
Please Log in or Create an account to join the conversation.
- OT-CNC
- Offline
- Platinum Member
- Posts: 623
- Thank you received: 75
I'm trying to pick the cw/ccw from your earlier code: setp hm2_5i25.0.pwgen.00.output-type 1 and the line below setp hm2_5i25.0.gpio.002.invert_output 1. I was trying to add the gpio.002 to the net spindle-fwd/rev but it errors out.if you look at the original code there was this:
# net spindle-fwd abs.0.is-positive parport.0.pin-NN-out
# net spindle-rev abs.0.is-negative parport.0.pin-NN-out
net spindle-rev abs.0.is-negative hm2_5i25.0.gpio.002.out-true, whats the proper ending for both?
Or is it better to have 2 pins linked? The way we had it, cw is always on.
I only see x,y,z calibration menus. Is possible to get both spindle calibrations pid screens up?You might be able to do this "live" from the machine-calibration menu item.
That is because you are only enabling the SPINX1 in velocity-mode. That is why you need the or2 component.[/quote]/quote]The M19 mode is not working yet
Understood. I type slow so I didn't see your response in time
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23559
- Thank you received: 4858
There is another very long thread about the Spinx1 (parallel port config) and I keep mixing the two up.
Because you are using a Mesa card there is already a direction pin on the pwmgen. You should use this to drive the SPINX1 direction input.
The reason it isn't working is the abs function. Get rid of that, net the spindle-cmd directly to the pwmgen, and negative values will set the direction output of the pwmgen.
Please Log in or Create an account to join the conversation.
- OT-CNC
- Offline
- Platinum Member
- Posts: 623
- Thank you received: 75
Please Log in or Create an account to join the conversation.
- OT-CNC
- Offline
- Platinum Member
- Posts: 623
- Thank you received: 75
I tried changing encoder value to neg in case it's a runaway. No change.
Encoder hal cofig shows the values for counting, vel, rawlatch, rawcounts, position, position-latched (0) and count latched (0).
Anything else missing before I get back to PID??
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23559
- Thank you received: 4858
Getting closer! CW/CCW works Somehow my spindle wants to ramp up to full rpm, regardless of S values set, same with m19. My RPS scale number is 60.
Have a look at PID command, feedback and error when that is happening.
This is probably a PID runaway of some sort. Does the encoder read positive and negative velocities correctly?
Please Log in or Create an account to join the conversation.
- OT-CNC
- Offline
- Platinum Member
- Posts: 623
- Thank you received: 75
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23559
- Thank you received: 4858
Velocity is neg when I spin the spindle manually CW. Oddly it's still neg when I make the encoder scale value opposite in the ini.
Is the HAL actually reading the scale from the INI?
Please Log in or Create an account to join the conversation.