New velocity channel from angle and time data

Discussions and questions about topics not covered above
stevenobryan
Posts: 1
Joined: 07 Mar 2022, 06:58
Contact:

New velocity channel from angle and time data

Unread postby stevenobryan » 07 Mar 2022, 07:08

Hi all,
I am trying to create a new channel for angular velocity based off an angle channel and a sampling frequency of 2000 Hz. Does anyone know how I can determine the change in angle between sample points so that I can divide it by time and create a new angular velocity channel? Any advice would be appreciated.
Cheers
Steve

Peter Rice
Major contributor
Posts: 184
Joined: 19 Jun 2008, 15:49
Software used: Spike2 and Signal
1401 type: Many 1401 types
Location: Cambridge, UK
Contact:

Re: New velocity channel from angle and time data

Unread postby Peter Rice » 07 Mar 2022, 13:19

You'll have to tell us a little more about your "angle channel". What device is used to generate this? Your mentioning a 2 KHz sampling rate implies this is an analogue signal of some sort. What is the maximum angular velocity? What latency can you tolerate in the output?

If the analogue signal is actually a measurement of shaft position, taking simple differences of successive samples would give you a (noisy) velocity signal. What happens to the signal as it goes through the zero angle (in either direction)? What velocity accuracy do you need?

If it's a digital output, e.g. from a standard Gray-encoded shaft encoder, then, in principle, things are a little easier because you have a direct pulse input representing angular changes. It would then be a matter of taking the inverse of the time interval between known angles of change to get a quantity that is proportional to angular velocity.

We don't have any information in our database about the type of CED1401 interface you are using for this work. If you do have a 1401, could you tell us its type and serial number? The 1401 model determines the maximum clock frequency you can use for pulse timing.

User avatar
Greg Smith
Major contributor
Posts: 1634
Joined: 19 Jun 2008, 12:27
Software used: Spike2 and Signal
1401 type: Many 1401 types
Location: Cambridge, England
Contact:

Re: New velocity channel from angle and time data

Unread postby Greg Smith » 21 Apr 2022, 17:30

If the input is a waveform, this is easy.

You can apply a 'Slope' channel process to the signal. Right-click the channel and choose "Channel Process...", then from the drop down list that probably has Rectify as the default setting, select Slope and click Add. Set an appropriate time constant (period over which to smooth the slope before and after each point).

This will cause the channel to be displayed as a slope and change the channel units appropriately, e.g. from Degrees to Degrees/s. Note that the channel itself is not changed, just the way it is displayed.

If you want a 'New' channel as slope, you can Duplicate the channel first (Right-click the channel, select the first item in the pop-up list 'Channel n' and the choose Duplicate, then add Slope to the channel, as above. If you want a permanent copy of the Slope, you can Right-click and select CHannel n, then select Save channel... and so on. These commands are also available in the Analysis menu.

You can use Virtual channels to do channel arithmetic (e.g. product, sum, differences, ratio of channels and other channel manipulations), you will find details of this in the Help.
Greg Smith Cambridge Electronic Design

User avatar
Greg Smith
Major contributor
Posts: 1634
Joined: 19 Jun 2008, 12:27
Software used: Spike2 and Signal
1401 type: Many 1401 types
Location: Cambridge, England
Contact:

Re: New velocity channel from angle and time data

Unread postby Greg Smith » 21 Apr 2022, 17:32

If you want the Angular velocity in real time (as you sample) as a waveform output, this is more complicated as it involves the use of the output sequencer to generate differences on the fly... it is possible, but is more complex to program.
Greg Smith Cambridge Electronic Design


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron