Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Tools
Old 22nd December 2006, 04:34 PM   #1
Default Recording speed of an Action

Hi Guys;
My very first query was messed up, so I am posting my query again.
My project has two objects, one stationary and other mobile.
When the mobile object touches(at a slow speed) the stationary object, a LED should light up....this is the easy part. Next, when the same mobile object is moved very fast towards the stationary object, another LED should light up and it should Flash! indicating that the action has been very rapid as against a lethargic movement...This is the Important part of my project.
Please help me with this problem!!
atuldey is offline  
Old 22nd December 2006, 07:45 PM   #2
Default

Time stamp the starting point (when you set the object in motion)
Time stamp the ending point (when the object hits the obstical)
Subtract the two and you have a difference. The small of the two differences is going to be the faster object.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is online now  
Old 22nd December 2006, 11:31 PM   #3
Default

what is your problem?

is it mathematics?

what sensors are going to use to detect the start and stop time?

i propose 1 IR led sender, and 2 receivers, with this sensor placed infront of the moving object, any stupid uController can perform the tast of calculating the speed of the moving object, by comparing the time at which the 2 sensors were trigered.
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline  
Old 23rd December 2006, 02:16 AM   #4
Default

Hi;
No, the problem is not maths!
In fact the Subject heading is diverting you guys to wrong solution. I am not looking for recording the speed of the action
My problem or rather I am looking for this solution:
When the mobile object touches(at a slow speed) the stationary object, a LED should light up....this is the easy part. Next, when the same mobile object is moved very fast towards the stationary object, another LED should light up and it should Flash! indicating that the action has been very rapid as against a slower movement...This is the Important part of my project.

Let me explain with a simple example:
It is like pressing on your Gas-Paddle while driving a car. When you press the Gas-Paddle ( I presume slowly) a LED should light up. Now, imagine you press the Gas - Paddle all the way down, the action of your foot ( or the Paddle) is very swift. The circuit should acknowledge this change of motion of the paddle ( the swiftness) and light up another LED ( may be different color or just flash). Here, the Gas-Paddle is a moving object and the floor of the car is a stationary object.
I hope I have been able to explain the problem!!

Thanks!
atuldey is offline  
Old 23rd December 2006, 09:02 AM   #5
Default

already posted an idea in the other thread.
why don't you use an accelerometer .?
__________________
Gods own Country
Incredible !ndia

www.flickr.com/photos/_akg/

"Give a man a fish, and he will eat for a day. Teach that man to fish, and he will eat for a lifetime."
akg is offline  
Old 23rd December 2006, 04:59 PM   #6
Default

Quote:
Originally Posted by atuldey
.
I hope I have been able to explain the problem!!
No you have not.

You started by talking of one object hitting another, then the analogy of moving the accelerator pedal of a car is used.
I am totally confused.

WHAT DO YOU WANT TO MEASURE???

An impact between two objects?

The speed of an object?

The acceleration of an object?

What are the object involved? If we dont know what it is, how can we suggest ways of measuring it?

Define the problem clearly and you may get some meaningfull replies.

JimB
__________________
Experience is directly proportional to the value of the equipment ruined.
JimB is offline  
Old 23rd December 2006, 08:04 PM   #7
Default

ok, I'll take a stab at it. He wants to determine when the mobile object moves above a certain velocity. I assume that the indicator is on the stationary object. This requires determining the distance of the object at specific periods and computing the speed.

If that is correct, you need a distance sensor in the stationary object that can track the mobile object. The uC would read the distance at periodic intervals and compute the speed. when the speed is above the threshold, the hi speed led gets lit.

seems like a wierd school assignment
philba is offline  
Old 23rd December 2006, 10:15 PM   #8
Default

Dear Philba:
You are very close to what I am looking for in my project:
"The uC would read the distance at periodic intervals and compute the speed. when the speed is above the threshold, the hi speed led gets lit."
Any idea, which UC I can use or if have come accross a circuit I can use!!
atuldey is offline  
Old 23rd December 2006, 10:44 PM   #9
Default

If you use a PIC micro, you could either use a potentiometer and connect it to the mechanical movement of the lever/object that you are monitoring speed. Then do the following in your program;

* Create a time interval routine
* Every 1/100th of a second (or less), make a new reading from the pot
* If last value is more than new value by a certain amount (i.e. - its accelerated to fast) then turn on LED2, but if the acceleration is within limits then turn on LED1

This would work if your problem consists of a mechanical movement such as the 'gas pedal' as you described earlier.

If the mechanical device is moving extremely quickly all the time, a potentiometer will probably be subject to mechanical failure..

Perhaps there's other better mechanical 'voltage dividers' out there instead of pot's
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Old 23rd December 2006, 10:44 PM   #10
Default

Quote:
Originally Posted by atuldey
Any idea, which UC I can use or if have come accross a circuit I can use!!
No we have not. You do not even tell us what the oblject is, or how its speed is being measured, so how do you expect anyone to make a sensible suggestion as to which hardware to use?

JimB
__________________
Experience is directly proportional to the value of the equipment ruined.
JimB is offline  
Old 23rd December 2006, 11:28 PM   #11
Default

I posted earlier and thought I'd better explain what I meant a bit more.

I threw something together really fast, it can definitely be refined, I used a a lot of variables to try and help you follow the code, its written in Proton+

This is untested, but just my view of a solution for your problem.

PHP Code:

 
Device 16F876A
Declare XTAL 4

'_______________________________________________________
ADC compiler settings declares

DECLARE ADIN_RES 10         ' 10-bit result required 
DECLARE ADIN_TAD 8_FOSC       ' 
RC OSC chosen 
DECLARE ADIN_STIME 50         ' Allow 50us sample time 

'
_______________________________________________________
' Define program variables

Dim ADC_Result As Float
Dim ADC_Total As Float
Dim ADC_Channel as Byte
Dim ADC_Loops as Byte
Dim Temp as Byte
    
Dim First_Result As Word
Dim Second_Result As Word    
Dim Difference As Word
Dim Last_Difference As Word

Symbol Max_Deviation = 10         ' 
Set the max deviation (i.eacceleration)
Symbol mS_Time_Sample 50       ' Set the interval for sampling (mS)    
Symbol LED1_Control = PORTB.0    ' 
Assign the outputs for the LED's
Symbol LED2_Control = PORTB.1    '

'_______________________________________________________
TMR0 Settings

Dim uS 
as Word
Dim mS 
as Word
Symbol GIE 
INTCON.7    
Symbol TMR0_uS 
512          ' Set time interval of TMR0 with 4Mhz Osc
Symbol TMR0_Enable = INTCON.5
Symbol TMR0_Overflow = INTCON.2

'
_______________________________________________________
' Start of program

ON_INTERRUPT Goto Interrupt_Sub

Goto Initialize
    
Initialize:

    INTCON = %00100000            ' 
Config the Interrupt Register
       OPTION_REG 
= %00000000         ' Config the OPTION_REG
        
    TRISA = %11111111            ' 
Set porta/b pins        
    TRISB 
= %00000000
    PORTB 
= %00000000
    
    ADC_Loops 
100             ' This controls the accurracy 
                                     '   
of the ADC routine    
     ADC_Channel 
1
 
    ADCON1 
= %10000000             ' Set analogue input, Vref is Vdd
    
Main:

     ' 
Grab a 10-Bit value (0-1023of what the voltage is on PORTA.0
     Gosub ADC_Average
     
     
' Store the value
     First_Result = ADC_Result
     
     ' 
Zero the timer settings
     uS 
0
     mS 
0
     TMR0 
0
     GIE 
1
     
     
' Loop until the specified time is reached
     Repeat
     
     Until mS = mS_Time_Sample
     
     GIE = 0
     
     ' 
Check what the new value of PORTA.0 is 
     Gosub ADC_Average
     
     
' Store it
     Second_Result = ADC_Result
     
     ' 
Check which direction it has moved
     
'  then calculate its amount of movement
     If First_Result > Second_Result Then
         Difference = First_Result - Second_Result
     Else
          Difference = Second_Result - First_Result
     Endif
     
     ' 
Check which direction it has moved
     
'  and determine if its to fast
     If Difference > Last_Difference Then
         If Difference - Last_Difference >= Max_Deviation Then
           LED1_Control = 0        
           LED2_Control = 1
        Else
           LED1_Control = 0        
           LED2_Control = 1
        Endif
     Else
         If Last_Difference - Difference >= Max_Deviation Then
           LED1_Control = 0        
           LED2_Control = 1
        Else
           LED1_Control = 0        
           LED2_Control = 1
        Endif         
     Endif 

     ' 
Store the last difference to compare with next time
     Last_Difference 
Difference
     
     Goto Main
     
ADC_Average
:      ' Grab an average of the ADC value, increases
                '  
accuracy greatly
    ADC_Total 
0
    
For Temp 1 To ADC_Loops
        ADC_Result 
ADIN ADC_Channel
        ADC_Total 
ADC_Total ADC_Result
    Next Temp
    
    ADC_Result 
ADC_Total ADC_Loops
    
    
Return 
    
Interrupt_Sub:

    
Context Save

    
If TMR0_Overflow And TMR0_Enable 1 Then
       TMR0_Overflow 
0
       uS 
uS TMR0_uS
       
If uS >= 1000 Then
             uS 
uS 1000
            mS 
mS 1
       
EndIf
    EndIf
              
    
GIE 1
    
    CONTEXT RESTORE 
It compiles to 946 Words of code, and you must use a device such as the 16F876A with ADC
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.


Last edited by gramo; 23rd December 2006 at 11:34 PM.
gramo is offline  
Old 24th December 2006, 01:12 AM   #12
Default

gramo, I think the mobile and stationary units are not connected.

atuldey, you can use any uC. your biggest challenge is to figure out how to do ranging (distance measurement). there are several approaches: ultrasonic, IR and true radar. all 3 require that you track the object since the beam is highly directional. so, you will need tracking as well as ranging. I think true radar is out of the question. get googling.
philba is offline  
Old 28th December 2006, 02:17 AM   #13
Default

Hi Gramo and Philba;
No measurement please!!
Even after acknowledging earlier that Philba, you got me right...I am trying to figure out how I can make the second LED light up once the moving object (the Paddle) moves at a faster speed ( like instantly pressing the Gas-Paddle)as against routine or normal pressure on the gas paddle ( first LED lights up).

Gramo...You are close, but could you please suggest me with my explainations above...
atuldey is offline  
Old 30th December 2006, 06:28 AM   #14
Default

A paddle.. Hmm, like a boat paddle that is anchored at a point and has a lever type action to move it?
__________________
digital-diy.com - Hobby microcontroller projects and tutorials. Assembly, PICBasic and C examples.

gramo is offline  
Old 30th December 2006, 05:33 PM   #15
Default

mAKE A PICTURE IN MS PAINT THEN EXPLAIN IT, what u want.
Ayne is offline  
Reply

Tags
action, recording, speed

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Intelligent digital speed control system for small truck model classic Robotics Chat 2 8th October 2006 12:57 PM
Government Ignores Police Concerns In Changing Speed Limit Rules ThermalRunaway Chit-Chat 5 20th August 2006 03:35 AM
motor speed control goodpickles Electronic Projects Design/Ideas/Reviews 1 26th February 2005 09:57 AM
design problem faced on PWM brushless motor speed control swear_swear Electronic Projects Design/Ideas/Reviews 0 23rd June 2003 02:06 AM
Monitoring PIns of controller at the same time waqar Micro Controllers 9 12th May 2003 11:12 AM



All times are GMT. The time now is 06:21 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker