Reaction Wheel Actuated Satellite Dynamics Test Platform

Dependencies:   mbed

Diploma Thesis in Aerospace Engineering, January 2014

University of Applied Sciences Munich, Faculty 03

Electronics:

  • 1x mbed NXP LPC 1768 Microcontroller
  • 2x XBee S1 Radios + Sparkfun USB Adapter
  • 1x CHR UM6-lt IMU
  • 4x Graupner BEC 8 Motor Controllers
  • 4x ROXXY 2826/09 Brushless Motors
  • 1x Hacker TopFuel LiPo 1300mAh Battery
  • 1x big Selfmade BreakOutBoard to connect all components
  • 1x small BreakOutBoard to connect IMU

Hardware developed with Catia V5R20

Manufactoring Technology: Rapid Prototyping - EOS Formiga P110

Controlled via text based menu with DockLight

__________________

UM6_usart/UM6_usart.h

Committer:
DimitriGruebel
Date:
2014-07-09
Revision:
0:1447d2f773db

File content as of revision 0:1447d2f773db:

/* ______________________________________________________________________________________
 File: UM6_usart.h
 Author: CH Robotics, adapted for mbed by lhiggs
 Version: 1.0
 
 Description: Function declarations for USART communucation
 -------------------------------------------------------------------------------------- */
 
 #ifndef _CHR_USART_H
 #define _CHR_USART_H

 #define  MAX_PACKET_DATA      40
 
 // Definitions of states for USART receiver state machine (for receiving packets)
 #define USART_STATE_WAIT       1
 #define USART_STATE_TYPE       2
 #define USART_STATE_ADDRESS    3
 #define USART_STATE_DATA       4
 #define USART_STATE_CHECKSUM   5

 // Flags for interpreting the packet type byte in communication packets
 #define PACKET_HAS_DATA            (1 << 7)
 #define PACKET_IS_BATCH            (1 << 6)
 #define PACKET_BATCH_LENGTH_MASK   ( 0x0F )
 
 #define PACKET_BATCH_LENGTH_OFFSET     2
 
 #define BATCH_SIZE_2                   2
 #define BATCH_SIZE_3                   3
 
 #define PACKET_NO_DATA                 0
 #define PACKET_COMMAND_FAILED      (1 << 0)
 
 
 // Define flags for identifying the type of packet address received
 #define ADDRESS_TYPE_CONFIG            0
 #define ADDRESS_TYPE_DATA              1
 #define ADDRESS_TYPE_COMMAND           2
 
 
extern uint8_t gUSART_State;

 // Structure for storing TX and RX packet data
 typedef struct _USARTPacket
 {
        uint8_t PT;         // Packet type
        uint8_t address;    // Packet address
        uint16_t checksum;  // Checksum
        
        // Data included for convenience, but that isn't stored in the packet itself
        uint8_t data_length;  // Number of bytes in data section
        uint8_t address_type; // Specified the address type (DATA, CONFIG, OR COMMAND)
        
        uint8_t packet_data[MAX_PACKET_DATA];
        
 } USARTPacket;
 
uint16_t ComputeChecksum( USARTPacket* new_packet );

#endif