Hi Benj,
Thank you for your quick answer friday.
I put one Set Position macro direct below the begin statement.
Than the enable Pan Servo macro direct below and the same for the tilt servo her under.
It gives indeed an improvement with a minimum of 50%
Instead of a linear disturbance movement of the servodrive rod of 16mm, the movement vary now between 2 and 8mm.
In most cases also these values can causes an bogged down camera head to.
I believe it has to be possible to start up the servo-motors in Flowcode without any disturbance.
Can you please help me with this?
Kind regards,
Beejo
Disturbance during startup Servomotor.
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: Disturbance during startup Servomotor.
Hello Beejo,
Can you say what exactly is causing the servo motors to move. Eg is it while you are holding down the reset switch or is it just after you release the reset. Could be that the servo is being told to go to an incorrect position at the start of the program. If the motors are moving while the chip is in reset then you maybe need say a 10K pull up or pull down resistor on the servo motor control signal.
Can you say what exactly is causing the servo motors to move. Eg is it while you are holding down the reset switch or is it just after you release the reset. Could be that the servo is being told to go to an incorrect position at the start of the program. If the motors are moving while the chip is in reset then you maybe need say a 10K pull up or pull down resistor on the servo motor control signal.
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
-
- Posts: 31
- Joined: Thu Sep 11, 2008 12:46 pm
- Location: TheNetherlands
- Has thanked: 4 times
- Been thanked: 1 time
Re: Disturbance during startup Servomotor.
Hi Benj,
The motors make his movement just after i released the reset button. There is nothing happened as long as I push the reset, but on the moment I release the knob the motors makes the swing.
I have to say that in the ICD mode, with step for step debugging, the first reaction comes from the Pan motor (portC2) on the moment direct after reading the port B “Poortknoppen” in the "while 1" loop of the main program. After the "Switch Poortknoppen" in default direction the Tilt motor (PortC3) react.
How do I connect a pull up or pull down resistor to the servo pulse entry. Do you mean an resistor of 10k between the power and the servopulse connection?
Thanks in advance and i hope on good solution.
Regards,
Beejo
The motors make his movement just after i released the reset button. There is nothing happened as long as I push the reset, but on the moment I release the knob the motors makes the swing.
I have to say that in the ICD mode, with step for step debugging, the first reaction comes from the Pan motor (portC2) on the moment direct after reading the port B “Poortknoppen” in the "while 1" loop of the main program. After the "Switch Poortknoppen" in default direction the Tilt motor (PortC3) react.
How do I connect a pull up or pull down resistor to the servo pulse entry. Do you mean an resistor of 10k between the power and the servopulse connection?
Thanks in advance and i hope on good solution.
Regards,
Beejo
- 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: Disturbance during startup Servomotor.
Hello,
Is it possible for you to attach the current version of your program so I can have a play with it?
Is it possible for you to attach the current version of your program so I can have a play with it?
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
- 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: Disturbance during startup Servomotor.
Hello,
I have given your program a go here on the hardware and the motor is twitching slightly when I reset the device but other then that it remains solid. This is made worse by the fact that if the device is reset during the servo control pulse then the motor will not receive the correct position signal and will move slightly.
Not really sure what else I can suggest to get around this. You say it wasn't an issue using other demo software? Would it be possible to attach the code that was working ok and I will see if they are using any tricks.
I have given your program a go here on the hardware and the motor is twitching slightly when I reset the device but other then that it remains solid. This is made worse by the fact that if the device is reset during the servo control pulse then the motor will not receive the correct position signal and will move slightly.
Not really sure what else I can suggest to get around this. You say it wasn't an issue using other demo software? Would it be possible to attach the code that was working ok and I will see if they are using any tricks.
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
-
- Posts: 31
- Joined: Thu Sep 11, 2008 12:46 pm
- Location: TheNetherlands
- Has thanked: 4 times
- Been thanked: 1 time
Re: Disturbance during startup Servomotor.
Hello Benj,
The PIC16F886 was already loaded with software and i hope with the same version than i get on CD. The writer says that the
versions on CD and on the PIC are the same. So I sent herewith the latest version from the CD.
The file is an .bas file and this extension is not allowed to send herewith. I try to rename it as a txt file.
Yes this works.
Regards,
Beejo
The PIC16F886 was already loaded with software and i hope with the same version than i get on CD. The writer says that the
versions on CD and on the PIC are the same. So I sent herewith the latest version from the CD.
The file is an .bas file and this extension is not allowed to send herewith. I try to rename it as a txt file.
Yes this works.
Regards,
Beejo
- Attachments
-
- servo sturing 2 stuks.txt
- (23.99 KiB) Downloaded 298 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: Disturbance during startup Servomotor.
Hi Beejo,
The basic program seems to be doing the same kind of thing as the Flowcode component, only using delays rather then interrupts. I can't really spot any tricks being used to avoid the servo glitching on a reset. Do your motors do more then twitch then? If you add a 1 second delay to the start of your program then you can see what is being caused by a reset during control signal and the small twitch during startup.
To get around the reset during control signal problem you could disable the motor when ever you are not moving it. This way the control signal is only active when you are moving the motor.
The basic program seems to be doing the same kind of thing as the Flowcode component, only using delays rather then interrupts. I can't really spot any tricks being used to avoid the servo glitching on a reset. Do your motors do more then twitch then? If you add a 1 second delay to the start of your program then you can see what is being caused by a reset during control signal and the small twitch during startup.
To get around the reset during control signal problem you could disable the motor when ever you are not moving it. This way the control signal is only active when you are moving the motor.
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
-
- Posts: 31
- Joined: Thu Sep 11, 2008 12:46 pm
- Location: TheNetherlands
- Has thanked: 4 times
- Been thanked: 1 time
Re: Disturbance during startup Servomotor.
Hello Benj,
After disabling the servo’s in the program, the motors don’t react on a reset and that is good. Only when you power up the system they start up with a wrong pulse. The motors do the same thing with power up after disconnecting the signal wires from the PIC. So the disturbance doesn’t comes from the PIC. Then I tried a lab power supply and set the voltage on 5V with the current regulated to 0 mA. By turning slowly the current up, the Pan motor react at 80mA. He turned fully CW to the end position and consumed the 80mA as well. When I turned the current higher he also consumes the higher current. So there have to be a problem in the motor. To control both motors and printed board I changed the connections on the board an did the same test with the same result (only the Pan motor react in this way) So...conclusion: I go for a new pan motor.
Thank you for all your good help and please let me know when you have an different opinon.
Regards,
Beejo
After disabling the servo’s in the program, the motors don’t react on a reset and that is good. Only when you power up the system they start up with a wrong pulse. The motors do the same thing with power up after disconnecting the signal wires from the PIC. So the disturbance doesn’t comes from the PIC. Then I tried a lab power supply and set the voltage on 5V with the current regulated to 0 mA. By turning slowly the current up, the Pan motor react at 80mA. He turned fully CW to the end position and consumed the 80mA as well. When I turned the current higher he also consumes the higher current. So there have to be a problem in the motor. To control both motors and printed board I changed the connections on the board an did the same test with the same result (only the Pan motor react in this way) So...conclusion: I go for a new pan motor.
Thank you for all your good help and please let me know when you have an different opinon.
Regards,
Beejo