View previous topic :: View next topic |
Author |
Message |
pekka1234
Joined: 28 May 2017 Posts: 87
|
Servo accuracy |
Posted: Sun Mar 09, 2025 3:09 pm |
|
|
Hey. I am doing motor generators as a voltage adjustments.
It should adjust the 230VAC.
They are used as heaters, so the adjustment is not very accuracy.
I did the other (23kW) with step motor.
It worked well, but it needed reset switch, so that it knows where it starts.
The second I did with servo motor.
It do not need reset switch.
I used normally 8MHz internal clock CPU PIC16F886.
It needs the interface with 1ms-2ms and then total 20ms off.
I used setup_timer_1 ( T1_INTERNAL | T1_DIV_BY_1 );
I used CCS version V5.118
1 ms needs 9 pulses and 2 ms needs 18 pulses.
So the total adjustment is only 9 pulses.
When I tested it, it turned to be coarse.
I put the CPU in 20MHz working 2.5 times faster.
Now it works 22 pulses to 45 pulses.
It is much softer.
I wonder is there better case to adjust more than to increase the crystal?
Pekka Ritamaki |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19730
|
|
Posted: Mon Mar 10, 2025 2:11 am |
|
|
You don't tell us how you are actually doing this?.
This obviously affects how fine adjustment can be.
There are more sophisticated chips that have extra features to speed up
things like this, but at the end of the day, speed is your friend, when doing
any sort of timing operation.. |
|
 |
pekka1234
Joined: 28 May 2017 Posts: 87
|
|
Posted: Mon Mar 10, 2025 4:00 am |
|
|
Do you mean how often I do the motor controllers?
This is the first time, when I have done this kind of the controller.
I will go to my friends friend, who is keeping car repair shop. I have not seen any photograph of this device. This was step motor controller as my friend asked.
The second controller will go to my friend. He has a 6kW motor and generator. It will also generate heat at 230VAC.
I have done 30MW and 50MW SCR controllers to high power systems, but they are quite different.
Here are some information about these devices.
http://capacitor.wikidot.com/
I can send the PIC code, if you want to see it.
If I got 40MHz PIC like PIC18F2680, it will adjust the voltage two times more accurate, but I need the control voltage go upwards, so the the servo works.
Pekka |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19730
|
|
Posted: Mon Mar 10, 2025 4:58 am |
|
|
You talk about servo pulses, but then talk about counting on the timer.
It sounds as if you are possibly using overflow counts of the timer to time your
output pulse?. However timer1 is a 16bit timer, so this would not give the
sort of values you are referring to. There are much higher resolution ways
of working like using the CCP to do the count for you, but we need to have
some idea what you are actually doing. |
|
 |
pekka1234
Joined: 28 May 2017 Posts: 87
|
|
Posted: Mon Mar 10, 2025 9:31 am |
|
|
OK Ttelmah.
I wanted to do it some other way.
The basic control is here https://probyte.fi/servoControl.jpg
Hopefully you can give me a new control system.
Pekka Ritamaki |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19730
|
|
Posted: Mon Mar 10, 2025 11:20 am |
|
|
So, why not generate a proper servo pulse, not a chain of narrower pulses?.
A servo does not really expect a chain of high frequency pulses as you show.
You must be being lucky and have a servo that is integrating these.
This gives really poor accuracy.
What is the 'other way' you want to use?.
There have been many posts here before explaining how to drive a servo
using the CCP, rather than a pulse train. The resolution of this then becomes
the instruction cycle of the processor.
Have a look at this, the comments here, and the links from it:
[url]
https://www.ccsinfo.com/forum/viewtopic.php?t=58522&highlight=ccp+servo
[/url] |
|
 |
pekka1234
Joined: 28 May 2017 Posts: 87
|
|
Posted: Mon Mar 10, 2025 3:15 pm |
|
|
Thank you Ttelmah
I will look it carefully.
I knew that here I find the answer
Pekka Ritamaki |
|
 |
|