CAN Motor Driver


Product and its documentation is supplied on an as-is basis and no warranty as to their suitability for any particular purpose is either made or implied. Producer will not accept any claim for damages howsoever arising as a result of use or failure of this product. This product is not intended for use in any medical appliance, device or system in which the failure of the product might reasonably be expected to result in personal injury.

Description

CAN motor controller can work with both stepper and dc motors. Motors can be controller for direction, position, speed, or PWM. Motor Speed and position can be send via CAN. Multiple features are supported like:

  • Stepper motors driven by DRV8825 module (8-45V supply, 1,5A continuous, 2.2A peak)
  • DC brushed motors driven by DRV8801 module (8-36V supply, 1A continuous, 2.8A peak)
  • Position control via ADC voltage measurement
  • Speed control via optical or hall sensor
  • One supply voltage for motor and electronics
  • USB dfu compatible bootloader for new software

  • Board overview

    CAN brushed DC motor driver board

    Frames

    Stepper motor status and control frame

    typedef struct tCANStepperCMD1 {
    	union {
    		struct {
    			union {
    				struct {
    					uint16_t stepSize :8;
    					uint16_t dir :1;
    					uint16_t unused :7;
    				};
    				uint16_t byte;
    			} flags;
    			uint16_t stepCount;
    			struct {
    				uint16_t position;
    				uint16_t speed;
    			} regulatorControl;
    		};
    		uint8_t data[8];
    	};
    } CANStepperCMD1;
    
    typedef struct tCANStatusFrame1 {
    	union {
    		struct {
    			union {
    				struct {
    					uint16_t Speed;
    					uint16_t Position;
    				};
    				uint32_t whole;
    			} sensors;
    
    			union {
    				struct {
    					uint32_t nowStepping:1;
    					uint32_t StepCount:31;
    				};
    				uint32_t whole;
    			} stepper;
    		};
    		uint8_t data[8];
    	};
    } ;
    
    
    

    Brush motor status and control frame

        typedef struct tCANBrushCMD1 {
            union {
                struct {
                    struct {
                        uint32_t pwm: 16;
                        uint32_t breakingOn : 1;
                        uint32_t dir : 1;
                        uint32_t speedControl: 1;
                        uint32_t positionControl: 1;
                        uint32_t unused: 12;
                    } directControl;
                    struct {
                        uint16_t position;
                        uint16_t speed;
                    } regulatorControl;
                };
                uint8_t data[8];
            };
        } CANBrushedCMD1;
    
        typedef struct tCANStatusFrame1 {
            union {
                struct {
                    union {
                        struct {
                            uint16_t Speed;
                            uint16_t Position;
                        };
                        uint32_t whole;
                    } sensors;
    
        
                union {
                    struct {
                        uint32_t state:3; // running, braking
                        uint32_t dir : 1;
                        uint32_t pwmValue:16;
                    };
                    uint32_t whole;
                } brushed;
        
                };
                uint8_t data[8];
            };
        };