Go Back  R/C Tech Forums > General Forums > Radio and Electronics
RCHourglass DIY Lap Timing (AKA Cano revised) >

RCHourglass DIY Lap Timing (AKA Cano revised)

Like Tree34Likes

RCHourglass DIY Lap Timing (AKA Cano revised)

Reply

Old 01-26-2018, 11:17 AM
  #61  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Originally Posted by mv4wd View Post
The temp sensor is available also in the PIC, but it gives the chip die temperature... usually we're interested on motor temperature and sticking the pic to the motor is not possible. An external connector to a temp sensor might be better. The critical part for PWM is generating exact 5Mhz bpsk signals and sometimes with the dividers/frequencies available in some chips this is not possible at all. Datasheet need to be deeply studied to check this possibility. Wifi and bluetooth are great but probably overkill for such use... I'm investigating VDD dac conversion and writing down a protocol to send this info to the decoder. When ready I'll update the firmware.
If you rewrite the firmware for the transponder, for me it will be useful to have
the possibility to put the cpu in sleep mode port RA3 has a low level for some
seconds (may be 10s ) to save the battery and use an interrupt to wake up on rising edge. so when no movement, the transponder will sleep.

On the part of the decoder,
it could be useful to have an extended Cano mode, with three more bits on the
transponder number defined:
000b: Mylaps transponder type
001b: Club transponder type ( so no confusion when mixed with Mylaps
other: Reserved for future use.

Thanks

Thor ( Alcatraz Amiga rulez)
mroc is offline  
Reply With Quote
Old 02-03-2018, 02:27 AM
  #62  
Tech Rookie
 
Join Date: Mar 2014
Posts: 1
Default

Hello,
it's amazing !!!
i just look at your system and it should be a good solution for training at our club.
i'm looking to make a PCB with my cnc mill , i'm a beginer in electronic and i tryed to make it myself.
i'm trying to make transponders too, mylaps is verry expansive and i'm looking for an other solution.
thanks for your hard work!!!

PS: sorry for my english ... i'm french ...

Ludo
zouky23 is offline  
Reply With Quote
Old 02-03-2018, 11:29 AM
  #63  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Here is an example of using the RMT module on ESP32 to get pulse of 3us, using
a 1Mhz clock ( dividing by 80 the master clock ).
I realy think we may use it as a transponder, and with the wifi part, telemetry.

ESP32: Sending short pulses with the RMT at Buildlog.Net Blog

Thor
mroc is offline  
Reply With Quote
Old 02-04-2018, 10:06 AM
  #64  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

I will be interested in a list with the transponder number written on the case and the one reader by the decoder.
If someone as this list.

Thor
mroc is offline  
Reply With Quote
Old 02-05-2018, 01:55 PM
  #65  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Ok, I try to make the encoder for the Remote module from the ESP32:

Code:
#include    <stdio.h>
#include	<stdlib.h>
#include	<string.h>

int	channel						= (0);

#define	MYLAPS_CLOCK_LOW_HIGH		( 80 / 5 / 2 )						// 80 Mhz base, then 5 Mhz for the carrier with 50% dutty
#define	MYLAPS_CLOCK_PHASE_CHG		( MYLAPS_CLOCK_LOW_HIGH * 2 )		// 80 Mhz base, then 5 Mhz for the carrier for phase change

#define TELEGRAM_SIZE   			( 12 * 8 * 4 )						/*!< Telegram has 12 bytes, so 96 bits */
#define RMT_TX_DATA_NUM  			1									/*!< NEC tx test data number */

#define msg_len     12
#define msg_count   8
#define TRANS_COUNT	1

#define	true	( 1 == 1 )
#define false	( 1 == 0 )


typedef struct {
    union {
        struct {
            unsigned int duration0 :15;
            unsigned int level0 :1;
            unsigned int duration1 :15;
            unsigned int level1 :1;
        };
        unsigned int val;
    };
} rmt_item32_t;

// 2351957
static unsigned char   radio_msg [msg_count*TRANS_COUNT][msg_len]   = 
    {
        {   0XF9, 0X16, 0XE1, 0XCB, 0X12, 0X1C, 0XC9, 0XD6, 0XC3, 0XE0, 0XFF, 0X0F  },		// Transponder ID Telegram
        {   0XF9, 0X16, 0XDA, 0XE7, 0X94, 0X77, 0XE9, 0X3C, 0X91, 0XD7, 0XC3, 0XCC  },		// Status Telegram
        {   0XF9, 0X16, 0XEC, 0X50, 0X55, 0X92, 0XE2, 0X23, 0X61, 0XD4, 0XF0, 0X0C  },
        {   0XF9, 0X16, 0X36, 0X58, 0X15, 0X1B, 0XC8, 0XC3, 0X62, 0X14, 0X3C, 0X00  },
        {   0XF9, 0X16, 0X0E, 0X29, 0XBA, 0XE0, 0X3E, 0XE3, 0X62, 0XDB, 0XC0, 0XC3  },
        {   0XF9, 0X16, 0X36, 0X55, 0X57, 0X09, 0XFB, 0X3F, 0X91, 0X27, 0X00, 0XF0  },
        {   0XF9, 0X16, 0X0E, 0XFE, 0XF0, 0X8A, 0X22, 0X3C, 0X52, 0X1B, 0X3F, 0XF3  },
        {   0XF9, 0X16, 0XD7, 0XA8, 0X10, 0X77, 0XD1, 0X23, 0XA2, 0XD7, 0XC3, 0X3C  }
	};
	

	static int MyLaps_CreateTelegram(int channel, rmt_item32_t* item, int item_num, unsigned char *msg)
{
    int 	i 			= 0,
			j 			= 0;
	int		last_bit	= ((0b010000000) & (msg[0])) ? true : false;				// initialise the n-1 bits
	int		phase		= false;
	
    if(item_num < TELEGRAM_SIZE)				// Check if we have space....
	{
        return -1;
    }

    for(j = 0; j < TELEGRAM_SIZE / 4  ; j++)
	{
		int		current_bit	= ((0b010000000 >> ( j % 8 )) & msg[ j / 8 ])? true : false;
		
					printf("> %8d %8d %8d\t",current_bit,last_bit,j,j%8,j/8);
		
		for( int b=0;b<8;b++)
		{
					printf("%d:%d ",current_bit,last_bit);

			if( current_bit == last_bit ) 	// test if previsous bit is the same 
			{ 																				// the and four cycles
				if( i % 2 )
				{
					item[i/2].duration0	=	MYLAPS_CLOCK_LOW_HIGH;
					item[i/2].level0	=	0;
				}
				else
				{
					item[i/2].duration1	=	MYLAPS_CLOCK_LOW_HIGH;
					item[i/2].level1	=	1;
				}
				i++;
				printf("    \t");
			}
			else																			// we have a phase change...
			{
	printf("<PC>\t");
				phase 		= ! phase;														// invert the phase
				last_bit 	=  current_bit;	// copy the last_bit....
			int	l =	i-1;
				if( i > 0 )																	// only to be sure we are not on start....
				{
					if( l % 2 )
					{
						item[l/2].duration0	=	MYLAPS_CLOCK_PHASE_CHG;					
					}
					else
					{
						item[l/2].duration1	=	MYLAPS_CLOCK_PHASE_CHG;
					}
				}
				else
					printf("ERROR \n");
				if( b )
					printf("Something wrong at: %d,%d,%d - %d;%d ** ", i,b,j,current_bit,last_bit);
			}
		}
		printf("\n");
		last_bit 	= current_bit ;			// copy the last_bit....
    }
    return i;
}

void rmt_write_items(int channel, rmt_item32_t *item, int item_num, int flag)
{
	printf("\n");
	
	int		t = 0;
	
	for( int i = 0; i<item_num; i ++ )
	{
	int 	d,l;
	
		if( i % 2 )
		{
			d = item[i/2].duration0;
			l = item[i/2].level0;
		}
		else
		{
			d = item[i/2].duration1;
			l = item[i/2].level1;
		}
		
		if( d == 0 )
		{
			printf("\nEnd at %d ( %d,%d)",i,d,l);
			break;
		}
		t += d;
		
		if( d != MYLAPS_CLOCK_LOW_HIGH )
		{
			printf("%s", l ? "X X":"_ _" );
		}
		else
		{
			printf("%s", l ? "X":"_" );
		}
		if( ( t % (  MYLAPS_CLOCK_LOW_HIGH * 4 * 2 ) ) == 0 )
			printf(" ");
	}
	
	printf("\n");
}
	
int main( int argc,char **argv)
{
		size_t 			size 		= (sizeof(rmt_item32_t) * TELEGRAM_SIZE );
        //each item represent a cycle of waveform.
		rmt_item32_t* 	item 		= (rmt_item32_t*) malloc(size);
		int 			item_num 	= TELEGRAM_SIZE ;
		
		int 			i,
						offset 		= 0;
						
		memset((void*) item, 0, size);
		
		printf("Creating radio :\n");
        i = MyLaps_CreateTelegram(channel, item , item_num,&radio_msg[0][0]);
		printf(" inserted %d items \n",i);
		rmt_write_items(channel, item, item_num, true);

	return 0;
}
hope is OK..

this will be the signal:
Code:
X_X_X_X_ X_X_X_X_ X_X_X_X_ X_X_X_X_ X_X_X_X_ _X_X_X_X _X_X_X_X X_X_X_X_ _X_X_X_X _X_X_X_X _X_X_X_X X_X_X_X_ _X_X_X_X X_X_X_X_ X_X_X_X_ _X_X_X_X X_X_X_X_ X_X_X_X_ X_X_X_X_ _X_X_X_X _X_X_X_X _X_X_X_X _X_X_X_X X_X_X_X_ X_X_X_X_ X_X_X_X_ _X_X_X_X _X_X_X_X X_X_X_X_ _X_X_X_X X_X_X_X_ X_X_X_X_ _X_X_X_X _X_X_X_X _X_X_X_X X_X_X_X_ _X_X_X_X _X_X_X_X X_X_X_X_ _X_X_X_X _X_X_X_X _X_X_X_X _X_X_X_X X_X_X_X_ X_X_X_X_ X_X_X_X_ _X_X_X_X _X_X_X_X X_X_X_X_ X_X_X_X_ _X_X_X_
Thor
mroc is offline  
Reply With Quote
Old 02-05-2018, 04:06 PM
  #66  
Tech Adept
Thread Starter
 
Join Date: Mar 2015
Posts: 132
Default

Originally Posted by mroc View Post
I will be interested in a list with the transponder number written on the case and the one reader by the decoder.
Hi, I don't understand the question: in the asm code for the transponder you have both the packet read by the decoder and the transponder number. Keep in mind that this 'easy' decoding is valid only for RC3 transponders.
For RC4 such relation does not exist, since the packet sent is always different (but repeating in the long run). I'm working on this fact to record RC4 passages.

By the way, nice work you're doing with ESP32. Only thing that you might want to beware is that size of send buffer seems to be 64 records (bits), so you need to extend it by setting RMT_MEM_SIZE_CHn > 1.
mv4wd is offline  
Reply With Quote
Old 02-05-2018, 09:43 PM
  #67  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

As I have read, the number witch is on the transponder is not the same as the one that the
decoder read. So, may be their is some CRC in the number given from the decoder,
mroc is offline  
Reply With Quote
Old 02-06-2018, 05:28 PM
  #68  
Tech Rookie
 
Join Date: Feb 2018
Posts: 6
Default

Hi for all! Firstly , sorry but my english is not good...
So, I am find a similar project by many time , and i am very happy when i find this topic.
Do you think if it possible make the decoder by raspberry pi? becouse here in Brazil is veri hard find the CY8CKIT-059 ...
I was see in github the folder of project, but i was dont find the source code for the decoder...
I want help this project very much!

P.S.: My idea is use the mylaps RC4 hybrid or RC3 transponder with this decoder

Thank and my best regards!
ercarnauba is offline  
Reply With Quote
Old 02-06-2018, 09:39 PM
  #69  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Originally Posted by ercarnauba View Post
Hi for all! Firstly , sorry but my english is not good...
So, I am find a similar project by many time , and i am very happy when i find this topic.
Do you think if it possible make the decoder by raspberry pi? becouse here in Brazil is veri hard find the CY8CKIT-059 ...
I was see in github the folder of project, but i was dont find the source code for the decoder...
I want help this project very much!

P.S.: My idea is use the mylaps RC4 hybrid or RC3 transponder with this decoder

Thank and my best regards!
You may order on aliexpress : https://fr.aliexpress.com/item/NEW-O...ceBeautifyAB=0

Thor
mroc is offline  
Reply With Quote
Old 02-07-2018, 05:32 AM
  #70  
Tech Rookie
 
Join Date: Feb 2018
Posts: 6
Default

Thank you Thor! But if i buy on Ali Express or in others sites from China, its will arrived here until 60 days...
If have possibilit to try in a Raspberry Pi for example, is better for us in Brazil...
But i will buy this board by Internet and wait coming.
Do you was make the prototype? Do you was use the same resistors from schematic? Becouse this resistors is precision...

Best Regards!
ercarnauba is offline  
Reply With Quote
Old 02-07-2018, 05:46 AM
  #71  
Tech Rookie
 
Join Date: Feb 2018
Posts: 6
Default

mv4wd, do you have a list with the components? Because the pictures don´t have quality, and is very difficult to see the numbers.
Thank you!
ercarnauba is offline  
Reply With Quote
Old 02-07-2018, 08:15 AM
  #72  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Originally Posted by ercarnauba View Post
mv4wd, do you have a list with the components? Because the pictures don´t have quality, and is very difficult to see the numbers.
Thank you!
Hello, I have remade the schematics from mv4wd on kicad, here are the pdf, hope
they are ok.
on the transponder, I have removed the 78L05 regulator since I run on CR2032 battery

Thor

PS: the développement is from mv4wd, not mine
Attached Files
File Type: pdf
Transpondeur.pdf (45.5 KB, 161 views)
File Type: pdf
Decoder.pdf (79.6 KB, 176 views)
ercarnauba likes this.
mroc is offline  
Reply With Quote
Old 02-07-2018, 04:08 PM
  #73  
Tech Rookie
 
Join Date: Feb 2018
Posts: 6
Default

Originally Posted by mroc View Post
Hello, I have remade the schematics from mv4wd on kicad, here are the pdf, hope
they are ok.
on the transponder, I have removed the 78L05 regulator since I run on CR2032 battery

Thor

PS: the développement is from mv4wd, not mine
Thank you very much Thor!
Do you have the drawnig of the loop amplifier?

Best Regards

Ederson
ercarnauba is offline  
Reply With Quote
Old 02-07-2018, 09:46 PM
  #74  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

Originally Posted by ercarnauba View Post
Thank you very much Thor!
Do you have the drawnig of the loop amplifier?

Best Regards

Ederson
Here is it... for now, do not mount the L1 is only for testing

Thor
Attached Files
File Type: pdf
Amplifier.pdf (48.9 KB, 120 views)
mroc is offline  
Reply With Quote
Old 02-08-2018, 10:06 AM
  #75  
Tech Apprentice
 
Join Date: Oct 2014
Location: St-Legier
Posts: 61
Default

On the transponder schematics, the RJ45 connector must not be mounted, only the pin are used to program the PIC.
mroc is offline  
Reply With Quote

Thread Tools
Search this Thread

Contact Us Archive Advertising Cookie Policy Privacy Statement Terms of Service