Shop OBEX P1 Docs P2 Docs Learn Events
USB Servo controller permanent ramp speed limitation — Parallax Forums

USB Servo controller permanent ramp speed limitation

BurkBurk Posts: 17
edited 2012-04-09 04:32 in Propeller 1
Is there a way to make the Parallax servo controller (28830) never ramp faster than a certain value? Been browsing the firmware source code but i'm new to this propellor chip and didn't see the 'magic spot' yet.

Comments

  • Mike GMike G Posts: 2,702
    edited 2012-03-30 05:21
    Ramp is part of the position command. Don't send a ramp larger than some max value when issuing a position command.
    PRI ValidateMaxRamp(value)
      if(value > MY_MAX_RAMP_VALUE)
        value := MY_MAX_RAMP_VALUE
    
     return value
    
  • BurkBurk Posts: 17
    edited 2012-03-30 06:30
    Thank you, but i need to change the code so it will never ramp fast not even on startup/reset which might be impossible in the end if the controller doesn't know the servo's position. Guess i should try a hardware solution.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-30 08:08
    Burk wrote: »
    Thank you, but i need to change the code so it will never ramp fast not even on startup/reset which might be impossible in the end if the controller doesn't know the servo's position. Guess i should try a hardware solution.

    I think normally the PSC doesn't know the servo positions at start up but you could save these values to EEPROM or some other external memory and use these positions as the initial position when starting the servos.

    One problem I see, if you write to the EEPROM continuously as your device is being used, you might wear out the EEPROM.
  • BurkBurk Posts: 17
    edited 2012-03-30 08:25
    Yeah i thought of that too but it would still be a partial solution, if you'd move the servo(s) by hand it could still ramp the sh*t out of something on startup/reset.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-30 09:54
    If the servos can be moved while the system is off, you'd need some way of detecting there positions when starting up the servo controller.

    I plan to make circuit boards for some magnetic encoders soon. I'm hoping to make a board small enough to replace a servo's pot. I'm not sure how to go about attaching a magnet to the inside of the servo yet.

    Mounting this type of encoder externally might also be an option.
  • BurkBurk Posts: 17
    edited 2012-03-30 10:38
    Not sure what i'll do yet, i might go for a servo that simply doesn't have the power to wreck things.

    If you have an A/D converter available you could just read the pot in the servo to detect its position.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-30 11:03
    Burk wrote: »
    Not sure what i'll do yet, i might go for a servo that simply doesn't have the power to wreck things.

    If you have an A/D converter available you could just read the pot in the servo to detect its position.

    I think Rayman is working on something like this.

    Beau also has a method for reading a servo's position. I thought I had a link to Beau's method in my index but I couldn't find it.
  • BurkBurk Posts: 17
    edited 2012-04-09 04:32
    With ramping enabled a servo will ramp if you disable en enable it (not cool), is there a newer firmware revision perhaps that doesn't?

    E: Never mind, sort of got it working.. i'll get there...
Sign In or Register to comment.