Setting Acceleration with 1067

Any hardware type questions or problems for all other Phidget devices.
Post Reply
AdamLee
Phidgetly
Posts: 34
Joined: Wed Jul 17, 2019 9:28 am
Contact:

Setting Acceleration with 1067

Post by AdamLee »

Good day, reader!

I'm trying to rip out some custom ramping code and replace it by setting the acceleration on our stepper through the API.

We've got the rescale factor set to drive off of RPM, so setting the velocity to 1 = 1 RPM. I'm a little bit confused by the language in the API documentation:
The rate at which the controller can change the motor's Velocity.
Units for Position, Velocity, and Acceleration can be set by the user through the RescaleFactor.The RescaleFactor allows you to use more intuitive units such as rotations, or degrees.

The default units for this motor controller are 1/16steps per count.
So you can probably guess I'm confused what value to plug into the setAcceleration method. What is a count? Would it essentially be RPM/s in our instance? So, for example, right now we're getting 1 RPM every 10s. Would I simply pass in 0.1?
Adam Lee
Software Engineer
www.activatedresearch.com
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Setting Acceleration with 1067

Post by jdecoux »

"counts" in that sentence are whatever unit you are using.

If your rescale factor is set to RPM, then setting acceleration to 0.1 will mean your motor will accelerate 1RPM every 10 seconds (up to your target velocity).
AdamLee
Phidgetly
Posts: 34
Joined: Wed Jul 17, 2019 9:28 am
Contact:

Re: Setting Acceleration with 1067

Post by AdamLee »

Thanks! That works like a charm.

One thing I noticed is that it doesn't decelerate. It doesn't look like there's any way to control this in the API. Can anyone just confirm for me whether that's possible or not? I honestly think for our application it isn't necessary since we aren't dealing with a lot of momentum but of course since that logic was built into our custom software package people are inquiring about it.
Adam Lee
Software Engineer
www.activatedresearch.com
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Setting Acceleration with 1067

Post by jdecoux »

The acceleration and deceleration are both specified by the acceleration property.

To extend the above example, an acceleration of 0.1 will take 10 seconds to reach 1 RPM from 0RPM, and will also take 10 seconds to decelerate from 1RPM down to 0RPM.
AdamLee
Phidgetly
Posts: 34
Joined: Wed Jul 17, 2019 9:28 am
Contact:

Re: Setting Acceleration with 1067

Post by AdamLee »

So the acceleration is definitely working but if I reduce the target velocity it drops immediately.

This line is doing all of the velocity setting (javascript):

Code: Select all

phidget.setVelocityLimit(rpm);
The setup for the channel is here:

Code: Select all

  phidget.onAttach = () => {
    eventEmitter.emit('stepperfound');
    return phidget.setVelocityLimit(0).then(() => {
      phidget.setCurrentLimit(parseFloat(env.phidgetStepperCurrentLimit));
      phidget.setRescaleFactor(parseFloat(env.phidgetStepperRescaleFactor));
      phidget.setAcceleration(0.1); // 0.1 RPM per second
      phidget.setControlMode(1); // 0 for step, 1 for velocity
      phidget.setEngaged(1);
      connected = true;
    }).catch((err) => {
      logger.error(err.message);
    });
  };
Adam Lee
Software Engineer
www.activatedresearch.com
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Setting Acceleration with 1067

Post by jdecoux »

Are you using the latest firmware for your 1067? I know some bugs were fixed a while ago that had to do with acceleration and run mode on the 1067.
AdamLee
Phidgetly
Posts: 34
Joined: Wed Jul 17, 2019 9:28 am
Contact:

Re: Setting Acceleration with 1067

Post by AdamLee »

I finally was able to get this device offline and update the stepper board firmware and it fixed the issue - thanks!
Adam Lee
Software Engineer
www.activatedresearch.com
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests