Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity should be positive #1

Open
klauer opened this issue Jun 18, 2019 · 1 comment
Open

Velocity should be positive #1

klauer opened this issue Jun 18, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@klauer
Copy link

klauer commented Jun 18, 2019

Velocity values should be positive, as the direction bit indicates positive/negative velocity.

One line, for example:

SET_REG(this->chanbase, REG_STARTSTOPSPD, (int)floor(min_velocity));

Local fix was as follows:
klauer/motor@bed2425

It seems as this may have been insufficient, as there are other references to the same register (REG_STARTSTOPSPD)

Disclaimer: this is from the SLAC accelerator fork of the motor record and uses hardware I don't have access to anymore, but I'm trying to bring the code back upstream as best I can. PR will follow once I get all of these issues in.

@kmpeters kmpeters added the bug Something isn't working label Aug 8, 2019
@kmpeters kmpeters self-assigned this Aug 8, 2019
@kmpeters
Copy link
Contributor

I'm not able to find an original manual for the Hytec 8601. I did find a newer manual (http://www.newwoodsolutions.co.uk/ProductPDFfiles/8602_UTM_G_x_1.0.pdf) which states this:

3.7 Ramp Rate Register (Channel base + 0Ch)

This 16-bit register is programmed in steps per second per second and sets the rate at which the
motor speed will increase or decrease during ramping. It is programmed in steps per second per
second and the minimum allowed value is 64. The granularity of the programmed value is also 64,
so the available rates are 64, 128, 192 and so on up to 1024, at which time the granularity
becomes 256. The maximum allowed value for this register is 50,000 decimal.

That description of the ramp rate register gives the impression that the code that sets the acceleration is also wrong:

/* XXXX: set ramp register, acceleration is steps/s/s */
SET_REG(this->chanbase, REG_RAMPRATE, (int)floor(acceleration));

I don't have an 8601 to use for testing. I'll keep this issue open for a few more years to see if anyone still uses the 8601.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants