following errors with stepgen in velocity mode with PID using parallel port

More
04 Jul 2023 20:16 - 04 Jul 2023 20:17 #274786 by dog
Hey hey y'all, I'm new to linuxcnc so I'm still learning how to set up the ini and hal files.  I've solved quite a few problems but this one has me blocked.  I'm guessing I've done something stupid.  I'm hoping someone here can take the time to point me in the right direction.

This is a three axis knee mill.  I'm using steppers and linear encoders with two parallel ports.  I want to home using a limit switch and the index in the encoders which I understand requires stepgen in velocity mode with PID.  I worked my way up from simple open loop configurations to the present one so I'm fairly confident that I have it wired correctly and that the motors are working correctly.  Once I moved over to velocity mode I started having problems.  When I try to jog an axis I get an immediate following error.  I opened up the FERROR limits to .5" to let the machine move a little.  No matter what I select for the jog distance the motor jumps to full velocity and runs for .5" at which point the following error is asserted.  I'm watching the DRO when this happens, which should be reporting the encoder values not commanded values, and it appears to work correctly.  I'm guessing I have stepgen or PID configured incorrectly.  I really have no idea what I should have for PID values.  Attached are the ini and hal files, hopefully they are written cleanly enough that they aren't too hard to understand.  TIA.

 

File Attachment:

File Name: mill.ini
File Size:4 KB

 

File Attachment:

File Name: mill.hal
File Size:10 KB


 
Attachments:
Last edit: 04 Jul 2023 20:17 by dog. Reason: forgot something

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

More
04 Jul 2023 21:00 #274788 by tommylight
Try omitting lines with :
setp pid.z.maxerror 0.0
Granted you have made sure the encoders are counting in the right direction, same as steppers.

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

More
04 Jul 2023 21:05 #274789 by PCW
As tommylight says you need to make sure the stepgen and encoder directions
are matched. In addition, you need to make sure the stepgen and encoder scaling
are correct.

Also for a velocity mode PID  loop, FF1 should be 1.000
The following user(s) said Thank You: tommylight

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

More
04 Jul 2023 22:14 #274796 by dog
Y'all rock. 
I changed one thing at a time.  I commented out the three setp pid.N.maxerror 0.0 lines.  No change but I left them commented out.

Then I noted that the DRO reported a move in the negative direction when I commanded a positive move.  The DRO direction was correct per normal machine axis directions so that meant I needed to change the direction of motion.  I didn't see any pins that set direction so I just inverted the DIR signal at the parallel card with this and now everything is awesome:
setp parport.0.pin-16-out-invert TRUE

That's for X, I also had to do the same thing for Y but Z was correct.

Woohoo.  I've got a lot more to master before I have this machine operational but thanks to you I'm now further down that road.

thanks for the help, here's hoping I don't have to ask for more.....
The following user(s) said Thank You: tommylight

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

More
04 Jul 2023 22:47 #274799 by dog
Ok, while at lunch it occurred to me that a better solution was to just change the appropriate dip switch for direction on the motor amplifier so I did that and removed the pin invert lines from the hal file. Such a nube....

I also failed to mention that I did change the FF1 values.

thanks again.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum