I am trying to smooth the motion of this code for my servos. (one goes up and down, the other spins 360)
I am using the varspeed library and wondering if the smooth-servo library will work with it, and if not, which one will. Has anyone else messed with this before I guess is what I am asking. Any advice would be great,
Looks like your ‘myservo’ moves are almost all as slow as they can go (speed 1). Maybe the problem is that the active range of the servo is only 40 degrees (110 degrees to 150 degrees). Maybe if your mechanism used a set of gears or levers you could use more of the available rotation of the servo which would then allow slower motion.
It helps to know what you are seeking advice about. "Buy low, sell high" is useless advice if you are looking for help deciding whether to get a haircut.
johnwasser:
Looks like your ‘myservo’ moves are almost all as slow as they can go (speed 1). Maybe the problem is that the active range of the servo is only 40 degrees (110 degrees to 150 degrees). Maybe if your mechanism used a set of gears or levers you could use more of the available rotation of the servo which would then allow slower motion.
The servo can go further but for this application it has to stay within these parameters.
PaulS:
It helps to know what you are seeking advice about. "Buy low, sell high" is useless advice if you are looking for help deciding whether to get a haircut.
What problem do you have?
I thought I explained it properly. Let me try again. I would like my servo movements to smooth out/ease in-out. (especially for the continuous movement servo I am using) I was asking if anyone has used the varspeed library with the smooth-servo library (or ANY easing library) with any success. I tried a bit but the smooth-servo documentation is not exactly thorough.
Sorry, I don't understand. A continuous servo is usually completely smooth. It's just a geared motor. And the control signals you send to it just change the speed. So what are you trying to do with it that is not smooth?
A standard servo is completely different. But what are you trying to achieve? Are you trying to get it to move from one angle to another very slowly and without any jerkiness? That is usually not possible with ordinary hobby servos because their control electronics only have fairly coarse resolution.
BTW to answer the direct question, I've used VarSpeedServo but I've never tried (or felt a need for) SmoothServo.
Did you look at the libraries I linked to and what they do? They are easing libraries. To ease in/out the start/stop of a servo. I am trying to see if certain ones play nice together and see if anyone has experience with said playing nice together.
Did you look at the libraries I linked to and what they do?
Yes.
They are easing libraries.
The SmoothServo library is a completely useless piece of crap. It has one method, test(), that simply waits for 5 seconds. It makes NO attempt to control the Servo instance in any way.
The VarSpeedServo allows a servo to move at different speeds.
Well, the device that you have is NOT servo. It is a variable speed electric motor. Why you think that you need a different library to control the speed of your device is complete mystery. You keep saying that the libraries are "easing" libraries, without explaining just what the hell "easing" means to you.
What it REALLY looks like is that you are looking for a library that lets you control acceleration, NOT speed. You can already control speed. Feel free to write such a library. But do NOT call it Servo anything, because you do not have a servo.
It is a nicely packaged geared DC motor with some control electronics.
after I get a REAL servo.
If what you need is continuous rotation, you may not need to purchase something else.
What is it that you are trying to do? You described 2 devices
a servo that goes up and down. I assume that this is an unmodified servo that retains the positional awareness.
a continuous rotation servo
Using a library that has acceleration to start and deceleration to stop might work with the standard servo.
I am not sure how well it will work controlling the speed of the 360 servo. The electronics that control the motor are not very good speed controls. They were designed to have a positionally aware servo move to a specified position as fast as possible, and hold well once it gets there.
When you change that to be a 360 servo, you get direction control, but not very good speed control.
What is your project? What are you doing with the 360 servo that needs acceleration and deceleration?
I can't understand why. You've been told more than once that the definition of a servo includes position control. You can't control the position of your continuous-rotation-"servo"-that-is-not-really-a-servo. Therefore, you don't have a servo.
Should I ask for my money back since Fry's clearly sold me the wrong thing?
No. You were the one that bought the wrong thing, if you expected to be able to control its position.
What I suspect that you need is a stepper motor, where you can control position, speed, AND acceleration.
I have two servos, one is standard, the other continuous. I am not trying to smooth the entire motion of the servo OR control the speed. I want to EASE IN and EASE OUT of the start and stop positions.
Example: The continuous rotation servo starts abruptly. I want it to ease into it's programmed turn speed. A "smooth" transition from stop to start if you will.
What I am trying to determine is if any of the pre-existing libraries for Easing in and out for servos will work with the variable speed library I linked to. The Varspeed library works great for slowing the servos down. However it does NOT ease in/out.
I am not sure that the electronics on your continuous servo support the slower speeds you are looking for at the start and stop.
Many do not. But some are better than others. You should experiment.
Have a pot? Hook up the knob tutorial and experiment with values near the 1500 stop value.
If you can send values close to 1500 and get slow movement, then you are good. But some servos go from stop to full speed with values just off of 1500, and larger differences from 1500 do not change the speed.
A standard servo has NO speed or acceleration control. It always moves to the position you command at full speed. VarSpeedServo just moves in small increments, basically like the Sweep example. And that's as smooth as a standard servo can get.
You have speed control of the continuous servo but again if you use VarSpeedServo with it the speed will ramp up in increments so relatively slowly. That's as smooth as it gets.
If you want something that has a defined acceleration curve you're going to need to use motors and encoders and write your own control code rather than relying on the controller built into a servo (or ex-servo).
If I wanted more control of servo acceleration and speed I would use the built-in Servo library, control the servo with .writeMicroseconds, and use the MultiMap library to create a piecewise linear interpolation of the desired position curve.
johnwasser:
If I wanted more control of servo acceleration and speed I would use the built-in Servo library, control the servo with .writeMicroseconds, and use the MultiMap library to create a piecewise linear interpolation of the desired position curve.