| View previous topic :: View next topic |
| Author |
Message |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Tue Dec 02, 2008 5:00 pm Post subject: |
|
|
| Generating a PWM is far too easy and than the specific TWI protocol.I guess thats why Barry made an announcement to bring in flexibility into open servo .(like able and disable features)I have one idea.When there is a normal PWM input the servo should work and when one wants to use TWI they can without one requiring to specifically enable and disable the feature.(So it will be a blockbuster among the amateurs as well as the experts.) |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 03, 2008 7:58 am Post subject: |
|
|
Will the circuit diagram for the version 2.1 work with the code of Ver_3 ?.
Any idea about IRF MOSFET drives which would sustain a motor with a stall current of 10A?(What do you suggest shall I go for IRF MOSFET drives or the motor driver from Robotshop?) |
|
| Back to top |
|
 |
mpthompson
Joined: 02 Jan 2006 Posts: 650 Location: San Carlos, CA
|
Posted: Wed Dec 03, 2008 7:32 pm Post subject: |
|
|
| youthreewire wrote: | Also one idea of mine was not to use pulse width control at all.Just send any number ranging between 1 to 1024 as the position in a format like :
<S><position value><E> where S denotes the start character ,E denoted the end character .This would also make it easy for one to control the servo from a laptop using a USB to RS232 converter and a Max232 chip. |
Utilizing the UART for RS232 based control was discussed many times early in the history of the OpenServo project (not sure about recently), but to my knowledge no one has actually implemented it and added the source code back to the CVS tree. Serial control really wouldn't be a hard project to implement at the ATmega8 or ATmega168 and the protocol could be kept very similar in nature to the TWI/I2C protocol.
-Mike |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Thu Dec 04, 2008 2:41 am Post subject: |
|
|
Hi,
If I have to make my own H-Bridge for motor with stall current 21A but operating voltage at 7.2 V ,what is needed?I would basically have the same version of code running in the atmega168 as in Version 3 but only with High rated MOSFETs.
I think the right IRF MOSFETs are required.While choosing from various types of motors what I see is for delivering a given high amount of torque either the operating voltage has to go up or the current. |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 10, 2008 6:04 am Post subject: |
|
|
| I have been checking the code of Pulsectl.c .It uses the measure of the current position and velocity of the servo.(I understand position is measured by potentiometer,but how is the velocity measured ?Is it derived from position with respect to time or any other way/electronic component does it?) |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1027 Location: Manchester, UK
|
Posted: Wed Dec 10, 2008 11:12 am Post subject: |
|
|
Hi Youth,
yes, in OpenServo v3.0 the velocity is derived from the change in position over time.
If you were to use the v3.0-dev branch, then you would be using the backemf velocity measurement system. _________________ http://www.headfuzz.co.uk/
http://www.robotfuzz.co.uk/ |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 10, 2008 1:41 pm Post subject: |
|
|
So what do you suggest ginge.
Shall I use the atmega168 with 2.0 version ,with the clock at 8Mhz and use the RC PWM feature (pulsectl.c)
or shall I use the 3.0 version with the pulsectl.c feature.Because I think since the code was not ported to 20 Mhz it remains an untested feature in 3.0 version. (was it successfully working on the 2.0 version at 8Mhz?) |
|
| Back to top |
|
 |
ginge Site Admin
Joined: 14 Jan 2006 Posts: 1027 Location: Manchester, UK
|
Posted: Wed Dec 10, 2008 2:28 pm Post subject: |
|
|
Hi Youth,
If you want to use the pulse code without modifying it to work at 20MHZ, then yes, you should use the version 2.x range.
The PWM was tested as working in 2.0
Please also make sure you are using the v2.x schematics as reference as the version 3 schematics use different pin assignments.
Cheers _________________ http://www.headfuzz.co.uk/
http://www.robotfuzz.co.uk/ |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 6:26 am Post subject: |
|
|
Hi Ginge,
I have seen one video of yours where you were testing the servo under different loads.So is the PID loop control effected by the external load?Is it the PID parameters remain the same under all loads or should one tune it after testing with each load? |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 8:20 am Post subject: |
|
|
Well I think we can definitely develop UART control of the open servo.I have been using a UART library as here and the implementation is pretty robust.Can we use it to give UART support for Atmega8 versionf of open servo?
Link to UART library:
http://homepage.hispeed.ch/peterfleury/avr-software.html#examples |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 9:22 am Post subject: |
|
|
| mpthompson wrote: |
I've put together an AVR Studio project that resurrects the OpenServo code for the ATmega8 as it was originally implemented in early March, 2006. You can download the project file at the following URL:
http://home.comcast.net/~michael.p.thompson/openservo/atmega8_openservo.zip
This zip file contains the ATmega8_Openservo.aps project file which compiles cleanly for AVR Studio version 4.14 (which I believe is the latest). Once compiled, you should be able to download it directly to the ATmega8 with your STK200. You shouldn't need the bootloader.
- Mike |
Mike,if I have to disable the TWI in this and send the position value through the UART which variable should I alter?(what is the position variable?)
I am thinking of controlling the position with the uart.Also one concern is when I include the UART.C and UART.h files will the compiled hex overshoot the memory range of Atmega8? |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 10:12 am Post subject: |
|
|
Also was looking at the config.h file in the above code.I think there are some things that can be eliminated to make it minimal.Things which can be eliminated are.
Regulator.c and regulator.h related stuff
Estimator.c and estimator.h related stuff
ipd.c and ipd.h related stuff
and vey useful is #define MAIN_MOTION_TEST_ENABLED which helps for servo positioning without using the TWI.I think compiling and flashing the atmega8 with MAIN_MOTION_TEST_ENABLED should give me how the position can be controlled and its respective variables.
Also I will be studying the code and explain it so that it will be useful for others. |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 10:18 am Post subject: |
|
|
Also after reading the adc.h file ,I came to know that two things are being read on the ADC one is position and the other is power.But the pins on which they are being read are ADC0(power) and ADC1(position) .This is quite different from the connections in 2.1.(I request you to kindly provide the circuit diagram associated with the code).In 2.1 current as well as voltage are being read.I understand power reading is done for some sort of overload protection.(I think since P=VxI in version 2.1 the same is being done but more accurately by reading the voltage and current components.But 2.0's power idea will be clear only after the respective diagram ia available)
Will just reading the position help ?(what do you exactly mean by reading power?)
Well this is the code for MAIN_MOTION_TEST
| Code: | #if MAIN_MOTION_TEST_ENABLED
// This code is in place for having the servo drive itself between
// two positions to aid in the servo tuning process. This code
// should normally be disabled.
{
// Get the timer. This timer is defined by the position/power sample
// frequency and has a cycle time of approximately 512 microseconds.
uint16_t timer = timer_get();
// Reset the timer if greater than 16000.
if (timer > 16000) timer_set(0);
// Look for specific events.
if (timer == 0)
{
registers_write_word(REG_SEEK_HI, REG_SEEK_LO, 0x0100);
}
else if (timer == 8000)
{
registers_write_word(REG_SEEK_HI, REG_SEEK_LO, 0x0300);
}
}
#endif
} |
So how exactly is it changing the position?
Last edited by youthreewire on Wed Dec 17, 2008 10:46 am; edited 1 time in total |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 10:26 am Post subject: |
|
|
Also looking at eeprom.c ,I understand that TWI master slave communication requires value to be read and sent back which are being stored in the EEPROM as a buffer.I think while making this minimal by sending values through the UART eeprom feature can be disabled.
(My intention is not to degrade the open servo code but is to provide UART control feature using the Atmega8.I have a lot of respect for the authors who have written the code and the hardworking hours that went into developing it) |
|
| Back to top |
|
 |
youthreewire
Joined: 30 Nov 2008 Posts: 39
|
Posted: Wed Dec 17, 2008 10:39 am Post subject: |
|
|
I was trying to understand how the position setting is done.I read this
| Quote: | For example, to set a servo position of 980 (which is the max value I can get from a Stell Servo) you would send this command sequence.
Assuming device address = 0x20
I2C communicates using hex bytes, so position 980 translates to 0x03D4
As with any I2C transaction, this 16 bit value must be split into 2 8 bit bytes. All that is required, is to send the upper and lower nibbles of the byte.
send: 0x20 0x10 0x03 0xD4 |
What does 0X10 mean in the above line? |
|
| Back to top |
|
 |
|