2015-01-03 05:58 AM
Hello, i am staring a remote control project for a quadcopter, the main ''processor'' is a stm32f103c8t mcu wich is intended to work with nrf24l01 or cc2500 wireless devices.
My main concern is after reading lets say 4 adc channels wich are wired with my analog potentiometers, i want to generate a ppm frame with a frequency of 50 hz, each 50hz frame will contain lets say 4 ppm impulses wich the width of the impulse vary between 1ms and max 2ms, this means that my 4 impulses accumulates a maximum lenght 8 ms, and the remains of 12 ms are free for the moment. Ok, lets say i understand the encoding of each ppm impulse in the 50hz frame. I was thinking of reading adc signals and convert them to values between 1000 and 2000 wich are considerd to be microseconds, and after loading them in a timer. But does anyone have a ideea how to encode these 4 impulses in one packet/byte ? My experience with ppm signals is zero :(2015-01-03 06:19 AM
But does anyone have a idea how to encode these 4 impulses in one packet/byte ?
For the purpose of transmission across a radio link or network connection? For ONE byte per channel, perhaps you could encode the signal a 1/256th for the 1ms range, and on reception multiply that out, and add the 1ms offset, so the range is 1..2ms rather than 0..1ms2015-01-03 07:19 AM
2015-01-03 08:30 AM
Yeah, well I'd set the ADC+DMA to cycle through my 4 potentiometers, and then every 20ms (50Hz) push the measurements over a radio link.
The ADC could be in 12-bit mode giving a value between 0 and 4095. Your high/low points might be between there, so you'd drop out the minimum and then scale across the min-max range into 256 (or 1000) points. Depends a lot on the sweep of the potentiometers being used, and the sweep of the servos. On the receiver/servo side I'd have the timer set up to pull it's pulse profile data out of a circular DMA buffer, so it loops automatically through the channel list, and slack time. On receiving data from the controller via the radio link it would modify the DMA buffer to reflect the new pulse profiles.