Hi All
I would appreciate it if someone could help me with a little information on using servos with flowcode 8. I have a small robot which uses 6 servos and have a few questions.
1. As soon as I enable the servos they shoot off at max speed to position 128. I can change this position by using set position before the enable instruction but cannot slow down the speed, which is way too fast.
2. When using movetoposition I can control the speed of the servo but once it has reached the position it effectively disables the servo and it becomes free to move when slight force applied.
Regards
Gary
Using servos
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using servos
Hi Gary,
1. This is how servos work, they will jump at full speed to your control position and there is no way to know where the motor is before you enable it (without hacking the motor or adding external position sensors). If you can then you need to put them in to the right position so that when you next enable them you are already in the correct place.
2. This should not be the case unless you are specifically disabling the servo motor output once it has reached position.
If you post your program then this might help for us to see what you're doing and maybe offer better advise.
1. This is how servos work, they will jump at full speed to your control position and there is no way to know where the motor is before you enable it (without hacking the motor or adding external position sensors). If you can then you need to put them in to the right position so that when you next enable them you are already in the correct place.
2. This should not be the case unless you are specifically disabling the servo motor output once it has reached position.
If you post your program then this might help for us to see what you're doing and maybe offer better advise.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using servos
Hi Ben
Thanks for the quick reply. regarding the initial position I have been placing it as close to where it starts as I can, I was just hoping there was a way to slow down the first movement. Regards the servos not locking, this is still happening. Can you please check the attached program and explain if I am doing something incorrect.
Regards
Gary
Thanks for the quick reply. regarding the initial position I have been placing it as close to where it starts as I can, I was just hoping there was a way to slow down the first movement. Regards the servos not locking, this is still happening. Can you please check the attached program and explain if I am doing something incorrect.
Regards
Gary
- Attachments
-
- robot v1.1.fcfx
- (20.07 KiB) Downloaded 280 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using servos
Hi Gary,
Your program looks ok to me the motors should be staying active after moving and held in position. I've checked the component code just to make sure there is nothing there disabling the motor when arriving at position but everything looks ok.
Your program looks ok to me the motors should be staying active after moving and held in position. I've checked the component code just to make sure there is nothing there disabling the motor when arriving at position but everything looks ok.
One of the downsides of using servos I'm afraid.As soon as I enable the servos they shoot off at max speed to position 128. I can change this position by using set position before the enable instruction but cannot slow down the speed, which is way too fast.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using servos
Thanks Ben
Ii appears for some reason that either the code or the servos don't like being set above 250, if set at a max of 250 then they stay enabled.
Regards
Gary
Edit
Further to the above, I have changed the program slightly and added a few commands to move some more servos. I have found that if a servo is set to 255 it actually appears to stop the program going any further. I have actually removed the physical connection to the servo to see if it was the servo but the program still appears to stop when the servo is set to 255. All works well in the simulator.
Further Edit
The problem appears to be the trim setting. With this setting set at +50 then the limit is 250 and the servo performs as above. If the is set to 0 then everything works well. I have tried setting the trim both with the set trim command and by changing the setting in the servo board properties, both have the same effect
Ii appears for some reason that either the code or the servos don't like being set above 250, if set at a max of 250 then they stay enabled.
Regards
Gary
Edit
Further to the above, I have changed the program slightly and added a few commands to move some more servos. I have found that if a servo is set to 255 it actually appears to stop the program going any further. I have actually removed the physical connection to the servo to see if it was the servo but the program still appears to stop when the servo is set to 255. All works well in the simulator.
Further Edit
The problem appears to be the trim setting. With this setting set at +50 then the limit is 250 and the servo performs as above. If the is set to 0 then everything works well. I have tried setting the trim both with the set trim command and by changing the setting in the servo board properties, both have the same effect
Re: Using servos
i want to control the position of wiper motor using potentiometer
but my program is not work please help.
but my program is not work please help.
- Attachments
-
- WIPERMOTOR_CONTROL.fcfx
- (24.12 KiB) Downloaded 211 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Using servos
Hello,
You seem to be using the PWM component as your driving component, this should instead be replaced with the servo controller component as the PWM will not be able to generate the correct timings to drive the motor.
An example is available from here.
https://www.matrixtsl.com/wiki/index.ph ... hatronics)
You seem to be using the PWM component as your driving component, this should instead be replaced with the servo controller component as the PWM will not be able to generate the correct timings to drive the motor.
An example is available from here.
https://www.matrixtsl.com/wiki/index.ph ... hatronics)
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Using servos
Yeah, I've tried running my servos with both (as I've heard it was possible to do with the PWM) and it's obviously better with the designated tool.