2021-03-07

2021-03-07 Motor Controller MK2

 Abstract

 The 8b 32MHz AT4809 microcontroller is not up to the task of running an high performance PID controller for the OrangeBot robot. A 32b 108MHz GD32VF103 Risc-V microcontroller has been choosen as replacement.

Significant effort went into writing the drivers to run the services, like screen and scheduler with minimal resource utilization. The scope of this entry is to glue the driver components together.

 

Architecture

  •  Longan Nano GD32VF103 32b 108MHz Risc-V microcontroller with screen
  •  IG32-05 Motor with low precision hall effect quadrature encoder
  • VNH7040 Driver

Illustration 1: Breadboard
 The encoder is wired directly to the hardware quadrature decoder integrated inside timer 2. The AT4809 had limitations in this regards, requiring expensive ISR based quadrature decoding that consumed CPU cycles.

An element missing is the current sensing. The driver of the ADC is up and running, and right now measures MCU temperature and reference voltage. Additional circuitry is needed to acquire the output current sense from the VNH7040 that will be needed to add a third PID loop on current.

Schematics

Illustration 2: Schematics

Firmware

 

Results

 The open loop test of the firmware, encoder and motor is a success.


 

No comments:

Post a Comment