Generating RPM from simple high/low switch- possible?

More
9 years 9 months ago #87113 by nigel-tufnel
I got encoder velocity to show but it is highly variable and the scaling seems way off. Changing the gain doesn't really help. Could this have something to do with it the servo-thread speed. I thought I recall reading that the servo-thread speed should be proportional to the encoder resolution. In this case I have a one count per rev resolution. Code to implement this if it's true would be greatly appreciated.

p.s. I noticed that my encA- and idx- are opposite. One is high when the other is low. Not sure if that has anything to do with it.

Thanks

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

More
9 years 9 months ago #87117 by andypugh
I don't see the source for your spindle-velocity signal. Where does it come from?

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

More
9 years 8 months ago #87141 by nigel-tufnel
Sorry. The code below was in an ancillary HAL file. It has since been moved to the main HAL file.

setp hm2_5i25.0.encoder.00.counter-mode 1 # set counter to up/down mode
setp hm2_5i25.0.encoder.00.vel-timeout 2 # go down to 1/2 RPS before we give up and report 0 velocity
setp hm2_5i25.0.encoder.00.scale 1 # set scale to 1 turn per count (may need to be -1 to get direction right)

net spindle-velocity hm2_5i25.0.encoder.00.velocity

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

More
9 years 8 months ago #87154 by andypugh
Curious. If it is a good encoder then the hm2_5i25.0.encoder.00.velocity value should be pretty accurate.

What does that pin look like in Halscope?

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

More
9 years 8 months ago #87326 by nigel-tufnel
The reason I was having problems was my setup. There was noise on the signal. Things seem to be working once I address this. Thanks for the help.

Question- how do you decrease the number of significant digits on the add on pyvcp spindle speed bar graph in Axis? I want to just display the RPM to one RPM (i.e. XXXX rpm; not XXXX.X rpm). Adding <format>"4.0f"</format> to the <bar> section didn't change anything.

Thanks.

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

More
9 years 8 months ago #87987 by verticalperformance

Question- how do you decrease the number of significant digits on the add on pyvcp spindle speed bar graph in Axis?

Not sure if you can. Tried a few flavours of <format> and I think it is not defined for the ttk progress bar, on which I assume the pyvcp <bar> is based

You might be able to do something funky in HAL where the <bar> connected to the spindle is converted from a float to an u32 integer but I suspect the bar will still display the ".0" anyway.

I moved away from pyvcp and defined my "extra info" using Glade. You can define the precision as an integer using the "text_template" property and setting it to %i or any other python format I guess.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum